make method creation class methods in MethodCompiler

and pass the wish to use main explicitly, which is really a test
feature
This commit is contained in:
Torsten Ruger
2017-01-17 21:23:58 +02:00
parent 0c64e367d5
commit cd211f970f
8 changed files with 21 additions and 22 deletions

View File

@ -6,7 +6,7 @@ module Register
# it isn't really a function, ie it is jumped to (not called), exits and may not return
# so it is responsible for initial setup
def __init__ context
compiler = Vm::MethodCompiler.new.create_method(:Kernel,:__init__ )
compiler = Vm::MethodCompiler.create_method(:Kernel,:__init__ )
new_start = Register.label("__init__ start" , "__init__" )
compiler.method.set_instructions( new_start)
compiler.set_current new_start
@ -29,7 +29,7 @@ module Register
end
def exit context
compiler = Vm::MethodCompiler.new.create_method(:Kernel,:exit ).init_method
compiler = Vm::MethodCompiler.create_method(:Kernel,:exit ).init_method
emit_syscall( compiler , :exit )
return compiler.method
end