diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-11 00:19:03 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-11 00:19:03 +0000 |
commit | 2b79ab512c20395015692671524a01645757fc79 (patch) | |
tree | dc19064ae220bbd38be72cf63aa76cb8a52ed52f | |
parent | aea14e68fb32af5323a52676f760938794080ba0 (diff) |
_mjit_compile_send.erb: PRI_SERIALT_PREFIX
* tool/ruby_vm/views/_mjit_compile_send.erb: `printf` modifier for
`rb_serial_t` which may not be `long long`, and '%ll' may not be
supported.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | internal.h | 3 | ||||
-rw-r--r-- | tool/ruby_vm/views/_mjit_compile_send.erb | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/internal.h b/internal.h index eab2d2b269..88a1f9210e 100644 --- a/internal.h +++ b/internal.h @@ -780,12 +780,15 @@ struct rb_subclass_entry { #if defined(HAVE_LONG_LONG) typedef unsigned LONG_LONG rb_serial_t; #define SERIALT2NUM ULL2NUM +#define PRI_SERIALT_PREFIX PRI_LL_PREFIX #elif defined(HAVE_UINT64_T) typedef uint64_t rb_serial_t; #define SERIALT2NUM SIZET2NUM +#define PRI_SERIALT_PREFIX PRI_64_PREFIX #else typedef unsigned long rb_serial_t; #define SERIALT2NUM ULONG2NUM +#define PRI_SERIALT_PREFIX PRI_LONG_PREFIX #endif struct rb_classext_struct { diff --git a/tool/ruby_vm/views/_mjit_compile_send.erb b/tool/ruby_vm/views/_mjit_compile_send.erb index fd133ae159..cefb071b1e 100644 --- a/tool/ruby_vm/views/_mjit_compile_send.erb +++ b/tool/ruby_vm/views/_mjit_compile_send.erb @@ -27,7 +27,8 @@ fprintf(f, " reg_cfp->sp = reg_cfp->bp + %d;\n", b->stack_size + 1 - <%= insn.pops.size %>); /* POPN(INSN_ATTR(popn)); */ % # JIT: Invalidate call cache if it requires vm_search_method. This allows to inline some of following things. - fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %llu || RCLASS_SERIAL(CLASS_OF(stack[%d])) != %llu)) {\n", cc->method_state, b->stack_size - 1 - argc, cc->class_serial); + fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc->method_state); + fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc->class_serial); fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos); fprintf(f, " return Qundef; /* cancel JIT */\n"); fprintf(f, " }\n"); |