mjit.c: separate call from macro

* mjit.c (convert_unit_to_func): separate a function call from a
  macro, which evaluates the argument multiple times.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-02-20 09:39:41 +00:00
Родитель b2033b8b84
Коммит 64072aa8e1
1 изменённых файлов: 8 добавлений и 4 удалений

12
mjit.c
Просмотреть файл

@ -827,10 +827,14 @@ convert_unit_to_func(struct rb_mjit_unit *unit)
in_jit = TRUE;
CRITICAL_SECTION_FINISH(3, "before mjit_compile to wait GC finish");
verbose(2, "start compile: %s@%s:%d -> %s", RSTRING_PTR(unit->iseq->body->location.label),
RSTRING_PTR(rb_iseq_path(unit->iseq)), FIX2INT(unit->iseq->body->location.first_lineno), c_file);
fprintf(f, "/* %s@%s:%d */\n\n", RSTRING_PTR(unit->iseq->body->location.label),
RSTRING_PTR(rb_iseq_path(unit->iseq)), FIX2INT(unit->iseq->body->location.first_lineno));
{
VALUE s = rb_iseq_path(unit->iseq);
const char *label = RSTRING_PTR(unit->iseq->body->location.label);
const char *path = RSTRING_PTR(s);
int lineno = FIX2INT(unit->iseq->body->location.first_lineno);
verbose(2, "start compile: %s@%s:%d -> %s", label, path, lineno, c_file);
fprintf(f, "/* %s@%s:%d */\n\n", label, path, lineno);
}
success = mjit_compile(f, unit->iseq->body, funcname);
/* release blocking mjit_gc_start_hook */