remove method_compiler init method

as init is really just adding a label it is done in the method
 (thus mixing the levels, “polluting” parfait with risc, but there must
be change coming that way anyway)
This commit is contained in:
Torsten Ruger
2018-03-25 19:37:51 +03:00
parent 3bd23cee28
commit eb7713a9f3
5 changed files with 4 additions and 19 deletions

View File

@ -12,7 +12,7 @@ module Risc
def compiler_for( type , method_name , arguments , locals = {})
frame = Parfait::NamedList.type_for( locals ) #TODO fix locals passing/ using in builtin
args = Parfait::NamedList.type_for( arguments )
Risc::MethodCompiler.create_method(type , method_name , args, frame ).init_method
Risc::MethodCompiler.create_method(type , method_name , args, frame )
end
# Load the value

View File

@ -9,10 +9,6 @@ module Risc
def __init__ context
compiler = Risc::MethodCompiler.create_method(:Kernel,:__init__ ,
Parfait::NamedList.type_for({}) , Parfait::NamedList.type_for({}))
new_start = Risc.label("__init__ start" , "__init__" )
compiler.method.set_instructions( new_start)
compiler.set_current( new_start ) #thus abandoning standard method setup
space = Parfait.object_space
space_reg = compiler.use_reg(:Space) #Set up the Space as self upon init
compiler.add_load_constant("__init__ load Space", space , space_reg)