From 64072aa8e199fa0a3af85e3908c0af46f759f1ba Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 20 Feb 2018 09:39:41 +0000 Subject: 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 --- mjit.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mjit.c b/mjit.c index a64a56b3a6..502769c52b 100644 --- a/mjit.c +++ b/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 */ -- cgit v1.2.3