dummy implementation of enter and return
This commit is contained in:
parent
7fd9ff44db
commit
dd0674c7dd
@ -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
|
||||||
|
13
lib/register/enter_implementation.rb
Normal file
13
lib/register/enter_implementation.rb
Normal 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
|
@ -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"
|
12
lib/register/return_implementation.rb
Normal file
12
lib/register/return_implementation.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user