diff --git a/lib/virtual.rb b/lib/virtual.rb index e4d24a5b..9d3e527b 100644 --- a/lib/virtual.rb +++ b/lib/virtual.rb @@ -5,7 +5,6 @@ require "virtual/instruction" require "virtual/compiled_method" require "virtual/slots/slot" require "virtual/type" -require "virtual/object" require "virtual/constants" # the passes _are_ order dependant require "virtual/passes/send_implementation" diff --git a/lib/virtual/block.rb b/lib/virtual/block.rb index 2b8ff27f..1ee07459 100644 --- a/lib/virtual/block.rb +++ b/lib/virtual/block.rb @@ -1,14 +1,12 @@ -require_relative "object" - module Virtual - + # Think flowcharts: blocks are the boxes. The smallest unit of linear code - - # Blocks must end in control instructions (jump/call/return). - # And the only valid argument for a jump is a Block - + + # Blocks must end in control instructions (jump/call/return). + # And the only valid argument for a jump is a Block + # Blocks form a graph, which is managed by the method - + class Block < Virtual::Object def initialize(name , method ) @@ -21,7 +19,7 @@ module Virtual attr_reader :name , :codes , :method attr_accessor :branch - + def reachable ret = [] add_next ret add_branch ret @@ -69,14 +67,14 @@ module Virtual end private - # helper for determining reachable blocks + # helper for determining reachable blocks def add_next ret return if @next.nil? return if ret.include? @next ret << @next @next.reachable ret end - # helper for determining reachable blocks + # helper for determining reachable blocks def add_branch ret return if @branch.nil? return if ret.include? @branch @@ -84,4 +82,4 @@ module Virtual @branch.reachable ret end end -end \ No newline at end of file +end diff --git a/lib/virtual/message.rb b/lib/virtual/message.rb index 3969cfb7..248b1043 100644 --- a/lib/virtual/message.rb +++ b/lib/virtual/message.rb @@ -38,19 +38,6 @@ module Virtual end attr_reader :me, :next_normal, :next_exception, :arguments , :frame - # dummy for the eventual - def new_frame - raise self.inspect - end # - def compile_get method , name - raise "CALLED" - if method.has_arg(name) - method.add_code MessageGet.new(name) - else - method.add_code FrameGet.new(name) - end - method.get_var(name) - end end end