fold last of the virtual into register
This commit is contained in:
@ -5,7 +5,7 @@ class AddTest < MiniTest::Test
|
||||
include Ticker
|
||||
|
||||
def setup
|
||||
machine = Virtual.machine.boot
|
||||
machine = Register.machine.boot
|
||||
code = s(:class, :Object,
|
||||
s(:derives, nil),
|
||||
s(:statements,
|
||||
@ -21,7 +21,7 @@ class AddTest < MiniTest::Test
|
||||
Phisol::Compiler.compile( code )
|
||||
machine.collect
|
||||
@interpreter = Interpreter::Interpreter.new
|
||||
@interpreter.start Virtual.machine.init
|
||||
@interpreter.start Register.machine.init
|
||||
end
|
||||
|
||||
def test_branch
|
||||
@ -31,7 +31,7 @@ class AddTest < MiniTest::Test
|
||||
end
|
||||
def test_load
|
||||
assert_equal Register::LoadConstant , ticks(2).class
|
||||
assert_equal Parfait::Space , Virtual.machine.objects[ @interpreter.get_register(:r2)].class
|
||||
assert_equal Parfait::Space , Register.machine.objects[ @interpreter.get_register(:r2)].class
|
||||
assert_equal :r2, @interpreter.instruction.array.symbol
|
||||
end
|
||||
def test_get
|
||||
|
@ -20,16 +20,16 @@ class Object
|
||||
end
|
||||
end
|
||||
HERE
|
||||
machine = Virtual.machine.boot
|
||||
machine = Register.machine.boot
|
||||
syntax = Parser::Salama.new.parse_with_debug(@string_input)
|
||||
parts = Parser::Transform.new.apply(syntax)
|
||||
#puts parts.inspect
|
||||
Phisol::Compiler.compile( parts )
|
||||
machine.collect
|
||||
# statements = Virtual.machine.boot.parse_and_compile @string_input
|
||||
# Phisol::Compiler.compile( statements , Virtual.machine.space.get_main )
|
||||
# statements = Register.machine.boot.parse_and_compile @string_input
|
||||
# Phisol::Compiler.compile( statements , Register.machine.space.get_main )
|
||||
@interpreter = Interpreter::Interpreter.new
|
||||
@interpreter.start Virtual.machine.init
|
||||
@interpreter.start Register.machine.init
|
||||
#show_ticks # get output of what is
|
||||
["Branch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
|
||||
"FunctionCall","SaveReturn","GetSlot","GetSlot","SetSlot",
|
||||
|
@ -48,16 +48,16 @@ class Object
|
||||
end
|
||||
end
|
||||
HERE
|
||||
machine = Virtual.machine.boot
|
||||
machine = Register.machine.boot
|
||||
syntax = Parser::Salama.new.parse_with_debug(@string_input)
|
||||
parts = Parser::Transform.new.apply(syntax)
|
||||
#puts parts.inspect
|
||||
Phisol::Compiler.compile( parts )
|
||||
machine.collect
|
||||
# statements = Virtual.machine.boot.parse_and_compile @string_input
|
||||
# Phisol::Compiler.compile( statements , Virtual.machine.space.get_main )
|
||||
# statements = Register.machine.boot.parse_and_compile @string_input
|
||||
# Phisol::Compiler.compile( statements , Register.machine.space.get_main )
|
||||
@interpreter = Interpreter::Interpreter.new
|
||||
@interpreter.start Virtual.machine.init
|
||||
@interpreter.start Register.machine.init
|
||||
#show_ticks # get output of what is
|
||||
["Branch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
|
||||
"FunctionCall","SaveReturn","GetSlot","LoadConstant","SetSlot",
|
||||
|
@ -4,7 +4,7 @@ class TestPuts < MiniTest::Test
|
||||
include AST::Sexp
|
||||
include Ticker
|
||||
def setup
|
||||
machine = Virtual.machine.boot
|
||||
machine = Register.machine.boot
|
||||
code = s(:class, :Object,
|
||||
s(:derives, nil),
|
||||
s(:statements,
|
||||
@ -21,7 +21,7 @@ class TestPuts < MiniTest::Test
|
||||
Phisol::Compiler.compile( code )
|
||||
machine.collect
|
||||
@interpreter = Interpreter::Interpreter.new
|
||||
@interpreter.start Virtual.machine.init
|
||||
@interpreter.start Register.machine.init
|
||||
end
|
||||
|
||||
def test_branch
|
||||
@ -31,7 +31,7 @@ class TestPuts < MiniTest::Test
|
||||
end
|
||||
def test_load
|
||||
assert_equal Register::LoadConstant , ticks(2).class
|
||||
assert_equal Parfait::Space , Virtual.machine.objects[ @interpreter.get_register(:r2)].class
|
||||
assert_equal Parfait::Space , Register.machine.objects[ @interpreter.get_register(:r2)].class
|
||||
assert_equal :r2, @interpreter.instruction.array.symbol
|
||||
end
|
||||
def test_get
|
||||
@ -78,7 +78,7 @@ class TestPuts < MiniTest::Test
|
||||
def test_return
|
||||
done = ticks(24)
|
||||
assert_equal Register::FunctionReturn , done.class
|
||||
assert @interpreter.block.is_a?(Virtual::Block)
|
||||
assert @interpreter.block.is_a?(Register::Block)
|
||||
assert @interpreter.instruction.is_a?(Register::Instruction) , "not instruction #{@interpreter.instruction}"
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user