 
 "use strict"
 
-run_profiled = (rs, cname, java_cmd_args, hot=false) ->
+run_profiled = (runner, rs, cname, hot=false) ->
   if hot
-    jvm.run_class rs, cname, java_cmd_args
+    runner()
   timings = {}
   call_counts = {}
   profiled_fn = (old_fn) -> ->

    unless cname?
      console.error "No main class provided and no Main-Class found in #{argv.jar}"

  if argv.profile?
    run_profiled rs, cname, java_cmd_args, argv.hot
  else
    jvm.run_class rs, cname, java_cmd_args, null, argv.compile

  methods.Method::run_bytecode = profiled_fn(methods.Method::run_bytecode)
  methods.Method::run_manually = profiled_fn(methods.Method::run_manually)

  runner()

  self_timings = {}
  total_timings = {}
