summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-07-13 12:27:53 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-07-13 12:30:43 +0900
commit927fe2422fe8ca3ee50b76c3ee82d3238ea2daca (patch)
treef327c5a115e45c636fdb912cddd960f3521396c4 /tool
parent16bc9bf7e85ed301498ccdea04569af1808559c2 (diff)
downloadruby-927fe2422fe8ca3ee50b76c3ee82d3238ea2daca.tar.gz
mk_builtin_loader.rb: STACK_ADDR_FROM_TOP unusable
Stacks are emulated in MJIT, must not touch the original VM stack. See also http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3061353
Diffstat (limited to 'tool')
-rw-r--r--tool/mk_builtin_loader.rb4
-rw-r--r--tool/ruby_vm/views/_mjit_compile_invokebuiltin.erb2
2 files changed, 3 insertions, 3 deletions
diff --git a/tool/mk_builtin_loader.rb b/tool/mk_builtin_loader.rb
index 18fa36199e..271c47f9ad 100644
--- a/tool/mk_builtin_loader.rb
+++ b/tool/mk_builtin_loader.rb
@@ -286,7 +286,7 @@ def mk_builtin_header file
bs.each_pair{|func, (argc, cfunc_name)|
f.puts %'static void'
- f.puts %'mjit_compile_invokebuiltin_for_#{func}(FILE *f, long index)'
+ f.puts %'mjit_compile_invokebuiltin_for_#{func}(FILE *f, long index, unsigned stack_size)'
f.puts %'{'
if inlines.has_key? cfunc_name
f.puts %' fprintf(f, " MAYBE_UNUSED(VALUE) self = GET_SELF();\\n");'
@@ -304,7 +304,7 @@ def mk_builtin_header file
f.puts %' fprintf(f, " typedef VALUE (*func)(rb_execution_context_t *, VALUE#{decl});\\n");'
if argc > 0
f.puts %' if (index == -1) {'
- f.puts %' fprintf(f, " const VALUE *argv = STACK_ADDR_FROM_TOP(%d);\\n", #{argc});'
+ f.puts %' fprintf(f, " const VALUE *argv = &stack[%d];\\n", stack_size - #{argc});'
f.puts %' }'
f.puts %' else {'
f.puts %' fprintf(f, " const unsigned int lnum = GET_ISEQ()->body->local_table_size;\\n");'
diff --git a/tool/ruby_vm/views/_mjit_compile_invokebuiltin.erb b/tool/ruby_vm/views/_mjit_compile_invokebuiltin.erb
index a95a8a7438..29a21b17de 100644
--- a/tool/ruby_vm/views/_mjit_compile_invokebuiltin.erb
+++ b/tool/ruby_vm/views/_mjit_compile_invokebuiltin.erb
@@ -19,7 +19,7 @@
fprintf(f, " VALUE val;\n");
bf->compiler(f, <%=
insn.name == 'invokebuiltin' ? '-1' : '(rb_num_t)operands[1]'
- %>);
+ %>, b->stack_size);
fprintf(f, " stack[%u] = val;\n", sp - 1);
fprintf(f, "}\n");
% if insn.name != 'opt_invokebuiltin_delegate_leave'