     n_bytes = @param_bytes()
     caller_stack.splice(caller_stack.length-n_bytes,n_bytes)
   
-  run_manually: (runtime_state, func) ->
+  run_manually: (runtime_state, func, padding='') ->
     func(runtime_state)
     s = runtime_state.meta_stack.pop().stack
     switch s.length

      when 0 then break
      else
        throw "too many items on the stack after manual method #{sig}"
    #cf = runtime_state.curr_frame()
    #console.log "#{padding}stack: [#{cf.stack}], local: [#{cf.locals}] (method end)"

  run: (runtime_state,virtual=false) ->
    caller_stack = runtime_state.curr_frame().stack

trapped_methods = {
  'java/lang/System::setJavaLangAccess()V': (rs) -> #NOP
  'java/lang/System::loadLibrary(Ljava/lang/String;)V': (rs) -> console.log "warning: library loads are NYI"
  'java/lang/ThreadLocal::<clinit>()V': (rs) -> #NOP
  'java/lang/ThreadLocal::<init>()V': (rs) -> #NOP
  'java/util/concurrent/atomic/AtomicInteger::<clinit>()V': (rs) -> #NOP
  'java/util/concurrent/atomic/AtomicInteger::compareAndSet(II)Z': (rs) -> rs.push 1  # always true
  'sun/misc/Unsafe::getUnsafe()Lsun/misc/Unsafe;': ((rs) -> # avoid reflection
    rs.static_get({'class':'sun/misc/Unsafe','sig':{'name':'theUnsafe'}}))
  'java/util/concurrent/atomic/AtomicReferenceFieldUpdater::newUpdater(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;': (rs) -> rs.push 0 # null
}
  
native_methods = {
  'java/lang/System::arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V': ((rs) -> 
    args = rs.curr_frame().locals
