 
   cl: (idx) -> @curr_frame().locals[idx]
   put_cl: (idx,val) -> @curr_frame().locals[idx] = val
-  # useful for category 2 values (longs, doubles)
+  # Category 2 values (longs, doubles) take two slots in Java. Since we only
+  # need one slot to represent a double in JS, we pad it with a null.
   put_cl2: (idx,val) -> @put_cl(idx,val); @put_cl(idx+1,null)
 
   push: (args...) ->
     cs = @curr_frame().stack
     Array::push.apply cs, args
-
   pop: () -> @curr_frame().stack.pop()
-  # useful for category 2 values (longs, doubles)
-  pop2: () -> @pop(); @pop()
-
-  # program counter manipulation
+  pop2: () -> @pop(); @pop() # For category 2 values.
+
+  # Program counter manipulation.
   curr_pc: ()   -> @curr_frame().pc
   goto_pc: (pc) -> @curr_frame().pc = pc
   inc_pc:  (n)  -> @curr_frame().pc += n
 
-  # heap manipulation
+  # Heap manipulation.
   get_obj: (oref) ->
     java_throw @, 'java/lang/NullPointerException', '' unless @heap[oref]?
     @heap[oref]


# things assigned to root will be available outside this module
root = exports ? this.runtime = {}
util ?= require './util'
types ?= require './types'

        @classes[cls] =
          file: class_file
          obj:  @set_obj(c2t('java/lang/Class'), { $type: type, name: 0 })
        # Run class initialization code. Superclasses get init'ed first.  We
        # don't want to call this more than once per class, so don't do dynamic
        # lookup. See spec [2.17.4][1].
        # [1]: http://docs.oracle.com/javase/specs/jvms/se5.0/html/Concepts.doc.html#19075
        if class_file.super_class
          @_class_lookup class_file.super_class
        class_file.methods['<clinit>()V']?.run(this)
        if cls is 'java/lang/System'  # zomg hardcode
          @method_lookup(class: cls, sig: 'initializeSystemClass()V').run(this)
    c = @classes[cls]
  # Spec [5.4.3.3][1], [5.4.3.4][2].
  # [1]: http://docs.oracle.com/javase/specs/jvms/se5.0/html/ConstantPool.doc.html#79473
  # [2]: http://docs.oracle.com/javase/specs/jvms/se5.0/html/ConstantPool.doc.html#78621
  method_lookup: (method_spec) ->
    type = c2t method_spec.class
    t = type
