keep risc and cpu instructions separate in method
that overwriting was a bit of thorn
This commit is contained in:
@ -149,9 +149,9 @@ module Risc
|
||||
super_class_name: :Word , instance_names: :List },
|
||||
Dictionary: {keys: :List , values: :List } ,
|
||||
CacheEntry: {cached_type: :Type , cached_method: :TypedMethod } ,
|
||||
TypedMethod: {name: :Word, source: :Object, instructions: :Object,
|
||||
binary: :BinaryCode, arguments: :Type , for_type: :Type,
|
||||
frame: :Type } ,
|
||||
TypedMethod: {name: :Word, source: :Object, risc_instructions: :Object,
|
||||
cpu_instructions: :Object, binary: :BinaryCode,
|
||||
arguments: :Type , for_type: :Type, frame: :Type } ,
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -43,7 +43,7 @@ module Risc
|
||||
def start( instruction )
|
||||
initialize
|
||||
set_state(:running)
|
||||
set_instruction instruction
|
||||
set_instruction( instruction )
|
||||
end
|
||||
|
||||
def set_state( state )
|
||||
@ -54,7 +54,7 @@ module Risc
|
||||
end
|
||||
|
||||
def set_instruction( i )
|
||||
raise "set to same instruction #{i}" if @instruction == i
|
||||
raise "set to same instruction #{i}:#{i.class}" if @instruction == i
|
||||
old = @instruction
|
||||
@instruction = i
|
||||
trigger(:instruction_changed, old , i)
|
||||
@ -195,7 +195,7 @@ module Risc
|
||||
end
|
||||
|
||||
def execute_FunctionCall
|
||||
set_instruction @instruction.method.instructions
|
||||
set_instruction @instruction.method.risc_instructions
|
||||
false
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user