From 6e009cc6dfba54cea1d88b82773f05c1e63cb3cd Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sun, 27 Sep 2015 19:18:36 +0300 Subject: [PATCH] remove send instruction --- lib/virtual/instruction.rb | 1 - lib/virtual/instructions/message_send.rb | 16 ---------------- lib/virtual/passes/minimizer.rb | 5 ----- 3 files changed, 22 deletions(-) delete mode 100644 lib/virtual/instructions/message_send.rb diff --git a/lib/virtual/instruction.rb b/lib/virtual/instruction.rb index 8f6453a7..3d4ac385 100644 --- a/lib/virtual/instruction.rb +++ b/lib/virtual/instruction.rb @@ -16,7 +16,6 @@ end require_relative "instructions/branch" require_relative "instructions/halt" require_relative "instructions/instance_get" -require_relative "instructions/message_send" require_relative "instructions/method_call" require_relative "instructions/method_enter" require_relative "instructions/method_return" diff --git a/lib/virtual/instructions/message_send.rb b/lib/virtual/instructions/message_send.rb deleted file mode 100644 index 65526ce8..00000000 --- a/lib/virtual/instructions/message_send.rb +++ /dev/null @@ -1,16 +0,0 @@ -module Virtual - - class MessageSend < Instruction - def initialize name , me , args = [] - @name = name.to_sym - @me = me - @args = args - end - attr_reader :name , :me , :args - - def to_s - "MessageSend.new(:#{name} , #{me} , #{args})" - end - end - -end diff --git a/lib/virtual/passes/minimizer.rb b/lib/virtual/passes/minimizer.rb index aff6cedb..422f722e 100644 --- a/lib/virtual/passes/minimizer.rb +++ b/lib/virtual/passes/minimizer.rb @@ -25,11 +25,6 @@ module Virtual @gonners.delete function function.source.blocks.each do |block| block.codes.each do |code| - if code.is_a? Virtual::MessageSend - @gonners.dup.each do |stay| - keep stay if(stay.name == code.name) - end - end keep code.method if code.is_a? Virtual::MethodCall end end