Some vool starting to work again
disabling some rubyx compiler tests
This commit is contained in:
@ -13,16 +13,16 @@ module Mom
|
||||
@constants = []
|
||||
@block_compilers = []
|
||||
@mom_instructions = Label.new(source_name, source_name)
|
||||
@current = start = @risc_instructions
|
||||
@current = start = @mom_instructions
|
||||
add_code Label.new( source_name, "return_label")
|
||||
add_code Mom::ReturnSequence.new
|
||||
add_code Mom::ReturnSequence.new(source_name)
|
||||
add_code Label.new( source_name, "unreachable")
|
||||
@current = start
|
||||
end
|
||||
attr_reader :risc_instructions , :constants , :block_compilers , :callable , :current
|
||||
attr_reader :mom_instructions , :constants , :block_compilers , :callable , :current
|
||||
|
||||
def return_label
|
||||
@risc_instructions.each do |ins|
|
||||
@mom_instructions.each do |ins|
|
||||
next unless ins.is_a?(Label)
|
||||
return ins if ins.name == "return_label"
|
||||
end
|
||||
|
@ -23,7 +23,8 @@ module Mom
|
||||
|
||||
class Label < Instruction
|
||||
attr_reader :name
|
||||
def initialize(name)
|
||||
def initialize(source , name)
|
||||
super(source)
|
||||
@name = name
|
||||
end
|
||||
|
||||
|
@ -28,7 +28,8 @@ module Mom
|
||||
|
||||
attr_reader :left , :right , :original_source
|
||||
|
||||
def initialize(left , right, original_source = nil)
|
||||
def initialize(source , left , right, original_source = nil)
|
||||
super(source)
|
||||
@left , @right = left , right
|
||||
@left = SlotDefinition.new(@left.shift , @left) if @left.is_a? Array
|
||||
@right = SlotDefinition.new(@right.shift , @right) if @right.is_a? Array
|
||||
|
@ -36,7 +36,7 @@ module Parfait
|
||||
callable_method = create_callable_method(self_type)
|
||||
compiler = Mom::MethodCompiler.new( callable_method )
|
||||
head = @source.to_mom( compiler )
|
||||
compiler.add_mom(head)
|
||||
compiler.add_code(head)
|
||||
compiler
|
||||
end
|
||||
end
|
||||
|
@ -20,7 +20,7 @@ module Risc
|
||||
# module method to reset, and init
|
||||
def self.boot!
|
||||
Position.clear_positions
|
||||
Builtin.boot_functions
|
||||
# Builtin.boot_functions
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -25,9 +25,9 @@ module Vool
|
||||
end
|
||||
|
||||
def full_if(compiler)
|
||||
true_label = Mom::Label.new( "true_label_#{object_id.to_s(16)}")
|
||||
false_label = Mom::Label.new( "false_label_#{object_id.to_s(16)}")
|
||||
merge_label = Mom::Label.new( "merge_label_#{object_id.to_s(16)}")
|
||||
true_label = Mom::Label.new( self , "true_label_#{object_id.to_s(16)}")
|
||||
false_label = Mom::Label.new( self , "false_label_#{object_id.to_s(16)}")
|
||||
merge_label = Mom::Label.new( self , "merge_label_#{object_id.to_s(16)}")
|
||||
|
||||
head = Mom::TruthCheck.new(condition.slot_definition(compiler) , false_label)
|
||||
head << true_label
|
||||
|
@ -5,7 +5,7 @@ module Vool
|
||||
def to_mom( compiler )
|
||||
to = Mom::SlotDefinition.new(:message ,[ :receiver , @name])
|
||||
from = @value.slot_definition(compiler)
|
||||
return chain_assign( Mom::SlotLoad.new(to,from) , compiler)
|
||||
return chain_assign( Mom::SlotLoad.new(self,to,from) , compiler)
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -16,9 +16,9 @@ module Vool
|
||||
# - store the given return value, this is a SlotMove
|
||||
# - activate return sequence (reinstantiate old message and jump to return address)
|
||||
def to_mom( compiler )
|
||||
ret = Mom::SlotLoad.new( [:message , :return_value] ,
|
||||
ret = Mom::SlotLoad.new( self , [:message , :return_value] ,
|
||||
@return_value.slot_definition(compiler) )
|
||||
ret << Mom::ReturnJump.new
|
||||
ret << Mom::ReturnJump.new(self)
|
||||
end
|
||||
|
||||
def to_s(depth = 0)
|
||||
|
Reference in New Issue
Block a user