uncommon trap for athrow

Tom Rodriguez Thomas.Rodriguez at Sun.COM
Wed Sep 9 16:27:33 PDT 2009


We got in a report, 6877221, complaining about the use of the uncommon  
trap below for handling of an athrow.  Anyone understand why we use an  
uncommon trap here to dispatch an exception?

   if (can_rerun_bytecode()) {
     // Do not push_ex_oop here!
     // Re-executing the bytecode will reproduce the throwing condition.
     bool must_throw = true;
     uncommon_trap(Deoptimization::Reason_unhandled,
                   Deoptimization::Action_none,
                   (ciKlass*)NULL, (const char*)NULL, // default args
                   must_throw);
     return;
   }

   // Oops, need to call into the VM to resolve the klasses at runtime.
   // Note:  This call must not deoptimize, since it is not a real at  
this bci!
   kill_dead_locals();

   make_runtime_call(RC_NO_LEAF | RC_MUST_THROW,
                     OptoRuntime::rethrow_Type(),
                     OptoRuntime::rethrow_stub(),
                     NULL, NULL,
                     ex_node);

We should just jump into rethrow since that's where we'll end up  
anyway right?  All the work of an uncommon trap is useless for the  
dispatch and also drops the code back into the interpreter.

tom


More information about the hotspot-compiler-dev mailing list