Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Get it working on TruffleRuby
  • Loading branch information
kddnewton committed Nov 22, 2022
commit b6fb92ee9fe39bec7e547a307742c915e78bf5d4
14 changes: 9 additions & 5 deletions lib/syntax_tree/yarv/instruction_sequence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ class InstructionSequence
# pass a serialized iseq to Ruby and have it return a
# RubyVM::InstructionSequence object.
ISEQ_LOAD =
Fiddle::Function.new(
Fiddle::Handle::DEFAULT["rb_iseq_load"],
[Fiddle::TYPE_VOIDP] * 3,
Fiddle::TYPE_VOIDP
)
begin
Fiddle::Function.new(
Fiddle::Handle::DEFAULT["rb_iseq_load"],
[Fiddle::TYPE_VOIDP] * 3,
Fiddle::TYPE_VOIDP
)
rescue NameError
end

# This object is used to track the size of the stack at any given time. It
# is effectively a mini symbolic interpreter. It's necessary because when
Expand Down Expand Up @@ -141,6 +144,7 @@ def length
end

def eval
raise "Unsupported platform" if ISEQ_LOAD.nil?
compiled = to_a

# Temporary hack until we get these working.
Expand Down