linked list of methods instead of list of methods
api changes slightly, especially for each, but mostly sama sama
This commit is contained in:
@ -145,14 +145,15 @@ module Risc
|
||||
false_object: :FalseClass , nil_object: :NilClass},
|
||||
NamedList: {},
|
||||
Type: {names: :List , types: :List ,
|
||||
object_class: :Class, methods: :List } ,
|
||||
object_class: :Class, methods: :TypedMethod } ,
|
||||
Class: {instance_methods: :List, instance_type: :Type, name: :Word,
|
||||
super_class_name: :Word , instance_names: :List },
|
||||
Dictionary: {keys: :List , values: :List } ,
|
||||
CacheEntry: {cached_type: :Type , cached_method: :TypedMethod } ,
|
||||
TypedMethod: {name: :Word, source: :Object, risc_instructions: :Object,
|
||||
cpu_instructions: :Object, binary: :BinaryCode,
|
||||
arguments: :Type , for_type: :Type, frame: :Type } ,
|
||||
arguments: :Type , for_type: :Type, frame: :Type ,
|
||||
next_method: :TypedMethod} ,
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -55,10 +55,8 @@ module Risc
|
||||
# This method is just a placeholder until boot is over and the real method is
|
||||
# parsed.
|
||||
def resolve_method( context)
|
||||
compiler = compiler_for(:Word, :resolve_method , {:value => :Object} )
|
||||
args = compiler.method.arguments
|
||||
len = args.instance_length
|
||||
raise "Compiler arg number mismatch, method=#{args} " if len != 2
|
||||
compiler = compiler_for(:Word, :resolve_method , {:value => :Type} )
|
||||
|
||||
compiler.add_mom( Mom::ReturnSequence.new)
|
||||
return compiler.method
|
||||
end
|
||||
|
@ -99,6 +99,11 @@ module Risc
|
||||
true
|
||||
end
|
||||
# Instruction interpretation starts here
|
||||
def execute_DynamicJump
|
||||
label = get_register(@instruction.register)
|
||||
puts "Jump to :#{label}:"
|
||||
set_instruction label
|
||||
end
|
||||
def execute_Branch
|
||||
label = @instruction.label
|
||||
set_instruction label
|
||||
|
Reference in New Issue
Block a user