split compiled_method into method and compiled_method_info

This commit is contained in:
Torsten Ruger
2015-05-20 16:43:26 +03:00
parent dd2a5e367f
commit d6d0f4f43a
8 changed files with 147 additions and 103 deletions

View File

@ -15,15 +15,21 @@ module Parfait
class Module < Object
def initialize name , superclass
@instance_methods = []
@name = name.to_sym
@name = name
@super_class = superclass
@meta_class = Virtual::MetaClass.new(self)
end
def add_instance_method method
raise "not a method #{method.class} #{method.inspect}" unless method.is_a? Virtual::CompiledMethod
raise "not a method #{method.class} #{method.inspect}" unless method.is_a? Method
raise "syserr " unless method.name.is_a? Symbol
method.for_class = self
@instance_methods << method
method
end
def create_instance_method name , arg_names
add_instance_method Method.new( name , arg_names )
end
# this needs to be done during booting as we can't have all the classes and superclassses