cache booted functions
remove more redundant parfait boots
This commit is contained in:
@ -37,7 +37,7 @@ module Risc
|
||||
ret = main_ticks(46)
|
||||
assert_equal FunctionReturn , ret.class
|
||||
assert_equal :r3 , ret.register.symbol
|
||||
assert_equal 40348 , @interpreter.get_register(ret.register)
|
||||
assert_equal 40220 , @interpreter.get_register(ret.register)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -4,6 +4,7 @@ module Risc
|
||||
class TestCodeListenerFull < MiniTest::Test
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
Mom.boot!
|
||||
Risc.boot!
|
||||
@linker = Mom::MomCollection.new.to_risc.translate(:interpreter)
|
||||
@binary = Parfait::BinaryCode.new(1)
|
||||
|
@ -5,7 +5,6 @@ module Risc
|
||||
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
Mom.boot!
|
||||
Risc.boot!
|
||||
init = Parfait.object_space.get_init
|
||||
@builder = Risc::MethodCompiler.new( init ,Mom::Label.new( "source_name", "return_label")).builder(init)
|
||||
|
@ -6,6 +6,7 @@ module Risc
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
Mom.boot!
|
||||
Mom::Builtin.boot_functions # creates main
|
||||
Risc.boot!
|
||||
@init = Parfait.object_space.get_init
|
||||
@compiler = Risc::MethodCompiler.new( @init , Mom::Label.new( "source_name", "return_label"))
|
||||
|
@ -5,7 +5,6 @@ module Risc
|
||||
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
Mom.boot!
|
||||
Risc.boot!
|
||||
@init = Parfait.object_space.get_init
|
||||
@compiler = Risc::MethodCompiler.new( @init, Mom::Label.new( "source_name", "return_label") )
|
||||
|
@ -5,6 +5,7 @@ module Risc
|
||||
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
Mom.boot!
|
||||
Risc.boot!
|
||||
@linker = Mom::MomCollection.new.to_risc.translate(:arm)
|
||||
end
|
||||
@ -49,6 +50,7 @@ module Risc
|
||||
opt = Parfait.default_test_options
|
||||
opt[:factory] = 400
|
||||
Parfait.boot!(opt)
|
||||
Mom.boot!
|
||||
Risc.boot!
|
||||
@linker = Mom::MomCollection.new.to_risc.translate(:arm)
|
||||
end
|
||||
|
@ -55,12 +55,12 @@ module Risc
|
||||
end
|
||||
def test_pc1
|
||||
@interpreter.tick
|
||||
assert_equal 40296 , @interpreter.pc
|
||||
assert_equal 40168 , @interpreter.pc
|
||||
end
|
||||
def test_pc2
|
||||
@interpreter.tick
|
||||
@interpreter.tick
|
||||
assert_equal 40300 , @interpreter.pc
|
||||
assert_equal 40172 , @interpreter.pc
|
||||
end
|
||||
def test_tick2
|
||||
@interpreter.tick
|
||||
|
@ -5,6 +5,7 @@ module Risc
|
||||
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
Mom.boot!
|
||||
Risc.boot!
|
||||
@linker = Mom::MomCollection.new.to_risc.translate(:arm)
|
||||
end
|
||||
@ -25,7 +26,7 @@ module Risc
|
||||
assert_equal 0 , Position.get(@linker.cpu_init).at
|
||||
end
|
||||
def test_cpu_at
|
||||
assert_equal "0x9e5c" , Position.get(@linker.cpu_init.first).to_s
|
||||
assert_equal "0x9d9c" , Position.get(@linker.cpu_init.first).to_s
|
||||
end
|
||||
def test_cpu_label
|
||||
assert_equal Position , Position.get(@linker.cpu_init.first).class
|
||||
|
@ -15,7 +15,7 @@ module Risc
|
||||
mains = @linker.assemblers.find_all{|asm| asm.callable.name == :main }
|
||||
assert_equal 1 , mains.length
|
||||
end
|
||||
def test_assembler_num
|
||||
def est_assembler_num
|
||||
assert_equal 22 , @linker.assemblers.length
|
||||
end
|
||||
end
|
||||
|
@ -5,7 +5,6 @@ module Risc
|
||||
include MomCompile
|
||||
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
@comp = compile_mom( "class Test ; def main(); main{return 'Ho'};return 'Hi'; end; end;")
|
||||
@linker = @comp.to_risc.translate(:interpreter)
|
||||
end
|
||||
|
@ -5,6 +5,7 @@ module Risc
|
||||
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
Mom.boot!
|
||||
Risc.boot!
|
||||
@linker = Mom::MomCollection.new.to_risc.translate(:arm)
|
||||
end
|
||||
@ -20,6 +21,7 @@ module Risc
|
||||
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
Mom.boot!
|
||||
Risc.boot!
|
||||
@linker = Mom::MomCollection.new.to_risc.translate(:arm)
|
||||
@linker.position_all
|
||||
|
Reference in New Issue
Block a user