<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/compiler/compiled_file.rb</filename>
    </added>
    <added>
      <filename>lib/compiler/marshal.rb</filename>
    </added>
    <added>
      <filename>lib/compiler/mri_compile.rb</filename>
    </added>
    <added>
      <filename>lib/compiler/mri_shim.rb</filename>
    </added>
    <added>
      <filename>lib/pp.rb</filename>
    </added>
    <added>
      <filename>lib/prettyprint.rb</filename>
    </added>
    <added>
      <filename>lib/vm/message.rb</filename>
    </added>
    <added>
      <filename>spec/compiler/file_spec.rb</filename>
    </added>
    <added>
      <filename>spec/compiler/marshal_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,4 @@
 class Array
-  ivar_as_index :total =&gt; 0, :tuple =&gt; 1, :start =&gt; 2, :shared =&gt; 3
-
   def total    ; @total ; end
   def tuple    ; @tuple ; end
   def start    ; @start ; end</diff>
      <filename>kernel/bootstrap/array.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,18 +12,8 @@ class Class
   end
   
   def new(*args)
-    obj = allocate()
-    Rubinius.asm(args, obj) do |args, obj|
-      run args
-      cast_array_for_args 0
-      push_array
-      push_block
-      run obj
-      set_call_flags 1
-      send_with_register :initialize
-    end
-
-    return obj
+    Ruby.primitive :class_new
+    raise PrimitiveFailure, &quot;Unable to create new instance&quot;
   end
   
   def instance_fields; @instance_fields ; end</diff>
      <filename>kernel/bootstrap/class.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,23 +7,21 @@ class NativeMethod
   def lines
     nil
   end
-  
+
   def exceptions
     nil
   end
-  
+
   def literals
     nil
   end
-  
+
   def line_from_ip(i)
     0
   end
 end
 
 class StaticScope
-  ivar_as_index :__ivars__ =&gt; 0, :module =&gt; 1, :parent =&gt; 2
-
   def initialize(mod, par=nil)
     @module = mod
     @parent = par
@@ -38,48 +36,51 @@ class StaticScope
   def module
     @module
   end
-  
+
   def parent
     @parent
-  end  
+  end
 end
 
-class CompiledMethod
-  # TODO: Delete/reuse cache (field 14) fields from C structure
-  ivar_as_index :__ivars__ =&gt; 0, :primitive =&gt; 1, :required =&gt; 2, :serial =&gt; 3, :bytecodes =&gt; 4, :name =&gt; 5, :file =&gt; 6, :local_count =&gt; 7, :literals =&gt; 8, :total_args =&gt; 9, :splat =&gt; 10, :exceptions =&gt; 11, :lines =&gt; 12, :path =&gt; 13, :bonus =&gt; 15, :compiled =&gt; 16, :staticscope =&gt; 17, :args =&gt; 18
-
-  def __ivars__  ; @__ivars__  ; end
-  def primitive  ; @primitive  ; end
-  def required   ; @required   ; end
-  def serial     ; @serial     ; end
-  def bytecodes  ; @bytecodes  ; end
-  def name       ; @name       ; end
-  def file       ; @file       ; end
-  def local_count; @local_count; end
-  def literals   ; @literals   ; end
-  def exceptions ; @exceptions ; end
-  def lines      ; @lines      ; end
-  def path       ; @path       ; end
-  def cache      ; @cache      ; end
-  def bonus      ; @bonus      ; end
-  def compiled   ; @compiled   ; end
-  def staticscope; @staticscope; end
-  def args       ; @args       ; end
-  def total_args ; @total_args ; end
-  def splat      ; @splat      ; end
+class Executable
+end
 
+class CompiledMethod &lt; Executable
+  # Ivars: instance_variables, primitive, serial, name, iseq, stack_size,
+  # local_count, required_args, total_args, splat, literals, exceptions,
+  # lines, file, compiled, scope
   ##
   # This is runtime hints, added to the method by the VM to indicate how it's
   # being used.
 
   attr_accessor :hints
-  
+  attr_accessor :__ivars__, :primitive, :name, :iseq, :stack_size
+  attr_accessor :local_count, :required_args, :total_args, :splat, :literals
+  attr_accessor :exceptions, :lines, :file, :local_names
+
+  def ==(other)
+    return false unless other.kind_of?(CompiledMethod)
+    @primitive == other.primitive and
+      @name == other.name and
+      @iseq == other.iseq and
+      @stack_size == other.stack_size and
+      @local_count == other.local_count and
+      @required_args == other.required_args and
+      @total_args == other.total_args and
+      @splat == other.splat and
+      @literals == other.literals and
+      @exceptions == other.exceptions and
+      @lines == other.lines and
+      @file == other.file and
+      @local_names == other.local_names
+  end
+
   def inspect
-    &quot;#&lt;#{self.class.name}:0x#{self.object_id.to_s(16)} name=#{@name} file=#{@file}&gt;&quot;
+    &quot;#&lt;#{self.class.name} #{@name} file=#{@file}&gt;&quot;
   end
-  
+
   def from_string(bc, lcls, req)
-    @bytecodes = bc
+    @iseq = bc
     @primitive = -1
     @local_count = lcls
     @literals = Tuple.new(0)
@@ -91,7 +92,7 @@ class CompiledMethod
     @required = req
     return self
   end
-  
+
   def inherit_scope(other)
     if ss = other.staticscope
       @staticscope = ss
@@ -100,119 +101,21 @@ class CompiledMethod
     end
   end
 
-  def staticscope=(val)
-    raise TypeError, &quot;not a static scope: #{val.inspect}&quot; unless val.kind_of? StaticScope
-    @staticscope = val
-  end
-  
-  def exceptions=(tup)
-    @exceptions = tup
-  end
-  
-  def literals=(tup)
-    @literals = tup
-  end
-  
-  def file=(val)
-    @file = val
-  end
-  
-  def name=(val)
-    @name = val
-  end
-
-  ##
-  # Lines consists of an array of tuples, with each tuple representing a line.
-  # The tuple for a line has fields for the first ip, last ip, and line number.
-
-  def lines=(val)
-    @lines = val
-  end
-  
-  def path=(val)
-    @path = val
-  end
-  
-  def primitive=(idx)
-    @primitive = idx
-  end
-  
-  def serial=(ser)
-    @serial = ser
-  end
-
-  def bonus=(tup)
-    @bonus = tup
-  end
-  
-  def args=(ary)
-    @args = ary
-  end
-
-  def total_args=(val)
-    @total_args = val.to_i
-  end
-
-  def splat=(val)
-    @splat = val.to_i
-  end
-  
-  def local_names
-    return nil unless @bonus
-    @bonus[0]
-  end
-  
-  def local_names=(names)
-    return if names.nil?
-    
-    unless names.kind_of? Tuple
-      raise ArgumentError, &quot;only accepts a Tuple&quot;
-    end
-    
-    names.each do |n|
-      unless n.kind_of? Symbol
-        raise ArgumentError, &quot;must be a tuple of symbols: #{n.inspect}&quot;
-      end
-    end
-    
-    @bonus = Tuple.new(1) unless @bonus
-    @bonus[0] = names
-    return names
-  end
-
   def activate(recv, mod, args, locals=nil, &amp;prc)
-    sz = args.total
-    if prc
-      block = prc.block
-    else
-      block = nil
-    end
-    
-    out = Rubinius.asm(args, block, locals, sz, mod, recv) do |a,b,l,s,m,r|
-      run a
-      push_array
-      run b
-      run l
-      run s
-      run m
-      push :self
-      run r
-      activate_method 0
-    end
-        
-    return out
+    Ruby.primitive :compiledmethod_activate
+    raise PrimitiveFailure, &quot;Unable to call #{@name} on #{recv.inspect}&quot;
   end
 
   class Script
     attr_accessor :path
   end
-  
+
   def as_script(script=nil)
     script ||= CompiledMethod::Script.new
     yield script if block_given?
 
     Rubinius::VM.save_encloser_path
-   
+
     # Setup the scoping.
     ss = StaticScope.new(Object)
     ss.script = script
@@ -233,40 +136,49 @@ class CompiledMethod
     end
     return 0
   end
-  
+
   def first_ip_on_line(line)
     @lines.each do |t|
       if t.at(2) &gt;= line
         return t.at(0)
       end
     end
-    
+
     return -1
   end
-  
+
   def bytecodes=(other)
-    @bytecodes = other
+    @iseq = other
   end
-  
+
   def first_line
     @lines.each do |ent|
       return ent[2] if ent[2] &gt; 0
     end
-    
+
     return -1
   end
 
   def is_block?
     @name =~ /__(?:(?:\w|_)+)?block__/
   end
-  
+
+  def describe
+    str = &quot;method #{@name}: #{@total_args} arg(s), #{@required_args} required&quot;
+    if @splat
+      str &lt;&lt; &quot;, splatted.&quot;
+    end
+
+    return str
+  end
+
   ##
   # Decodes the instruction sequence that is represented by this compileed
   # method. Delegates to InstructionSequence to do the instruction decoding,
   # but then converts opcode literal arguments to their actual values by looking
   # them up in the literals tuple.
   def decode
-    stream = @bytecodes.decode
+    stream = @iseq.decode
     ip = 0
     args_reg = 0
     stream.map! do |inst|
@@ -320,6 +232,7 @@ class CompiledMethod
     def initialize(inst, cm, ip, args_reg)
       @op = inst[0]
       @args = inst[1..-1]
+      @comment = nil
       @args.each_index do |i|
         case @op.args[i]
         when :literal
@@ -327,7 +240,9 @@ class CompiledMethod
         when :local
           # TODO: Blocks should be able to retrieve local names as well,
           # but need access to method corresponding to home context
-          @args[i] = cm.local_names[args[i]] if cm.local_names and cm.name != :__block__
+          if cm.local_names and cm.name != :__block__
+            @comment = cm.local_names[args[i]].to_s
+          end
         when :block_local
           # TODO: Blocks should be able to retrieve enclosing block local names as well,
           # but need access to static scope
@@ -418,6 +333,11 @@ class CompiledMethod
     def to_s
       str = &quot;%04d:  %-27s&quot; % [@ip, opcode]
       str &lt;&lt; @args.map{|a| a.inspect}.join(', ')
+      if @comment
+        str &lt;&lt; &quot;    # #{@comment}&quot;
+      end
+
+      return str
     end
   end
 end</diff>
      <filename>kernel/core/compiled_method.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,12 +14,12 @@ class InstructionSet
   #   the stack. The first code identifies the number of operands popped from
   #   the stack, and the second the number of operands pushed back onto the
   #   stack.
-  #   
+  #
   #   If the code is zero or a positive value, it is the exact number of
   #   operands pushed or popped. If the code is a negative value, it means the
   #   number of operands consumed/produced is calculated based on another
   #   value, and cannot be determined just from the opcode.
-  #   
+  #
   #   Negative codes
   #   consist of 3-digits, where:
   #   - the first digit is a multiplier (normally 1, but make_hash has a value
@@ -27,7 +27,7 @@ class InstructionSet
   #   - the second digit is the where the arg to be multiplied comes from;
   #     1 = first opcode arg, 2 = second opcode arg, 3 = arg register;
   #   - the final digit is a constant number to be added to the result.
-  #   
+  #
   #   The value -999 is a special value, indicating that the result cannot be
   #   calculated from the bytecode, since it is dependent on the number of
   #   items in an array that will be on the stack when the opcode is
@@ -47,16 +47,26 @@ class InstructionSet
     {:opcode =&gt; :push_nil, :args =&gt; [], :stack =&gt; [0,1]},
     {:opcode =&gt; :push_true, :args =&gt; [], :stack =&gt; [0,1]},
     {:opcode =&gt; :push_false, :args =&gt; [], :stack =&gt; [0,1]},
-    {:opcode =&gt; :store_field, :args =&gt; [], :stack =&gt; [3,1]},
     {:opcode =&gt; :push_int, :args =&gt; [:int], :stack =&gt; [0,1]},
-    {:opcode =&gt; :fetch_field, :args =&gt; [], :stack =&gt; [2,1]},
     {:opcode =&gt; :push_context, :args =&gt; [], :stack =&gt; [0,1]},
     {:opcode =&gt; :push_literal, :args =&gt; [:literal], :stack =&gt; [0,1]},
     {:opcode =&gt; :push_self, :args =&gt; [], :stack =&gt; [0,1]},
+
+    # Flow control opcodes
+
     {:opcode =&gt; :goto, :args =&gt; [:ip], :stack =&gt; [0,0], :flow =&gt; :goto},
     {:opcode =&gt; :goto_if_false, :args =&gt; [:ip], :stack =&gt; [1,0], :flow =&gt; :goto},
     {:opcode =&gt; :goto_if_true, :args =&gt; [:ip], :stack =&gt; [1,0], :flow =&gt; :goto},
+    {:opcode =&gt; :goto_if_defined, :args =&gt; [:ip], :stack =&gt; [1,0],
+      :flow =&gt; :goto},
+    {:opcode =&gt; :ret, :args =&gt; [], :stack =&gt; [1,0], :flow =&gt; :return,
+      :vm_flags =&gt; [:terminator]},
+
+    # stack maintainence
+
     {:opcode =&gt; :swap_stack, :args =&gt; [], :stack =&gt; [1,1]},
+    {:opcode =&gt; :dup_top, :args =&gt; [], :stack =&gt; [0,1]},
+    {:opcode =&gt; :pop, :args =&gt; [], :stack =&gt; [1,0]},
     {:opcode =&gt; :set_local, :args =&gt; [:local], :stack =&gt; [1,1]},
     {:opcode =&gt; :push_local, :args =&gt; [:local], :stack =&gt; [0,1]},
     {:opcode =&gt; :push_exception, :args =&gt; [], :stack =&gt; [0,1]},
@@ -65,8 +75,6 @@ class InstructionSet
     {:opcode =&gt; :set_ivar, :args =&gt; [:literal], :stack =&gt; [1,1],
       :vm_flags =&gt; []},
     {:opcode =&gt; :push_ivar, :args =&gt; [:literal], :stack =&gt; [0,1]},
-    {:opcode =&gt; :goto_if_defined, :args =&gt; [:ip], :stack =&gt; [1,0],
-      :flow =&gt; :goto},
     {:opcode =&gt; :push_const, :args =&gt; [:literal], :stack =&gt; [0,1]},
     {:opcode =&gt; :set_const, :args =&gt; [:literal], :stack =&gt; [1,1],
       :vm_flags =&gt; []},
@@ -89,14 +97,21 @@ class InstructionSet
       :vm_flags =&gt; []},
     {:opcode =&gt; :cast_tuple, :args =&gt; [], :stack =&gt; [1,1],
       :vm_flags =&gt; []},
-    {:opcode =&gt; :dup_top, :args =&gt; [], :stack =&gt; [0,1]},
-    {:opcode =&gt; :pop, :args =&gt; [], :stack =&gt; [1,0]},
+
+    # send opcodes
     {:opcode =&gt; :send_method, :args =&gt; [:literal], :stack =&gt; [1,1],
       :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
-    {:opcode =&gt; :send_stack, :args =&gt; [:literal, :int], :stack =&gt; [-121,1],
-      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
+    {:opcode =&gt; :send_stack, :args =&gt; [:literal, :int], 
+      :stack =&gt; [-121,1], :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
     {:opcode =&gt; :send_stack_with_block, :args =&gt; [:literal, :int],
       :stack =&gt; [-122,1], :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
+    {:opcode =&gt; :send_stack_with_splat, :args =&gt; [:literal, :int], 
+      :stack =&gt; [-123,1], :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
+    {:opcode =&gt; :send_super_stack_with_block,  :args =&gt; [:literal, :int],
+      :stack =&gt; [-121,1], :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
+    {:opcode =&gt; :send_super_stack_with_splat, :args =&gt; [:literal, :int],
+      :stack =&gt; [-122,1], :flow =&gt; :send},
+
     {:opcode =&gt; :push_block, :args =&gt; [], :stack =&gt; [0,1]},
     {:opcode =&gt; :clear_exception, :args =&gt; [], :stack =&gt; [0,0]},
     {:opcode =&gt; :cast_array, :args =&gt; [], :stack =&gt; [1,1],
@@ -109,33 +124,9 @@ class InstructionSet
      :vm_flags =&gt; []},
     {:opcode =&gt; :string_dup, :args =&gt; [], :stack =&gt; [1,1],
       :vm_flags =&gt; []},
-    {:opcode =&gt; :send_stack_with_splat, :args =&gt; [:literal, :int], :stack =&gt; [-132,1],
-      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
-    {:opcode =&gt; :send_super_stack_with_block,  :args =&gt; [:literal, :int],
-      :stack =&gt; [-121,1], :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
-    {:opcode =&gt; :send_super_stack_with_splat, :args =&gt; [:literal, :int],
-      :stack =&gt; [-131,1], :flow =&gt; :send},
     {:opcode =&gt; :push_my_field, :args =&gt; [:field], :stack =&gt; [0,1]},
     {:opcode =&gt; :store_my_field, :args =&gt; [:field], :stack =&gt; [1,1]},
     {:opcode =&gt; :open_metaclass, :args =&gt; [], :stack =&gt; [1,1]},
-    {:opcode =&gt; :meta_push_neg_1, :args =&gt; [], :stack =&gt; [0,1]},
-    {:opcode =&gt; :meta_push_0, :args =&gt; [], :stack =&gt; [0,1]},
-    {:opcode =&gt; :meta_push_1, :args =&gt; [], :stack =&gt; [0,1]},
-    {:opcode =&gt; :meta_push_2, :args =&gt; [], :stack =&gt; [0,1]},
-    {:opcode =&gt; :meta_send_op_plus, :args =&gt; [], :stack =&gt; [2,1],
-      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
-    {:opcode =&gt; :meta_send_op_minus, :args =&gt; [], :stack =&gt; [2,1],
-      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
-    {:opcode =&gt; :meta_send_op_equal, :args =&gt; [], :stack =&gt; [2,1],
-      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
-    {:opcode =&gt; :meta_send_op_lt, :args =&gt; [], :stack =&gt; [2,1],
-      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
-    {:opcode =&gt; :meta_send_op_gt, :args =&gt; [], :stack =&gt; [2,1],
-      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
-    {:opcode =&gt; :meta_send_op_tequal, :args =&gt; [], :stack =&gt; [2,1],
-      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
-    {:opcode =&gt; :meta_send_op_nequal, :args =&gt; [], :stack =&gt; [2,1],
-      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
     {:opcode =&gt; :push_local_depth, :args =&gt; [:depth, :block_local],
       :stack =&gt; [0,1]},
     {:opcode =&gt; :set_local_depth, :args =&gt; [:depth, :block_local],
@@ -151,8 +142,6 @@ class InstructionSet
     {:opcode =&gt; :is_nil, :args =&gt; [], :stack =&gt; [1,1]},
     {:opcode =&gt; :class, :args =&gt; [], :stack =&gt; [1,1]},
     {:opcode =&gt; :equal, :args =&gt; [], :stack =&gt; [2,1]},
-    {:opcode =&gt; :ret, :args =&gt; [], :stack =&gt; [1,0], :flow =&gt; :return,
-      :vm_flags =&gt; [:terminator]},
     {:opcode =&gt; :set_literal, :args =&gt; [:literal], :stack =&gt; [0,0]},
     {:opcode =&gt; :passed_blockarg, :args =&gt; [:int], :stack =&gt; [0,1]},
     {:opcode =&gt; :create_block, :args =&gt; [], :stack =&gt; [1,1],
@@ -160,12 +149,30 @@ class InstructionSet
     {:opcode =&gt; :cast_for_single_block_arg, :args =&gt; [], :stack =&gt; [1,1]},
     {:opcode =&gt; :cast_for_multi_block_arg, :args =&gt; [], :stack =&gt; [1,1]},
     {:opcode =&gt; :check_serial, :args =&gt; [:literal, :int], :stack =&gt; [1,1]},
+    
+    # meta opcodes, used for optimization only.
+    {:opcode =&gt; :meta_push_neg_1, :args =&gt; [], :stack =&gt; [0,1]},
+    {:opcode =&gt; :meta_push_0, :args =&gt; [], :stack =&gt; [0,1]},
+    {:opcode =&gt; :meta_push_1, :args =&gt; [], :stack =&gt; [0,1]},
+    {:opcode =&gt; :meta_push_2, :args =&gt; [], :stack =&gt; [0,1]},
+    {:opcode =&gt; :meta_send_op_plus, :args =&gt; [], :stack =&gt; [2,1],
+      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
+    {:opcode =&gt; :meta_send_op_minus, :args =&gt; [], :stack =&gt; [2,1],
+      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
+    {:opcode =&gt; :meta_send_op_equal, :args =&gt; [], :stack =&gt; [2,1],
+      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
+    {:opcode =&gt; :meta_send_op_lt, :args =&gt; [], :stack =&gt; [2,1],
+      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
+    {:opcode =&gt; :meta_send_op_gt, :args =&gt; [], :stack =&gt; [2,1],
+      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
+    {:opcode =&gt; :meta_send_op_tequal, :args =&gt; [], :stack =&gt; [2,1],
+      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
+    {:opcode =&gt; :meta_send_op_nequal, :args =&gt; [], :stack =&gt; [2,1],
+      :flow =&gt; :send, :vm_flags =&gt; [:check_interrupts]},
     {:opcode =&gt; :meta_send_call, :args =&gt; [:int], :stack =&gt; [-111,1],
       :flow =&gt; :send}
   ]
 
-  InstructionSize = 4
-
   class OpCode
     def initialize(opcode_info)
       @opcode_info = opcode_info
@@ -195,10 +202,10 @@ class InstructionSet
     end
 
     ##
-    # Returns the width of the opcode (including arguments) in bytes
+    # Returns the width of the opcode (including arguments) in Iseq units
 
     def width
-      (@opcode_info[:args].size + 1) * InstructionSize
+      (@opcode_info[:args].size + 1)
     end
 
     ##
@@ -230,6 +237,9 @@ class InstructionSet
     #
     # If the value is positive, it is the exact number of items produced.
     #
+    # NOTE at present, all opcodes are either positive or 0. The variable
+    # scheme below is not used at present, and may never be again.
+    #
     # If the value is negative, it is a 3-digit number where:
     # - first digit is a multiplier (1 or 2)
     # - second digit is the opcode arg to be multiplied
@@ -247,6 +257,23 @@ class InstructionSet
       @opcode_info[:stack].last
     end
 
+    # Indicates how the stack changes with this instruction. Positive numbers
+    # meaning how far the sp is pushed forward, negative how far back.
+    # +inst+ is an Array in the same format that Encoder#encode takes as input
+    def stack_difference(inst)
+      consumed = stack_consumed()
+      if consumed &lt; 0
+        consumed = -consumed
+        mult =   consumed / 100
+        arg =   (consumed % 100) / 10
+        const = (consumed % 100) % 10
+        consumed = (mult * inst[arg]) + const
+      end
+      produced = stack_produced()
+
+      return produced - consumed
+    end
+
     def check_interrupts?
       flags = @opcode_info[:vm_flags]
       flags and flags.include? :check_interrupts
@@ -290,13 +317,36 @@ class InstructionSet
     else
       inst = @opcodes[op]
     end
-    raise InvalidOpCode, &quot;Invalid opcode #{op}&quot; if inst.nil?
+    raise InvalidOpCode, &quot;Invalid opcode #{op.inspect}&quot; if inst.nil?
     inst
   end
 end
 
 
 class InstructionSequence
+  def initialize(size)
+    @opcodes = Tuple.new(size)
+    @stack_depth = 0
+  end
+
+  attr_reader :opcodes
+  attr_accessor :stack_depth
+
+  def ==(other)
+    other.kind_of?(InstructionSequence) and @opcodes == other.opcodes
+  end
+
+  def []=(idx, val)
+    @opcodes[idx] = val
+  end
+
+  def [](idx)
+    @opcodes[idx]
+  end
+
+  def size
+    @opcodes.size
+  end
 
   class Encoder
 
@@ -311,7 +361,7 @@ class InstructionSequence
       stream = []
 
       last_good = [nil, 0]
-      
+
       begin
         while @offset &lt; @iseq.size
           inst = decode
@@ -323,7 +373,7 @@ class InstructionSequence
         # Because bytearrays and iseqs are allocated in chunks of 4 or 8 bytes,
         # we can get junk at the end of the iseq
         unless last_good.first and last_good.first.flow == :return
-          ex.message &lt;&lt; &quot; at byte #{@offset} of #{@iseq.size} [IP:#{@offset / InstructionSet::InstructionSize}]&quot;
+          ex.message &lt;&lt; &quot; at byte #{@offset} of #{@iseq.size} [IP:#{@offset}]&quot;
           raise ex
         end
       end
@@ -340,9 +390,15 @@ class InstructionSequence
     # whose meaning depends on the opcode.
 
     def encode_stream(stream)
-      sz = stream.inject(0) { |acc, ele| acc + (ele.size * InstructionSet::InstructionSize) }
+      sz = stream.inject(0) do |acc, ele|
+        acc + (ele.kind_of?(Array) ? ele.size : 1)
+      end
+
+      @max_stack_depth = 0
+      @stack_depth = 0
       @iseq = InstructionSequence.new(sz)
       @offset = 0
+
       begin
         stream.each do |inst|
           encode inst
@@ -353,6 +409,8 @@ class InstructionSequence
         raise e
       end
 
+      @iseq.stack_depth = @max_stack_depth
+
       return @iseq
     end
 
@@ -367,7 +425,7 @@ class InstructionSequence
 
     def replace_instruction(iseq, ip, inst)
       @iseq = iseq
-      @offset = start = ip * InstructionSet::InstructionSize
+      @offset = start = ip
 
       old_inst = iseq2int
       old_op = InstructionSet[old_inst]
@@ -382,10 +440,10 @@ class InstructionSequence
 
       1.upto(old_op.arg_count) do
         replaced &lt;&lt; iseq2int
-        @offset -= InstructionSet::InstructionSize
+        @offset -= 1
         int2str(0)  # Replace old args with 0
       end
-      
+
       @offset = start
       encode inst
       replaced
@@ -397,7 +455,7 @@ class InstructionSequence
 
     def decode_instruction(iseq, ip)
       @iseq = iseq
-      @offset = ip * InstructionSet::InstructionSize
+      @offset = ip
 
       decode
     end
@@ -417,55 +475,53 @@ class InstructionSequence
     end
 
     private :decode
-    
+
+    def iseq2int
+      op = @iseq[@offset]
+      @offset += 1
+      return op
+    end
+
     def encode(inst)
-      opcode = inst.first
-      unless opcode.kind_of? InstructionSet::OpCode
-        opcode = InstructionSet[opcode]
-      end
+      if inst.kind_of? Array
+        opcode = inst.first
+        unless opcode.kind_of? InstructionSet::OpCode
+          opcode = InstructionSet[opcode]
+        end
 
-      arg_count = opcode.arg_count
-      unless inst.size - 1 == arg_count
-        raise ArgumentError, &quot;Missing instruction arguments to #{inst.first} (need #{arg_count} / got #{inst.size - 1})&quot;
+        arg_count = opcode.arg_count
+        unless inst.size - 1 == arg_count
+          raise ArgumentError, &quot;Missing instruction arguments to #{inst.first} (need #{arg_count} / got #{inst.size - 1})&quot;
+        end
+      else
+        opcode = inst
+        arg_count = 0
+        unless opcode.kind_of? InstructionSet::OpCode
+          opcode = InstructionSet[opcode]
+        end
       end
 
+      this = opcode.stack_difference(inst)
+      @stack_depth += this
+      @max_stack_depth = @stack_depth if @stack_depth &gt; @max_stack_depth
+
       begin
-        int2str(opcode.bytecode)
+        @iseq[@offset] = opcode.bytecode
         case arg_count
         when 1
-          int2str(inst[1])
+          @iseq[@offset + 1] = inst[1].to_i
         when 2
-          int2str(inst[1])
-          int2str(inst[2])
+          @iseq[@offset + 1] = inst[1].to_i
+          @iseq[@offset + 2] = inst[2].to_i
         end
-      rescue Object
+        @offset += (1 + arg_count)
+      rescue =&gt; e
         raise ArgumentError, &quot;Unable to encode #{inst.inspect}&quot;
       end
     end
 
     private :encode
 
-    def iseq2int
-      inst =  (@iseq[@offset    ] * 16777216)
-      inst += (@iseq[@offset + 1] * 65536)
-      inst += (@iseq[@offset + 2] * 256)
-      inst += (@iseq[@offset + 3])
-      @offset += 4
-      return inst
-    end
-
-    private :iseq2int
-
-    def int2str(int)
-      3.downto(0) do |i|
-        @iseq[@offset + i] = (int % 256)
-        int = int / 256
-      end
-
-      @offset += 4
-    end
-
-    private :int2str
   end
 
   ##</diff>
      <filename>kernel/core/iseq.rb</filename>
    </modified>
    <modified>
      <diff>@@ -66,18 +66,6 @@ class Node
       [0, 0, nil]
     end
 
-    def push_self_or_class(meth)
-      is_module = meth.new_label
-      meth.push :self
-      meth.dup
-      meth.push_cpath_top
-      meth.find_const :Module
-      meth.send :kind_of?, 1
-      meth.git is_module
-      meth.send :class, 0
-      is_module.set!
-    end
-
     def attach_and_call(g, name)
       # If the body is empty, then don't bother with it.
       return if @body.empty?
@@ -87,16 +75,13 @@ class Node
 
       prelude(g, meth)
 
-      push_self_or_class(meth)
-      meth.set_encloser
-
       set(:scope, self) do
         show_errors(meth) do
           desc.run self, @body
         end
       end
 
-      meth.sret
+      meth.ret
       meth.close
 
       g.dup
@@ -105,7 +90,6 @@ class Node
       g.attach_method name
       g.pop
       g.send name, 0
-      g.push_encloser
     end
 
     def prelude(orig, g)
@@ -136,22 +120,18 @@ class Node
       set(:scope, self) do
         prelude(nil, g)
         @body.bytecode(g)
-        g.sret
+        g.ret
       end
     end
   end
 
   # REFACTOR See if there is a sane way to call 'super' here
-  # We need to call 'push_encloser' before 'sret', hence the copy-and-paste
   class EvalExpression
     def bytecode(g)
       set(:scope, self) do
-        push_self_or_class(g)
-        g.set_encloser
         prelude(nil, g)
         @body.bytecode(g)
-        g.push_encloser
-        g.sret
+        g.ret
       end
       enlarge_context
     end
@@ -164,7 +144,7 @@ class Node
         @body.bytecode(g)
         g.pop
         g.push :true
-        g.sret
+        g.ret
       end
     end
   end
@@ -642,12 +622,12 @@ class Node
         sub.redo.set!
         @body.bytecode(sub)
         sub.pop_modifiers
-        sub.soft_return
+        sub.ret
         sub.close
       end
 
       g.push_literal desc
-      g.create_block2
+      g.create_block
     end
   end
 
@@ -731,7 +711,7 @@ class Node
         else
           g.push :nil
         end
-        g.soft_return
+        g.ret
       else
         jump_error g, &quot;next used in invalid context&quot;
       end
@@ -1618,7 +1598,7 @@ class Node
           if @in_block
             Return.emit_lre(g, @check_var)
           else
-            g.sret
+            g.ret
           end
 
           after.set!
@@ -1661,7 +1641,7 @@ class Node
       if @in_block
         Return.emit_lre(g, @check_var)
       else
-        g.sret
+        g.ret
       end
     end
 
@@ -1823,13 +1803,14 @@ class Node
       elsif @source.is? ConcatArgs
         @source.bytecode(g)
       elsif @source
+        p self
         raise Error, &quot;Unknown form: #{@source.class}&quot;
       end
       g.cast_tuple
 
       if @assigns
         @assigns.body.each do |x|
-          g.unshift_tuple
+          g.shift_tuple
           if x.is? AttrAssign
             x.bytecode(g, true)
           else
@@ -1851,7 +1832,7 @@ class Node
     def block_arg_bytecode(g)
       if @assigns
         @assigns.body.each do |x|
-          g.unshift_tuple
+          g.shift_tuple
           x.bytecode(g)
           g.pop
         end
@@ -1970,9 +1951,7 @@ class Node
       if @block and @block.is? Iter
         block_bytecode(g)
       elsif @dynamic
-        g.push @argcount
-        g.set_args
-        g.send_with_register @method, allow_private?, @concat
+        g.send_with_splat @method, @argcount, allow_private?, @concat
       elsif @block
         # Only BlockPass currently
         g.send_with_block @method, @argcount, allow_private?
@@ -1993,9 +1972,7 @@ class Node
         g.pop
 
         if @dynamic
-          g.push @argcount
-          g.set_args
-          g.send_with_register @method, allow_private?, false
+          g.send_with_splat @method, @argcount, allow_private?, false
         else
           g.send_with_block @method, @argcount, allow_private?
         end
@@ -2023,7 +2000,7 @@ class Node
         # If this is occuring already in a block, keep it raising.
         unless @in_block
           g.send :value, 0
-          g.sret
+          g.ret
         end
 
         after.set!
@@ -2046,9 +2023,7 @@ class Node
 
       if @dynamic
         g.push :nil
-        g.push @argcount
-        g.set_args
-        g.send_with_register :call, false, false
+        g.send_with_splat :call, @argcount, false, false
       else
         g.meta_send_call @argcount
       end
@@ -2067,9 +2042,7 @@ class Node
       end
 
       if @dynamic
-        g.push @argcount
-        g.set_args
-        g.send_super @method.name
+        g.send_super @method.name, @argcount, true
       else
         g.send_super @method.name, @argcount
       end
@@ -2208,7 +2181,7 @@ class Node
 
       desc.args = [required, optional, @arguments.splat &amp;&amp; @arguments.splat.name]
 
-      meth.sret
+      meth.ret
       meth.close
 
       use_plugin g, :method, desc</diff>
      <filename>lib/compiler/bytecode.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,16 +1,14 @@
-require 'compiler/system_hints'
-
 class Compiler
 
   Config = Hash.new
-  
+
   class Error &lt; RuntimeError
   end
-  
+
   def self.process_flags(flags)
     flags.each { |f| Config[f] = true } if flags
   end
-  
+
   def self.parse_flags(stream)
     to_clear = []
     stream.each do |token|
@@ -205,7 +203,7 @@ class Compiler
 
     klass = Node::Mapping[sexp.first]
 
-    raise Error, &quot;Unable to resolve #{sexp.first}&quot; unless klass
+    raise Error, &quot;Unable to resolve '#{sexp.first.inspect}'&quot; unless klass
 
     return klass.create(self, sexp)
   end
@@ -244,7 +242,7 @@ class Compiler
       end
     end
   end
-  
+
   class GenerationError &lt; Error; end
   
   def show_errors(gen)
@@ -257,7 +255,7 @@ class Compiler
       puts &quot;   #{e.message} (#{e.class})&quot;
       puts &quot;   near #{gen.file}:#{gen.line}&quot;
       puts &quot;&quot;
-      puts e.awesome_backtrace.show
+      puts e.backtrace
 
       raise GenerationError, &quot;unable to generate bytecode&quot;
     end</diff>
      <filename>lib/compiler/compiler.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,21 +1,21 @@
 class Compiler
-    
+
   class Generator
-    
+
     class Label
       def initialize(generator)
         @generator = generator
         @position = nil
       end
-      
+
       attr_accessor :position
-      
+
       def set!
         @position = @generator.ip
       end
-      
+
     end
-        
+
     def initialize
       @stream = []
       @encoder = InstructionSequence::Encoder.new
@@ -31,10 +31,10 @@ class Compiler
       @file = nil
       @lines = []
       @primitive = nil
-      
+
       @exceptions = []
     end
-    
+
     attr_reader :ip, :cache_size, :exceptions, :stream, :literals
     attr_accessor :break, :redo, :next, :retry, :ensure_return
 
@@ -52,11 +52,17 @@ class Compiler
           next
         end
 
-        part.each do |e|
-          s = pat[j]
-          next if s == :any
-          return false unless e == s
+        if part.kind_of? Array
+          part.each do |e|
+            s = pat[j]
+            next if s == :any
+            return false unless e == s
 
+            j += 1
+          end
+        else
+          next if pat[j] == :any
+          return false unless pat[j] == part
           j += 1
         end
 
@@ -65,13 +71,13 @@ class Compiler
 
       return true
     end
-    
+
     def run(node)
       node.bytecode self
     end
 
     # Formalizers
-        
+
     def collapse_labels
       @stream.each do |part|
         if part.kind_of? Array
@@ -89,7 +95,7 @@ class Compiler
         end
       end
     end
-    
+
     def encode_lines
       tup = Tuple.new(@lines.size)
       i = 0
@@ -97,10 +103,10 @@ class Compiler
         tup[i] = Tuple[ent[0], ent[1], ent[2]]
         i += 1
       end
-      
+
       return tup
     end
-    
+
     def encode_literals(cm)
       tup = Tuple.new(@literals.size)
       i = 0
@@ -113,34 +119,52 @@ class Compiler
         tup[i] = lit
         i += 1
       end
-      
+
       return tup
     end
-    
+
     def encode_exceptions
       @exceptions.sort!
-  
+
       tup = Tuple.new(@exceptions.size)
       i = 0
       @exceptions.each do |e|
         tup[i] = e.as_tuple
         i += 1
       end
-      
+
       return tup
     end
-    
+
     def to_cmethod(desc)
       collapse_labels
+      
       iseq = @encoder.encode_stream @stream
       cm = CompiledMethod.new.from_string iseq, desc.locals.size, desc.required
+      
+      cm.total_args = desc.required + desc.optional
+      cm.required_args = desc.required
+      cm.literals = encode_literals(cm)
+      cm.lines = encode_lines()
+      cm.local_names = desc.locals.encoded_order
+      cm.exceptions = encode_exceptions()
+     
 
+      if desc.splat
+        cm.splat = desc.splat.slot
+        cm.total_args += 1
+      else
+        cm.splat = nil
+      end
+      
+      cm.stack_size = cm.total_args + iseq.stack_depth
+     
       if @file
         cm.file = @file.to_sym
       else
         cm.file = nil
       end
-      
+
       cm.name = desc.name
 
       if @primitive
@@ -148,61 +172,54 @@ class Compiler
       else
         cm.primitive = nil
       end
-      
-      if desc.splat
-        cm.splat = desc.splat.slot
-      else
-        cm.splat = nil
-      end
 
-      cm.total_args = desc.required + desc.optional
-      cm.literals = encode_literals(cm)
-      cm.lines = encode_lines()
-      cm.exceptions = encode_exceptions()
-      cm.serial = 0
-      cm.local_names = desc.locals.encoded_order
-      cm.args = desc.args
       return cm
     end
-    
+
     # Helpers
-    
+
     def add(*what)
       @ip += what.size
-      @stream &lt;&lt; what
+      if what.size == 1
+        @stream &lt;&lt; what.first
+      else
+        @stream &lt;&lt; what
+      end
     end
-    
+
     # Find the index for the specified literal, or create a new slot if the
-    # literal has not been encountered previously. 
+    # literal has not been encountered previously.
     def find_literal(what)
+      raise &quot;blah&quot; if what.kind_of? Compiler::Node::Literal
       idx = @literals.index(what)
       return idx if idx
       add_literal(what)
     end
-    
+
     # Add literal exists to allow RegexLiteral's to create a new regex literal
     # object at run-time. All other literals should be added via find_literal,
     # which re-use an existing matching literal if one exists.
     def add_literal(val)
+      raise &quot;blah&quot; if val.kind_of? Compiler::Node::Literal
       idx = @literals.size
       @literals &lt;&lt; val
       return idx
     end
 
     # Commands (these don't generate data in the stream)
-    
+
     def advanced_since?(ip)
       @ip &gt; ip
     end
-    
+
     def push_modifiers
       @modstack &lt;&lt; [@break, @redo, @next, @retry]
     end
-    
+
     def pop_modifiers
       @break, @redo, @next, @retry = @modstack.pop
     end
-    
+
     def set_line(line, file)
       if line != @last_line
         # Update the last entry to complete it
@@ -210,93 +227,93 @@ class Compiler
           @lines.last[1] = @ip - 1
         end
         @last_line = line
-        
+
         @lines &lt;&lt; [@ip, nil, line]
         @file = file
       end
     end
-    
+
     def line
       @last_line
     end
-    
+
     attr_reader :file
 
     def import_position(g)
       set_line g.line, g.file
     end
-    
+
     def close
       if @lines and !@lines.empty? and @lines.last[1].nil?
         @lines.last[1] = @ip
       end
     end
-    
+
     def as_primitive(name)
       @primitive = name
     end
-    
+
     def new_label
       Label.new(self)
     end
-    
+
     class ExceptionBlock
       def initialize(gen)
         @generator = gen
       end
-      
+
       def start!
         @start = @generator.ip
       end
-      
+
       def handle!
         @handler = @generator.ip
         @end = @handler - 1
       end
-      
+
       def range
         [@start, @end]
       end
-      
+
       def as_tuple
         Tuple[@start, @end, @handler]
       end
-      
+
       def &lt;=&gt;(other)
         return 0 if self.equal?(other)
-        
+
         os, oe = other.range
-        
+
         # Make sure that the 2 blocks are valid
         if os == @start and oe == @end
           raise Error, &quot;Invalid exception blocking detected&quot;
         end
-        
+
         if @start &lt; os and @end &gt;= os and @end &lt;= oe
           raise Error, &quot;Overlapping exception ranges&quot;
         end
-        
+
         if os &lt; @start and oe &gt;= @start and oe &lt;= @end
           raise Error, &quot;Overlapping exception ranges&quot;
         end
-        
+
         # Now, they're either disjoined or one is a subrange.
-        
+
         # If self is a sub-region of other, then it's
         # less than other.
         return -1 if @start &gt;= os and @end &lt;= oe
         return  1 if os &gt;= @start and oe &lt;= @end
-        
+
         # Ok, they're disjoined.
-        
-        @start &lt;=&gt; os        
+
+        @start &lt;=&gt; os
       end
-      
+
       def inspect
         &quot;#&lt;#{self.class}:0x#{object_id.to_s(16)} start=#{@start} handler=#{@handler}&gt;&quot;
       end
     end
-    
+
     def exceptions
       ex = ExceptionBlock.new(self)
       ex.start!
@@ -305,7 +322,7 @@ class Compiler
     end
 
     # Operations
-    
+
     def push(what)
       case what
       when :true
@@ -322,7 +339,7 @@ class Compiler
         raise Error, &quot;Unknown push argument '#{what.inspect}'&quot;
       end
     end
-    
+
     def push_symbol(what)
       push_literal what
     end
@@ -340,22 +357,22 @@ class Compiler
       else
         # The max value we use for inline ints. Above this, they're
         # stored in the literals tuple.
-        inline_cutoff = 0x8000000 # 2**27
-        if int.abs &lt; inline_cutoff
+        inline_cutoff = 256
+        if int &gt; 0 and int &lt; inline_cutoff
           add :push_int, int
         else
           push_literal int
         end
       end
     end
-    
+
     # Pushes the specified literal value into the literal's tuple
     def push_literal(what)
       idx = find_literal(what)
       add :push_literal, idx
       return idx
     end
-    
+
     # Puts +what+ is the literals tuple without trying to see if
     # something that is like +what+ is already there.
     def push_unique_literal(what)
@@ -372,27 +389,27 @@ class Compiler
       add :push_literal, idx
       return idx
     end
-    
+
     def set_literal(which)
       add :set_literal, which
     end
-    
+
     def push_ivar(name)
       add :push_ivar, find_literal(name)
     end
-    
+
     def set_ivar(name)
       add :set_ivar, find_literal(name)
     end
-    
+
     def push_const(name)
       add :push_const, find_literal(name)
     end
-    
+
     def find_const(name)
       add :find_const, find_literal(name)
     end
-    
+
     def set_const(name, sub=false)
       if sub
         add :set_const_at, find_literal(name)
@@ -400,87 +417,87 @@ class Compiler
         add :set_const, find_literal(name)
       end
     end
-    
+
     def open_class(name)
       add :open_class, find_literal(name)
     end
-    
+
     def open_class_under(name)
       add :open_class_under, find_literal(name)
     end
-    
+
     def open_module(name)
-      add :open_module, find_literal(name)      
+      add :open_module, find_literal(name)
     end
-    
+
     def open_module_under(name)
-      add :open_module_under, find_literal(name)      
+      add :open_module_under, find_literal(name)
     end
-    
+
     def dup
       add :dup_top
     end
-    
+
     def swap
       add :swap_stack
     end
-    
+
     def gif(lbl)
       add :goto_if_false, lbl
     end
-    
+
     def git(lbl)
       add :goto_if_true, lbl
     end
-    
+
     def goto(lbl)
       add :goto, lbl
     end
-    
+
     def attach_method(name)
       add :attach_method, find_literal(name)
     end
-    
+
     def add_method(name)
       add :add_method, find_literal(name)
     end
-    
+
     def check_argcount(a, b)
       add :check_argcount, a, b
     end
-    
+
     def set_local(a)
       add :set_local, a
     end
-    
+
     def push_local(a)
       add :push_local, a
     end
-    
+
     def set_local_depth(a, b)
       add :set_local_depth, a, b
     end
-    
+
     def push_local_depth(a, b)
       add :push_local_depth, a, b
     end
-    
+
     def allocate_stack(a)
       add :allocate_stack, a
     end
-    
+
     def set_local_fp(a)
       add :set_local_fp, a
     end
-    
+
     def get_local_fp(a)
       add :get_local_fp, a
     end
-    
+
     def make_array(count)
       add :make_array, count
     end
-    
+
     def send(meth, count, priv=false)
       add :set_call_flags, 1 if priv
 
@@ -490,28 +507,28 @@ class Compiler
 
       ss = SendSite.new meth
       idx = add_literal(ss)
-      
+
       if count == 0
         add :send_method, idx
       else
         add :send_stack, idx, count
       end
     end
-    
+
     def send_with_block(meth, count, priv=false)
       add :set_call_flags, 1 if priv
-      
+
       unless count.kind_of? Fixnum
         raise Error, &quot;count must be a number&quot;
       end
-      
+
       ss = SendSite.new meth
       idx = add_literal(ss)
 
       add :send_stack_with_block, idx, count
     end
 
-    def send_with_register(meth, priv=false, concat=false)
+    def send_with_splat(meth, args, priv=false, concat=false)
       if priv or concat
         val = 0
         val |= 1 if priv
@@ -522,17 +539,17 @@ class Compiler
       ss = SendSite.new meth
       idx = add_literal(ss)
 
-      add :send_with_arg_register, idx
+      add :send_stack_with_splat, args, idx
     end
 
-    def send_super(meth, args=nil)
+    def send_super(meth, args, splat=false)
       ss = SendSite.new meth
       idx = add_literal(ss)
 
-      if args
+      if splat
         add :send_super_stack_with_block, idx, args
       else
-        add :send_super_with_arg_register, idx
+        add :send_super_stack_with_splat, idx, args
       end
     end
 
@@ -540,9 +557,12 @@ class Compiler
       idx = find_literal(sym)
       add :check_serial, idx, serial.to_i
     end
-    
+
     def method_missing(*op)
+      if op[0] == :val
+        raise &quot;blah&quot;
+      end
       add *op
-    end    
+    end
   end
 end</diff>
      <filename>lib/compiler/generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@ class Node
         node.args(*args)
       end
     rescue ArgumentError =&gt; e
-      raise ArgumentError, &quot;#{kind} (#{self}) takes #{args.size} argument(s): passed #{args.inspect} (#{e.message})&quot;, e.context
+      raise ArgumentError, &quot;#{kind} (#{self}) takes #{args.size} argument(s): passed #{args.inspect} (#{e.message})&quot;
     end
 
     return node
@@ -29,9 +29,6 @@ class Node
 
   def initialize(compiler)
     @compiler = compiler
-    @in_masgn = false
-    @splat = false
-    @parent = nil
   end
 
   def convert(x)
@@ -76,7 +73,8 @@ class Node
     end
     prefix
 
-    super(prefix)
+    super
+    # super(prefix)
   end
 
   def is?(clas)
@@ -214,14 +212,6 @@ class Node
       return [lcl, depth]
     end
 
-    def find_ivar_index(name)
-      @ivar_as_slot[name]
-    end
-
-    def add_ivar_as_slot(name, slot)
-      @ivar_as_slot[&quot;@#{name}&quot;.to_sym] = slot
-    end
-
     def allocate_stack
       return nil if @use_eval
       # This is correct. the first one is 1, not 0.
@@ -417,6 +407,21 @@ class Node
         nd = RegexLiteral.new(@compiler)
         nd.args(value.source, value.options)
         return nd
+      when ::Range
+        if value.exclude_end?
+          nd = RangeExclude.new(@compiler)
+        else
+          nd = Range.new(@compiler)
+        end
+
+        start = NumberLiteral.new(@compiler)
+        start.args value.begin
+
+        fin = NumberLiteral.new(@compiler)
+        fin.args value.end
+
+        nd.args start, fin
+        return nd
       end
 
       return self
@@ -463,7 +468,11 @@ class Node
     def args(str, *body)
       @string = str
       @body = body
-      @options = body.pop
+      if body.last.kind_of? Fixnum
+        @options = body.pop
+      else
+        @options = 0
+      end
     end
   end
 
@@ -549,7 +558,7 @@ class Node
     kind :scope
 
     def consume(sexp)
-      if sexp.size == 1 or sexp[0].nil?
+      if sexp[0].nil?
         return [nil, nil]
       end
 
@@ -559,6 +568,11 @@ class Node
       end
 
       sexp[0] = convert(sexp[0])
+
+      # Fake the locals
+      if sexp.size == 1
+        sexp &lt;&lt; []
+      end
       return sexp
     end
 
@@ -584,24 +598,53 @@ class Node
         return [[], [], nil, nil]
       end
 
-      # Strip the parser calculated index of splat
-      if sexp[2] and !sexp[2].empty?
-        sexp[2] = sexp[2].first
+      splat = nil
+      defaults = nil
+
+      # Detect Rubinius format
+      if sexp[0].kind_of? Array
+        # Strip the parser calculated index of splat
+        if sexp[2] and !sexp[2].empty?
+          splat = sexp[2].first
+        end
+
+        required = sexp[0]
+        optional = sexp[1]
+        defaults = sexp[3]
+
+      # Current PT format
+      else
+        required = []
+        optional = []
+
+        # detect defaults
+        if sexp.last.kind_of? Array
+          defaults = sexp.pop
+          1.upto(defaults.size - 1) do |idx|
+            optional &lt;&lt; defaults[idx][1]
+          end
+        end
+
+        sexp.each do |var|
+          if var.to_s[0] == ?*
+            splat = var.to_s[1..-1].to_sym
+          else
+            required &lt;&lt; var unless optional.include? var
+          end
+        end
       end
 
       scope = get(:scope)
-      # Allocate the required locals first, so they go in the first set 
+      # Allocate the required locals first, so they go in the first set
       # of slots.
       i = 0
-      sexp[0].each do |var|
+      required.each do |var|
         var, depth = scope.find_local(var)
         var.argument!(i)
         i += 1
         var
       end
 
-      defaults = sexp[3]
-
       if defaults
         defaults.shift
         i = 0
@@ -622,11 +665,9 @@ class Node
 
           convert(node)
         end
-
-        sexp[3] = defaults
       end
 
-      sexp
+      [required, optional, splat, defaults]
     end
 
     def args(req, optional, splat, defaults)
@@ -757,10 +798,19 @@ class Node
     kind :case
 
     def consume(sexp)
-      sexp[1].map! do |w|
-        convert(w)
+      # Detect PT format
+      if sexp[1][0] == :when
+        i = 1
+        whens = []
+        while sexp[i].kind_of? Array and sexp[i].first == :when
+          whens &lt;&lt; convert(sexp[i])
+        end
+      else
+        whens = sexp[1].map do |w|
+          convert(w)
+        end
       end
-      [convert(sexp[0]), sexp[1], convert(sexp[2])]
+      [convert(sexp[0]), whens, convert(sexp.last)]
     end
 
     def args(recv, whens, els)
@@ -833,6 +883,30 @@ class Node
 
   end
 
+  class DasgnCurr &lt; Node
+    kind :dasgn_curr
+
+    def self.create(compiler, sexp)
+      LocalAssignment.create(compiler, [:lasgn, sexp[1], sexp[2]])
+    end
+  end
+
+  class Dasgn &lt; Node
+    kind :dasgn
+
+    def self.create(compiler, sexp)
+      LocalAssignment.create(compiler, [:lasgn, sexp[1], sexp[2]])
+    end
+  end
+
+  class Dvar &lt; Node
+    kind :dvar
+
+    def self.create(compiler, sexp)
+      return LocalAccess.create(compiler, [:lvar, sexp.last])
+    end
+  end
+
   class LocalAssignment &lt; LocalVariable
     kind :lasgn
 
@@ -864,7 +938,7 @@ class Node
   class LocalAccess &lt; LocalVariable
     kind :lvar
 
-    def args(name, idx)
+    def args(name, idx=nil)
       @name = name
       super(name)
     end
@@ -906,15 +980,32 @@ class Node
     kind :op_asgn1
 
     def consume(sexp)
-      # Value to be op-assigned is always first element of value
-      sexp[2].shift # Discard :array token
-      val = convert(sexp[2].shift)
-      # Remaining elements in value are index args excluding final nil marker
-      idx = []
-      while sexp[2].size &gt; 1 do
-        idx &lt;&lt; convert(sexp[2].shift)
+      # Detect PT form
+      if sexp.size == 4
+        idx = convert(sexp[1]).body
+        which = sexp[2]
+        
+        case which
+        when :&quot;||&quot;
+          which = :or
+        when :&quot;&amp;&amp;&quot;
+          which = :and
+        end
+
+        val = convert(sexp[3])
+      else
+        # Value to be op-assigned is always first element of value
+        sexp[2].shift # Discard :array token
+        val = convert(sexp[2].shift)
+        # Remaining elements in value are index args excluding final nil marker
+        idx = []
+        while sexp[2].size &gt; 1 do
+          idx &lt;&lt; convert(sexp[2].shift)
+        end
+        which = sexp[1]
       end
-      [convert(sexp[0]), sexp[1], idx, val]
+      
+      [convert(sexp[0]), which, idx, val]
     end
 
     def args(obj, kind, index, value)
@@ -933,14 +1024,32 @@ class Node
   class OpAssign2 &lt; Node
     kind :op_asgn2
 
-    def args(obj, method, kind, assign, value)
-      @object, @method, @kind, @value = obj, method, kind, value
-      str = assign.to_s
-      if str[-1] == ?=
-        @assign = assign
+    def args(obj, method, kind, assign, value=nil)
+      @object = obj
+
+      # Detect PT form
+      if !value
+        @method = method.to_s[0..-1].to_sym
+        @assign = method
+        @value = assign
+        @kind = kind
+
+        case kind
+        when :&quot;||&quot;
+          @kind = :or
+        when :&quot;&amp;&amp;&quot;
+          @kind = :and
+        end
       else
-        str &lt;&lt; &quot;=&quot;
-        @assign = str.to_sym
+        @object, @method, @kind, @value = obj, method, kind, value
+        str = assign.to_s
+        if str[-1] == ?=
+          @assign = assign
+        else
+          str &lt;&lt; &quot;=&quot;
+          @assign = str.to_sym
+        end
+
       end
     end
 
@@ -1096,13 +1205,6 @@ class Node
     kind :ivar
 
     def normalize(name)
-      fam = get(:family)
-      if fam and idx = fam.find_ivar_index(name)
-        ac = AccessSlot.new @compiler
-        ac.args(idx)
-        return ac
-      end
-
       @name = name
       return self
     end
@@ -1115,13 +1217,6 @@ class Node
     kind :iasgn
 
     def normalize(name, val=nil)
-      fam = get(:family)
-      if fam and idx = fam.find_ivar_index(name)
-        ac = SetSlot.new @compiler
-        ac.args(idx, val)
-        return ac
-      end
-
       @value = val
       @name = name
       return self
@@ -1211,7 +1306,7 @@ class Node
   class ConstSet &lt; Node
     kind :cdecl
 
-    def args(simp, val, complex)
+    def args(simp, val, complex=nil)
       @from_top = false
 
       @value = val
@@ -1262,10 +1357,15 @@ class Node
     end
 
     def consume(sexp)
-      name = convert(sexp[0])
-      sym = name.name
+      if sexp[0].kind_of? Symbol
+        sym = sexp[0]
+        name = nil
+      else
+        name = convert(sexp[0])
+        sym = name.name
+      end
 
-      if name.is? ConstFind
+      if !name or name.is? ConstFind
         parent = nil
       else
         parent = name.parent
@@ -1292,23 +1392,6 @@ class Node
 
     attr_accessor :name, :parent, :superclass, :body
 
-    def find_ivar_index(name)
-      slot = super(name)
-      if slot
-        return slot
-      elsif !@namespace
-        if tbl = Bootstrap::HINTS[@name]
-          return tbl[name]
-        elsif @superclass_name
-          if tbl = Bootstrap::HINTS[@superclass_name]
-            return tbl[name]
-          end
-        end
-      end
-
-      return nil
-    end
-
     def module_body?
       true
     end
@@ -1322,15 +1405,20 @@ class Node
     end
 
     def consume(sexp)
-      name = convert(sexp[0])
-      sym = name.name
-
-      if name.is? ConstFind
+      if sexp[0].kind_of? Symbol
+        name = sexp[0]
         parent = nil
-      elsif name.is? ConstAtTop
-        parent = name
       else
-        parent = name.parent
+        name = convert(sexp[0])
+        sym = name.name
+
+        if name.is? ConstFind
+          parent = nil
+        elsif name.is? ConstAtTop
+          parent = name
+        else
+          parent = name.parent
+        end
       end
 
       body = set(:namespace, sym) do
@@ -1360,15 +1448,15 @@ class Node
   class RescueCondition &lt; Node
     kind :resbody
 
-    def args(cond, body, nxt)
+    def args(cond, body=nil, nxt=nil)
       @body, @next = body, nxt
+      @splat = nil
       if cond.nil?
         cf = ConstFind.new(@compiler)
         cf.args :StandardError
         @conditions = [cf]
       elsif cond.is? ArrayLiteral
         @conditions = cond.body
-        @splat = nil
       elsif cond.is? Splat
         @conditions = nil
         @splat = cond.child
@@ -1515,8 +1603,23 @@ class Node
   class MAsgn &lt; Node
     kind :masgn
 
-    def args(assigns, splat, source=:bogus)
-      if source == :bogus  # Only two args supplied, therefore no assigns
+    attr_accessor :block_args
+
+    def initialize(comp)
+      super(comp)
+      @block_args = false
+    end
+
+    def args(assigns, splat=nil, source=:bogus)
+      if @block_args
+        @assigns = assigns
+        @splat = splat
+        @source = nil
+      elsif splat.nil? and source == :bogus
+        @assigns = assigns
+        @source = nil
+        @splat = nil
+      elsif source == :bogus  # Only two args supplied, therefore no assigns
         @assigns = nil
         @splat = assigns
         @source = splat
@@ -1534,13 +1637,12 @@ class Node
     end
 
     def optional
-      return [] if splat.equal?(true) or splat.nil?
-      splat.required
+      []
     end
 
     def required
       return [] if assigns.nil?
-      assigns.body.map { |i| i.kind_of?(MAsgn) ? i.required : i.name }.flatten
+      @assigns.body.map { |i| i.kind_of?(MAsgn) ? i.required : i.name }.flatten
     end
   end
 
@@ -1761,8 +1863,10 @@ class Node
     kind :attrasgn
 
     def args(obj, meth, args=nil)
+      @in_masgn = false
       @object, @method = obj, meth
       @arguments = args
+      @rhs_expression = nil
 
       # Strange. nil is passed when it's self. Whatevs.
       @object = Self.new @compiler if @object.nil?
@@ -1821,7 +1925,7 @@ class Node
   class Yield &lt; Call
     kind :yield
 
-    def args(args, direct=false)
+    def args(args=nil, direct=false)
       if direct and args.kind_of? ArrayLiteral
         @arguments = args.body
       elsif args.kind_of? DynamicArguments
@@ -1860,6 +1964,19 @@ class Node
   class IterArgs &lt; Node
     kind :iter_args
 
+    def consume(sexp)
+      if sexp[0] and sexp[0][0] == :masgn
+        node = MAsgn.new(@compiler)
+        node.block_args = true
+        ma = sexp[0]
+        ma.shift
+        node.args convert(ma[0])
+        return [node]
+      else
+        return [convert(sexp[0])]
+      end
+    end
+
     def args(child)
       @child = child
     end
@@ -1877,11 +1994,9 @@ class Node
     def arity
       case @child
       when nil
-        return -1
-      when Fixnum
         return 0
       else
-        optional.empty? ? required.size : -(required.size + optional.size)
+        required.size
       end
     end
 
@@ -2072,6 +2187,11 @@ class Node
     kind :alias
 
     def args(current, name)
+      if current.kind_of? Literal
+        current = current.value
+        name = name.value
+      end
+
       @current, @new = current, name
     end
 </diff>
      <filename>lib/compiler/nodes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -391,7 +391,8 @@ module Plugins
         meth.generator.literals[0] = ss[1][1]
         meth.generator.as_primitive :opt_push_my_field
       else
-        case ss[1].first
+        cmd = (ss[1].kind_of?(Array) ? ss[1].first : ss[1])
+        case cmd
         when :push_nil
           lit = nil
         when :push_true</diff>
      <filename>lib/compiler/plugins.rb</filename>
    </modified>
    <modified>
      <diff>@@ -134,7 +134,7 @@ def compile(name, output=nil, check_mtime=false)
       return
     end
   end
-  
+
   inc = &quot;-Iruntime/stable/compiler.rba -rcompiler/init&quot;
   flags = &quot;-frbx-safe-math -frbx-kernel&quot;
 
@@ -142,8 +142,10 @@ def compile(name, output=nil, check_mtime=false)
     sh &quot;rbx compile -f #{flags} #{name} #{output}&quot;, :verbose =&gt; $verbose
   elsif ENV['GDB']
     sh &quot;shotgun/rubinius --gdb #{inc} compile #{flags} #{name} #{output}&quot;, :verbose =&gt; $verbose
-  else
+  elsif ENV['NATIVE']
     sh &quot;shotgun/rubinius #{inc} compile #{flags} #{name} #{output}&quot;, :verbose =&gt; $verbose
+  else
+    ruby &quot;lib/compiler/mri_compile.rb #{flags} #{name} #{output}&quot;
   end
 end
 </diff>
      <filename>rakelib/rubinius.rb</filename>
    </modified>
    <modified>
      <diff>@@ -32,9 +32,7 @@ describe Compiler do
       g.send :a, 0, true
       g.cast_array
       g.push :nil
-      g.push 0
-      g.set_args
-      g.send_with_register :blah, true, false
+      g.send_with_splat :blah, 0, true, false
     end
   end
 
@@ -85,13 +83,13 @@ describe Compiler do
         d.new_label.set! # redo
         d.push 12
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
 
       g.push 10
       g.push 2
       g.push_literal desc
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :times, 1, false
       end
@@ -112,7 +110,7 @@ describe Compiler do
          d.new_label.set! # redo
          d.push 12
          d.pop_modifiers
-         d.soft_return
+         d.ret
        end
        g.push :self
        g.send :a, 0, true
@@ -121,12 +119,10 @@ describe Compiler do
        g.send :c, 0, true
        g.cast_array
        g.push_literal desc
-       g.create_block2
+       g.create_block
 
        g.passed_block do
-         g.push 0
-         g.set_args
-         g.send_with_register :b, false, false
+         g.send_with_splat :b, 0, false, false
        end
     end
   end
@@ -186,9 +182,7 @@ describe Compiler do
       g.cast_array
 
       g.push :nil
-      g.push 2
-      g.set_args
-      g.send_with_register :h, true, false
+      g.send_with_splat :h, 2, true, false
     end
   end
 
@@ -205,9 +199,7 @@ describe Compiler do
       g.push 3
       g.swap
       g.push :nil
-      g.push 1
-      g.set_args
-      g.send_with_register :[]=, false, true
+      g.send_with_splat :[]=, 1, false, true
     end
   end
 
@@ -225,12 +217,10 @@ describe Compiler do
 
     gen x do |g|
       desc = description do |d|
-        d.push_self_or_class
-        d.set_encloser
         d.push :self
         d.push_literal :blah
         d.send :undef_method, 1
-        d.sret
+        d.ret
       end
 
       g.push :nil
@@ -241,7 +231,6 @@ describe Compiler do
       g.attach_method :__class_init__
       g.pop
       g.send :__class_init__, 0
-      g.push_encloser
 
     end
   end
@@ -298,9 +287,7 @@ describe Compiler do
       g.cast_array
 
       g.push :nil
-      g.push 0
-      g.set_args
-      g.send_with_register :call, false, false
+      g.send_with_splat :call, 0, false, false
     end
   end
 
@@ -314,7 +301,7 @@ describe Compiler do
         d.push 2
         d.push :nil
         d.send_super :a, 2
-        d.sret
+        d.ret
       end
 
       g.push :self
@@ -334,10 +321,8 @@ describe Compiler do
         d.send :blah, 0, true
         d.cast_array
         d.push :nil
-        d.push 0
-        d.set_args
-        d.send_super :a
-        d.sret
+        d.send_super_with_splat :a, 0
+        d.ret
       end
 
       g.push :self
@@ -357,7 +342,7 @@ describe Compiler do
         d.push_local 1
         d.push :nil
         d.send_super :a, 2
-        d.sret
+        d.ret
       end
 
       g.push :self
@@ -378,10 +363,8 @@ describe Compiler do
         d.push_local 1
         d.cast_array
         d.push :nil
-        d.push 1
-        d.set_args
-        d.send_super :a
-        d.sret
+        d.send_super_with_splat :a, 1
+        d.ret
       end
 
       g.push :self
@@ -419,14 +402,14 @@ describe Compiler do
         redo_label.set!
         d.push 666
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
       desc.name = :__block__
       desc.required = -1
 
       g.push :self
       g.push_literal desc
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :at_exit, 0, true
       end</diff>
      <filename>spec/compiler/call_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -168,7 +168,7 @@ describe Compiler do
         d.new_label.set!
         d.push :nil
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
       g.push_cpath_top
       g.find_const :Range
@@ -176,7 +176,7 @@ describe Compiler do
       g.push 2
       g.send :new, 2
       g.push_literal iter
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :each, 0, false
       end
@@ -193,10 +193,10 @@ describe Compiler do
     gen(sexp) do |g|
       iter = description do |d|
         d.cast_for_multi_block_arg
-        d.unshift_tuple
+        d.shift_tuple
         d.set_local_depth 0, 0
         d.pop
-        d.unshift_tuple
+        d.shift_tuple
         d.set_local_depth 0, 1
         d.pop
         d.pop
@@ -204,12 +204,12 @@ describe Compiler do
         d.new_label.set!
         d.push 5
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
       g.push :self
       g.send :x, 0, true
       g.push_literal iter
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :each, 0, false
       end
@@ -231,7 +231,7 @@ describe Compiler do
         d.new_label.set!
         d.push :nil
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
       g.push_cpath_top
       g.find_const :Range
@@ -239,7 +239,7 @@ describe Compiler do
       g.push 2
       g.send :new, 2
       g.push_literal iter
-      g.create_block2
+      g.create_block
       g.passed_block(1) do
         g.send_with_block :each, 0, false
       end
@@ -260,7 +260,7 @@ describe Compiler do
         d.new_label.set!
         d.push :nil
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
       g.push_cpath_top
       g.find_const :Range
@@ -268,7 +268,7 @@ describe Compiler do
       g.push 2
       g.send :new, 2
       g.push_literal iter
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :each, 0, false
       end
@@ -285,10 +285,10 @@ describe Compiler do
     gen(sexp) do |g|
       iter = description do |d|
         d.cast_for_multi_block_arg
-        d.unshift_tuple
+        d.shift_tuple
         d.set_local 0
         d.pop
-        d.unshift_tuple
+        d.shift_tuple
         d.set_local 1
         d.pop
         d.pop
@@ -296,12 +296,12 @@ describe Compiler do
         d.new_label.set!
         d.push 5
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
       g.push :self
       g.send :x, 0, true
       g.push_literal iter
-      g.create_block2
+      g.create_block
       g.passed_block(2) do
         g.send_with_block :each, 0, false
       end
@@ -317,10 +317,10 @@ describe Compiler do
     gen(sexp) do |g|
       iter = description do |d|
         d.cast_for_multi_block_arg
-        d.unshift_tuple
+        d.shift_tuple
         d.set_local 0
         d.pop
-        d.unshift_tuple
+        d.shift_tuple
         d.set_local 1
         d.pop
         d.pop
@@ -329,12 +329,12 @@ describe Compiler do
         d.push 5
         d.set_local_depth 0,0
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
       g.push :self
       g.send :x, 0, true
       g.push_literal iter
-      g.create_block2
+      g.create_block
       g.passed_block(2) do
         g.send_with_block :each, 0, false
       end
@@ -420,12 +420,12 @@ describe Compiler do
         d.raise_exc
 
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
 
       g.push :self
       g.push_literal iter
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :go, 0, true
       end
@@ -480,12 +480,12 @@ describe Compiler do
         d.pop
         d.goto d.redo
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
 
       g.push :self
       g.push_literal iter
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :go, 0, true
       end
@@ -879,14 +879,14 @@ describe Compiler do
   it &quot;compiles 'return'&quot; do
     gen [:return] do |g|
       g.push :nil
-      g.sret
+      g.ret
     end
   end
 
   it &quot;compiles 'return 12'&quot; do
     gen [:return, [:fixnum, 12]] do |g|
       g.push 12
-      g.sret
+      g.ret
     end
   end
 
@@ -923,7 +923,7 @@ describe Compiler do
       body.set!
       g.clear_exception
       g.push 13
-      g.sret
+      g.ret
       g.clear_exception
 
       g.goto last
@@ -955,12 +955,12 @@ describe Compiler do
         d.push_local 0
         d.raise_exc
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
 
       g.push :self
       g.push_literal iter
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :go, 0, true
       end
@@ -981,7 +981,7 @@ describe Compiler do
       g.cast_array
 
       g.send :+, 1
-      g.sret
+      g.ret
     end
   end
 end</diff>
      <filename>spec/compiler/control_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -422,7 +422,7 @@ describe Compiler do
       body.set!
       g.clear_exception
       g.push :nil
-      g.sret
+      g.ret
       g.clear_exception
       g.goto last
 
@@ -489,7 +489,7 @@ describe Compiler do
       g.pop
 
       g.push 2
-      g.sret
+      g.ret
 
     end
   end
@@ -539,7 +539,7 @@ describe Compiler do
       g.pop
 
       g.push 2
-      g.sret
+      g.ret
 
     end
   end
@@ -588,7 +588,7 @@ describe Compiler do
           g.pop
 
           g.push 3
-          g.sret
+          g.ret
         end
 
       end
@@ -616,11 +616,11 @@ describe Compiler do
       g.pop
 
       g.push 3
-      g.sret
+      g.ret
       g.pop
 
       g.push 2
-      g.sret
+      g.ret
     end
   end
 =end</diff>
      <filename>spec/compiler/exception_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -126,15 +126,15 @@ describe Compiler do
       g.send :d, 0, true
       g.cast_tuple
 
-      g.unshift_tuple
+      g.shift_tuple
       g.set_local 0
       g.pop
 
-      g.unshift_tuple
+      g.shift_tuple
       g.set_local 1
       g.pop
 
-      g.unshift_tuple
+      g.shift_tuple
       g.set_local 2
       g.pop
 
@@ -158,15 +158,15 @@ describe Compiler do
       g.send :+, 1
       g.cast_tuple
 
-      g.unshift_tuple
+      g.shift_tuple
       g.set_local 0
       g.pop
 
-      g.unshift_tuple
+      g.shift_tuple
       g.set_local 1
       g.pop
 
-      g.unshift_tuple
+      g.shift_tuple
       g.set_local 2
       g.pop
 
@@ -187,11 +187,11 @@ describe Compiler do
       g.send :d, 0, true
       g.cast_tuple
 
-      g.unshift_tuple
+      g.shift_tuple
       g.set_local 0
       g.pop
 
-      g.unshift_tuple
+      g.shift_tuple
       g.set_local 1
       g.pop
 
@@ -222,7 +222,7 @@ describe Compiler do
     gen x do |g|
       desc = description do |d|
         d.cast_for_multi_block_arg
-        d.unshift_tuple
+        d.shift_tuple
         d.set_local_depth 0,0
         d.pop
         d.pop
@@ -230,13 +230,13 @@ describe Compiler do
         d.new_label.set!
         d.push :nil
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
 
       g.push :self
       g.send :x, 0, true
       g.push_literal desc
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :each, 0, false
       end
@@ -253,10 +253,10 @@ describe Compiler do
     gen(x) do |g|
       desc = description do |d|
         d.cast_for_multi_block_arg
-        d.unshift_tuple
+        d.shift_tuple
         d.set_local_depth 0,0
         d.pop
-        d.unshift_tuple
+        d.shift_tuple
         d.set_local_depth 0,1
 
         d.pop
@@ -265,13 +265,13 @@ describe Compiler do
         d.new_label.set!
         d.push :nil
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
 
       g.push :self
       g.send :x, 0, true
       g.push_literal desc
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :each, 0, false
       end
@@ -281,7 +281,7 @@ describe Compiler do
   it &quot;compiles '|*args|'&quot; do
     x = [:iter,
          [:call, [:vcall, :x], :each],
-         [:masgn, [:lasgn, :args], nil]]
+         [:masgn, nil, [:lasgn, :args], nil]]
 
     gen x do |g|
       desc = description do |d|
@@ -292,13 +292,13 @@ describe Compiler do
         d.new_label.set!
         d.push :nil
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
 
       g.push :self
       g.send :x, 0, true
       g.push_literal desc
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :each, 0, false
       end
@@ -314,7 +314,7 @@ describe Compiler do
     gen x do |g|
       desc = description do |d|
         d.cast_for_multi_block_arg
-        d.unshift_tuple
+        d.shift_tuple
         d.set_local_depth 0,0
         d.pop
         d.cast_array
@@ -324,13 +324,13 @@ describe Compiler do
         d.new_label.set!
         d.push :nil
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
 
       g.push :self
       g.send :x, 0, true
       g.push_literal desc
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :each, 0, false
       end</diff>
      <filename>spec/compiler/masgn_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ describe Compiler do
     gen x do |g|
       meth = description do |d|
         d.push 12
-        d.sret
+        d.ret
       end
 
       g.push :self
@@ -34,7 +34,7 @@ describe Compiler do
         d.push_local 0
         d.push_local 1
         d.meta_send_op_plus
-        d.sret
+        d.ret
       end
 
       g.push :self
@@ -69,7 +69,7 @@ describe Compiler do
         d.push_local 0
         d.push_local 1
         d.meta_send_op_plus
-        d.sret
+        d.ret
       end
 
       g.push :self
@@ -109,15 +109,15 @@ describe Compiler do
           i.push_local_depth 0, 0
           i.meta_send_op_plus
           i.pop_modifiers
-          i.soft_return
+          i.ret
         end
 
         d.push_literal iter
-        d.create_block2
+        d.create_block
         d.passed_block(1) do
           d.send_with_block :each, 0, false
         end
-        d.sret
+        d.ret
       end
 
       g.push :self
@@ -140,7 +140,7 @@ describe Compiler do
     gen x do |g|
       meth = description do |d|
         d.push_local 0
-        d.sret
+        d.ret
       end
 
       g.push :self
@@ -176,7 +176,7 @@ describe Compiler do
         d.set_local 0
         d.pop
         d.push_local 0
-        d.sret
+        d.ret
       end
 
       g.push :self
@@ -193,7 +193,7 @@ describe Compiler do
     gen x do |g|
       meth = description do |d|
         d.push 12
-        d.sret
+        d.ret
       end
 
       g.push :self
@@ -218,7 +218,7 @@ describe Compiler do
       lam = description do |l|
         meth = description do |m|
           m.push_local 0
-          m.sret
+          m.ret
         end
 
         l.pop
@@ -229,12 +229,12 @@ describe Compiler do
         l.push_literal meth
         l.send :__add_method__, 2
         l.pop_modifiers
-        l.soft_return
+        l.ret
       end
 
       g.push :self
       g.push_literal lam
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :lambda, 0, true
       end
@@ -246,10 +246,8 @@ describe Compiler do
 
     gen x do |g|
       meth = description do |d|
-        d.push_self_or_class
-        d.set_encloser
         d.push 12
-        d.sret
+        d.ret
       end
 
       g.push :self
@@ -264,7 +262,6 @@ describe Compiler do
       g.attach_method :__metaclass_init__
       g.pop
       g.send :__metaclass_init__, 0
-      g.push_encloser
     end
   end
 
@@ -273,10 +270,8 @@ describe Compiler do
 
     gen x do |g|
       desc = description do |d|
-        d.push_self_or_class
-        d.set_encloser
         d.push 12
-        d.sret
+        d.ret
       end
 
       g.push :nil
@@ -287,7 +282,6 @@ describe Compiler do
       g.attach_method :__class_init__
       g.pop
       g.send :__class_init__, 0
-      g.push_encloser
     end
   end
 
@@ -296,10 +290,8 @@ describe Compiler do
 
     gen x do |g|
       desc = description do |d|
-        d.push_self_or_class
-        d.set_encloser
         d.push 12
-        d.sret
+        d.ret
       end
 
       g.push_const :B
@@ -311,7 +303,6 @@ describe Compiler do
       g.attach_method :__class_init__
       g.pop
       g.send :__class_init__, 0
-      g.push_encloser
     end
   end
 
@@ -320,10 +311,8 @@ describe Compiler do
 
     gen x do |g|
       desc = description do |d|
-        d.push_self_or_class
-        d.set_encloser
         d.push 12
-        d.sret
+        d.ret
       end
 
       g.push_const :B
@@ -334,7 +323,6 @@ describe Compiler do
       g.attach_method :__class_init__
       g.pop
       g.send :__class_init__, 0
-      g.push_encloser
     end
   end
 
@@ -344,11 +332,9 @@ describe Compiler do
 
     gen x do |g|
       desc = description do |d|
-        d.push_self_or_class
-        d.set_encloser
         d.push 1
         d.set_local 0
-        d.sret
+        d.ret
       end
 
       g.push :nil
@@ -359,7 +345,6 @@ describe Compiler do
       g.attach_method :__class_init__
       g.pop
       g.send :__class_init__, 0
-      g.push_encloser
 
     end
   end
@@ -369,10 +354,8 @@ describe Compiler do
 
     gen x do |g|
       desc = description do |d|
-        d.push_self_or_class
-        d.set_encloser
         d.push 12
-        d.sret
+        d.ret
       end
 
       g.open_module :A
@@ -382,7 +365,6 @@ describe Compiler do
       g.attach_method :__module_init__
       g.pop
       g.send :__module_init__, 0
-      g.push_encloser
     end
   end
 
@@ -391,10 +373,8 @@ describe Compiler do
 
     gen x do |g|
       desc = description do |d|
-        d.push_self_or_class
-        d.set_encloser
         d.push 12
-        d.sret
+        d.ret
       end
 
       g.push_const :B
@@ -405,7 +385,6 @@ describe Compiler do
       g.attach_method :__module_init__
       g.pop
       g.send :__module_init__, 0
-      g.push_encloser
     end
   end
 end</diff>
      <filename>spec/compiler/scopes_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,10 @@
+require 'stringio'
+
 require File.dirname(__FILE__) + '/../spec_helper'
 
+$:.unshift(File.dirname(__FILE__) + &quot;/../../lib&quot;)
+
+require File.dirname(__FILE__) + '/../../lib/compiler/system_hints'
 require File.dirname(__FILE__) + '/../../lib/compiler/compiler'
 require File.dirname(__FILE__) + '/../../lib/compiler/nodes'
 require File.dirname(__FILE__) + '/../../lib/compiler/generator'
@@ -7,15 +12,35 @@ require File.dirname(__FILE__) + '/../../lib/compiler/bytecode'
 require File.dirname(__FILE__) + '/../../lib/compiler/plugins'
 require File.dirname(__FILE__) + '/../../lib/compiler/local'
 require File.dirname(__FILE__) + '/../../lib/compiler/text'
+require File.dirname(__FILE__) + '/../../lib/compiler/marshal'
+require File.dirname(__FILE__) + '/../../lib/compiler/compiled_file'
+
+class SendSite
+  def initialize(name)
+    @name = name
+  end
+
+  attr_reader :name
+end
+
+class Tuple &lt; Array
+end
+
+class LookupTable &lt; Hash
+end
+
+require File.dirname(__FILE__) + '/../../kernel/core/iseq.rb'
+require File.dirname(__FILE__) + '/../../kernel/core/compiled_method.rb'
+require File.dirname(__FILE__) + '/../../vm/gen/simple_field.rb'
 
 class TestGenerator
   def initialize
     @stream = []
     @ip = 0
   end
-  
+
   attr_reader :stream, :ip
-  
+
   def run(node)
     node.bytecode(self)
   end
@@ -65,11 +90,12 @@ class TestGenerator
   end
 
   opcodes = InstructionSet::OpCodes.map { |desc| desc.opcode }
-  stupids = [:add_literal, :gif, :git, :pop_modifiers, :push,
+  others  = [:add_literal, :gif, :git, :pop_modifiers, :push,
              :push_literal_at, :push_modifiers, :push_unique_literal, :send,
-             :send_super, :send_with_block, :send_with_register, :swap,]
+             :send_super, :send_with_block, :send_with_splat, :swap,
+             :send_super_with_splat]
 
-  (opcodes + stupids - [:class]).each do |name|
+  (opcodes + others - [:class]).each do |name|
     class_eval &lt;&lt;-CODE
       def #{name}(*args)
         add :#{name}, *args
@@ -162,7 +188,7 @@ class TestGenerator
     
       unless in_block
         g.send :value, 0
-        g.sret
+        g.ret
       end
 
       after.set!
@@ -183,16 +209,6 @@ class TestGenerator
     self.send :__add_method__, 2
   end
 
-  def push_self_or_class
-    lbl = self.new_label
-    self.push :self
-    self.push_cpath_top
-    self.find_const :Module
-    self.send :kind_of?, 1
-    self.git lbl
-    self.send :class, 0
-    lbl.set!
-  end
 end
 
 def gen(sexp, plugins=[])
@@ -217,11 +233,11 @@ def gen_iter x
       d.new_label.set!
       d.push :nil
       d.pop_modifiers
-      d.soft_return
+      d.ret
     end
 
     g.push_literal desc
-    g.create_block2
+    g.create_block
     g.push :self
     g.send :ary, 0, true
 </diff>
      <filename>spec/compiler/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -35,7 +35,7 @@ describe Compiler do
     gen x do |g|
       meth = description do |d|
         d.push_local 0
-        d.sret
+        d.ret
       end
 
       g.push :self
@@ -57,7 +57,7 @@ describe Compiler do
         d.new_label.set! # redo
         d.push_local 0
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
 
       g.push 12
@@ -65,7 +65,7 @@ describe Compiler do
       g.pop
       g.push :self
       g.push_literal iter
-      g.create_block2
+      g.create_block
       g.passed_block(1) do
         g.send_with_block :go, 0, true
       end
@@ -87,12 +87,12 @@ describe Compiler do
         d.pop
         d.push_local_depth 0, 0
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
 
       g.push :self
       g.push_literal iter
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :go, 0, true
       end
@@ -121,22 +121,22 @@ describe Compiler do
           j.new_label.set! # redo
           j.push_local_depth 1, 0
           j.pop_modifiers
-          j.soft_return
+          j.ret
         end
 
         d.push :self
         d.push_literal i2
-        d.create_block2
+        d.create_block
         d.passed_block(0, true) do
           d.send_with_block :go, 0, true
         end
         d.pop_modifiers
-        d.soft_return
+        d.ret
       end
 
       g.push :self
       g.push_literal iter
-      g.create_block2
+      g.create_block
       g.passed_block do
         g.send_with_block :go, 0, true
       end
@@ -157,27 +157,6 @@ describe Compiler do
     end
   end
 
-  it &quot;compiles '@blah' when blah is a slot&quot; do
-    x = [:block,
-      [:fcall, :ivar_as_index, [:array, [:ihash, [:lit, :blah], [:fixnum, 12]]]],
-      [:ivar, :@blah]]
-
-    gen x do |g|
-      g.push_my_field 12
-    end
-  end
-
-  it &quot;compiles '@blah = 1' when blah is a slot&quot; do
-    x = [:block,
-      [:fcall, :ivar_as_index, [:array, [:ihash, [:lit, :blah], [:fixnum, 12]]]],
-      [:iasgn, :@blah, [:fixnum, 9]]]
-
-    gen x do |g|
-      g.push 9
-      g.store_my_field 12
-    end
-  end
-
   it &quot;compiles '$var'&quot; do
     gen [:gvar, :$var] do |g|
       g.push_cpath_top</diff>
      <filename>spec/compiler/variables_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>52c078bd38c5a9f7246cc504043fdcfcad48d97c</id>
    </parent>
  </parents>
  <author>
    <name>Evan Phoenix</name>
    <email>ephoenix@engineyard.com</email>
  </author>
  <url>http://github.com/evanphx/rubinius/commit/611cd7440cacf3fa3c730f5093dc66e3f8e33d2e</url>
  <id>611cd7440cacf3fa3c730f5093dc66e3f8e33d2e</id>
  <committed-date>2008-05-07T17:49:20-07:00</committed-date>
  <authored-date>2008-05-07T17:47:49-07:00</authored-date>
  <message>Work up MRI bootstrap using new format

Includes:
* Instruction changes for new VM
* Marshal class for new marshal format
* Compiler changes for new VM
* Compiler changes to support ParseTree format
* shims to run compiler on MRI
* Specs</message>
  <tree>2caf768a6b40f8527f77fb2c5af59ee32a19a7af</tree>
  <committer>
    <name>Evan Phoenix</name>
    <email>ephoenix@engineyard.com</email>
  </committer>
</commit>
