more on set
This commit is contained in:
parent
1d33c03537
commit
b7e0d3fba4
@ -15,7 +15,7 @@ module Builtin
|
||||
clazz = Virtual::BootSpace.space.get_or_create_class :Kernel
|
||||
method = clazz.resolve_method :main
|
||||
me = Virtual::Self.new(Virtual::Reference)
|
||||
code = Virtual::Set.new(Virtual::NewSelf.new(me.type), me)
|
||||
code = Virtual::Set.new(Virtual::Self.new(me.type), me)
|
||||
function.add_code(code)
|
||||
function.add_code Virtual::FunctionCall.new(method)
|
||||
return function
|
||||
|
@ -6,9 +6,13 @@ module Register
|
||||
def run block
|
||||
block.codes.dup.each do |code|
|
||||
next unless code.is_a? Virtual::Set
|
||||
tmp = RegisterReference.new(Virtual::Message::TMP_REG)
|
||||
if( code.to.is_a? Virtual::NewMessageSlot)
|
||||
to = RegisterReference.new(:r0)
|
||||
tmp = RegisterReference.new(:r5)
|
||||
to = Virtual::Message::NEW_MESSAGE_REG
|
||||
move = RegisterMachine.instance.ldr( to , tmp , code.to.index )
|
||||
block.replace(code , move )
|
||||
elsif( code.to.is_a? Virtual::Self)
|
||||
to = RegisterReference.new(Virtual::Message::SELF_REG)
|
||||
move = RegisterMachine.instance.ldr( to , tmp , code.to.index )
|
||||
block.replace(code , move )
|
||||
else
|
||||
|
@ -24,6 +24,13 @@ module Virtual
|
||||
EXCEPTION = 3
|
||||
SELF = 4
|
||||
|
||||
SELF_REG = :r0
|
||||
MESSAGE_REG = :r1
|
||||
FRAME_REG = :r2
|
||||
NEW_MESSAGE_REG = :r3
|
||||
|
||||
TMP_REG = :r4
|
||||
|
||||
def initialize me , normal , exceptional
|
||||
@me = me
|
||||
@next_normal = normal
|
||||
|
Loading…
Reference in New Issue
Block a user