dummy implementation of enter and return

This commit is contained in:
Torsten Ruger 2014-08-26 12:05:49 +03:00
parent 7fd9ff44db
commit dd0674c7dd
4 changed files with 27 additions and 6 deletions

View File

@ -51,12 +51,6 @@ module Register
link_object code , at link_object code , at
end end
end end
def link_MethodEnter str , at
end
def link_MethodReturn str , at
end
def link_FunctionCall str , at
end
def link_String str , at def link_String str , at
end end
def link_Symbol sym , at def link_Symbol sym , at

View File

@ -0,0 +1,13 @@
module Register
class EnterImplementation
def run block
block.codes.dup.each do |code|
next unless code.is_a? Virtual::MethodEnter
# save return register and create a new frame
block.replace(code , [] )
end
end
end
Virtual::BootSpace.space.add_pass_after EnterImplementation , CallImplementation
end

View File

@ -149,5 +149,7 @@ require_relative "register_reference"
require_relative "get_implementation" require_relative "get_implementation"
require_relative "set_implementation" require_relative "set_implementation"
require_relative "call_implementation" require_relative "call_implementation"
require_relative "enter_implementation"
require_relative "return_implementation"
require "arm/arm_machine" require "arm/arm_machine"
require_relative "assembler" require_relative "assembler"

View File

@ -0,0 +1,12 @@
module Register
class ReturnImplementation
def run block
block.codes.dup.each do |code|
next unless code.is_a? Virtual::MethodReturn
# call = RegisterMachine.instance.call( code.method )
block.replace(code , [] )
end
end
end
Virtual::BootSpace.space.add_pass_after ReturnImplementation , CallImplementation
end