summaryrefslogtreecommitdiff
path: root/tool/ruby_vm
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2021-08-21 10:15:01 -0700
committerGitHub <noreply@github.com>2021-08-21 10:15:01 -0700
commit48c8df9e0eb295af06d593ce37ce1933c0ee1d90 (patch)
tree4a8092796f397a12835f89c4f220a84fa8f5f867 /tool/ruby_vm
parentf51a6ace06cecd193bf00747a63809849e254050 (diff)
Allow tracing of optimized methods
This updates the trace instructions to directly dispatch to opt_send_without_block. So this should cause no slowdown in non-trace mode. To enable the tracing of the optimized methods, RUBY_EVENT_C_CALL and RUBY_EVENT_C_RETURN are added as events to the specialized instructions. Fixes [Bug #14870] Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4739 Merged-By: jeremyevans <code@jeremyevans.net>
Diffstat (limited to 'tool/ruby_vm')
-rw-r--r--tool/ruby_vm/views/_trace_instruction.erb7
1 files changed, 6 insertions, 1 deletions
diff --git a/tool/ruby_vm/views/_trace_instruction.erb b/tool/ruby_vm/views/_trace_instruction.erb
index d604e0318b..3588207d39 100644
--- a/tool/ruby_vm/views/_trace_instruction.erb
+++ b/tool/ruby_vm/views/_trace_instruction.erb
@@ -11,6 +11,11 @@
INSN_ENTRY(<%= insn.name %>)
{
vm_trace(ec, GET_CFP());
- DISPATCH_ORIGINAL_INSN(<%= insn.jump_destination %>);
+% if insn.name =~
+% /\Atrace_opt_(plus|minus|mult|div|mod|eq|neq|lt|le|gt|ge|ltlt|and|or|aref|aset|length|size|empty_p|nil_p|succ|not|regexpmatch2)\z/
+% jump_dest = "opt_send_without_block"
+% end
+ <%= 'ADD_PC(1);' if insn.name == 'trace_opt_neq' %>
+ DISPATCH_ORIGINAL_INSN(<%= jump_dest || insn.jump_destination %>);
END_INSN(<%= insn.name %>);
}