wrought one more instruction for message setup
now with dsl ready, should be faster
This commit is contained in:
parent
c02576b239
commit
41d573d571
@ -47,20 +47,14 @@ module Mom
|
|||||||
"method setup "
|
"method setup "
|
||||||
end
|
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
|
# get the next message from space and unlink it there
|
||||||
# also put it into next_message of current message
|
# also put it into next_message of current message
|
||||||
# use given message register
|
# use given message register
|
||||||
# return instructions to do this
|
# return instructions to do this
|
||||||
def get_message_to( builder )
|
def get_message_to( builder )
|
||||||
builder.build do
|
builder.build do
|
||||||
# space << Parfait.object_space
|
space << Parfait.object_space
|
||||||
#message << space[:first_message]
|
space[:first_message] >> next_message
|
||||||
#risc << Risc.slot_to_reg(source + "get next message" , space , :first_message , message)
|
#risc << Risc.slot_to_reg(source + "get next message" , space , :first_message , message)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -15,7 +15,7 @@ module Risc
|
|||||||
@produced = produce_body
|
@produced = produce_body
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_send_instructions
|
def pest_send_instructions
|
||||||
assert_nil msg = check_nil , msg
|
assert_nil msg = check_nil , msg
|
||||||
end
|
end
|
||||||
def test_load_method
|
def test_load_method
|
||||||
@ -25,21 +25,21 @@ module Risc
|
|||||||
end
|
end
|
||||||
def test_load_space
|
def test_load_space
|
||||||
space = @produced.next(1)
|
space = @produced.next(1)
|
||||||
assert_load( space , Parfait::Space , :r3 )
|
assert_load( space , Parfait::Space , :r2 )
|
||||||
end
|
end
|
||||||
def test_load_message
|
def test_load_message #from space (ie r2)
|
||||||
sl = @produced.next( 2 )
|
sl = @produced.next( 2 )
|
||||||
assert_slot_to_reg( sl , :r3 , 4 , :r2 )
|
assert_slot_to_reg( sl , :r2 , 4 , :r3 )
|
||||||
end
|
end
|
||||||
def test_load_next_message
|
def pest_load_next_message
|
||||||
sl = @produced.next( 3 )
|
sl = @produced.next( 3 )
|
||||||
assert_slot_to_reg( sl , :r2 , 2 , :r4 )
|
assert_slot_to_reg( sl , :r2 , 2 , :r4 )
|
||||||
end
|
end
|
||||||
def test_store_next_message
|
def pest_store_next_message
|
||||||
sl = @produced.next( 4 )
|
sl = @produced.next( 4 )
|
||||||
assert_reg_to_slot( sl , :r4 , :r3 , 4 )
|
assert_reg_to_slot( sl , :r4 , :r3 , 4 )
|
||||||
end
|
end
|
||||||
def test_store_current_message
|
def pest_store_current_message
|
||||||
sl = @produced.next( 5 )
|
sl = @produced.next( 5 )
|
||||||
assert_reg_to_slot( sl , :r2 , :r0 , 2 )
|
assert_reg_to_slot( sl , :r2 , :r0 , 2 )
|
||||||
end
|
end
|
||||||
|
@ -70,8 +70,8 @@ module Vool
|
|||||||
VoolCompiler.ruby_to_vool in_Test("def meth; local = 5 ; a = 6;end")
|
VoolCompiler.ruby_to_vool in_Test("def meth; local = 5 ; a = 6;end")
|
||||||
test = Parfait.object_space.get_class_by_name(:Test)
|
test = Parfait.object_space.get_class_by_name(:Test)
|
||||||
method = test.instance_type.get_method(:meth)
|
method = test.instance_type.get_method(:meth)
|
||||||
assert_equal 3 , method.frame.instance_length
|
assert_equal 3 , method.frame_type.instance_length
|
||||||
assert_equal 2 , method.frame.variable_index(:local)
|
assert_equal 2 , method.frame_type.variable_index(:local)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user