summaryrefslogtreecommitdiff
path: root/lib/ruby_vm/mjit/context.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2023-02-08 11:10:04 -0800
committerTakashi Kokubun <[email protected]>2023-03-05 22:11:20 -0800
commit8d099ff699fb475f9fa2bc3abf19c3700c4f37f0 (patch)
tree97cfebded3a7a0a6054821031a8c622666beb21a /lib/ruby_vm/mjit/context.rb
parenta458923fe5f47d753f13c5fa4c7f74517f54c145 (diff)
Implement opt_aref for Hash
Diffstat (limited to 'lib/ruby_vm/mjit/context.rb')
-rw-r--r--lib/ruby_vm/mjit/context.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ruby_vm/mjit/context.rb b/lib/ruby_vm/mjit/context.rb
index c5c5e987bd..86aa03514a 100644
--- a/lib/ruby_vm/mjit/context.rb
+++ b/lib/ruby_vm/mjit/context.rb
@@ -18,5 +18,13 @@ module RubyVM::MJIT
self.sp_offset -= size
[SP, C.VALUE.size * self.sp_offset]
end
+
+ def stack_opnd(depth_from_top)
+ [SP, C.VALUE.size * (self.sp_offset - 1 - depth_from_top)]
+ end
+
+ def sp_opnd(offset_bytes)
+ [SP, (C.VALUE.size * self.sp_offset) + offset_bytes]
+ end
end
end