diff options
Diffstat (limited to 'tool/ruby_vm')
-rw-r--r-- | tool/ruby_vm/models/bare_instructions.rb | 13 | ||||
-rw-r--r-- | tool/ruby_vm/views/_insn_entry.erb | 8 |
2 files changed, 16 insertions, 5 deletions
diff --git a/tool/ruby_vm/models/bare_instructions.rb b/tool/ruby_vm/models/bare_instructions.rb index 16d5782e2f..5ed27520ea 100644 --- a/tool/ruby_vm/models/bare_instructions.rb +++ b/tool/ruby_vm/models/bare_instructions.rb @@ -33,6 +33,7 @@ class RubyVM::BareInstructions h[a.key] = a } @attrs_orig = @attrs.dup + predefine_attributes end def pretty_name @@ -109,8 +110,8 @@ class RubyVM::BareInstructions }.join end - def pushs_frame? - opes.any? {|o| /CALL_INFO/ =~ o[:type] } + def handles_frame? + /\b(false|0)\b/ !~ @attrs['handles_frame'].expr.expr end def inspect @@ -126,7 +127,13 @@ class RubyVM::BareInstructions type: t, \ location: [], \ expr: v.to_s + ';' - return @attrs[k] = attr + return @attrs[k] ||= attr + end + + def predefine_attributes + generate_attribute 'sp_inc', 'rb_snum_t', rets.size - pops.size + generate_attribute 'handles_frame', 'bool', \ + opes.any? {|o| /CALL_INFO/ =~ o[:type] } end def typesplit a diff --git a/tool/ruby_vm/views/_insn_entry.erb b/tool/ruby_vm/views/_insn_entry.erb index cebca8b8d0..f2f0f6418e 100644 --- a/tool/ruby_vm/views/_insn_entry.erb +++ b/tool/ruby_vm/views/_insn_entry.erb @@ -28,8 +28,9 @@ INSN_ENTRY(<%= insn.name %>) <%= pop[:name] %> = <%= insn.cast_from_VALUE pop, "TOPN(#{i})"%>; % end DEBUG_ENTER_INSN(<%=cstr insn.name %>); +% if insn.handles_frame? ADD_PC(<%= insn.width %>); - PREFETCH(GET_PC()); +% end % unless insn.pops.empty? POPN(<%= insn.pops.size %>); % end @@ -44,7 +45,10 @@ INSN_ENTRY(<%= insn.name %>) PUSH(<%= insn.cast_to_VALUE ret %>); % end % end -% +% unless insn.handles_frame? + ADD_PC(<%= insn.width %>); + PREFETCH(GET_PC()); +% end END_INSN(<%= insn.name %>); } #undef NAME_OF_CURRENT_INSN |