8239782: CC_INTERP is only used by Zero interpreter
Change CC_INTERP conditional to ZERO and remove in places where unnecessary. Fix build to exclude compilers and rename CppInterpreter to ZeroInterpreter. The "C++ Interpreter" has been removed from the code a while ago. Reviewed-by: dholmes, ihse
This commit is contained in:
parent
6b251191e0
commit
1550fd889b
@ -106,14 +106,16 @@ $(eval $(call SetupJvmtiGeneration, jvmti.h, jvmtiH.xsl, \
|
||||
$(eval $(call SetupJvmtiGeneration, jvmti.html, jvmti.xsl, \
|
||||
-PARAM majorversion $(VERSION_FEATURE)))
|
||||
|
||||
JVMTI_BC_SRCDIR := $(TOPDIR)/src/hotspot/share/interpreter
|
||||
JVMTI_BC_SRCDIR := $(TOPDIR)/src/hotspot/share/interpreter/zero
|
||||
|
||||
$(eval $(call SetupXslTransform, bytecodeInterpreterWithChecks.cpp, \
|
||||
XML_FILE := $(JVMTI_BC_SRCDIR)/bytecodeInterpreterWithChecks.xml, \
|
||||
XSL_FILE := $(JVMTI_BC_SRCDIR)/bytecodeInterpreterWithChecks.xsl, \
|
||||
OUTPUT_DIR := $(JVMTI_OUTPUTDIR), \
|
||||
DEPS := $(JVMTI_BC_SRCDIR)/bytecodeInterpreter.cpp, \
|
||||
))
|
||||
ifeq ($(call check-jvm-feature, zero), true)
|
||||
$(eval $(call SetupXslTransform, bytecodeInterpreterWithChecks.cpp, \
|
||||
XML_FILE := $(JVMTI_BC_SRCDIR)/bytecodeInterpreterWithChecks.xml, \
|
||||
XSL_FILE := $(JVMTI_BC_SRCDIR)/bytecodeInterpreterWithChecks.xsl, \
|
||||
OUTPUT_DIR := $(JVMTI_OUTPUTDIR), \
|
||||
DEPS := $(JVMTI_BC_SRCDIR)/bytecodeInterpreter.cpp, \
|
||||
))
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Copy jvmti.h to include dir
|
||||
|
@ -45,11 +45,17 @@ else
|
||||
endif
|
||||
|
||||
ifeq ($(call check-jvm-feature, zero), true)
|
||||
JVM_CFLAGS_FEATURES += -DZERO -DCC_INTERP -DZERO_LIBARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' $(LIBFFI_CFLAGS)
|
||||
JVM_EXCLUDES += opto libadt
|
||||
JVM_EXCLUDE_PATTERNS += c1_ c1/ c2_ runtime_ /c2/
|
||||
JVM_EXCLUDE_FILES += templateInterpreter.cpp templateInterpreterGenerator.cpp \
|
||||
bcEscapeAnalyzer.cpp ciTypeFlow.cpp
|
||||
JVM_CFLAGS_FEATURES += -DZERO -DZERO_LIBARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' $(LIBFFI_CFLAGS)
|
||||
JVM_LIBS_FEATURES += $(LIBFFI_LIBS)
|
||||
ifeq ($(ENABLE_LIBFFI_BUNDLING), true)
|
||||
JVM_LDFLAGS_FEATURES += $(call SET_EXECUTABLE_ORIGIN,/..)
|
||||
endif
|
||||
else
|
||||
JVM_EXCLUDE_PATTERNS += /zero/
|
||||
endif
|
||||
|
||||
ifeq ($(JVM_VARIANT), custom)
|
||||
|
@ -26,10 +26,6 @@
|
||||
#ifndef CPU_PPC_GLOBALDEFINITIONS_PPC_HPP
|
||||
#define CPU_PPC_GLOBALDEFINITIONS_PPC_HPP
|
||||
|
||||
#ifdef CC_INTERP
|
||||
#error "CC_INTERP is no longer supported. Removed in change 8145117."
|
||||
#endif
|
||||
|
||||
#ifndef FILE_AND_LINE
|
||||
#define FILE_AND_LINE __FILE__ ":" XSTR(__LINE__)
|
||||
#endif
|
||||
|
@ -26,10 +26,6 @@
|
||||
#ifndef CPU_S390_GLOBALDEFINITIONS_S390_HPP
|
||||
#define CPU_S390_GLOBALDEFINITIONS_S390_HPP
|
||||
|
||||
#ifdef CC_INTERP
|
||||
#error "CC_INTERP is not supported on z/Architecture."
|
||||
#endif
|
||||
|
||||
// Convenience macro that produces a string literal with the filename
|
||||
// and linenumber of the location where the macro was used.
|
||||
#ifndef FILE_AND_LINE
|
||||
|
@ -88,8 +88,8 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
|
||||
//
|
||||
// On entry:
|
||||
// Z_ARG1 - intptr_t* Address of java argument list in memory.
|
||||
// Z_state - cppInterpreter* Address of interpreter state for
|
||||
// this method
|
||||
// Z_state - zeroInterpreter* Address of interpreter state for
|
||||
// this method
|
||||
// Z_method
|
||||
//
|
||||
// On exit (just before return instruction):
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -24,8 +24,8 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "interpreter/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/cppInterpreter.hpp"
|
||||
#include "interpreter/zero/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/zero/zeroInterpreter.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2008 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -25,10 +25,9 @@
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/assembler.hpp"
|
||||
#include "interpreter/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/bytecodeInterpreter.inline.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "interpreter/interpreterRuntime.hpp"
|
||||
#include "interpreter/zero/bytecodeInterpreter.inline.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
@ -40,8 +39,6 @@
|
||||
#include "runtime/vframeArray.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
|
||||
#ifdef CC_INTERP
|
||||
|
||||
const char *BytecodeInterpreter::name_of_field_at_address(address addr) {
|
||||
#define DO(member) {if (addr == (address) &(member)) return XSTR(member);}
|
||||
DO(_thread);
|
||||
@ -102,5 +99,3 @@ void BytecodeInterpreter::layout_interpreterState(interpreterState istate,
|
||||
istate->set_stack(stack);
|
||||
istate->set_stack_limit(stack_base - method->max_stack() - 1);
|
||||
}
|
||||
|
||||
#endif // CC_INTERP
|
||||
|
@ -1,93 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* 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/cppInterpreterGenerator.hpp"
|
||||
#include "interpreter/interpreterRuntime.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "interpreter/cppInterpreter.hpp"
|
||||
|
||||
address CppInterpreterGenerator::generate_slow_signature_handler() {
|
||||
_masm->advance(1);
|
||||
return (address) InterpreterRuntime::slow_signature_handler;
|
||||
}
|
||||
|
||||
address CppInterpreterGenerator::generate_math_entry(
|
||||
AbstractInterpreter::MethodKind kind) {
|
||||
if (!InlineIntrinsics)
|
||||
return NULL;
|
||||
|
||||
Unimplemented();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address CppInterpreterGenerator::generate_abstract_entry() {
|
||||
return generate_entry((address) ShouldNotCallThisEntry());
|
||||
}
|
||||
|
||||
address CppInterpreterGenerator::generate_empty_entry() {
|
||||
if (!UseFastEmptyMethods)
|
||||
return NULL;
|
||||
|
||||
return generate_entry((address) CppInterpreter::empty_entry);
|
||||
}
|
||||
|
||||
address CppInterpreterGenerator::generate_accessor_entry() {
|
||||
if (!UseFastAccessorMethods)
|
||||
return NULL;
|
||||
|
||||
return generate_entry((address) CppInterpreter::accessor_entry);
|
||||
}
|
||||
|
||||
address CppInterpreterGenerator::generate_Reference_get_entry(void) {
|
||||
#if INCLUDE_G1GC
|
||||
if (UseG1GC) {
|
||||
// We need to generate have a routine that generates code to:
|
||||
// * load the value in the referent field
|
||||
// * passes that value to the pre-barrier.
|
||||
//
|
||||
// In the case of G1 this will record the value of the
|
||||
// referent in an SATB buffer if marking is active.
|
||||
// This will cause concurrent marking to mark the referent
|
||||
// field as live.
|
||||
Unimplemented();
|
||||
}
|
||||
#endif // INCLUDE_G1GC
|
||||
|
||||
// If G1 is not enabled then attempt to go through the normal entry point
|
||||
// Reference.get could be instrumented by jvmti
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address CppInterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
return generate_entry((address) CppInterpreter::native_entry);
|
||||
}
|
||||
|
||||
address CppInterpreterGenerator::generate_normal_entry(bool synchronized) {
|
||||
return generate_entry((address) CppInterpreter::normal_entry);
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2008, 2009, 2010 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -26,7 +26,7 @@
|
||||
#ifndef CPU_ZERO_ENTRY_ZERO_HPP
|
||||
#define CPU_ZERO_ENTRY_ZERO_HPP
|
||||
|
||||
#include "interpreter/cppInterpreter.hpp"
|
||||
#include "interpreter/zero/zeroInterpreter.hpp"
|
||||
|
||||
class ZeroEntry {
|
||||
public:
|
||||
@ -69,7 +69,7 @@ class ZeroEntry {
|
||||
private:
|
||||
static void maybe_deoptimize(int deoptimized_frames, TRAPS) {
|
||||
if (deoptimized_frames)
|
||||
CppInterpreter::main_loop(deoptimized_frames - 1, THREAD);
|
||||
ZeroInterpreter::main_loop(deoptimized_frames - 1, THREAD);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -24,26 +24,16 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "code/scopeDesc.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "interpreter/interpreterRuntime.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "oops/markWord.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/javaCalls.hpp"
|
||||
#include "runtime/monitorChunk.hpp"
|
||||
#include "runtime/signature.hpp"
|
||||
#include "runtime/stubCodeGenerator.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
#include "vmreg_zero.inline.hpp"
|
||||
#ifdef COMPILER1
|
||||
#include "c1/c1_Runtime1.hpp"
|
||||
#include "runtime/vframeArray.hpp"
|
||||
#endif
|
||||
|
||||
#ifdef ASSERT
|
||||
void RegisterMap::check_location_valid() {
|
||||
@ -87,7 +77,6 @@ frame frame::sender(RegisterMap* map) const {
|
||||
return sender_for_nonentry_frame(map);
|
||||
}
|
||||
|
||||
#ifdef CC_INTERP
|
||||
BasicObjectLock* frame::interpreter_frame_monitor_begin() const {
|
||||
return get_interpreterState()->monitor_base();
|
||||
}
|
||||
@ -95,7 +84,6 @@ BasicObjectLock* frame::interpreter_frame_monitor_begin() const {
|
||||
BasicObjectLock* frame::interpreter_frame_monitor_end() const {
|
||||
return (BasicObjectLock*) get_interpreterState()->stack_base();
|
||||
}
|
||||
#endif // CC_INTERP
|
||||
|
||||
void frame::patch_pc(Thread* thread, address pc) {
|
||||
if (pc != NULL) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -26,8 +26,6 @@
|
||||
#ifndef CPU_ZERO_FRAME_ZERO_HPP
|
||||
#define CPU_ZERO_FRAME_ZERO_HPP
|
||||
|
||||
#include "runtime/synchronizer.hpp"
|
||||
|
||||
// A frame represents a physical stack frame on the Zero stack.
|
||||
|
||||
public:
|
||||
@ -51,9 +49,7 @@
|
||||
return (intptr_t *) zeroframe();
|
||||
}
|
||||
|
||||
#ifdef CC_INTERP
|
||||
inline interpreterState get_interpreterState() const;
|
||||
#endif // CC_INTERP
|
||||
|
||||
public:
|
||||
const EntryFrame *zero_entryframe() const {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -82,7 +82,6 @@ inline intptr_t* frame::link() const {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef CC_INTERP
|
||||
inline interpreterState frame::get_interpreterState() const {
|
||||
return zero_interpreterframe()->interpreter_state();
|
||||
}
|
||||
@ -119,7 +118,6 @@ inline oop* frame::interpreter_frame_temp_oop_addr() const {
|
||||
interpreterState istate = get_interpreterState();
|
||||
return (oop *)&istate->_oop_temp;
|
||||
}
|
||||
#endif // CC_INTERP
|
||||
|
||||
inline int frame::interpreter_frame_monitor_size() {
|
||||
return BasicObjectLock::size();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2008, 2010 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -26,13 +26,12 @@
|
||||
#ifndef CPU_ZERO_INTERPRETERFRAME_ZERO_HPP
|
||||
#define CPU_ZERO_INTERPRETERFRAME_ZERO_HPP
|
||||
|
||||
#include "interpreter/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/zero/bytecodeInterpreter.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "runtime/thread.hpp"
|
||||
#include "stack_zero.hpp"
|
||||
#include "utilities/align.hpp"
|
||||
|
||||
#ifdef CC_INTERP
|
||||
// | ... |
|
||||
// +--------------------+ ------------------
|
||||
// | stack slot n-1 | low addresses
|
||||
@ -79,6 +78,5 @@ class InterpreterFrame : public ZeroFrame {
|
||||
char* valuebuf,
|
||||
int buflen) const;
|
||||
};
|
||||
#endif // CC_INTERP
|
||||
|
||||
#endif // CPU_ZERO_INTERPRETERFRAME_ZERO_HPP
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2009, 2010, 2011 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -25,9 +25,9 @@
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/javaClasses.inline.hpp"
|
||||
#include "interpreter/cppInterpreterGenerator.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "interpreter/interpreterRuntime.hpp"
|
||||
#include "interpreter/zero/zeroInterpreterGenerator.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/method.inline.hpp"
|
||||
@ -35,6 +35,7 @@
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
|
||||
|
||||
void MethodHandles::invoke_target(Method* method, TRAPS) {
|
||||
|
||||
JavaThread *thread = (JavaThread *) THREAD;
|
||||
@ -210,16 +211,16 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
|
||||
// Perhaps surprisingly, the symbolic references visible to Java are not directly used.
|
||||
// They are linked to Java-generated adapters via MethodHandleNatives.linkMethod.
|
||||
// They all allow an appendix argument.
|
||||
return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invalid);
|
||||
return ZeroInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invalid);
|
||||
case vmIntrinsics::_invokeBasic:
|
||||
return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invokeBasic);
|
||||
return ZeroInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invokeBasic);
|
||||
case vmIntrinsics::_linkToStatic:
|
||||
case vmIntrinsics::_linkToSpecial:
|
||||
return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToStaticOrSpecial);
|
||||
return ZeroInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToStaticOrSpecial);
|
||||
case vmIntrinsics::_linkToInterface:
|
||||
return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToInterface);
|
||||
return ZeroInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToInterface);
|
||||
case vmIntrinsics::_linkToVirtual:
|
||||
return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToVirtual);
|
||||
return ZeroInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToVirtual);
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
return NULL;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2008 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -26,17 +26,9 @@
|
||||
#include "precompiled.hpp"
|
||||
#include "assembler_zero.inline.hpp"
|
||||
#include "entry_zero.hpp"
|
||||
#include "interpreter/cppInterpreter.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "interpreter/zero/zeroInterpreter.hpp"
|
||||
#include "nativeInst_zero.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/handles.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
#include "utilities/ostream.hpp"
|
||||
#ifdef COMPILER1
|
||||
#include "c1/c1_Runtime1.hpp"
|
||||
#endif
|
||||
|
||||
// This method is called by nmethod::make_not_entrant_or_zombie to
|
||||
// insert a jump to SharedRuntime::get_handle_wrong_method_stub()
|
||||
@ -48,10 +40,6 @@ void NativeJump::patch_verified_entry(address entry,
|
||||
address dest) {
|
||||
assert(dest == SharedRuntime::get_handle_wrong_method_stub(), "should be");
|
||||
|
||||
#ifdef CC_INTERP
|
||||
((ZeroEntry*) verified_entry)->set_entry_point(
|
||||
(address) CppInterpreter::normal_entry);
|
||||
#else
|
||||
Unimplemented();
|
||||
#endif // CC_INTERP
|
||||
(address) ZeroInterpreter::normal_entry);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2010 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -24,8 +24,8 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "interpreter/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/interpreterRuntime.hpp"
|
||||
#include "interpreter/zero/bytecodeInterpreter.hpp"
|
||||
#include "runtime/thread.inline.hpp"
|
||||
#include "stack_zero.hpp"
|
||||
#include "stack_zero.inline.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -26,34 +26,73 @@
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/assembler.hpp"
|
||||
#include "interpreter/bytecodeHistogram.hpp"
|
||||
#include "interpreter/cppInterpreter.hpp"
|
||||
#include "interpreter/cppInterpreterGenerator.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "interpreter/interpreterRuntime.hpp"
|
||||
#include "oops/arrayOop.hpp"
|
||||
#include "interpreter/zero/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/zero/zeroInterpreter.hpp"
|
||||
#include "interpreter/zero/zeroInterpreterGenerator.hpp"
|
||||
#include "oops/cpCache.inline.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "prims/jvmtiExport.hpp"
|
||||
#include "prims/jvmtiThreadState.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/deoptimization.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/jniHandles.inline.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
#include "runtime/synchronizer.hpp"
|
||||
#include "runtime/timer.hpp"
|
||||
#include "runtime/vframeArray.hpp"
|
||||
#include "stack_zero.inline.hpp"
|
||||
#include "runtime/timerTrace.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
#ifdef CC_INTERP
|
||||
#include "entry_zero.hpp"
|
||||
#include "stack_zero.inline.hpp"
|
||||
|
||||
void ZeroInterpreter::initialize_stub() {
|
||||
if (_code != NULL) return;
|
||||
|
||||
// generate interpreter
|
||||
int code_size = InterpreterCodeSize;
|
||||
NOT_PRODUCT(code_size *= 4;) // debug uses extra interpreter code space
|
||||
_code = new StubQueue(new InterpreterCodeletInterface, code_size, NULL,
|
||||
"Interpreter");
|
||||
}
|
||||
|
||||
void ZeroInterpreter::initialize_code() {
|
||||
AbstractInterpreter::initialize();
|
||||
|
||||
// generate interpreter
|
||||
{ ResourceMark rm;
|
||||
TraceTime timer("Interpreter generation", TRACETIME_LOG(Info, startuptime));
|
||||
ZeroInterpreterGenerator g(_code);
|
||||
if (PrintInterpreter) print();
|
||||
}
|
||||
|
||||
// Allow c++ interpreter to do one initialization now that switches are set, etc.
|
||||
BytecodeInterpreter start_msg(BytecodeInterpreter::initialize);
|
||||
if (JvmtiExport::can_post_interpreter_events())
|
||||
BytecodeInterpreter::runWithChecks(&start_msg);
|
||||
else
|
||||
BytecodeInterpreter::run(&start_msg);
|
||||
}
|
||||
|
||||
void ZeroInterpreter::invoke_method(Method* method, address entry_point, TRAPS) {
|
||||
((ZeroEntry *) entry_point)->invoke(method, THREAD);
|
||||
}
|
||||
|
||||
void ZeroInterpreter::invoke_osr(Method* method,
|
||||
address entry_point,
|
||||
address osr_buf,
|
||||
TRAPS) {
|
||||
((ZeroEntry *) entry_point)->invoke_osr(method, osr_buf, THREAD);
|
||||
}
|
||||
|
||||
|
||||
|
||||
InterpreterCodelet* ZeroInterpreter::codelet_containing(address pc) {
|
||||
// FIXME: I'm pretty sure _code is null and this is never called, which is why it's copied.
|
||||
return (InterpreterCodelet*)_code->stub_containing(pc);
|
||||
}
|
||||
#define fixup_after_potential_safepoint() \
|
||||
method = istate->method()
|
||||
|
||||
@ -66,7 +105,7 @@
|
||||
CALL_VM_NOCHECK_NOFIX(func) \
|
||||
fixup_after_potential_safepoint()
|
||||
|
||||
int CppInterpreter::normal_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||
int ZeroInterpreter::normal_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||
JavaThread *thread = (JavaThread *) THREAD;
|
||||
|
||||
// Allocate and initialize our frame.
|
||||
@ -104,7 +143,7 @@ intptr_t narrow(BasicType type, intptr_t result) {
|
||||
}
|
||||
|
||||
|
||||
void CppInterpreter::main_loop(int recurse, TRAPS) {
|
||||
void ZeroInterpreter::main_loop(int recurse, TRAPS) {
|
||||
JavaThread *thread = (JavaThread *) THREAD;
|
||||
ZeroStack *stack = thread->zero_stack();
|
||||
|
||||
@ -234,7 +273,7 @@ void CppInterpreter::main_loop(int recurse, TRAPS) {
|
||||
}
|
||||
}
|
||||
|
||||
int CppInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||
int ZeroInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||
// Make sure method is native and not abstract
|
||||
assert(method->is_native() && !method->is_abstract(), "should be");
|
||||
|
||||
@ -247,6 +286,7 @@ int CppInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||
interpreterState istate = frame->interpreter_state();
|
||||
intptr_t *locals = istate->locals();
|
||||
|
||||
#if 0
|
||||
// Update the invocation counter
|
||||
if ((UseCompiler || CountCompiledCalls) && !method->is_synchronized()) {
|
||||
MethodCounters* mcs = method->method_counters();
|
||||
@ -264,6 +304,7 @@ int CppInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||
goto unwind_and_return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Lock if necessary
|
||||
BasicObjectLock *monitor;
|
||||
@ -504,7 +545,7 @@ int CppInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CppInterpreter::accessor_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||
int ZeroInterpreter::accessor_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||
JavaThread *thread = (JavaThread *) THREAD;
|
||||
ZeroStack *stack = thread->zero_stack();
|
||||
intptr_t *locals = stack->sp();
|
||||
@ -637,7 +678,7 @@ int CppInterpreter::accessor_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CppInterpreter::empty_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||
int ZeroInterpreter::empty_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||
JavaThread *thread = (JavaThread *) THREAD;
|
||||
ZeroStack *stack = thread->zero_stack();
|
||||
|
||||
@ -656,7 +697,7 @@ int CppInterpreter::empty_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||
// The new slots will be inserted before slot insert_before.
|
||||
// Slots < insert_before will have the same slot number after the insert.
|
||||
// Slots >= insert_before will become old_slot + num_slots.
|
||||
void CppInterpreter::insert_vmslots(int insert_before, int num_slots, TRAPS) {
|
||||
void ZeroInterpreter::insert_vmslots(int insert_before, int num_slots, TRAPS) {
|
||||
JavaThread *thread = (JavaThread *) THREAD;
|
||||
ZeroStack *stack = thread->zero_stack();
|
||||
|
||||
@ -670,7 +711,7 @@ void CppInterpreter::insert_vmslots(int insert_before, int num_slots, TRAPS) {
|
||||
SET_VMSLOTS_SLOT(VMSLOTS_SLOT(i + num_slots), i);
|
||||
}
|
||||
|
||||
void CppInterpreter::remove_vmslots(int first_slot, int num_slots, TRAPS) {
|
||||
void ZeroInterpreter::remove_vmslots(int first_slot, int num_slots, TRAPS) {
|
||||
JavaThread *thread = (JavaThread *) THREAD;
|
||||
ZeroStack *stack = thread->zero_stack();
|
||||
intptr_t *vmslots = stack->sp();
|
||||
@ -683,13 +724,13 @@ void CppInterpreter::remove_vmslots(int first_slot, int num_slots, TRAPS) {
|
||||
stack->set_sp(stack->sp() + num_slots);
|
||||
}
|
||||
|
||||
BasicType CppInterpreter::result_type_of_handle(oop method_handle) {
|
||||
BasicType ZeroInterpreter::result_type_of_handle(oop method_handle) {
|
||||
oop method_type = java_lang_invoke_MethodHandle::type(method_handle);
|
||||
oop return_type = java_lang_invoke_MethodType::rtype(method_type);
|
||||
return java_lang_Class::as_BasicType(return_type, (Klass* *) NULL);
|
||||
}
|
||||
|
||||
intptr_t* CppInterpreter::calculate_unwind_sp(ZeroStack* stack,
|
||||
intptr_t* ZeroInterpreter::calculate_unwind_sp(ZeroStack* stack,
|
||||
oop method_handle) {
|
||||
oop method_type = java_lang_invoke_MethodHandle::type(method_handle);
|
||||
int argument_slots = java_lang_invoke_MethodType::ptype_slot_count(method_type);
|
||||
@ -697,7 +738,7 @@ intptr_t* CppInterpreter::calculate_unwind_sp(ZeroStack* stack,
|
||||
return stack->sp() + argument_slots;
|
||||
}
|
||||
|
||||
JRT_ENTRY(void, CppInterpreter::throw_exception(JavaThread* thread,
|
||||
JRT_ENTRY(void, ZeroInterpreter::throw_exception(JavaThread* thread,
|
||||
Symbol* name,
|
||||
char* message))
|
||||
THROW_MSG(name, message);
|
||||
@ -804,18 +845,27 @@ InterpreterFrame *InterpreterFrame::build(int size, TRAPS) {
|
||||
return (InterpreterFrame *) fp;
|
||||
}
|
||||
|
||||
address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) {
|
||||
address ZeroInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) {
|
||||
ShouldNotCallThis();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address CppInterpreter::deopt_entry(TosState state, int length) {
|
||||
address ZeroInterpreter::deopt_entry(TosState state, int length) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address ZeroInterpreter::remove_activation_preserving_args_entry() {
|
||||
// Do an uncommon trap type entry. c++ interpreter will know
|
||||
// to pop frame and preserve the args
|
||||
return Interpreter::deopt_entry(vtos, 0);
|
||||
}
|
||||
|
||||
address ZeroInterpreter::remove_activation_early_entry(TosState state) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Helper for figuring out if frames are interpreter frames
|
||||
|
||||
bool CppInterpreter::contains(address pc) {
|
||||
bool ZeroInterpreter::contains(address pc) {
|
||||
return false; // make frame::print_value_on work
|
||||
}
|
||||
#endif // CC_INTERP
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008, 2010, 2011 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
@ -27,7 +27,6 @@
|
||||
#include "asm/macroAssembler.inline.hpp"
|
||||
#include "compiler/disassembler.hpp"
|
||||
#include "interpreter/bytecodeHistogram.hpp"
|
||||
#include "interpreter/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/bytecodeStream.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "interpreter/interpreterRuntime.hpp"
|
||||
@ -121,7 +120,7 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(const methodHan
|
||||
return kind;
|
||||
}
|
||||
|
||||
#ifndef CC_INTERP
|
||||
#ifndef ZERO
|
||||
switch (m->intrinsic_id()) {
|
||||
// Use optimized stub code for CRC32 native methods.
|
||||
case vmIntrinsics::_updateCRC32 : return java_util_zip_CRC32_update;
|
||||
@ -136,7 +135,7 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(const methodHan
|
||||
case vmIntrinsics::_doubleToRawLongBits: return java_lang_Double_doubleToRawLongBits;
|
||||
default: break;
|
||||
}
|
||||
#endif // CC_INTERP
|
||||
#endif // ZERO
|
||||
|
||||
// Native method?
|
||||
// Note: This test must come _before_ the test for intrinsic
|
||||
@ -189,7 +188,7 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(const methodHan
|
||||
// Accessor method?
|
||||
if (m->is_getter()) {
|
||||
// TODO: We should have used ::is_accessor above, but fast accessors in Zero expect only getters.
|
||||
// See CppInterpreter::accessor_entry in cppInterpreter_zero.cpp. This should be fixed in Zero,
|
||||
// See ZeroInterpreter::accessor_entry in zeroInterpreter_zero.cpp. This should be fixed in Zero,
|
||||
// then the call above updated to ::is_accessor
|
||||
assert(m->size_of_parameters() == 1, "fast code for accessors assumes parameter size = 1");
|
||||
return accessor;
|
||||
|
@ -39,21 +39,19 @@
|
||||
// an assembly language version (aka template interpreter) and a high level language version
|
||||
// (aka c++ interpreter). Th division of labor is as follows:
|
||||
|
||||
// Template Interpreter C++ Interpreter Functionality
|
||||
// Template Interpreter Zero Interpreter Functionality
|
||||
//
|
||||
// templateTable* bytecodeInterpreter* actual interpretation of bytecodes
|
||||
//
|
||||
// templateInterpreter* cppInterpreter* generation of assembly code that creates
|
||||
// templateInterpreter* zeroInterpreter* generation of assembly code that creates
|
||||
// and manages interpreter runtime frames.
|
||||
// Also code for populating interpreter
|
||||
// frames created during deoptimization.
|
||||
//
|
||||
|
||||
class InterpreterMacroAssembler;
|
||||
|
||||
class AbstractInterpreter: AllStatic {
|
||||
friend class VMStructs;
|
||||
friend class CppInterpreterGenerator;
|
||||
friend class ZeroInterpreterGenerator;
|
||||
friend class TemplateInterpreterGenerator;
|
||||
public:
|
||||
enum MethodKind {
|
||||
|
@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* 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 "interpreter/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/cppInterpreterGenerator.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "interpreter/interpreterRuntime.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "runtime/timerTrace.hpp"
|
||||
|
||||
#ifdef CC_INTERP
|
||||
|
||||
#ifdef ZERO
|
||||
# include "entry_zero.hpp"
|
||||
#else
|
||||
#error "Only Zero CppInterpreter is supported"
|
||||
#endif
|
||||
|
||||
void CppInterpreter::initialize_stub() {
|
||||
if (_code != NULL) return;
|
||||
|
||||
// generate interpreter
|
||||
int code_size = InterpreterCodeSize;
|
||||
NOT_PRODUCT(code_size *= 4;) // debug uses extra interpreter code space
|
||||
_code = new StubQueue(new InterpreterCodeletInterface, code_size, NULL,
|
||||
"Interpreter");
|
||||
}
|
||||
|
||||
void CppInterpreter::initialize_code() {
|
||||
AbstractInterpreter::initialize();
|
||||
|
||||
// generate interpreter
|
||||
{ ResourceMark rm;
|
||||
TraceTime timer("Interpreter generation", TRACETIME_LOG(Info, startuptime));
|
||||
CppInterpreterGenerator g(_code);
|
||||
if (PrintInterpreter) print();
|
||||
}
|
||||
|
||||
// Allow c++ interpreter to do one initialization now that switches are set, etc.
|
||||
BytecodeInterpreter start_msg(BytecodeInterpreter::initialize);
|
||||
if (JvmtiExport::can_post_interpreter_events())
|
||||
BytecodeInterpreter::runWithChecks(&start_msg);
|
||||
else
|
||||
BytecodeInterpreter::run(&start_msg);
|
||||
}
|
||||
|
||||
void CppInterpreter::invoke_method(Method* method, address entry_point, TRAPS) {
|
||||
((ZeroEntry *) entry_point)->invoke(method, THREAD);
|
||||
}
|
||||
|
||||
void CppInterpreter::invoke_osr(Method* method,
|
||||
address entry_point,
|
||||
address osr_buf,
|
||||
TRAPS) {
|
||||
((ZeroEntry *) entry_point)->invoke_osr(method, osr_buf, THREAD);
|
||||
}
|
||||
|
||||
|
||||
|
||||
InterpreterCodelet* CppInterpreter::codelet_containing(address pc) {
|
||||
// FIXME: I'm pretty sure _code is null and this is never called, which is why it's copied.
|
||||
return (InterpreterCodelet*)_code->stub_containing(pc);
|
||||
}
|
||||
|
||||
#endif // CC_INTERP
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,7 +27,6 @@
|
||||
#include "asm/macroAssembler.inline.hpp"
|
||||
#include "compiler/disassembler.hpp"
|
||||
#include "interpreter/bytecodeHistogram.hpp"
|
||||
#include "interpreter/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "interpreter/interpreterRuntime.hpp"
|
||||
#include "interpreter/interp_masm.hpp"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,8 +26,9 @@
|
||||
#define SHARE_INTERPRETER_INTERPRETER_HPP
|
||||
|
||||
#include "code/stubs.hpp"
|
||||
#include "interpreter/cppInterpreter.hpp"
|
||||
#include "interpreter/interp_masm.hpp"
|
||||
#include "interpreter/templateInterpreter.hpp"
|
||||
#include "interpreter/zero/zeroInterpreter.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "utilities/align.hpp"
|
||||
|
||||
@ -115,8 +116,8 @@ class CodeletMark: ResourceMark {
|
||||
};
|
||||
|
||||
// Wrapper typedef to use the name Interpreter to mean either
|
||||
// the c++ interpreter or the template interpreter.
|
||||
// the Zero interpreter or the template interpreter.
|
||||
|
||||
typedef CC_INTERP_ONLY(CppInterpreter) NOT_CC_INTERP(TemplateInterpreter) Interpreter;
|
||||
typedef ZERO_ONLY(ZeroInterpreter) NOT_ZERO(TemplateInterpreter) Interpreter;
|
||||
|
||||
#endif // SHARE_INTERPRETER_INTERPRETER_HPP
|
||||
|
@ -353,28 +353,6 @@ void InterpreterRuntime::note_trap(JavaThread* thread, int reason, TRAPS) {
|
||||
note_trap_inner(thread, reason, trap_method, trap_bci, THREAD);
|
||||
}
|
||||
|
||||
#ifdef CC_INTERP
|
||||
// As legacy note_trap, but we have more arguments.
|
||||
JRT_ENTRY(void, InterpreterRuntime::note_trap(JavaThread* thread, int reason, Method *method, int trap_bci))
|
||||
methodHandle trap_method(thread, method);
|
||||
note_trap_inner(thread, reason, trap_method, trap_bci, THREAD);
|
||||
JRT_END
|
||||
|
||||
// Class Deoptimization is not visible in BytecodeInterpreter, so we need a wrapper
|
||||
// for each exception.
|
||||
void InterpreterRuntime::note_nullCheck_trap(JavaThread* thread, Method *method, int trap_bci)
|
||||
{ if (ProfileTraps) note_trap(thread, Deoptimization::Reason_null_check, method, trap_bci); }
|
||||
void InterpreterRuntime::note_div0Check_trap(JavaThread* thread, Method *method, int trap_bci)
|
||||
{ if (ProfileTraps) note_trap(thread, Deoptimization::Reason_div0_check, method, trap_bci); }
|
||||
void InterpreterRuntime::note_rangeCheck_trap(JavaThread* thread, Method *method, int trap_bci)
|
||||
{ if (ProfileTraps) note_trap(thread, Deoptimization::Reason_range_check, method, trap_bci); }
|
||||
void InterpreterRuntime::note_classCheck_trap(JavaThread* thread, Method *method, int trap_bci)
|
||||
{ if (ProfileTraps) note_trap(thread, Deoptimization::Reason_class_check, method, trap_bci); }
|
||||
void InterpreterRuntime::note_arrayCheck_trap(JavaThread* thread, Method *method, int trap_bci)
|
||||
{ if (ProfileTraps) note_trap(thread, Deoptimization::Reason_array_check, method, trap_bci); }
|
||||
#endif // CC_INTERP
|
||||
|
||||
|
||||
static Handle get_preinitialized_exception(Klass* k, TRAPS) {
|
||||
// get klass
|
||||
InstanceKlass* klass = InstanceKlass::cast(k);
|
||||
@ -501,11 +479,7 @@ JRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea
|
||||
// during deoptimization so the interpreter needs to skip it when
|
||||
// the frame is popped.
|
||||
thread->set_do_not_unlock_if_synchronized(true);
|
||||
#ifdef CC_INTERP
|
||||
return (address) -1;
|
||||
#else
|
||||
return Interpreter::remove_activation_entry();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Need to do this check first since when _do_not_unlock_if_synchronized
|
||||
@ -516,11 +490,7 @@ JRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea
|
||||
ResourceMark rm;
|
||||
assert(current_bci == 0, "bci isn't zero for do_not_unlock_if_synchronized");
|
||||
thread->set_vm_result(exception);
|
||||
#ifdef CC_INTERP
|
||||
return (address) -1;
|
||||
#else
|
||||
return Interpreter::remove_activation_entry();
|
||||
#endif
|
||||
}
|
||||
|
||||
do {
|
||||
@ -590,19 +560,13 @@ JRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea
|
||||
JvmtiExport::post_exception_throw(thread, h_method(), last_frame.bcp(), h_exception());
|
||||
}
|
||||
|
||||
#ifdef CC_INTERP
|
||||
address continuation = (address)(intptr_t) handler_bci;
|
||||
#else
|
||||
address continuation = NULL;
|
||||
#endif
|
||||
address handler_pc = NULL;
|
||||
if (handler_bci < 0 || !thread->reguard_stack((address) &continuation)) {
|
||||
// Forward exception to callee (leaving bci/bcp untouched) because (a) no
|
||||
// handler in this method, or (b) after a stack overflow there is not yet
|
||||
// enough stack space available to reprotect the stack.
|
||||
#ifndef CC_INTERP
|
||||
continuation = Interpreter::remove_activation_entry();
|
||||
#endif
|
||||
#if COMPILER2_OR_JVMCI
|
||||
// Count this for compilation purposes
|
||||
h_method->interpreter_throwout_increment(THREAD);
|
||||
@ -610,11 +574,14 @@ JRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea
|
||||
} else {
|
||||
// handler in this method => change bci/bcp to handler bci/bcp and continue there
|
||||
handler_pc = h_method->code_base() + handler_bci;
|
||||
#ifndef CC_INTERP
|
||||
#ifndef ZERO
|
||||
set_bcp_and_mdp(handler_pc, thread);
|
||||
continuation = Interpreter::dispatch_table(vtos)[*handler_pc];
|
||||
#else
|
||||
continuation = (address)(intptr_t) handler_bci;
|
||||
#endif
|
||||
}
|
||||
|
||||
// notify debugger of an exception catch
|
||||
// (this is good for exceptions caught in native methods as well)
|
||||
if (JvmtiExport::can_post_on_exceptions()) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -46,10 +46,6 @@ class InterpreterRuntime: AllStatic {
|
||||
static void note_trap_inner(JavaThread* thread, int reason,
|
||||
const methodHandle& trap_method, int trap_bci, TRAPS);
|
||||
static void note_trap(JavaThread *thread, int reason, TRAPS);
|
||||
#ifdef CC_INTERP
|
||||
// Profile traps in C++ interpreter.
|
||||
static void note_trap(JavaThread* thread, int reason, Method *method, int trap_bci);
|
||||
#endif // CC_INTERP
|
||||
|
||||
// Inner work method for Interpreter's frequency counter overflow.
|
||||
static nmethod* frequency_counter_overflow_inner(JavaThread* thread, address branch_bcp);
|
||||
@ -92,17 +88,6 @@ class InterpreterRuntime: AllStatic {
|
||||
#endif
|
||||
static void throw_pending_exception(JavaThread* thread);
|
||||
|
||||
#ifdef CC_INTERP
|
||||
// Profile traps in C++ interpreter.
|
||||
static void note_nullCheck_trap (JavaThread* thread, Method *method, int trap_bci);
|
||||
static void note_div0Check_trap (JavaThread* thread, Method *method, int trap_bci);
|
||||
static void note_rangeCheck_trap(JavaThread* thread, Method *method, int trap_bci);
|
||||
static void note_classCheck_trap(JavaThread* thread, Method *method, int trap_bci);
|
||||
static void note_arrayCheck_trap(JavaThread* thread, Method *method, int trap_bci);
|
||||
// A dummy for macros that shall not profile traps.
|
||||
static void note_no_trap(JavaThread* thread, Method *method, int trap_bci) {}
|
||||
#endif // CC_INTERP
|
||||
|
||||
static void resolve_from_cache(JavaThread* thread, Bytecodes::Code bytecode);
|
||||
private:
|
||||
// Statics & fields
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -80,32 +80,3 @@ void InvocationCounter::print() {
|
||||
extract_count(counter), limit(),
|
||||
extract_carry(counter) ? "true" : "false");
|
||||
}
|
||||
|
||||
#ifdef CC_INTERP
|
||||
int InvocationCounter::InterpreterInvocationLimit;
|
||||
int InvocationCounter::InterpreterBackwardBranchLimit;
|
||||
#endif
|
||||
|
||||
void invocationCounter_init() {
|
||||
#ifdef CC_INTERP
|
||||
InvocationCounter::InterpreterInvocationLimit =
|
||||
CompileThreshold << InvocationCounter::count_shift;
|
||||
|
||||
// When methodData is collected, the backward branch limit is compared against a
|
||||
// methodData counter, rather than an InvocationCounter. In the former case, we
|
||||
// don't need the shift by number_of_noncount_bits, but we do need to adjust
|
||||
// the factor by which we scale the threshold.
|
||||
if (ProfileInterpreter) {
|
||||
InvocationCounter::InterpreterBackwardBranchLimit =
|
||||
(int)((int64_t)CompileThreshold
|
||||
* (OnStackReplacePercentage - InterpreterProfilePercentage) / 100);
|
||||
} else {
|
||||
InvocationCounter::InterpreterBackwardBranchLimit =
|
||||
(int)(((int64_t)CompileThreshold * OnStackReplacePercentage / 100)
|
||||
<< InvocationCounter::count_shift);
|
||||
}
|
||||
|
||||
assert(0 <= InvocationCounter::InterpreterBackwardBranchLimit,
|
||||
"OSR threshold should be non-negative");
|
||||
#endif
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -82,22 +82,6 @@ private:
|
||||
void set(uint count, uint carry);
|
||||
|
||||
public:
|
||||
#ifdef CC_INTERP
|
||||
static int InterpreterInvocationLimit; // CompileThreshold scaled for interpreter use
|
||||
static int InterpreterBackwardBranchLimit; // A separate threshold for on stack replacement
|
||||
|
||||
// Test counter using scaled limits like the asm interpreter would do rather than doing
|
||||
// the shifts to normalize the counter.
|
||||
// Checks sum of invocation_counter and backedge_counter as the template interpreter does.
|
||||
bool reached_InvocationLimit(InvocationCounter *back_edge_count) const {
|
||||
return (_counter & count_mask) + (back_edge_count->_counter & count_mask) >=
|
||||
(uint) InterpreterInvocationLimit;
|
||||
}
|
||||
bool reached_BackwardBranchLimit(InvocationCounter *back_edge_count) const {
|
||||
return (_counter & count_mask) + (back_edge_count->_counter & count_mask) >=
|
||||
(uint) InterpreterBackwardBranchLimit;
|
||||
}
|
||||
#endif // CC_INTERP
|
||||
|
||||
// Miscellaneous
|
||||
static ByteSize counter_offset() { return byte_offset_of(InvocationCounter, _counter); }
|
||||
|
@ -404,7 +404,7 @@ void Rewriter::scan_method(Thread* thread, Method* method, bool reverse, bool* i
|
||||
|
||||
switch (c) {
|
||||
case Bytecodes::_lookupswitch : {
|
||||
#ifndef CC_INTERP
|
||||
#ifndef ZERO
|
||||
Bytecode_lookupswitch bc(method, bcp);
|
||||
(*bcp) = (
|
||||
bc.number_of_pairs() < BinarySwitchThreshold
|
||||
@ -416,7 +416,7 @@ void Rewriter::scan_method(Thread* thread, Method* method, bool reverse, bool* i
|
||||
}
|
||||
case Bytecodes::_fast_linearswitch:
|
||||
case Bytecodes::_fast_binaryswitch: {
|
||||
#ifndef CC_INTERP
|
||||
#ifndef ZERO
|
||||
(*bcp) = Bytecodes::_lookupswitch;
|
||||
#endif
|
||||
break;
|
||||
|
@ -35,8 +35,6 @@
|
||||
#include "runtime/timerTrace.hpp"
|
||||
#include "utilities/copy.hpp"
|
||||
|
||||
#ifndef CC_INTERP
|
||||
|
||||
# define __ _masm->
|
||||
|
||||
void TemplateInterpreter::initialize_stub() {
|
||||
@ -369,5 +367,3 @@ bool TemplateInterpreter::bytecode_should_reexecute(Bytecodes::Code code) {
|
||||
InterpreterCodelet* TemplateInterpreter::codelet_containing(address pc) {
|
||||
return (InterpreterCodelet*)_code->stub_containing(pc);
|
||||
}
|
||||
|
||||
#endif // !CC_INTERP
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -31,7 +31,7 @@
|
||||
// This file contains the platform-independent parts
|
||||
// of the template interpreter and the template interpreter generator.
|
||||
|
||||
#ifndef CC_INTERP
|
||||
#ifndef ZERO
|
||||
|
||||
class InterpreterMacroAssembler;
|
||||
class InterpreterCodelet;
|
||||
@ -195,6 +195,6 @@ class TemplateInterpreter: public AbstractInterpreter {
|
||||
static int InterpreterCodeSize;
|
||||
};
|
||||
|
||||
#endif // !CC_INTERP
|
||||
#endif // !ZERO
|
||||
|
||||
#endif // SHARE_INTERPRETER_TEMPLATEINTERPRETER_HPP
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -32,8 +32,6 @@
|
||||
#include "interpreter/templateTable.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
|
||||
#ifndef CC_INTERP
|
||||
|
||||
#define __ Disassembler::hook<InterpreterMacroAssembler>(__FILE__, __LINE__, _masm)->
|
||||
|
||||
TemplateInterpreterGenerator::TemplateInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) {
|
||||
@ -485,4 +483,3 @@ address TemplateInterpreterGenerator::generate_method_entry(
|
||||
|
||||
return entry_point;
|
||||
}
|
||||
#endif // !CC_INTERP
|
||||
|
@ -28,7 +28,7 @@
|
||||
// This file contains the platform-independent parts
|
||||
// of the template interpreter generator.
|
||||
|
||||
#ifndef CC_INTERP
|
||||
#ifndef ZERO
|
||||
|
||||
class TemplateInterpreterGenerator: public AbstractInterpreterGenerator {
|
||||
protected:
|
||||
@ -123,6 +123,6 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator {
|
||||
TemplateInterpreterGenerator(StubQueue* _code);
|
||||
};
|
||||
|
||||
#endif // !CC_INTERP
|
||||
#endif // !ZERO
|
||||
|
||||
#endif // SHARE_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "interpreter/interp_masm.hpp"
|
||||
#include "interpreter/templateTable.hpp"
|
||||
|
||||
#ifdef CC_INTERP
|
||||
#ifdef ZERO
|
||||
|
||||
void templateTable_init() {
|
||||
}
|
||||
@ -505,4 +505,4 @@ void TemplateTable::initialize() {
|
||||
void TemplateTable::unimplemented_bc() {
|
||||
_masm->unimplemented( Bytecodes::name(_desc->bytecode()));
|
||||
}
|
||||
#endif /* !CC_INTERP */
|
||||
#endif /* !ZERO */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -30,7 +30,7 @@
|
||||
#include "runtime/frame.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
#ifndef CC_INTERP
|
||||
#ifndef ZERO
|
||||
// All the necessary definitions used for (bytecode) template generation. Instead of
|
||||
// spreading the implementation functionality for each bytecode in the interpreter
|
||||
// and the snippet generator, a template is assigned to each bytecode which can be
|
||||
@ -351,6 +351,6 @@ class TemplateTable: AllStatic {
|
||||
#include CPU_HEADER(templateTable)
|
||||
|
||||
};
|
||||
#endif /* !CC_INTERP */
|
||||
#endif /* !ZERO */
|
||||
|
||||
#endif // SHARE_INTERPRETER_TEMPLATETABLE_HPP
|
||||
|
@ -27,9 +27,8 @@
|
||||
#include "gc/shared/collectedHeap.hpp"
|
||||
#include "gc/shared/threadLocalAllocBuffer.inline.hpp"
|
||||
#include "interpreter/bytecodeHistogram.hpp"
|
||||
#include "interpreter/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/bytecodeInterpreter.inline.hpp"
|
||||
#include "interpreter/bytecodeInterpreterProfiling.hpp"
|
||||
#include "interpreter/zero/bytecodeInterpreter.inline.hpp"
|
||||
#include "interpreter/zero/bytecodeInterpreterProfiling.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "interpreter/interpreterRuntime.hpp"
|
||||
#include "logging/log.hpp"
|
||||
@ -56,7 +55,6 @@
|
||||
#include "utilities/exceptions.hpp"
|
||||
|
||||
// no precompiled headers
|
||||
#ifdef CC_INTERP
|
||||
|
||||
/*
|
||||
* USELABELS - If using GCC, then use labels for the opcode dispatching
|
||||
@ -117,11 +115,10 @@
|
||||
* is no entry point to do the transition to vm so we just
|
||||
* do it by hand here.
|
||||
*/
|
||||
#define VM_JAVA_ERROR_NO_JUMP(name, msg, note_a_trap) \
|
||||
#define VM_JAVA_ERROR_NO_JUMP(name, msg) \
|
||||
DECACHE_STATE(); \
|
||||
SET_LAST_JAVA_FRAME(); \
|
||||
{ \
|
||||
InterpreterRuntime::note_a_trap(THREAD, istate->method(), BCI()); \
|
||||
ThreadInVMfromJava trans(THREAD); \
|
||||
Exceptions::_throw_msg(THREAD, __FILE__, __LINE__, name, msg); \
|
||||
} \
|
||||
@ -129,8 +126,8 @@
|
||||
CACHE_STATE();
|
||||
|
||||
// Normal throw of a java error.
|
||||
#define VM_JAVA_ERROR(name, msg, note_a_trap) \
|
||||
VM_JAVA_ERROR_NO_JUMP(name, msg, note_a_trap) \
|
||||
#define VM_JAVA_ERROR(name, msg) \
|
||||
VM_JAVA_ERROR_NO_JUMP(name, msg) \
|
||||
goto handle_exception;
|
||||
|
||||
#ifdef PRODUCT
|
||||
@ -173,7 +170,7 @@
|
||||
pc); \
|
||||
RESET_LAST_JAVA_FRAME(); \
|
||||
CACHE_STATE(); \
|
||||
if (THREAD->pop_frame_pending() && \
|
||||
if (THREAD->has_pending_popframe() && \
|
||||
!THREAD->pop_frame_in_process()) { \
|
||||
goto handle_Pop_Frame; \
|
||||
} \
|
||||
@ -289,66 +286,8 @@
|
||||
|
||||
|
||||
#define METHOD istate->method()
|
||||
#define GET_METHOD_COUNTERS(res) \
|
||||
res = METHOD->method_counters(); \
|
||||
if (res == NULL) { \
|
||||
CALL_VM(res = InterpreterRuntime::build_method_counters(THREAD, METHOD), handle_exception); \
|
||||
}
|
||||
|
||||
#define OSR_REQUEST(res, branch_pc) \
|
||||
CALL_VM(res=InterpreterRuntime::frequency_counter_overflow(THREAD, branch_pc), handle_exception);
|
||||
/*
|
||||
* For those opcodes that need to have a GC point on a backwards branch
|
||||
*/
|
||||
|
||||
// Backedge counting is kind of strange. The asm interpreter will increment
|
||||
// the backedge counter as a separate counter but it does it's comparisons
|
||||
// to the sum (scaled) of invocation counter and backedge count to make
|
||||
// a decision. Seems kind of odd to sum them together like that
|
||||
|
||||
// skip is delta from current bcp/bci for target, branch_pc is pre-branch bcp
|
||||
|
||||
|
||||
#define DO_BACKEDGE_CHECKS(skip, branch_pc) \
|
||||
if ((skip) <= 0) { \
|
||||
MethodCounters* mcs; \
|
||||
GET_METHOD_COUNTERS(mcs); \
|
||||
if (UseLoopCounter) { \
|
||||
bool do_OSR = UseOnStackReplacement; \
|
||||
mcs->backedge_counter()->increment(); \
|
||||
if (ProfileInterpreter) { \
|
||||
BI_PROFILE_GET_OR_CREATE_METHOD_DATA(handle_exception); \
|
||||
/* Check for overflow against MDO count. */ \
|
||||
do_OSR = do_OSR \
|
||||
&& (mdo_last_branch_taken_count >= (uint)InvocationCounter::InterpreterBackwardBranchLimit)\
|
||||
/* When ProfileInterpreter is on, the backedge_count comes */ \
|
||||
/* from the methodDataOop, which value does not get reset on */ \
|
||||
/* the call to frequency_counter_overflow(). To avoid */ \
|
||||
/* excessive calls to the overflow routine while the method is */ \
|
||||
/* being compiled, add a second test to make sure the overflow */ \
|
||||
/* function is called only once every overflow_frequency. */ \
|
||||
&& (!(mdo_last_branch_taken_count & 1023)); \
|
||||
} else { \
|
||||
/* check for overflow of backedge counter */ \
|
||||
do_OSR = do_OSR \
|
||||
&& mcs->invocation_counter()->reached_InvocationLimit(mcs->backedge_counter()); \
|
||||
} \
|
||||
if (do_OSR) { \
|
||||
nmethod* osr_nmethod; \
|
||||
OSR_REQUEST(osr_nmethod, branch_pc); \
|
||||
if (osr_nmethod != NULL && osr_nmethod->is_in_use()) { \
|
||||
intptr_t* buf; \
|
||||
/* Call OSR migration with last java frame only, no checks. */ \
|
||||
CALL_VM_NAKED_LJF(buf=SharedRuntime::OSR_migration_begin(THREAD)); \
|
||||
istate->set_msg(do_osr); \
|
||||
istate->set_osr_buf((address)buf); \
|
||||
istate->set_osr_entry(osr_nmethod->osr_entry()); \
|
||||
return; \
|
||||
} \
|
||||
} \
|
||||
} /* UseCompiler ... */ \
|
||||
SAFEPOINT; \
|
||||
}
|
||||
#define GET_METHOD_COUNTERS(res)
|
||||
#define DO_BACKEDGE_CHECKS(skip, branch_pc)
|
||||
|
||||
/*
|
||||
* For those opcodes that need to have a GC point on a backwards branch
|
||||
@ -391,7 +330,7 @@
|
||||
#undef CHECK_NULL
|
||||
#define CHECK_NULL(obj_) \
|
||||
if ((obj_) == NULL) { \
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_NullPointerException(), NULL, note_nullCheck_trap); \
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_NullPointerException(), NULL); \
|
||||
} \
|
||||
VERIFY_OOP(obj_)
|
||||
|
||||
@ -426,7 +365,7 @@
|
||||
// Call the VM. Don't check for pending exceptions.
|
||||
#define CALL_VM_NOCHECK(func) \
|
||||
CALL_VM_NAKED_LJF(func) \
|
||||
if (THREAD->pop_frame_pending() && \
|
||||
if (THREAD->has_pending_popframe() && \
|
||||
!THREAD->pop_frame_in_process()) { \
|
||||
goto handle_Pop_Frame; \
|
||||
} \
|
||||
@ -607,12 +546,7 @@ BytecodeInterpreter::run(interpreterState istate) {
|
||||
topOfStack < istate->stack_base(),
|
||||
"Stack top out of range");
|
||||
|
||||
#ifdef CC_INTERP_PROFILE
|
||||
// MethodData's last branch taken count.
|
||||
uint mdo_last_branch_taken_count = 0;
|
||||
#else
|
||||
const uint mdo_last_branch_taken_count = 0;
|
||||
#endif
|
||||
|
||||
switch (istate->msg()) {
|
||||
case initialize: {
|
||||
@ -629,18 +563,6 @@ BytecodeInterpreter::run(interpreterState istate) {
|
||||
// count invocations
|
||||
assert(initialized, "Interpreter not initialized");
|
||||
if (_compiling) {
|
||||
MethodCounters* mcs;
|
||||
GET_METHOD_COUNTERS(mcs);
|
||||
#if COMPILER2_OR_JVMCI
|
||||
if (ProfileInterpreter) {
|
||||
METHOD->increment_interpreter_invocation_count(THREAD);
|
||||
}
|
||||
#endif
|
||||
mcs->invocation_counter()->increment();
|
||||
if (mcs->invocation_counter()->reached_InvocationLimit(mcs->backedge_counter())) {
|
||||
CALL_VM((void)InterpreterRuntime::frequency_counter_overflow(THREAD, NULL), handle_exception);
|
||||
// We no longer retry on a counter overflow.
|
||||
}
|
||||
// Get or create profile data. Check for pending (async) exceptions.
|
||||
BI_PROFILE_GET_OR_CREATE_METHOD_DATA(handle_exception);
|
||||
SAFEPOINT;
|
||||
@ -783,7 +705,7 @@ BytecodeInterpreter::run(interpreterState istate) {
|
||||
os::breakpoint();
|
||||
}
|
||||
// returned from a java call, continue executing.
|
||||
if (THREAD->pop_frame_pending() && !THREAD->pop_frame_in_process()) {
|
||||
if (THREAD->has_pending_popframe() && !THREAD->pop_frame_in_process()) {
|
||||
goto handle_Pop_Frame;
|
||||
}
|
||||
if (THREAD->jvmti_thread_state() &&
|
||||
@ -1142,7 +1064,7 @@ run:
|
||||
pc = istate->method()->code_base() + (intptr_t)(LOCALS_ADDR(reg));
|
||||
UPDATE_PC_AND_CONTINUE(0);
|
||||
default:
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_InternalError(), "undefined opcode", note_no_trap);
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_InternalError(), "undefined opcode");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1223,7 +1145,7 @@ run:
|
||||
CASE(_i##opcname): \
|
||||
if (test && (STACK_INT(-1) == 0)) { \
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_ArithmeticException(), \
|
||||
"/ by zero", note_div0Check_trap); \
|
||||
"/ by zero"); \
|
||||
} \
|
||||
SET_STACK_INT(VMint##opname(STACK_INT(-2), \
|
||||
STACK_INT(-1)), \
|
||||
@ -1235,7 +1157,7 @@ run:
|
||||
jlong l1 = STACK_LONG(-1); \
|
||||
if (VMlongEqz(l1)) { \
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_ArithmeticException(), \
|
||||
"/ by long zero", note_div0Check_trap); \
|
||||
"/ by long zero"); \
|
||||
} \
|
||||
} \
|
||||
/* First long at (-1,-2) next long at (-3,-4) */ \
|
||||
@ -1647,7 +1569,7 @@ run:
|
||||
if ((uint32_t)index >= (uint32_t)arrObj->length()) { \
|
||||
sprintf(message, "%d", index); \
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), \
|
||||
message, note_rangeCheck_trap); \
|
||||
message); \
|
||||
}
|
||||
|
||||
/* 32-bit loads. These handle conversion from < 32-bit types */
|
||||
@ -1730,7 +1652,7 @@ run:
|
||||
if (rhsKlass != elemKlass && !rhsKlass->is_subtype_of(elemKlass)) { // ebx->is...
|
||||
// Decrement counter if subtype check failed.
|
||||
BI_PROFILE_SUBTYPECHECK_FAILED(rhsKlass);
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_ArrayStoreException(), "", note_arrayCheck_trap);
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_ArrayStoreException(), "");
|
||||
}
|
||||
// Profile checkcast with null_seen and receiver.
|
||||
BI_PROFILE_UPDATE_CHECKCAST(/*null_seen=*/false, rhsKlass);
|
||||
@ -2155,7 +2077,6 @@ run:
|
||||
// Disable non-TLAB-based fast-path, because profiling requires that all
|
||||
// allocations go through InterpreterRuntime::_new() if THREAD->tlab().allocate
|
||||
// returns NULL.
|
||||
#ifndef CC_INTERP_PROFILE
|
||||
if (result == NULL) {
|
||||
need_zero = true;
|
||||
// Try allocate in shared eden
|
||||
@ -2169,7 +2090,6 @@ run:
|
||||
result = (oop) compare_to;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (result != NULL) {
|
||||
// Initialize object (if nonzero size and need) and then the header
|
||||
if (need_zero ) {
|
||||
@ -2254,7 +2174,7 @@ run:
|
||||
ResourceMark rm(THREAD);
|
||||
char* message = SharedRuntime::generate_class_cast_message(
|
||||
objKlass, klassOf);
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_ClassCastException(), message, note_classCheck_trap);
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_ClassCastException(), message);
|
||||
}
|
||||
// Profile checkcast with null_seen and receiver.
|
||||
BI_PROFILE_UPDATE_CHECKCAST(/*null_seen=*/false, objKlass);
|
||||
@ -2556,7 +2476,7 @@ run:
|
||||
jio_snprintf(buf, sizeof(buf), "Class %s does not implement the requested interface %s",
|
||||
recv_klass->external_name(),
|
||||
resolved_klass->external_name());
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_IncompatibleClassChangeError(), buf, note_no_trap);
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
|
||||
}
|
||||
callee = cache->f2_as_vfinal_method();
|
||||
}
|
||||
@ -2598,7 +2518,7 @@ run:
|
||||
// interface, and wasn't the same as when the caller was
|
||||
// compiled.
|
||||
if (scan->interface_klass() == NULL) {
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_IncompatibleClassChangeError(), "", note_no_trap);
|
||||
VM_JAVA_ERROR(vmSymbols::java_lang_IncompatibleClassChangeError(), "");
|
||||
}
|
||||
}
|
||||
|
||||
@ -2904,7 +2824,7 @@ run:
|
||||
istate->set_msg(popping_frame);
|
||||
// Clear pending so while the pop is in process
|
||||
// we don't start another one if a call_vm is done.
|
||||
THREAD->clr_pop_frame_pending();
|
||||
THREAD->clear_popframe_condition();
|
||||
// Let interpreter (only) see the we're in the process of popping a frame
|
||||
THREAD->set_pop_frame_in_process();
|
||||
|
||||
@ -3088,7 +3008,7 @@ run:
|
||||
oop rcvr = base->obj();
|
||||
if (rcvr == NULL) {
|
||||
if (!suppress_error) {
|
||||
VM_JAVA_ERROR_NO_JUMP(vmSymbols::java_lang_NullPointerException(), "", note_nullCheck_trap);
|
||||
VM_JAVA_ERROR_NO_JUMP(vmSymbols::java_lang_NullPointerException(), "");
|
||||
illegal_state_oop = Handle(THREAD, THREAD->pending_exception());
|
||||
THREAD->clear_pending_exception();
|
||||
}
|
||||
@ -3488,9 +3408,6 @@ BytecodeInterpreter::print() {
|
||||
tty->print_cr("stack_base: " INTPTR_FORMAT, (uintptr_t) this->_stack_base);
|
||||
tty->print_cr("stack_limit: " INTPTR_FORMAT, (uintptr_t) this->_stack_limit);
|
||||
tty->print_cr("monitor_base: " INTPTR_FORMAT, (uintptr_t) this->_monitor_base);
|
||||
#if !defined(ZERO) && defined(PPC)
|
||||
tty->print_cr("last_Java_fp: " INTPTR_FORMAT, (uintptr_t) this->_last_Java_fp);
|
||||
#endif // !ZERO
|
||||
tty->print_cr("self_link: " INTPTR_FORMAT, (uintptr_t) this->_self_link);
|
||||
}
|
||||
|
||||
@ -3502,4 +3419,3 @@ extern "C" {
|
||||
#endif // PRODUCT
|
||||
|
||||
#endif // JVMTI
|
||||
#endif // CC_INTERP
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -34,8 +34,6 @@
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
#ifdef CC_INTERP
|
||||
|
||||
// JavaStack Implementation
|
||||
#define MORE_STACK(count) \
|
||||
(topOfStack -= ((count) * Interpreter::stackElementWords))
|
||||
@ -79,7 +77,7 @@ union frame_manager_message {
|
||||
class BytecodeInterpreter : StackObj {
|
||||
friend class SharedRuntime;
|
||||
friend class AbstractInterpreterGenerator;
|
||||
friend class CppInterpreterGenerator;
|
||||
friend class ZeroInterpreterGenerator;
|
||||
friend class InterpreterMacroAssembler;
|
||||
friend class frame;
|
||||
friend class VMStructs;
|
||||
@ -573,15 +571,8 @@ static const char* C_msg(BytecodeInterpreter::messages msg);
|
||||
void print();
|
||||
#endif // PRODUCT
|
||||
|
||||
#ifdef ZERO
|
||||
# include "bytecodeInterpreter_zero.hpp"
|
||||
#else
|
||||
#error "Only Zero Bytecode Interpreter is supported"
|
||||
#endif
|
||||
|
||||
|
||||
}; // BytecodeInterpreter
|
||||
|
||||
#endif // CC_INTERP
|
||||
|
||||
#endif // SHARE_INTERPRETER_BYTECODEINTERPRETER_HPP
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -25,14 +25,12 @@
|
||||
#ifndef SHARE_INTERPRETER_BYTECODEINTERPRETER_INLINE_HPP
|
||||
#define SHARE_INTERPRETER_BYTECODEINTERPRETER_INLINE_HPP
|
||||
|
||||
#include "interpreter/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/zero/bytecodeInterpreter.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
// This file holds platform-independent bodies of inline functions for the C++ based interpreter
|
||||
|
||||
#ifdef CC_INTERP
|
||||
|
||||
#ifdef ASSERT
|
||||
#define VERIFY_OOP(o_) \
|
||||
if (VerifyOops) { \
|
||||
@ -43,12 +41,6 @@
|
||||
#define VERIFY_OOP(o)
|
||||
#endif
|
||||
|
||||
#ifdef ZERO
|
||||
# include "bytecodeInterpreter_zero.inline.hpp"
|
||||
#else
|
||||
#error "Only Zero Bytecode Interpreter is supported"
|
||||
#endif
|
||||
|
||||
#endif // CC_INTERP
|
||||
|
||||
#endif // SHARE_INTERPRETER_BYTECODEINTERPRETER_INLINE_HPP
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2014 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -30,8 +30,6 @@
|
||||
#ifndef SHARE_INTERPRETER_BYTECODEINTERPRETERPROFILING_HPP
|
||||
#define SHARE_INTERPRETER_BYTECODEINTERPRETERPROFILING_HPP
|
||||
|
||||
#ifdef CC_INTERP
|
||||
|
||||
// Empty dummy implementations if profiling code is switched off. //////////////
|
||||
|
||||
#define SET_MDX(mdx)
|
||||
@ -54,6 +52,4 @@
|
||||
#define BI_PROFILE_UPDATE_VIRTUALCALL(receiver)
|
||||
#define BI_PROFILE_UPDATE_SWITCH(switch_index)
|
||||
|
||||
#endif // CC_INTERP
|
||||
|
||||
#endif // SHARE_INTERPRETER_BYTECODEINTERPRETERPROFILING_HPP
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,7 @@
|
||||
<xsl:template match="processcode">
|
||||
<xsl:text>
|
||||
#define VM_JVMTI
|
||||
#include "interpreter/bytecodeInterpreter.cpp"
|
||||
#include "interpreter/zero/bytecodeInterpreter.cpp"
|
||||
</xsl:text>
|
||||
<xsl:text disable-output-escaping = "yes">
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -22,20 +22,20 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SHARE_INTERPRETER_CPPINTERPRETER_HPP
|
||||
#define SHARE_INTERPRETER_CPPINTERPRETER_HPP
|
||||
#ifndef SHARE_INTERPRETER_ZEROINTERPRETER_HPP
|
||||
#define SHARE_INTERPRETER_ZEROINTERPRETER_HPP
|
||||
|
||||
#include "interpreter/abstractInterpreter.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
#ifdef CC_INTERP
|
||||
#ifdef ZERO
|
||||
|
||||
class InterpreterCodelet;
|
||||
|
||||
// This file contains the platform-independent parts
|
||||
// of the c++ interpreter
|
||||
|
||||
class CppInterpreter: public AbstractInterpreter {
|
||||
class ZeroInterpreter: public AbstractInterpreter {
|
||||
friend class VMStructs;
|
||||
public:
|
||||
// Initialization/debugging
|
||||
@ -58,17 +58,23 @@ class CppInterpreter: public AbstractInterpreter {
|
||||
static address return_entry (TosState state, int length, Bytecodes::Code code);
|
||||
static address deopt_entry (TosState state, int length);
|
||||
|
||||
static address remove_activation_entry() { return (address)-1; }
|
||||
static address remove_activation_early_entry(TosState state);
|
||||
static address remove_activation_preserving_args_entry();
|
||||
|
||||
static void invoke_method(Method* method, address entry_point, TRAPS);
|
||||
static void invoke_osr(Method* method,
|
||||
address entry_point,
|
||||
address osr_buf,
|
||||
TRAPS);
|
||||
#ifdef ZERO
|
||||
# include "cppInterpreter_zero.hpp"
|
||||
#endif
|
||||
|
||||
static address throw_NullPointerException_entry() { return NULL; }
|
||||
static address throw_ArithmeticException_entry() { return NULL; }
|
||||
static address throw_StackOverflowError_entry() { return NULL; }
|
||||
|
||||
# include "zeroInterpreter_zero.hpp"
|
||||
};
|
||||
|
||||
#endif // CC_INTERP
|
||||
#endif // ZERO
|
||||
|
||||
#endif // SHARE_INTERPRETER_CPPINTERPRETER_HPP
|
||||
#endif // SHARE_INTERPRETER_ZEROINTERPRETER_HPP
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,18 +24,21 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "interpreter/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/cppInterpreterGenerator.hpp"
|
||||
#include "asm/assembler.hpp"
|
||||
#include "interpreter/bytecodeHistogram.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "interpreter/interpreterRuntime.hpp"
|
||||
#include "interpreter/zero/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/zero/zeroInterpreter.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "zeroInterpreterGenerator.hpp"
|
||||
|
||||
#ifdef CC_INTERP
|
||||
|
||||
CppInterpreterGenerator::CppInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) {
|
||||
ZeroInterpreterGenerator::ZeroInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) {
|
||||
generate_all();
|
||||
}
|
||||
|
||||
void CppInterpreterGenerator::generate_all() {
|
||||
void ZeroInterpreterGenerator::generate_all() {
|
||||
{ CodeletMark cm(_masm, "slow signature handler");
|
||||
AbstractInterpreter::_slow_signature_handler = generate_slow_signature_handler();
|
||||
}
|
||||
@ -73,7 +77,7 @@ void CppInterpreterGenerator::generate_all() {
|
||||
}
|
||||
|
||||
// Generate method entries
|
||||
address CppInterpreterGenerator::generate_method_entry(
|
||||
address ZeroInterpreterGenerator::generate_method_entry(
|
||||
AbstractInterpreter::MethodKind kind) {
|
||||
// determine code generation flags
|
||||
bool native = false;
|
||||
@ -126,4 +130,63 @@ address CppInterpreterGenerator::generate_method_entry(
|
||||
|
||||
return entry_point;
|
||||
}
|
||||
#endif // CC_INTERP
|
||||
|
||||
address ZeroInterpreterGenerator::generate_slow_signature_handler() {
|
||||
_masm->advance(1);
|
||||
return (address) InterpreterRuntime::slow_signature_handler;
|
||||
}
|
||||
|
||||
address ZeroInterpreterGenerator::generate_math_entry(
|
||||
AbstractInterpreter::MethodKind kind) {
|
||||
if (!InlineIntrinsics)
|
||||
return NULL;
|
||||
|
||||
Unimplemented();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address ZeroInterpreterGenerator::generate_abstract_entry() {
|
||||
return generate_entry((address) ShouldNotCallThisEntry());
|
||||
}
|
||||
|
||||
address ZeroInterpreterGenerator::generate_empty_entry() {
|
||||
if (!UseFastEmptyMethods)
|
||||
return NULL;
|
||||
|
||||
return generate_entry((address) ZeroInterpreter::empty_entry);
|
||||
}
|
||||
|
||||
address ZeroInterpreterGenerator::generate_accessor_entry() {
|
||||
if (!UseFastAccessorMethods)
|
||||
return NULL;
|
||||
|
||||
return generate_entry((address) ZeroInterpreter::accessor_entry);
|
||||
}
|
||||
|
||||
address ZeroInterpreterGenerator::generate_Reference_get_entry(void) {
|
||||
#if INCLUDE_G1GC
|
||||
if (UseG1GC) {
|
||||
// We need to generate have a routine that generates code to:
|
||||
// * load the value in the referent field
|
||||
// * passes that value to the pre-barrier.
|
||||
//
|
||||
// In the case of G1 this will record the value of the
|
||||
// referent in an SATB buffer if marking is active.
|
||||
// This will cause concurrent marking to mark the referent
|
||||
// field as live.
|
||||
Unimplemented();
|
||||
}
|
||||
#endif // INCLUDE_G1GC
|
||||
|
||||
// If G1 is not enabled then attempt to go through the normal entry point
|
||||
// Reference.get could be instrumented by jvmti
|
||||
return NULL;
|
||||
}
|
||||
|
||||
address ZeroInterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
return generate_entry((address) ZeroInterpreter::native_entry);
|
||||
}
|
||||
|
||||
address ZeroInterpreterGenerator::generate_normal_entry(bool synchronized) {
|
||||
return generate_entry((address) ZeroInterpreter::normal_entry);
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,15 +26,12 @@
|
||||
#define SHARE_INTERPRETER_CPPINTERPRETERGENERATOR_HPP
|
||||
|
||||
// This file contains the platform-independent parts
|
||||
// of the template interpreter generator.
|
||||
// of the Zero interpreter generator.
|
||||
|
||||
#ifdef CC_INTERP
|
||||
#ifdef ZERO
|
||||
# include "entry_zero.hpp"
|
||||
# include "interpreter/interp_masm.hpp"
|
||||
#endif
|
||||
// # include "interpreter/interp_masm.hpp"
|
||||
|
||||
class CppInterpreterGenerator: public AbstractInterpreterGenerator {
|
||||
class ZeroInterpreterGenerator: public AbstractInterpreterGenerator {
|
||||
|
||||
private:
|
||||
void generate_all();
|
||||
@ -51,9 +48,8 @@ class CppInterpreterGenerator: public AbstractInterpreterGenerator {
|
||||
address generate_Reference_get_entry();
|
||||
|
||||
public:
|
||||
CppInterpreterGenerator(StubQueue* _code);
|
||||
ZeroInterpreterGenerator(StubQueue* _code);
|
||||
|
||||
#ifdef ZERO
|
||||
protected:
|
||||
MacroAssembler* assembler() const {
|
||||
return _masm;
|
||||
@ -71,8 +67,6 @@ class CppInterpreterGenerator: public AbstractInterpreterGenerator {
|
||||
address generate_entry(address entry_point) {
|
||||
return generate_entry_impl(assembler(), entry_point);
|
||||
}
|
||||
#endif // ZERO
|
||||
};
|
||||
|
||||
#endif // CC_INTERP
|
||||
#endif // SHARE_INTERPRETER_CPPINTERPRETERGENERATOR_HPP
|
@ -36,7 +36,6 @@
|
||||
# include "interpreter/interpreter.hpp"
|
||||
#endif
|
||||
|
||||
|
||||
class MacroAssembler;
|
||||
class Label;
|
||||
|
||||
|
@ -4143,13 +4143,13 @@ jint Arguments::apply_ergo() {
|
||||
UseBiasedLocking = false;
|
||||
}
|
||||
|
||||
#ifdef CC_INTERP
|
||||
#ifdef ZERO
|
||||
// Clear flags not supported on zero.
|
||||
FLAG_SET_DEFAULT(ProfileInterpreter, false);
|
||||
FLAG_SET_DEFAULT(UseBiasedLocking, false);
|
||||
LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedOops, false));
|
||||
LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedClassPointers, false));
|
||||
#endif // CC_INTERP
|
||||
#endif // ZERO
|
||||
|
||||
if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
|
||||
warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
|
||||
|
@ -596,16 +596,9 @@ void Deoptimization::cleanup_deopt_info(JavaThread *thread,
|
||||
|
||||
|
||||
if (JvmtiExport::can_pop_frame()) {
|
||||
#ifndef CC_INTERP
|
||||
// Regardless of whether we entered this routine with the pending
|
||||
// popframe condition bit set, we should always clear it now
|
||||
thread->clear_popframe_condition();
|
||||
#else
|
||||
// C++ interpreter will clear has_pending_popframe when it enters
|
||||
// with method_resume. For deopt_resume2 we clear it now.
|
||||
if (thread->popframe_forcing_deopt_reexecution())
|
||||
thread->clear_popframe_condition();
|
||||
#endif /* CC_INTERP */
|
||||
}
|
||||
|
||||
// unpack_frames() is called at the end of the deoptimization handler
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -280,11 +280,9 @@ class frame {
|
||||
|
||||
intptr_t* interpreter_frame_sender_sp() const;
|
||||
|
||||
#ifndef CC_INTERP
|
||||
// template based interpreter deoptimization support
|
||||
void set_interpreter_frame_sender_sp(intptr_t* sender_sp);
|
||||
void interpreter_frame_set_monitor_end(BasicObjectLock* value);
|
||||
#endif // CC_INTERP
|
||||
|
||||
// Address of the temp oop in the frame. Needed as GC root.
|
||||
oop* interpreter_frame_temp_oop_addr() const;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,8 +26,6 @@
|
||||
#define SHARE_RUNTIME_FRAME_INLINE_HPP
|
||||
|
||||
#include "code/compiledMethod.inline.hpp"
|
||||
#include "interpreter/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/bytecodeInterpreter.inline.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "runtime/frame.hpp"
|
||||
|
@ -68,7 +68,6 @@ jint universe_init(); // depends on codeCache_init and stubRoutines_ini
|
||||
void gc_barrier_stubs_init();
|
||||
void interpreter_init_stub(); // before any methods loaded
|
||||
void interpreter_init_code(); // after methods loaded, but before they are linked
|
||||
void invocationCounter_init(); // after methods loaded, but before they are linked
|
||||
void accessFlags_init();
|
||||
void InterfaceSupport_init();
|
||||
void universe2_init(); // dependent on codeCache_init and stubRoutines_init, loads primordial classes
|
||||
@ -128,7 +127,6 @@ jint init_globals() {
|
||||
universe2_init(); // dependent on codeCache_init and stubRoutines_init1
|
||||
javaClasses_init();// must happen after vtable initialization, before referenceProcessor_init
|
||||
interpreter_init_code(); // after javaClasses_init and before any method gets linked
|
||||
invocationCounter_init(); // after javaClasses_init and before any method gets linked
|
||||
referenceProcessor_init();
|
||||
jni_handles_init();
|
||||
#if INCLUDE_VM_STRUCTS
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -132,7 +132,7 @@ class JNIHandles : AllStatic {
|
||||
|
||||
class JNIHandleBlock : public CHeapObj<mtInternal> {
|
||||
friend class VMStructs;
|
||||
friend class CppInterpreter;
|
||||
friend class ZeroInterpreter;
|
||||
|
||||
private:
|
||||
enum SomeConstants {
|
||||
|
@ -771,17 +771,12 @@ address SharedRuntime::continuation_for_implicit_exception(JavaThread* thread,
|
||||
address target_pc = NULL;
|
||||
|
||||
if (Interpreter::contains(pc)) {
|
||||
#ifdef CC_INTERP
|
||||
// C++ interpreter doesn't throw implicit exceptions
|
||||
ShouldNotReachHere();
|
||||
#else
|
||||
switch (exception_kind) {
|
||||
case IMPLICIT_NULL: return Interpreter::throw_NullPointerException_entry();
|
||||
case IMPLICIT_DIVIDE_BY_ZERO: return Interpreter::throw_ArithmeticException_entry();
|
||||
case STACK_OVERFLOW: return Interpreter::throw_StackOverflowError_entry();
|
||||
default: ShouldNotReachHere();
|
||||
}
|
||||
#endif // !CC_INTERP
|
||||
} else {
|
||||
switch (exception_kind) {
|
||||
case STACK_OVERFLOW: {
|
||||
|
@ -50,9 +50,6 @@
|
||||
#include "utilities/exceptions.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
#ifdef ZERO
|
||||
# include "stack_zero.hpp"
|
||||
#endif
|
||||
#if INCLUDE_JFR
|
||||
#include "jfr/support/jfrThreadExtension.hpp"
|
||||
#endif
|
||||
@ -2001,13 +1998,10 @@ class JavaThread: public Thread {
|
||||
bool has_pending_popframe() { return (popframe_condition() & popframe_pending_bit) != 0; }
|
||||
bool popframe_forcing_deopt_reexecution() { return (popframe_condition() & popframe_force_deopt_reexecution_bit) != 0; }
|
||||
void clear_popframe_forcing_deopt_reexecution() { _popframe_condition &= ~popframe_force_deopt_reexecution_bit; }
|
||||
#ifdef CC_INTERP
|
||||
bool pop_frame_pending(void) { return ((_popframe_condition & popframe_pending_bit) != 0); }
|
||||
void clr_pop_frame_pending(void) { _popframe_condition = popframe_inactive; }
|
||||
|
||||
bool pop_frame_in_process(void) { return ((_popframe_condition & popframe_processing_bit) != 0); }
|
||||
void set_pop_frame_in_process(void) { _popframe_condition |= popframe_processing_bit; }
|
||||
void clr_pop_frame_in_process(void) { _popframe_condition &= ~popframe_processing_bit; }
|
||||
#endif
|
||||
|
||||
int frames_to_pop_failed_realloc() const { return _frames_to_pop_failed_realloc; }
|
||||
void set_frames_to_pop_failed_realloc(int nb) { _frames_to_pop_failed_realloc = nb; }
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -225,14 +225,7 @@ void vframeArrayElement::unpack_on_stack(int caller_actual_parameters,
|
||||
(thread->has_pending_popframe() || thread->popframe_forcing_deopt_reexecution())) {
|
||||
if (thread->has_pending_popframe()) {
|
||||
// Pop top frame after deoptimization
|
||||
#ifndef CC_INTERP
|
||||
pc = Interpreter::remove_activation_preserving_args_entry();
|
||||
#else
|
||||
// Do an uncommon trap type entry. c++ interpreter will know
|
||||
// to pop frame and preserve the args
|
||||
pc = Interpreter::deopt_entry(vtos, 0);
|
||||
use_next_mdp = false;
|
||||
#endif
|
||||
} else {
|
||||
// Reexecute invoke in top frame
|
||||
pc = Interpreter::deopt_entry(vtos, 0);
|
||||
@ -242,11 +235,10 @@ void vframeArrayElement::unpack_on_stack(int caller_actual_parameters,
|
||||
// Deoptimization::fetch_unroll_info_helper
|
||||
popframe_preserved_args_size_in_words = in_words(thread->popframe_preserved_args_size_in_words());
|
||||
}
|
||||
} else if (!realloc_failure_exception && JvmtiExport::can_force_early_return() && state != NULL && state->is_earlyret_pending()) {
|
||||
} else if (!realloc_failure_exception && JvmtiExport::can_force_early_return() && state != NULL &&
|
||||
state->is_earlyret_pending()) {
|
||||
// Force early return from top frame after deoptimization
|
||||
#ifndef CC_INTERP
|
||||
pc = Interpreter::remove_activation_early_entry(state->earlyret_tos());
|
||||
#endif
|
||||
} else {
|
||||
if (realloc_failure_exception && JvmtiExport::can_force_early_return() && state != NULL && state->is_earlyret_pending()) {
|
||||
state->clr_earlyret_pending();
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include "compiler/compileBroker.hpp"
|
||||
#include "compiler/oopMap.hpp"
|
||||
#include "gc/shared/vmStructs_gc.hpp"
|
||||
#include "interpreter/bytecodeInterpreter.hpp"
|
||||
#include "interpreter/bytecodes.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
|
@ -367,14 +367,6 @@
|
||||
#define NOT_CHECK_UNHANDLED_OOPS(code) code
|
||||
#endif // CHECK_UNHANDLED_OOPS
|
||||
|
||||
#ifdef CC_INTERP
|
||||
#define CC_INTERP_ONLY(code) code
|
||||
#define NOT_CC_INTERP(code)
|
||||
#else
|
||||
#define CC_INTERP_ONLY(code)
|
||||
#define NOT_CC_INTERP(code) code
|
||||
#endif // CC_INTERP
|
||||
|
||||
#ifdef ASSERT
|
||||
#define DEBUG_ONLY(code) code
|
||||
#define NOT_DEBUG(code)
|
||||
@ -450,9 +442,11 @@
|
||||
#if defined(ZERO)
|
||||
#define ZERO_ONLY(code) code
|
||||
#define NOT_ZERO(code)
|
||||
#define NOT_ZERO_RETURN {}
|
||||
#else
|
||||
#define ZERO_ONLY(code)
|
||||
#define NOT_ZERO(code) code
|
||||
#define NOT_ZERO_RETURN
|
||||
#endif
|
||||
|
||||
#if defined(IA32) || defined(AMD64)
|
||||
|
Loading…
x
Reference in New Issue
Block a user