summaryrefslogtreecommitdiff
path: root/tool/ruby_vm/views/mjit_compile.inc.erb
diff options
context:
space:
mode:
Diffstat (limited to 'tool/ruby_vm/views/mjit_compile.inc.erb')
-rw-r--r--tool/ruby_vm/views/mjit_compile.inc.erb19
1 files changed, 15 insertions, 4 deletions
diff --git a/tool/ruby_vm/views/mjit_compile.inc.erb b/tool/ruby_vm/views/mjit_compile.inc.erb
index 9961b18453e..f78c45385f4 100644
--- a/tool/ruby_vm/views/mjit_compile.inc.erb
+++ b/tool/ruby_vm/views/mjit_compile.inc.erb
@@ -46,14 +46,25 @@ switch (insn) {
% (RubyVM::BareInstructions.to_a + RubyVM::OperandsUnifications.to_a).each do |insn|
% next if unsupported_insns.include?(insn.name)
case BIN(<%= insn.name %>):
-% if %w[opt_send_without_block send].include?(insn.name)
-<%= render 'mjit_compile_send', locals: { insn: insn } -%>
-% elsif %w[opt_aref].include?(insn.name) # experimental. TODO: increase insns and make the list automatically by finding DISPATCH_ORIGINAL_INSN
-<%= render 'mjit_compile_send', locals: { insn: opt_send_without_block } -%>
+% # Instruction-specific behavior in JIT
+% case insn.name
+% when 'opt_send_without_block', 'send'
+<%= render 'mjit_compile_send', locals: { insn: insn } -%>
+% when 'opt_aref' # experimental. TODO: increase insns and make the list automatically by finding DISPATCH_ORIGINAL_INSN
+<%= render 'mjit_compile_send', locals: { insn: opt_send_without_block } -%>
+% when 'leave'
+ if (b->stack_size != 1) {
+ if (mjit_opts.warnings || mjit_opts.verbose)
+ fprintf(stderr, "MJIT warning: Unexpected JIT stack_size on leave: %d\n", b->stack_size);
+ status->success = FALSE;
+ }
% end
+%
+% # Main insn implementation generated by insns.def
<%= render 'mjit_compile_insn', locals: { insn: insn, dispatched: false } -%>
break;
% end
+%
% # We don't support InstructionsUnifications yet because it's not used for now.
% # We don't support TraceInstructions yet. There is no blocker for it but it's just not implemented.
default: