From 2315ad6920193bc4df401fef1aaba0b2ffe695ff Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sat, 7 Nov 2015 21:55:04 +0200 Subject: [PATCH] minor cleaning --- lib/interpreter/interpreter.rb | 1 - lib/parfait/class.rb | 1 - lib/register/register_value.rb | 7 +------ lib/soml/compiler/call_site.rb | 2 +- lib/soml/compiler/return_statement.rb | 2 +- 5 files changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/interpreter/interpreter.rb b/lib/interpreter/interpreter.rb index 0f65b476..891675fe 100644 --- a/lib/interpreter/interpreter.rb +++ b/lib/interpreter/interpreter.rb @@ -115,7 +115,6 @@ module Interpreter end def execute_GetSlot - puts @instruction object = get_register( @instruction.array ) if( @instruction.index.is_a?(Numeric) ) index = @instruction.index diff --git a/lib/parfait/class.rb b/lib/parfait/class.rb index 5eeead0d..892f548d 100644 --- a/lib/parfait/class.rb +++ b/lib/parfait/class.rb @@ -63,7 +63,6 @@ module Parfait end def super_class - puts "Superclass #{super_class_name}" Parfait::Space.object_space.get_class_by_name(self.super_class_name) end diff --git a/lib/register/register_value.rb b/lib/register/register_value.rb index 80fc926d..a09a0932 100644 --- a/lib/register/register_value.rb +++ b/lib/register/register_value.rb @@ -44,6 +44,7 @@ module Register #helper method to calculate with register symbols def next_reg_use type , value = nil int = @symbol[1,3].to_i + raise "No more registers #{self}" if int > 12 sym = "r#{int + 1}".to_sym RegisterValue.new( sym , type, value) end @@ -111,10 +112,4 @@ module Register return register end - # when knowing the index of the argument, return the index into the message - # index passed is parfait, ie stats at 1 - def self.arg_index i - last = resolve_index :message , :name - return last + i - end end diff --git a/lib/soml/compiler/call_site.rb b/lib/soml/compiler/call_site.rb index 72662f07..642e3b21 100644 --- a/lib/soml/compiler/call_site.rb +++ b/lib/soml/compiler/call_site.rb @@ -26,8 +26,8 @@ module Soml set_message_details(name_s , arguments) set_arguments(arguments) + ret = use_reg( :Integer ) #TODO real return type do_call(clazz , statement) - ret = use_reg( :Integer ) # the effect of the method is that the NewMessage Return slot will be filled, return it # but move it into a register too add_code Register.get_slot(statement, :new_message , :return_value , ret ) diff --git a/lib/soml/compiler/return_statement.rb b/lib/soml/compiler/return_statement.rb index ed662b11..94a2d224 100644 --- a/lib/soml/compiler/return_statement.rb +++ b/lib/soml/compiler/return_statement.rb @@ -2,7 +2,7 @@ module Soml Compiler.class_eval do def on_return statement - reg = process(statement.first ) + reg = process(statement.first) add_code Register.set_slot( statement, reg , :message , :return_value) nil # statements don't return end