makeing the method of the compiler more or less private
in preparation for using the same code for bocks
This commit is contained in:
@ -70,7 +70,7 @@ module Vool
|
||||
@my_type = type
|
||||
end
|
||||
def slot_definition(compiler)
|
||||
@my_type = compiler.method.self_type
|
||||
@my_type = compiler.resolve_type(:receiver)
|
||||
Mom::SlotDefinition.new(:message , [:receiver])
|
||||
end
|
||||
def ct_type
|
||||
|
@ -21,7 +21,7 @@ module Vool
|
||||
# to the method compiler for further processing
|
||||
def to_mom( compiler )
|
||||
parfait_block = self.parfait_block(compiler)
|
||||
block_compiler = Risc::BlockCompiler.new( parfait_block , compiler.method )
|
||||
block_compiler = Risc::BlockCompiler.new( parfait_block , compiler.get_method )
|
||||
compiler.add_block_compiler(block_compiler)
|
||||
head = body.to_mom( block_compiler )
|
||||
#block_compiler.add_mom(head)
|
||||
@ -41,7 +41,7 @@ module Vool
|
||||
# to CallableMethod)
|
||||
def parfait_block(compiler)
|
||||
return @parfait_block if @parfait_block
|
||||
@parfait_block = compiler.method.create_block( make_arg_type , make_frame(compiler))
|
||||
@parfait_block = compiler.create_block( make_arg_type , make_frame(compiler))
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -72,7 +72,7 @@ module Vool
|
||||
# - Setting up the next message, with receiver, arguments, and (importantly) return address
|
||||
# - a CachedCall , or a SimpleCall, depending on wether the receiver type can be determined
|
||||
def to_mom( compiler )
|
||||
@receiver = SelfExpression.new(compiler.method.self_type) if @receiver.is_a?(SelfExpression)
|
||||
@receiver = SelfExpression.new(compiler.resolve_type(:receiver)) if @receiver.is_a?(SelfExpression)
|
||||
if(@receiver.ct_type)
|
||||
simple_call(compiler)
|
||||
else
|
||||
|
@ -11,12 +11,8 @@ module Vool
|
||||
class LocalVariable < Expression
|
||||
include Named
|
||||
def slot_definition(compiler)
|
||||
if compiler.method.arguments_type.variable_index(@name)
|
||||
type = :arguments
|
||||
else
|
||||
type = :frame
|
||||
end
|
||||
Mom::SlotDefinition.new(:message , [type , @name])
|
||||
slot_def = compiler.slot_type_for(@name)
|
||||
Mom::SlotDefinition.new(:message , slot_def)
|
||||
end
|
||||
def to_s
|
||||
name.to_s
|
||||
|
Reference in New Issue
Block a user