src/share/vm/interpreter/bytecodeInterpreter.cpp

Print this page
rev 4869 : 8019519: PPC64 (part 105): C interpreter: implement support for jvmti early return.


  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 // no precompiled headers
  26 #include "classfile/vmSymbols.hpp"
  27 #include "gc_interface/collectedHeap.hpp"
  28 #include "interpreter/bytecodeHistogram.hpp"
  29 #include "interpreter/bytecodeInterpreter.hpp"
  30 #include "interpreter/bytecodeInterpreter.inline.hpp"
  31 #include "interpreter/interpreter.hpp"
  32 #include "interpreter/interpreterRuntime.hpp"
  33 #include "memory/cardTableModRefBS.hpp"
  34 #include "memory/resourceArea.hpp"
  35 #include "oops/methodCounters.hpp"
  36 #include "oops/objArrayKlass.hpp"
  37 #include "oops/oop.inline.hpp"
  38 #include "prims/jvmtiExport.hpp"

  39 #include "runtime/biasedLocking.hpp"
  40 #include "runtime/frame.inline.hpp"
  41 #include "runtime/handles.inline.hpp"
  42 #include "runtime/interfaceSupport.hpp"
  43 #include "runtime/sharedRuntime.hpp"
  44 #include "runtime/threadCritical.hpp"
  45 #include "utilities/exceptions.hpp"
  46 #ifdef TARGET_OS_ARCH_linux_x86
  47 # include "orderAccess_linux_x86.inline.hpp"
  48 #endif
  49 #ifdef TARGET_OS_ARCH_linux_sparc
  50 # include "orderAccess_linux_sparc.inline.hpp"
  51 #endif
  52 #ifdef TARGET_OS_ARCH_linux_zero
  53 # include "orderAccess_linux_zero.inline.hpp"
  54 #endif
  55 #ifdef TARGET_OS_ARCH_solaris_x86
  56 # include "orderAccess_solaris_x86.inline.hpp"
  57 #endif
  58 #ifdef TARGET_OS_ARCH_solaris_sparc


 181    As a result if we call at_single_stepping_point() we refetch opcode
 182    to get the current opcode. This will override any other prefetching
 183    that might have occurred.
 184 */
 185 #define DEBUGGER_SINGLE_STEP_NOTIFY()                                            \
 186 {                                                                                \
 187       if (_jvmti_interp_events) {                                                \
 188         if (JvmtiExport::should_post_single_step()) {                            \
 189           DECACHE_STATE();                                                       \
 190           SET_LAST_JAVA_FRAME();                                                 \
 191           ThreadInVMfromJava trans(THREAD);                                      \
 192           JvmtiExport::at_single_stepping_point(THREAD,                          \
 193                                           istate->method(),                      \
 194                                           pc);                                   \
 195           RESET_LAST_JAVA_FRAME();                                               \
 196           CACHE_STATE();                                                         \
 197           if (THREAD->pop_frame_pending() &&                                     \
 198               !THREAD->pop_frame_in_process()) {                                 \
 199             goto handle_Pop_Frame;                                               \
 200           }                                                                      \




 201           opcode = *pc;                                                          \
 202         }                                                                        \
 203       }                                                                          \
 204 }
 205 #else
 206 #define DEBUGGER_SINGLE_STEP_NOTIFY()
 207 #endif
 208 
 209 /*
 210  * CONTINUE - Macro for executing the next opcode.
 211  */
 212 #undef CONTINUE
 213 #ifdef USELABELS
 214 // Have to do this dispatch this way in C++ because otherwise gcc complains about crossing an
 215 // initialization (which is is the initialization of the table pointer...)
 216 #define DISPATCH(opcode) goto *(void*)dispatch_table[opcode]
 217 #define CONTINUE {                              \
 218         opcode = *pc;                           \
 219         DO_UPDATE_INSTRUCTION_COUNT(opcode);    \
 220         DEBUGGER_SINGLE_STEP_NOTIFY();          \


 404 // Decache the interpreter state that interpreter modifies directly (i.e. GC is indirect mod)
 405 #define DECACHE_STATE() DECACHE_PC(); DECACHE_TOS();
 406 
 407 // Reload interpreter state after calling the VM or a possible GC
 408 #define CACHE_STATE()   \
 409         CACHE_TOS();    \
 410         CACHE_PC();     \
 411         CACHE_CP();     \
 412         CACHE_LOCALS();
 413 
 414 // Call the VM don't check for pending exceptions
 415 #define CALL_VM_NOCHECK(func)                                     \
 416           DECACHE_STATE();                                        \
 417           SET_LAST_JAVA_FRAME();                                  \
 418           func;                                                   \
 419           RESET_LAST_JAVA_FRAME();                                \
 420           CACHE_STATE();                                          \
 421           if (THREAD->pop_frame_pending() &&                      \
 422               !THREAD->pop_frame_in_process()) {                  \
 423             goto handle_Pop_Frame;                                \




 424           }
 425 
 426 // Call the VM and check for pending exceptions
 427 #define CALL_VM(func, label) {                                    \
 428           CALL_VM_NOCHECK(func);                                  \
 429           if (THREAD->has_pending_exception()) goto label;        \
 430         }
 431 
 432 /*
 433  * BytecodeInterpreter::run(interpreterState istate)
 434  * BytecodeInterpreter::runWithChecks(interpreterState istate)
 435  *
 436  * The real deal. This is where byte codes actually get interpreted.
 437  * Basically it's a big while loop that iterates until we return from
 438  * the method passed in.
 439  *
 440  * The runWithChecks is used if JVMTI is enabled.
 441  *
 442  */
 443 #if defined(VM_JVMTI)


 803       if ((istate->_stack_base - istate->_stack_limit) != istate->method()->max_stack() + 1) {
 804         // resume
 805         os::breakpoint();
 806       }
 807 #ifdef HACK
 808       {
 809         ResourceMark rm;
 810         char *method_name = istate->method()->name_and_sig_as_C_string();
 811         if (strstr(method_name, "runThese$TestRunner.run()V") != NULL) {
 812           tty->print_cr("resume: depth %d bci: %d",
 813                          (istate->_stack_base - istate->_stack) ,
 814                          istate->_bcp - istate->_method->code_base());
 815           interesting = true;
 816         }
 817       }
 818 #endif // HACK
 819       // returned from a java call, continue executing.
 820       if (THREAD->pop_frame_pending() && !THREAD->pop_frame_in_process()) {
 821         goto handle_Pop_Frame;
 822       }




 823 
 824       if (THREAD->has_pending_exception()) goto handle_exception;
 825       // Update the pc by the saved amount of the invoke bytecode size
 826       UPDATE_PC(istate->bcp_advance());
 827       goto run;
 828     }
 829 
 830     case deopt_resume2: {
 831       // Returned from an opcode that will reexecute. Deopt was
 832       // a result of a PopFrame request.
 833       //
 834       goto run;
 835     }
 836 
 837     case deopt_resume: {
 838       // Returned from an opcode that has completed. The stack has
 839       // the result all we need to do is skip across the bytecode
 840       // and continue (assuming there is no exception pending)
 841       //
 842       // compute continuation length


2706       // for AbortVMOnException flag
2707       NOT_PRODUCT(Exceptions::debug_check_abort(except_oop));
2708       goto run;
2709     }
2710     if (TraceExceptions) {
2711       ttyLocker ttyl;
2712       ResourceMark rm;
2713       tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), except_oop());
2714       tty->print_cr(" thrown in interpreter method <%s>", METHOD->print_value_string());
2715       tty->print_cr(" at bci %d, unwinding for thread " INTPTR_FORMAT,
2716                     pc  - (intptr_t) METHOD->code_base(),
2717                     THREAD);
2718     }
2719     // for AbortVMOnException flag
2720     NOT_PRODUCT(Exceptions::debug_check_abort(except_oop));
2721     // No handler in this activation, unwind and try again
2722     THREAD->set_pending_exception(except_oop(), NULL, 0);
2723     goto handle_return;
2724   }  /* handle_exception: */
2725 
2726 
2727 
2728   // Return from an interpreter invocation with the result of the interpretation
2729   // on the top of the Java Stack (or a pending exception)
2730 
2731 handle_Pop_Frame:
2732 
2733   // We don't really do anything special here except we must be aware
2734   // that we can get here without ever locking the method (if sync).
2735   // Also we skip the notification of the exit.
2736 
2737   istate->set_msg(popping_frame);
2738   // Clear pending so while the pop is in process
2739   // we don't start another one if a call_vm is done.
2740   THREAD->clr_pop_frame_pending();
2741   // Let interpreter (only) see the we're in the process of popping a frame
2742   THREAD->set_pop_frame_in_process();
2743 














































2744 handle_return:
2745   {
2746     DECACHE_STATE();
2747 
2748     bool suppress_error = istate->msg() == popping_frame;
2749     bool suppress_exit_event = THREAD->has_pending_exception() || suppress_error;
2750     Handle original_exception(THREAD, THREAD->pending_exception());
2751     Handle illegal_state_oop(THREAD, NULL);
2752 
2753     // We'd like a HandleMark here to prevent any subsequent HandleMarkCleaner
2754     // in any following VM entries from freeing our live handles, but illegal_state_oop
2755     // isn't really allocated yet and so doesn't become live until later and
2756     // in unpredicatable places. Instead we must protect the places where we enter the
2757     // VM. It would be much simpler (and safer) if we could allocate a real handle with
2758     // a NULL oop in it and then overwrite the oop later as needed. This isn't
2759     // unfortunately isn't possible.
2760 
2761     THREAD->clear_pending_exception();
2762 
2763     //
2764     // As far as we are concerned we have returned. If we have a pending exception
2765     // that will be returned as this invocation's result. However if we get any
2766     // exception(s) while checking monitor state one of those IllegalMonitorStateExceptions
2767     // will be our final result (i.e. monitor exception trumps a pending exception).
2768     //
2769 


2942             HandleMark __hm(THREAD);
2943             CALL_VM_NOCHECK(InterpreterRuntime::post_method_exit(THREAD));
2944           }
2945         }
2946       }
2947 #endif /* VM_JVMTI */
2948 
2949     //
2950     // See if we are returning any exception
2951     // A pending exception that was pending prior to a possible popping frame
2952     // overrides the popping frame.
2953     //
2954     assert(!suppress_error || suppress_error && illegal_state_oop() == NULL, "Error was not suppressed");
2955     if (illegal_state_oop() != NULL || original_exception() != NULL) {
2956       // inform the frame manager we have no result
2957       istate->set_msg(throwing_exception);
2958       if (illegal_state_oop() != NULL)
2959         THREAD->set_pending_exception(illegal_state_oop(), NULL, 0);
2960       else
2961         THREAD->set_pending_exception(original_exception(), NULL, 0);
2962       istate->set_return_kind((Bytecodes::Code)opcode);
2963       UPDATE_PC_AND_RETURN(0);
2964     }
2965 
2966     if (istate->msg() == popping_frame) {
2967       // Make it simpler on the assembly code and set the message for the frame pop.
2968       // returns
2969       if (istate->prev() == NULL) {
2970         // We must be returning to a deoptimized frame (because popframe only happens between
2971         // two interpreted frames). We need to save the current arguments in C heap so that
2972         // the deoptimized frame when it restarts can copy the arguments to its expression
2973         // stack and re-execute the call. We also have to notify deoptimization that this
2974         // has occurred and to pick the preserved args copy them to the deoptimized frame's
2975         // java expression stack. Yuck.
2976         //
2977         THREAD->popframe_preserve_args(in_ByteSize(METHOD->size_of_parameters() * wordSize),
2978                                 LOCALS_SLOT(METHOD->size_of_parameters() - 1));
2979         THREAD->set_popframe_condition_bit(JavaThread::popframe_force_deopt_reexecution_bit);
2980       }
2981       THREAD->clr_pop_frame_in_process();

2982     }
2983 
2984     // Normal return
2985     // Advance the pc and return to frame manager
2986     istate->set_msg(return_from_method);
2987     istate->set_return_kind((Bytecodes::Code)opcode);
2988     UPDATE_PC_AND_RETURN(1);
2989   } /* handle_return: */
2990 
2991 // This is really a fatal error return
2992 
2993 finish:
2994   DECACHE_TOS();
2995   DECACHE_PC();
2996 
2997   return;
2998 }
2999 
3000 /*
3001  * All the code following this point is only produced once and is not present
3002  * in the JVMTI version of the interpreter
3003 */
3004 
3005 #ifndef VM_JVMTI
3006 
3007 // This constructor should only be used to contruct the object to signal




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 // no precompiled headers
  26 #include "classfile/vmSymbols.hpp"
  27 #include "gc_interface/collectedHeap.hpp"
  28 #include "interpreter/bytecodeHistogram.hpp"
  29 #include "interpreter/bytecodeInterpreter.hpp"
  30 #include "interpreter/bytecodeInterpreter.inline.hpp"
  31 #include "interpreter/interpreter.hpp"
  32 #include "interpreter/interpreterRuntime.hpp"
  33 #include "memory/cardTableModRefBS.hpp"
  34 #include "memory/resourceArea.hpp"
  35 #include "oops/methodCounters.hpp"
  36 #include "oops/objArrayKlass.hpp"
  37 #include "oops/oop.inline.hpp"
  38 #include "prims/jvmtiExport.hpp"
  39 #include "prims/jvmtiThreadState.hpp"
  40 #include "runtime/biasedLocking.hpp"
  41 #include "runtime/frame.inline.hpp"
  42 #include "runtime/handles.inline.hpp"
  43 #include "runtime/interfaceSupport.hpp"
  44 #include "runtime/sharedRuntime.hpp"
  45 #include "runtime/threadCritical.hpp"
  46 #include "utilities/exceptions.hpp"
  47 #ifdef TARGET_OS_ARCH_linux_x86
  48 # include "orderAccess_linux_x86.inline.hpp"
  49 #endif
  50 #ifdef TARGET_OS_ARCH_linux_sparc
  51 # include "orderAccess_linux_sparc.inline.hpp"
  52 #endif
  53 #ifdef TARGET_OS_ARCH_linux_zero
  54 # include "orderAccess_linux_zero.inline.hpp"
  55 #endif
  56 #ifdef TARGET_OS_ARCH_solaris_x86
  57 # include "orderAccess_solaris_x86.inline.hpp"
  58 #endif
  59 #ifdef TARGET_OS_ARCH_solaris_sparc


 182    As a result if we call at_single_stepping_point() we refetch opcode
 183    to get the current opcode. This will override any other prefetching
 184    that might have occurred.
 185 */
 186 #define DEBUGGER_SINGLE_STEP_NOTIFY()                                            \
 187 {                                                                                \
 188       if (_jvmti_interp_events) {                                                \
 189         if (JvmtiExport::should_post_single_step()) {                            \
 190           DECACHE_STATE();                                                       \
 191           SET_LAST_JAVA_FRAME();                                                 \
 192           ThreadInVMfromJava trans(THREAD);                                      \
 193           JvmtiExport::at_single_stepping_point(THREAD,                          \
 194                                           istate->method(),                      \
 195                                           pc);                                   \
 196           RESET_LAST_JAVA_FRAME();                                               \
 197           CACHE_STATE();                                                         \
 198           if (THREAD->pop_frame_pending() &&                                     \
 199               !THREAD->pop_frame_in_process()) {                                 \
 200             goto handle_Pop_Frame;                                               \
 201           }                                                                      \
 202           if (THREAD->jvmti_thread_state() &&                                    \
 203               THREAD->jvmti_thread_state()->is_earlyret_pending()) {             \
 204             goto handle_Early_Return;                                            \
 205           }                                                                      \
 206           opcode = *pc;                                                          \
 207         }                                                                        \
 208       }                                                                          \
 209 }
 210 #else
 211 #define DEBUGGER_SINGLE_STEP_NOTIFY()
 212 #endif
 213 
 214 /*
 215  * CONTINUE - Macro for executing the next opcode.
 216  */
 217 #undef CONTINUE
 218 #ifdef USELABELS
 219 // Have to do this dispatch this way in C++ because otherwise gcc complains about crossing an
 220 // initialization (which is is the initialization of the table pointer...)
 221 #define DISPATCH(opcode) goto *(void*)dispatch_table[opcode]
 222 #define CONTINUE {                              \
 223         opcode = *pc;                           \
 224         DO_UPDATE_INSTRUCTION_COUNT(opcode);    \
 225         DEBUGGER_SINGLE_STEP_NOTIFY();          \


 409 // Decache the interpreter state that interpreter modifies directly (i.e. GC is indirect mod)
 410 #define DECACHE_STATE() DECACHE_PC(); DECACHE_TOS();
 411 
 412 // Reload interpreter state after calling the VM or a possible GC
 413 #define CACHE_STATE()   \
 414         CACHE_TOS();    \
 415         CACHE_PC();     \
 416         CACHE_CP();     \
 417         CACHE_LOCALS();
 418 
 419 // Call the VM don't check for pending exceptions
 420 #define CALL_VM_NOCHECK(func)                                      \
 421         DECACHE_STATE();                                           \
 422         SET_LAST_JAVA_FRAME();                                     \
 423         func;                                                      \
 424         RESET_LAST_JAVA_FRAME();                                   \
 425         CACHE_STATE();                                             \
 426         if (THREAD->pop_frame_pending() &&                         \
 427             !THREAD->pop_frame_in_process()) {                     \
 428           goto handle_Pop_Frame;                                   \
 429         }                                                          \
 430         if (THREAD->jvmti_thread_state() &&                        \
 431             THREAD->jvmti_thread_state()->is_earlyret_pending()) { \
 432           goto handle_Early_Return;                                \
 433         }
 434 
 435 // Call the VM and check for pending exceptions
 436 #define CALL_VM(func, label) {                                     \
 437           CALL_VM_NOCHECK(func);                                   \
 438           if (THREAD->has_pending_exception()) goto label;         \
 439         }
 440 
 441 /*
 442  * BytecodeInterpreter::run(interpreterState istate)
 443  * BytecodeInterpreter::runWithChecks(interpreterState istate)
 444  *
 445  * The real deal. This is where byte codes actually get interpreted.
 446  * Basically it's a big while loop that iterates until we return from
 447  * the method passed in.
 448  *
 449  * The runWithChecks is used if JVMTI is enabled.
 450  *
 451  */
 452 #if defined(VM_JVMTI)


 812       if ((istate->_stack_base - istate->_stack_limit) != istate->method()->max_stack() + 1) {
 813         // resume
 814         os::breakpoint();
 815       }
 816 #ifdef HACK
 817       {
 818         ResourceMark rm;
 819         char *method_name = istate->method()->name_and_sig_as_C_string();
 820         if (strstr(method_name, "runThese$TestRunner.run()V") != NULL) {
 821           tty->print_cr("resume: depth %d bci: %d",
 822                          (istate->_stack_base - istate->_stack) ,
 823                          istate->_bcp - istate->_method->code_base());
 824           interesting = true;
 825         }
 826       }
 827 #endif // HACK
 828       // returned from a java call, continue executing.
 829       if (THREAD->pop_frame_pending() && !THREAD->pop_frame_in_process()) {
 830         goto handle_Pop_Frame;
 831       }
 832       if (THREAD->jvmti_thread_state() &&
 833           THREAD->jvmti_thread_state()->is_earlyret_pending()) {
 834         goto handle_Early_Return;
 835       }
 836 
 837       if (THREAD->has_pending_exception()) goto handle_exception;
 838       // Update the pc by the saved amount of the invoke bytecode size
 839       UPDATE_PC(istate->bcp_advance());
 840       goto run;
 841     }
 842 
 843     case deopt_resume2: {
 844       // Returned from an opcode that will reexecute. Deopt was
 845       // a result of a PopFrame request.
 846       //
 847       goto run;
 848     }
 849 
 850     case deopt_resume: {
 851       // Returned from an opcode that has completed. The stack has
 852       // the result all we need to do is skip across the bytecode
 853       // and continue (assuming there is no exception pending)
 854       //
 855       // compute continuation length


2719       // for AbortVMOnException flag
2720       NOT_PRODUCT(Exceptions::debug_check_abort(except_oop));
2721       goto run;
2722     }
2723     if (TraceExceptions) {
2724       ttyLocker ttyl;
2725       ResourceMark rm;
2726       tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), except_oop());
2727       tty->print_cr(" thrown in interpreter method <%s>", METHOD->print_value_string());
2728       tty->print_cr(" at bci %d, unwinding for thread " INTPTR_FORMAT,
2729                     pc  - (intptr_t) METHOD->code_base(),
2730                     THREAD);
2731     }
2732     // for AbortVMOnException flag
2733     NOT_PRODUCT(Exceptions::debug_check_abort(except_oop));
2734     // No handler in this activation, unwind and try again
2735     THREAD->set_pending_exception(except_oop(), NULL, 0);
2736     goto handle_return;
2737   }  /* handle_exception: */
2738 


2739   // Return from an interpreter invocation with the result of the interpretation
2740   // on the top of the Java Stack (or a pending exception)
2741 
2742 handle_Pop_Frame:
2743 
2744   // We don't really do anything special here except we must be aware
2745   // that we can get here without ever locking the method (if sync).
2746   // Also we skip the notification of the exit.
2747 
2748   istate->set_msg(popping_frame);
2749   // Clear pending so while the pop is in process
2750   // we don't start another one if a call_vm is done.
2751   THREAD->clr_pop_frame_pending();
2752   // Let interpreter (only) see the we're in the process of popping a frame
2753   THREAD->set_pop_frame_in_process();
2754 
2755   goto handle_return;
2756 
2757 // ForceEarlyReturn ends a method, and returns to the caller with a return value
2758 // given by the invoker of the early return.
2759 handle_Early_Return:
2760 
2761   istate->set_msg(early_return);
2762 
2763   // Clear expression stack.
2764   topOfStack = istate->stack_base() - Interpreter::stackElementWords;
2765 
2766   // Push the value to be returned.
2767   switch (istate->method()->result_type()) {
2768     case T_BOOLEAN:
2769     case T_SHORT:
2770     case T_BYTE:
2771     case T_CHAR:
2772     case T_INT:
2773       SET_STACK_INT(THREAD->jvmti_thread_state()->earlyret_value().i, 0);
2774       MORE_STACK(1);
2775       break;
2776     case T_LONG:
2777       SET_STACK_LONG(THREAD->jvmti_thread_state()->earlyret_value().j, 1);
2778       MORE_STACK(2);
2779       break;
2780     case T_FLOAT:
2781       SET_STACK_FLOAT(THREAD->jvmti_thread_state()->earlyret_value().f, 0);
2782       MORE_STACK(1);
2783       break;
2784     case T_DOUBLE:
2785       SET_STACK_DOUBLE(THREAD->jvmti_thread_state()->earlyret_value().d, 1);
2786       MORE_STACK(2);
2787       break;
2788     case T_ARRAY:
2789     case T_OBJECT:
2790       SET_STACK_OBJECT(THREAD->jvmti_thread_state()->earlyret_oop(), 0);
2791       MORE_STACK(1);
2792       break;
2793   }
2794 
2795   THREAD->jvmti_thread_state()->clr_earlyret_value();
2796   THREAD->jvmti_thread_state()->set_earlyret_oop(NULL);
2797   THREAD->jvmti_thread_state()->clr_earlyret_pending();
2798 
2799   // Fall through to handle_return.
2800 
2801 handle_return:
2802   {
2803     DECACHE_STATE();
2804 
2805     bool suppress_error = istate->msg() == popping_frame || istate->msg() == early_return;
2806     bool suppress_exit_event = THREAD->has_pending_exception() || istate->msg() == popping_frame;
2807     Handle original_exception(THREAD, THREAD->pending_exception());
2808     Handle illegal_state_oop(THREAD, NULL);
2809 
2810     // We'd like a HandleMark here to prevent any subsequent HandleMarkCleaner
2811     // in any following VM entries from freeing our live handles, but illegal_state_oop
2812     // isn't really allocated yet and so doesn't become live until later and
2813     // in unpredicatable places. Instead we must protect the places where we enter the
2814     // VM. It would be much simpler (and safer) if we could allocate a real handle with
2815     // a NULL oop in it and then overwrite the oop later as needed. This isn't
2816     // unfortunately isn't possible.
2817 
2818     THREAD->clear_pending_exception();
2819 
2820     //
2821     // As far as we are concerned we have returned. If we have a pending exception
2822     // that will be returned as this invocation's result. However if we get any
2823     // exception(s) while checking monitor state one of those IllegalMonitorStateExceptions
2824     // will be our final result (i.e. monitor exception trumps a pending exception).
2825     //
2826 


2999             HandleMark __hm(THREAD);
3000             CALL_VM_NOCHECK(InterpreterRuntime::post_method_exit(THREAD));
3001           }
3002         }
3003       }
3004 #endif /* VM_JVMTI */
3005 
3006     //
3007     // See if we are returning any exception
3008     // A pending exception that was pending prior to a possible popping frame
3009     // overrides the popping frame.
3010     //
3011     assert(!suppress_error || suppress_error && illegal_state_oop() == NULL, "Error was not suppressed");
3012     if (illegal_state_oop() != NULL || original_exception() != NULL) {
3013       // inform the frame manager we have no result
3014       istate->set_msg(throwing_exception);
3015       if (illegal_state_oop() != NULL)
3016         THREAD->set_pending_exception(illegal_state_oop(), NULL, 0);
3017       else
3018         THREAD->set_pending_exception(original_exception(), NULL, 0);

3019       UPDATE_PC_AND_RETURN(0);
3020     }
3021 
3022     if (istate->msg() == popping_frame) {
3023       // Make it simpler on the assembly code and set the message for the frame pop.
3024       // returns
3025       if (istate->prev() == NULL) {
3026         // We must be returning to a deoptimized frame (because popframe only happens between
3027         // two interpreted frames). We need to save the current arguments in C heap so that
3028         // the deoptimized frame when it restarts can copy the arguments to its expression
3029         // stack and re-execute the call. We also have to notify deoptimization that this
3030         // has occurred and to pick the preserved args copy them to the deoptimized frame's
3031         // java expression stack. Yuck.
3032         //
3033         THREAD->popframe_preserve_args(in_ByteSize(METHOD->size_of_parameters() * wordSize),
3034                                 LOCALS_SLOT(METHOD->size_of_parameters() - 1));
3035         THREAD->set_popframe_condition_bit(JavaThread::popframe_force_deopt_reexecution_bit);
3036       }
3037     } else {
3038       istate->set_msg(return_from_method);
3039     }
3040 
3041     // Normal return
3042     // Advance the pc and return to frame manager


3043     UPDATE_PC_AND_RETURN(1);
3044   } /* handle_return: */
3045 
3046 // This is really a fatal error return
3047 
3048 finish:
3049   DECACHE_TOS();
3050   DECACHE_PC();
3051 
3052   return;
3053 }
3054 
3055 /*
3056  * All the code following this point is only produced once and is not present
3057  * in the JVMTI version of the interpreter
3058 */
3059 
3060 #ifndef VM_JVMTI
3061 
3062 // This constructor should only be used to contruct the object to signal