Move add_object to collector

more changes to come
This commit is contained in:
Torsten Ruger
2016-12-31 14:54:15 +02:00
parent b9073d0c88
commit 853a531578
2 changed files with 28 additions and 18 deletions

View File

@ -36,7 +36,7 @@ module Register
def translate_methods(methods)
translator = Arm::Translator.new
methods.each do |method|
log.debug "Method #{method.name}"
log.debug "Translate method #{method.name}"
instruction = method.instructions
while instruction.next
nekst = instruction.next
@ -50,18 +50,6 @@ module Register
end
end
# Objects are data and get assembled after functions
def add_object( objekt )
return false if @objects[objekt.object_id]
return true if objekt.is_a? Fixnum
unless objekt.is_a?( Parfait::Object) or objekt.is_a?( Symbol) or objekt.is_a?( Register::Label)
raise "adding non parfait #{objekt.class}"
end
#raise "Method #{objekt.name}" if objekt.is_a? Parfait::TypedMethod
@objects[objekt.object_id] = objekt
true
end
def boot
initialize
boot_parfait!