mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
builtin.h: avoid copy&paste
Instead of doubling the invokebuiltin logic here and there, use the same insns.def definition for both MJIT/non-JIT situations.
This commit is contained in:
parent
802bcd3ec8
commit
7e536b3be2
Notes:
git
2020-07-13 08:56:51 +09:00
4 changed files with 24 additions and 38 deletions
16
builtin.h
16
builtin.h
|
@ -80,20 +80,4 @@ struct builtin_binary {
|
|||
size_t bin_size;
|
||||
};
|
||||
|
||||
// mjit
|
||||
|
||||
RBIMPL_ATTR_MAYBE_UNUSED()
|
||||
static void
|
||||
mjit_invokebuiltin_default_compiler(FILE *f, const struct rb_builtin_function *bf, long index)
|
||||
{
|
||||
if (index >= 0) {
|
||||
fprintf(f, "val = vm_invoke_builtin(ec, GET_CFP(), %p, STACK_ADDR_FROM_TOP(%d));\n",
|
||||
(const void *)bf, bf->argc);
|
||||
}
|
||||
else {
|
||||
fprintf(f, "val = vm_invoke_builtin_delegate(ec, GET_CFP(), %p, %ld);\n",
|
||||
(const void *)bf, index);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BUILTIN_H_INCLUDED
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue