move constants to machine
This commit is contained in:
@ -6,6 +6,7 @@ module Register
|
||||
# init= Parfait::Space.object_space.get_class_by_name("Kernel").get_instance_method "__init__"
|
||||
self.objects.clear
|
||||
keep Parfait::Space.object_space , 0
|
||||
constants.each {|o| keep(o,0)}
|
||||
end
|
||||
|
||||
def keep object , depth
|
||||
@ -14,12 +15,6 @@ module Register
|
||||
#puts "ADD #{object.first.class}, #{object.last.class}" if object.is_a? Array
|
||||
return unless self.add_object object
|
||||
return unless object.respond_to? :has_layout?
|
||||
if( object.is_a? Parfait::Method)
|
||||
object.source.constants.each{|c|
|
||||
#puts "keeping constant #{c.class}:#{c.object_id}"
|
||||
keep(c , depth + 1)
|
||||
}
|
||||
end
|
||||
layout = object.get_layout
|
||||
keep(layout , depth + 1)
|
||||
return if object.is_a? Symbol
|
||||
|
Reference in New Issue
Block a user