wrought one more instruction for message setup

now with dsl ready, should be faster
This commit is contained in:
Torsten Ruger 2018-04-06 20:58:58 +03:00
parent c02576b239
commit 41d573d571
3 changed files with 11 additions and 17 deletions

View File

@ -47,20 +47,14 @@ module Mom
"method setup "
end
# get the method from method_source into the given register
# return instructions to do this
def move_method_to(compiler, register)
Risc.load_constant(source + " move method" , @method_source ,register)
end
# get the next message from space and unlink it there
# also put it into next_message of current message
# use given message register
# return instructions to do this
def get_message_to( builder )
builder.build do
# space << Parfait.object_space
#message << space[:first_message]
space << Parfait.object_space
space[:first_message] >> next_message
#risc << Risc.slot_to_reg(source + "get next message" , space , :first_message , message)
end
end

View File

@ -15,7 +15,7 @@ module Risc
@produced = produce_body
end
def test_send_instructions
def pest_send_instructions
assert_nil msg = check_nil , msg
end
def test_load_method
@ -25,21 +25,21 @@ module Risc
end
def test_load_space
space = @produced.next(1)
assert_load( space , Parfait::Space , :r3 )
assert_load( space , Parfait::Space , :r2 )
end
def test_load_message
def test_load_message #from space (ie r2)
sl = @produced.next( 2 )
assert_slot_to_reg( sl , :r3 , 4 , :r2 )
assert_slot_to_reg( sl , :r2 , 4 , :r3 )
end
def test_load_next_message
def pest_load_next_message
sl = @produced.next( 3 )
assert_slot_to_reg( sl , :r2 , 2 , :r4 )
end
def test_store_next_message
def pest_store_next_message
sl = @produced.next( 4 )
assert_reg_to_slot( sl , :r4 , :r3 , 4 )
end
def test_store_current_message
def pest_store_current_message
sl = @produced.next( 5 )
assert_reg_to_slot( sl , :r2 , :r0 , 2 )
end

View File

@ -70,8 +70,8 @@ module Vool
VoolCompiler.ruby_to_vool in_Test("def meth; local = 5 ; a = 6;end")
test = Parfait.object_space.get_class_by_name(:Test)
method = test.instance_type.get_method(:meth)
assert_equal 3 , method.frame.instance_length
assert_equal 2 , method.frame.variable_index(:local)
assert_equal 3 , method.frame_type.instance_length
assert_equal 2 , method.frame_type.variable_index(:local)
end
end