/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "interpreter/bytecodeHistogram.hpp"
#include "interpreter/bytecodeInterpreter.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
#include "interpreter/templateTable.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "oops/arrayOop.hpp"
#include "oops/methodDataOop.hpp"
#include "oops/methodOop.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiExport.hpp"
#include "prims/methodHandles.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
//------------------------------------------------------------------------------------------------------------------------
// Implementation of InterpreterCodelet
}
}
if (PrintInterpreter) {
}
if (PrintInterpreter) {
}
}
//------------------------------------------------------------------------------------------------------------------------
// Implementation of platform independent aspects of Interpreter
// make sure 'imported' classes are initialized
}
}
void interpreter_init() {
#ifndef PRODUCT
#endif // PRODUCT
// need to hit every safepoint in order to call zapping routine
// register the interpreter
"Interpreter",
);
// notify JVMTI profiler
}
}
//------------------------------------------------------------------------------------------------------------------------
// Implementation of interpreter
//------------------------------------------------------------------------------------------------------------------------
// Generation of complete interpreter
}
T_CHAR ,
T_BYTE ,
T_SHORT ,
T_INT ,
T_LONG ,
T_VOID ,
T_FLOAT ,
T_DOUBLE ,
};
}
}
//------------------------------------------------------------------------------------------------------------------------
// Entry points
// Abstract method?
if (m->is_abstract()) return abstract;
// Method handle primitive?
if (m->is_method_handle_intrinsic()) {
return kind;
}
// Native method?
// Note: This test must come _before_ the test for intrinsic
// methods. See also comments below.
if (m->is_native()) {
}
// Synchronized?
if (m->is_synchronized()) {
return zerolocals_synchronized;
}
// We need to execute the special return bytecode to check for
// finalizer registration so create a normal frame.
return zerolocals;
}
// Empty method?
if (m->is_empty_method()) {
return empty;
}
// Special intrinsic method?
// Note: This test must come _after_ the test for native methods,
// otherwise we will run into problems with JDK 1.2, see also
// AbstractInterpreterGenerator::generate_method_entry() for
// for details.
switch (m->intrinsic_id()) {
case vmIntrinsics::_Reference_get:
return java_lang_ref_reference_get;
}
// Accessor method?
if (m->is_accessor()) {
return accessor;
}
// Note: for now: zero locals for all non-empty methods
return zerolocals;
}
}
// Return true if the interpreter can prove that the given bytecode has
// not yet been executed (in Java semantics, not in actual operation).
// might have been reached
return false;
}
// the bytecode might not be rewritten if the method is an accessor, etc.
return false; // interpreter does not run this method!
// otherwise, we can be sure this bytecode has never been executed
return true;
}
#ifndef PRODUCT
switch (kind) {
default:
if (kind >= method_handle_invoke_FIRST &&
break;
}
break;
}
}
#endif // PRODUCT
//------------------------------------------------------------------------------------------------------------------------
// Deoptimization support
// If deoptimization happens, this function returns the point of next bytecode to continue execution
address AbstractInterpreter::deopt_continue_after_entry(methodOop method, address bcp, int callee_parameters, bool is_top_frame) {
// compute continuation length
// compute result type
switch (code) {
case Bytecodes::_invokevirtual :
case Bytecodes::_invokespecial :
case Bytecodes::_invokestatic :
case Bytecodes::_invokeinterface: {
// since the cache entry might not be initialized:
// (NOT needed for the old calling convension)
if (!is_top_frame) {
}
break;
}
case Bytecodes::_invokedynamic: {
// since the cache entry might not be initialized:
// (NOT needed for the old calling convension)
if (!is_top_frame) {
}
break;
}
{
break;
}
default:
break;
}
// return entry point for computed continuation state & bytecode length
return
}
// If deoptimization happens, this function returns the point where the interpreter reexecutes
// the bytecode.
// Note: Bytecodes::_athrow is a special case in that it does not return
// Interpreter::deopt_entry(vtos, 0) like others
#ifdef COMPILER1
return Interpreter::rethrow_exception_entry();
}
#endif /* COMPILER1 */
}
// If deoptimization happens, the interpreter should reexecute these bytecodes.
// This function mainly helps the compilers to set up the reexecute bit.
switch (code) {
case Bytecodes::_lookupswitch:
case Bytecodes::_tableswitch:
case Bytecodes::_fast_binaryswitch:
case Bytecodes::_fast_linearswitch:
// recompute condtional expression folded into _if<cond>
case Bytecodes::_ifnonnull :
case Bytecodes::_if_icmpeq :
case Bytecodes::_if_icmpne :
case Bytecodes::_if_icmplt :
case Bytecodes::_if_icmpge :
case Bytecodes::_if_icmpgt :
case Bytecodes::_if_icmple :
case Bytecodes::_if_acmpeq :
case Bytecodes::_if_acmpne :
// special cases
case Bytecodes::_getstatic :
case Bytecodes::_putstatic :
#ifdef COMPILER1
//special case of reexecution
#endif
return true;
default:
return false;
}
}
// Quick & dirty stack overflow checking: bang the stack & handle trap.
// Note that we do the banging after the frame is setup, since the exception
// handling code expects to find a valid interpreter frame on the stack.
// Doing the banging earlier fails if the caller frame is not an interpreter
// frame.
// (Also, the exception throwing code expects to unlock any synchronized
// method receiever, so do the banging after locking the receiver.)
// Bang each page in the shadow zone. We can't assume it's been done for
// an interpreter frame with greater than a page of locals, so each page
// needs to be checked. Only true for non-native.
if (UseStackBanging) {
}
}
}
// method handle entry kinds are generated later in MethodHandlesAdapterGenerator::generate:
for (int i = Interpreter::method_handle_invoke_FIRST; i <= Interpreter::method_handle_invoke_LAST; i++) {
}
}