src/share/vm/interpreter/bytecodeInterpreter.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8144953.02 Sdiff src/share/vm/interpreter

src/share/vm/interpreter/bytecodeInterpreter.cpp

Print this page


   1 /*
   2  * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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  *


2763     // Prevent any subsequent HandleMarkCleaner in the VM
2764     // from freeing the except_oop handle.
2765     HandleMark __hm(THREAD);
2766 
2767     THREAD->clear_pending_exception();
2768     assert(except_oop(), "No exception to process");
2769     intptr_t continuation_bci;
2770     // expression stack is emptied
2771     topOfStack = istate->stack_base() - Interpreter::stackElementWords;
2772     CALL_VM(continuation_bci = (intptr_t)InterpreterRuntime::exception_handler_for_exception(THREAD, except_oop()),
2773             handle_exception);
2774 
2775     except_oop = THREAD->vm_result();
2776     THREAD->set_vm_result(NULL);
2777     if (continuation_bci >= 0) {
2778       // Place exception on top of stack
2779       SET_STACK_OBJECT(except_oop(), 0);
2780       MORE_STACK(1);
2781       pc = METHOD->code_base() + continuation_bci;
2782       if (log_is_enabled(Info, exceptions)) {
2783         ResourceMark rm;
2784         log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ")\n"
2785                              " thrown in interpreter method <%s>\n"
2786                              " at bci %d, continuing at %d for thread " INTPTR_FORMAT,
2787                              except_oop->print_value_string(), p2i(except_oop()),
2788                              METHOD->print_value_string(),
2789                              (int)(istate->bcp() - METHOD->code_base()),
2790                              (int)continuation_bci, p2i(THREAD));

2791       }
2792       // for AbortVMOnException flag
2793       Exceptions::debug_check_abort(except_oop);
2794 
2795       // Update profiling data.
2796       BI_PROFILE_ALIGN_TO_CURRENT_BCI();
2797       goto run;
2798     }
2799     if (log_is_enabled(Info, exceptions)) {
2800       ResourceMark rm;
2801       log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ")\n"
2802                            " thrown in interpreter method <%s>\n"
2803                            " at bci %d, unwinding for thread " INTPTR_FORMAT,
2804                            except_oop->print_value_string(), p2i(except_oop()),
2805                            METHOD->print_value_string(),
2806                            (int)(istate->bcp() - METHOD->code_base()),
2807                            p2i(THREAD));

2808     }
2809     // for AbortVMOnException flag
2810     Exceptions::debug_check_abort(except_oop);
2811 
2812     // No handler in this activation, unwind and try again
2813     THREAD->set_pending_exception(except_oop(), NULL, 0);
2814     goto handle_return;
2815   }  // handle_exception:
2816 
2817   // Return from an interpreter invocation with the result of the interpretation
2818   // on the top of the Java Stack (or a pending exception)
2819 
2820   handle_Pop_Frame: {
2821 
2822     // We don't really do anything special here except we must be aware
2823     // that we can get here without ever locking the method (if sync).
2824     // Also we skip the notification of the exit.
2825 
2826     istate->set_msg(popping_frame);
2827     // Clear pending so while the pop is in process


   1 /*
   2  * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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  *


2763     // Prevent any subsequent HandleMarkCleaner in the VM
2764     // from freeing the except_oop handle.
2765     HandleMark __hm(THREAD);
2766 
2767     THREAD->clear_pending_exception();
2768     assert(except_oop(), "No exception to process");
2769     intptr_t continuation_bci;
2770     // expression stack is emptied
2771     topOfStack = istate->stack_base() - Interpreter::stackElementWords;
2772     CALL_VM(continuation_bci = (intptr_t)InterpreterRuntime::exception_handler_for_exception(THREAD, except_oop()),
2773             handle_exception);
2774 
2775     except_oop = THREAD->vm_result();
2776     THREAD->set_vm_result(NULL);
2777     if (continuation_bci >= 0) {
2778       // Place exception on top of stack
2779       SET_STACK_OBJECT(except_oop(), 0);
2780       MORE_STACK(1);
2781       pc = METHOD->code_base() + continuation_bci;
2782       if (log_is_enabled(Info, exceptions)) {
2783         ResourceMark rm(thread);
2784         stringStream tempst;
2785         tempst.print("interpreter method <%s>\n"
2786                      " at bci %d, continuing at %d for thread " INTPTR_FORMAT,

2787                      METHOD->print_value_string(),
2788                      (int)(istate->bcp() - METHOD->code_base()),
2789                      (int)continuation_bci, p2i(THREAD));
2790         Exceptions::log_exception(except_oop, tempst);
2791       }
2792       // for AbortVMOnException flag
2793       Exceptions::debug_check_abort(except_oop);
2794 
2795       // Update profiling data.
2796       BI_PROFILE_ALIGN_TO_CURRENT_BCI();
2797       goto run;
2798     }
2799     if (log_is_enabled(Info, exceptions)) {
2800       ResourceMark rm;
2801       stringStream tempst;
2802       tempst.print("interpreter method <%s>\n"
2803              " at bci %d, unwinding for thread " INTPTR_FORMAT,

2804              METHOD->print_value_string(),
2805              (int)(istate->bcp() - METHOD->code_base()),
2806              p2i(THREAD));
2807       Exceptions::log_exception(except_oop, tempst);
2808     }
2809     // for AbortVMOnException flag
2810     Exceptions::debug_check_abort(except_oop);
2811 
2812     // No handler in this activation, unwind and try again
2813     THREAD->set_pending_exception(except_oop(), NULL, 0);
2814     goto handle_return;
2815   }  // handle_exception:
2816 
2817   // Return from an interpreter invocation with the result of the interpretation
2818   // on the top of the Java Stack (or a pending exception)
2819 
2820   handle_Pop_Frame: {
2821 
2822     // We don't really do anything special here except we must be aware
2823     // that we can get here without ever locking the method (if sync).
2824     // Also we skip the notification of the exit.
2825 
2826     istate->set_msg(popping_frame);
2827     // Clear pending so while the pop is in process


src/share/vm/interpreter/bytecodeInterpreter.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File