diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-12 05:04:24 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-12 05:04:24 +0000 |
commit | dd64636a85779e22c53015d716435a33996a5522 (patch) | |
tree | 38fc43a69ac36ce4fee7b1638e0ed53890e86777 /mjit.c | |
parent | 7a0bc1f35098c5840eaee2b9ad69874d42b54139 (diff) |
mjit.c: print JIT failure
mjit_compile.inc.erb: show unsupported insn name on --jit-verbose=1 too.
Also, removed osboleted workaround. Now some insn-related functions are
declared with MAYBE_UNUSED.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit.c')
-rw-r--r-- | mjit.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -735,6 +735,14 @@ header_name_end(const char *s) } #endif +static void +print_jit_result(const char *result, const struct rb_mjit_unit *unit, const double duration, const char *c_file) +{ + verbose(1, "JIT %s (%.1fms): %s@%s:%d -> %s", result, + duration, RSTRING_PTR(unit->iseq->body->location.label), + RSTRING_PTR(rb_iseq_path(unit->iseq)), FIX2INT(unit->iseq->body->location.first_lineno), c_file); +} + /* Compile ISeq in UNIT and return function pointer of JIT-ed code. It may return NOT_COMPILABLE_JIT_ISEQ_FUNC if something went wrong. */ static mjit_func_t @@ -830,6 +838,7 @@ convert_unit_to_func(struct rb_mjit_unit *unit) if (!success) { if (!mjit_opts.save_temps) remove(c_file); + print_jit_result("failure", unit, 0, c_file); return (mjit_func_t)NOT_COMPILABLE_JIT_ISEQ_FUNC; } @@ -853,8 +862,7 @@ convert_unit_to_func(struct rb_mjit_unit *unit) CRITICAL_SECTION_START(3, "end of jit"); add_to_list(node, &active_units); if (unit->iseq) - verbose(1, "JIT success (%.1fms): %s@%s:%d -> %s", end_time - start_time, RSTRING_PTR(unit->iseq->body->location.label), - RSTRING_PTR(rb_iseq_path(unit->iseq)), FIX2INT(unit->iseq->body->location.first_lineno), c_file); + print_jit_result("success", unit, end_time - start_time, c_file); CRITICAL_SECTION_FINISH(3, "end of jit"); } return (mjit_func_t)func; |