create methods with binaries and extend them later

Binary is new jump target for function call
This commit is contained in:
Torsten Ruger
2018-03-28 12:49:17 +03:00
parent 105e8f7092
commit 85ddf53429
4 changed files with 16 additions and 4 deletions

View File

@ -64,5 +64,10 @@ module Parfait
@code.set_word(20,1)
assert_equal 1 , @code.get_word(20)
end
def test_extend
@code.extend_to(20)
assert @code.next
assert_nil @code.next.next
end
end
end

View File

@ -3,6 +3,7 @@ require_relative "../helper"
class TestMethod < MiniTest::Test
def setup
Risc.machine.boot
obj = Parfait.object_space.get_class_by_name(:Object).instance_type
args = Parfait::Type.for_hash( obj.object_class , { bar: :Integer , foo: :Type})
frame = Parfait::Type.for_hash( obj.object_class , { local_bar: :Integer , local_foo: :Type})
@ -90,5 +91,7 @@ class TestMethod < MiniTest::Test
index = @method.has_local(:local_bar)
assert_equal :Integer , @method.frame_type(index)
end
def test_created_with_binary
assert @method.binary
end
end