--- old/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp 2018-03-20 18:38:49.553746208 -0400 +++ new/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp 2018-03-20 18:38:48.894685042 -0400 @@ -38,6 +38,7 @@ #include "gc/shared/collectedHeap.hpp" #include "nativeInst_aarch64.hpp" #include "oops/objArrayKlass.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/sharedRuntime.hpp" #include "vmreg_aarch64.inline.hpp" --- old/src/hotspot/cpu/aarch64/frame_aarch64.hpp 2018-03-20 18:38:50.354820554 -0400 +++ new/src/hotspot/cpu/aarch64/frame_aarch64.hpp 2018-03-20 18:38:49.726762265 -0400 @@ -158,4 +158,6 @@ // deoptimization support void interpreter_frame_set_last_sp(intptr_t* sp); + static jint interpreter_frame_expression_stack_direction() { return -1; } + #endif // CPU_AARCH64_VM_FRAME_AARCH64_HPP --- old/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp 2018-03-20 18:38:51.106890351 -0400 +++ new/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp 2018-03-20 18:38:50.456830021 -0400 @@ -227,9 +227,6 @@ } -inline jint frame::interpreter_frame_expression_stack_direction() { return -1; } - - // Entry frames inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const { --- old/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp 2018-03-20 18:38:51.959969523 -0400 +++ new/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp 2018-03-20 18:38:51.211900097 -0400 @@ -36,6 +36,7 @@ #include "prims/jvmtiThreadState.hpp" #include "runtime/basicLock.hpp" #include "runtime/biasedLocking.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/safepointMechanism.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/thread.inline.hpp" --- old/src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp 2018-03-20 18:38:52.744042291 -0400 +++ new/src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp 2018-03-20 18:38:52.100982611 -0400 @@ -24,6 +24,7 @@ */ #include "precompiled.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" @@ -42,6 +43,14 @@ Register InterpreterRuntime::SignatureHandlerGenerator::to() { return sp; } Register InterpreterRuntime::SignatureHandlerGenerator::temp() { return rscratch1; } +InterpreterRuntime::SignatureHandlerGenerator::SignatureHandlerGenerator( + const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) { + _masm = new MacroAssembler(buffer); + _num_int_args = (method->is_static() ? 1 : 0); + _num_fp_args = 0; + _stack_offset = 0; +} + void InterpreterRuntime::SignatureHandlerGenerator::pass_int() { const Address src(from(), Interpreter::local_offset_in_bytes(offset())); --- old/src/hotspot/cpu/aarch64/interpreterRT_aarch64.hpp 2018-03-20 18:38:53.600121742 -0400 +++ new/src/hotspot/cpu/aarch64/interpreterRT_aarch64.hpp 2018-03-20 18:38:52.855052594 -0400 @@ -27,7 +27,6 @@ #define CPU_AARCH64_VM_INTERPRETERRT_AARCH64_HPP #include "asm/macroAssembler.hpp" -#include "memory/allocation.hpp" // native method calls @@ -47,12 +46,7 @@ public: // Creation - SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) { - _masm = new MacroAssembler(buffer); - _num_int_args = (method->is_static() ? 1 : 0); - _num_fp_args = 0; - _stack_offset = 0; - } + SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer); // Code generation void generate(uint64_t fingerprint); --- old/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp 2018-03-20 18:38:54.213178638 -0400 +++ new/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp 2018-03-20 18:38:53.698130838 -0400 @@ -26,6 +26,7 @@ #include "jvmci/jvmciCompilerToVM.hpp" #include "jvmci/jvmciJavaClasses.hpp" #include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/sharedRuntime.hpp" #include "vmreg_aarch64.inline.hpp" --- old/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp 2018-03-20 18:38:54.949246950 -0400 +++ new/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp 2018-03-20 18:38:54.315188105 -0400 @@ -30,6 +30,7 @@ #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" #include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" #define __ _masm-> --- old/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp 2018-03-20 18:38:55.681314892 -0400 +++ new/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp 2018-03-20 18:38:55.058257067 -0400 @@ -35,6 +35,7 @@ #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" #include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/synchronizer.hpp" --- old/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp 2018-03-20 18:38:56.586398890 -0400 +++ new/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp 2018-03-20 18:38:55.859331413 -0400 @@ -35,6 +35,7 @@ #include "gc/shared/collectedHeap.hpp" #include "nativeInst_arm.hpp" #include "oops/objArrayKlass.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/sharedRuntime.hpp" #include "vmreg_arm.inline.hpp" --- old/src/hotspot/cpu/arm/frame_arm.hpp 2018-03-20 18:38:57.445478618 -0400 +++ new/src/hotspot/cpu/arm/frame_arm.hpp 2018-03-20 18:38:56.755414575 -0400 @@ -135,4 +135,6 @@ // helper to update a map with callee-saved FP static void update_map_with_saved_link(RegisterMap* map, intptr_t** link_addr); + static jint interpreter_frame_expression_stack_direction() { return -1; } + #endif // CPU_ARM_VM_FRAME_ARM_HPP --- old/src/hotspot/cpu/arm/frame_arm.inline.hpp 2018-03-20 18:38:58.225551014 -0400 +++ new/src/hotspot/cpu/arm/frame_arm.inline.hpp 2018-03-20 18:38:57.544487807 -0400 @@ -218,9 +218,6 @@ } -inline jint frame::interpreter_frame_expression_stack_direction() { return -1; } - - // Entry frames inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const { --- old/src/hotspot/cpu/arm/interp_masm_arm.cpp 2018-03-20 18:38:59.023625081 -0400 +++ new/src/hotspot/cpu/arm/interp_masm_arm.cpp 2018-03-20 18:38:58.331560853 -0400 @@ -40,6 +40,7 @@ #include "prims/jvmtiThreadState.hpp" #include "runtime/basicLock.hpp" #include "runtime/biasedLocking.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/sharedRuntime.hpp" #if INCLUDE_ALL_GCS --- old/src/hotspot/cpu/arm/interpreterRT_arm.cpp 2018-03-20 18:38:59.949711028 -0400 +++ new/src/hotspot/cpu/arm/interpreterRT_arm.cpp 2018-03-20 18:38:59.170638725 -0400 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" @@ -36,6 +37,21 @@ #define __ _masm-> +Interpreter::SignatureHandlerGenerator::SignatureHandlerGenerator( + const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) { + _masm = new MacroAssembler(buffer); + _abi_offset = 0; + _ireg = is_static() ? 2 : 1; +#ifdef __ABI_HARD__ +#ifdef AARCH64 + _freg = 0; +#else + _fp_slot = 0; + _single_fpr_slot = 0; +#endif +#endif +} + #ifdef SHARING_FAST_NATIVE_FINGERPRINTS // mapping from SignatureIterator param to (common) type of parsing static const u1 shared_type[] = { --- old/src/hotspot/cpu/arm/interpreterRT_arm.hpp 2018-03-20 18:39:00.752785559 -0400 +++ new/src/hotspot/cpu/arm/interpreterRT_arm.hpp 2018-03-20 18:39:00.069722166 -0400 @@ -25,8 +25,6 @@ #ifndef CPU_ARM_VM_INTERPRETERRT_ARM_HPP #define CPU_ARM_VM_INTERPRETERRT_ARM_HPP -#include "memory/allocation.hpp" - // native method calls class SignatureHandlerGenerator: public NativeSignatureIterator { @@ -56,23 +54,10 @@ #endif public: // Creation - SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) { - _masm = new MacroAssembler(buffer); - _abi_offset = 0; - _ireg = is_static() ? 2 : 1; -#ifdef __ABI_HARD__ -#ifdef AARCH64 - _freg = 0; -#else - _fp_slot = 0; - _single_fpr_slot = 0; -#endif -#endif - } + SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer); // Code generation void generate(uint64_t fingerprint); - }; #ifndef AARCH64 --- old/src/hotspot/cpu/arm/jvmciCodeInstaller_arm.cpp 2018-03-20 18:39:01.468852014 -0400 +++ new/src/hotspot/cpu/arm/jvmciCodeInstaller_arm.cpp 2018-03-20 18:39:00.855795119 -0400 @@ -27,6 +27,7 @@ #include "jvmci/jvmciCompilerToVM.hpp" #include "jvmci/jvmciJavaClasses.hpp" #include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/sharedRuntime.hpp" #include "vmreg_arm.inline.hpp" --- old/src/hotspot/cpu/arm/methodHandles_arm.cpp 2018-03-20 18:39:02.244924039 -0400 +++ new/src/hotspot/cpu/arm/methodHandles_arm.cpp 2018-03-20 18:39:01.573861760 -0400 @@ -34,6 +34,7 @@ #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" #include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" #define __ _masm-> --- old/src/hotspot/cpu/arm/templateTable_arm.cpp 2018-03-20 18:39:02.874982512 -0400 +++ new/src/hotspot/cpu/arm/templateTable_arm.cpp 2018-03-20 18:39:02.355934341 -0400 @@ -34,6 +34,7 @@ #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" #include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/synchronizer.hpp" --- old/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp 2018-03-20 18:39:03.734062240 -0400 +++ new/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp 2018-03-20 18:39:03.078001354 -0400 @@ -36,6 +36,7 @@ #include "gc/shared/cardTableBarrierSet.hpp" #include "nativeInst_ppc.hpp" #include "oops/objArrayKlass.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/safepointMechanism.inline.hpp" #include "runtime/sharedRuntime.hpp" --- old/src/hotspot/cpu/ppc/frame_ppc.hpp 2018-03-20 18:39:04.659148094 -0400 +++ new/src/hotspot/cpu/ppc/frame_ppc.hpp 2018-03-20 18:39:03.906078204 -0400 @@ -425,4 +425,6 @@ pc_return_offset = 0 }; + static jint interpreter_frame_expression_stack_direction() { return -1; } + #endif // CPU_PPC_VM_FRAME_PPC_HPP --- old/src/hotspot/cpu/ppc/frame_ppc.inline.hpp 2018-03-20 18:39:05.438220397 -0400 +++ new/src/hotspot/cpu/ppc/frame_ppc.inline.hpp 2018-03-20 18:39:04.769158304 -0400 @@ -179,10 +179,6 @@ return (intptr_t*)interpreter_frame_monitor_end() - 1; } -inline jint frame::interpreter_frame_expression_stack_direction() { - return -1; -} - // top of expression stack inline intptr_t* frame::interpreter_frame_tos_address() const { return ((intptr_t*) get_ijava_state()->esp) + Interpreter::stackElementWords; --- old/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp 2018-03-20 18:39:06.307301052 -0400 +++ new/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp 2018-03-20 18:39:05.538229678 -0400 @@ -29,6 +29,7 @@ #include "interp_masm_ppc.hpp" #include "interpreter/interpreterRuntime.hpp" #include "prims/jvmtiThreadState.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/safepointMechanism.hpp" #include "runtime/sharedRuntime.hpp" --- old/src/hotspot/cpu/ppc/interpreterRT_ppc.cpp 2018-03-20 18:39:07.119376418 -0400 +++ new/src/hotspot/cpu/ppc/interpreterRT_ppc.cpp 2018-03-20 18:39:06.468315995 -0400 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "asm/assembler.inline.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" @@ -46,6 +47,12 @@ // Implementation of SignatureHandlerGenerator +InterpreterRuntime::SignatureHandlerGenerator::SignatureHandlerGenerator( + const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) { + _masm = new MacroAssembler(buffer); + _num_used_fp_arg_regs = 0; +} + void InterpreterRuntime::SignatureHandlerGenerator::pass_int() { Argument jni_arg(jni_offset()); Register r = jni_arg.is_register() ? jni_arg.as_register() : R0; --- old/src/hotspot/cpu/ppc/interpreterRT_ppc.hpp 2018-03-20 18:39:07.971455496 -0400 +++ new/src/hotspot/cpu/ppc/interpreterRT_ppc.hpp 2018-03-20 18:39:07.219385699 -0400 @@ -27,7 +27,6 @@ #define CPU_PPC_VM_INTERPRETERRT_PPC_HPP #include "asm/macroAssembler.hpp" -#include "memory/allocation.hpp" // native method calls @@ -45,10 +44,7 @@ public: // Creation - SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) { - _masm = new MacroAssembler(buffer); - _num_used_fp_arg_regs = 0; - } + SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer); // Code generation void generate(uint64_t fingerprint); --- old/src/hotspot/cpu/ppc/jvmciCodeInstaller_ppc.cpp 2018-03-20 18:39:08.800532439 -0400 +++ new/src/hotspot/cpu/ppc/jvmciCodeInstaller_ppc.cpp 2018-03-20 18:39:08.072464870 -0400 @@ -26,6 +26,7 @@ #include "jvmci/jvmciCompilerToVM.hpp" #include "jvmci/jvmciJavaClasses.hpp" #include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/sharedRuntime.hpp" #include "vmreg_ppc.inline.hpp" --- old/src/hotspot/cpu/ppc/methodHandles_ppc.cpp 2018-03-20 18:39:09.683614394 -0400 +++ new/src/hotspot/cpu/ppc/methodHandles_ppc.cpp 2018-03-20 18:39:08.899541628 -0400 @@ -31,6 +31,7 @@ #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" #include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" #include "utilities/preserveException.hpp" #define __ _masm-> --- old/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp 2018-03-20 18:39:10.479688274 -0400 +++ new/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp 2018-03-20 18:39:09.794624696 -0400 @@ -34,6 +34,7 @@ #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" #include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/safepointMechanism.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" --- old/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp 2018-03-20 18:39:11.390772827 -0400 +++ new/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp 2018-03-20 18:39:10.675706465 -0400 @@ -36,6 +36,7 @@ #include "gc/shared/cardTableBarrierSet.hpp" #include "nativeInst_s390.hpp" #include "oops/objArrayKlass.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/safepointMechanism.inline.hpp" #include "runtime/sharedRuntime.hpp" #include "vmreg_s390.inline.hpp" --- old/src/hotspot/cpu/s390/frame_s390.hpp 2018-03-20 18:39:12.327859794 -0400 +++ new/src/hotspot/cpu/s390/frame_s390.hpp 2018-03-20 18:39:11.567789256 -0400 @@ -549,4 +549,6 @@ pc_return_offset = 0, }; + static jint interpreter_frame_expression_stack_direction() { return -1; } + #endif // CPU_S390_VM_FRAME_S390_HPP --- old/src/hotspot/cpu/s390/frame_s390.inline.hpp 2018-03-20 18:39:13.202941006 -0400 +++ new/src/hotspot/cpu/s390/frame_s390.inline.hpp 2018-03-20 18:39:12.436869911 -0400 @@ -175,10 +175,6 @@ return (intptr_t*)interpreter_frame_monitor_end() - 1; } -inline jint frame::interpreter_frame_expression_stack_direction() { - return -1; -} - inline intptr_t* frame::interpreter_frame_tos_at(jint offset) const { return &interpreter_frame_tos_address()[offset]; } --- old/src/hotspot/cpu/s390/interp_masm_s390.cpp 2018-03-20 18:39:14.065021012 -0400 +++ new/src/hotspot/cpu/s390/interp_masm_s390.cpp 2018-03-20 18:39:13.306950659 -0400 @@ -36,6 +36,7 @@ #include "prims/jvmtiThreadState.hpp" #include "runtime/basicLock.hpp" #include "runtime/biasedLocking.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/safepointMechanism.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/thread.inline.hpp" --- old/src/hotspot/cpu/s390/interpreterRT_s390.cpp 2018-03-20 18:39:14.993107143 -0400 +++ new/src/hotspot/cpu/s390/interpreterRT_s390.cpp 2018-03-20 18:39:14.220035398 -0400 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" @@ -64,6 +65,11 @@ } // Implementation of SignatureHandlerGenerator +InteprerterRuntime::SignatureHandlerGenerator::SignatureHandlerGenerator( + const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) { + _masm = new MacroAssembler(buffer); + _fp_arg_nr = 0; +} void InterpreterRuntime::SignatureHandlerGenerator::pass_int() { int int_arg_nr = jni_offset() - _fp_arg_nr; --- old/src/hotspot/cpu/s390/interpreterRT_s390.hpp 2018-03-20 18:39:15.781180280 -0400 +++ new/src/hotspot/cpu/s390/interpreterRT_s390.hpp 2018-03-20 18:39:15.098116889 -0400 @@ -26,8 +26,6 @@ #ifndef CPU_S390_VM_INTERPRETERRT_S390_HPP #define CPU_S390_VM_INTERPRETERRT_S390_HPP -#include "memory/allocation.hpp" - static int binary_search(int key, LookupswitchPair* array, int n); static address iload (JavaThread* thread); @@ -51,10 +49,7 @@ public: // creation - SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) { - _masm = new MacroAssembler(buffer); - _fp_arg_nr = 0; - } + SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer); // code generation void generate(uint64_t fingerprint); --- old/src/hotspot/cpu/s390/jvmciCodeInstaller_s390.cpp 2018-03-20 18:39:16.668262606 -0400 +++ new/src/hotspot/cpu/s390/jvmciCodeInstaller_s390.cpp 2018-03-20 18:39:15.884189840 -0400 @@ -34,6 +34,7 @@ #include "jvmci/jvmciCompilerToVM.hpp" #include "jvmci/jvmciJavaClasses.hpp" #include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/sharedRuntime.hpp" #include "vmreg_s390.inline.hpp" --- old/src/hotspot/cpu/s390/methodHandles_s390.cpp 2018-03-20 18:39:17.543343817 -0400 +++ new/src/hotspot/cpu/s390/methodHandles_s390.cpp 2018-03-20 18:39:16.768271887 -0400 @@ -31,6 +31,7 @@ #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" #include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" #include "utilities/preserveException.hpp" #ifdef PRODUCT --- old/src/hotspot/cpu/s390/templateTable_s390.cpp 2018-03-20 18:39:18.418425029 -0400 +++ new/src/hotspot/cpu/s390/templateTable_s390.cpp 2018-03-20 18:39:17.657354398 -0400 @@ -33,6 +33,7 @@ #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" #include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/safepointMechanism.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" --- old/src/hotspot/cpu/sparc/c1_LIRAssembler_sparc.cpp 2018-03-20 18:39:19.276504663 -0400 +++ new/src/hotspot/cpu/sparc/c1_LIRAssembler_sparc.cpp 2018-03-20 18:39:18.614443221 -0400 @@ -35,6 +35,7 @@ #include "gc/shared/collectedHeap.hpp" #include "nativeInst_sparc.hpp" #include "oops/objArrayKlass.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/jniHandles.inline.hpp" #include "runtime/safepointMechanism.inline.hpp" --- old/src/hotspot/cpu/sparc/frame_sparc.hpp 2018-03-20 18:39:20.204590794 -0400 +++ new/src/hotspot/cpu/sparc/frame_sparc.hpp 2018-03-20 18:39:19.463522019 -0400 @@ -240,4 +240,6 @@ void interpreter_frame_set_monitors(BasicObjectLock* monitors); public: + static jint interpreter_frame_expression_stack_direction() { return -1; } + #endif // CPU_SPARC_VM_FRAME_SPARC_HPP --- old/src/hotspot/cpu/sparc/frame_sparc.inline.hpp 2018-03-20 18:39:20.857651401 -0400 +++ new/src/hotspot/cpu/sparc/frame_sparc.inline.hpp 2018-03-20 18:39:20.308600446 -0400 @@ -99,8 +99,6 @@ return (intptr_t*) sp_addr_at( ImethodDataPtr->sp_offset_in_saved_window()); } -inline jint frame::interpreter_frame_expression_stack_direction() { return -1; } - // bottom(base) of the expression stack (highest address) inline intptr_t* frame::interpreter_frame_expression_stack() const { return (intptr_t*)interpreter_frame_monitors() - 1; --- old/src/hotspot/cpu/sparc/interp_masm_sparc.cpp 2018-03-20 18:39:21.701729735 -0400 +++ new/src/hotspot/cpu/sparc/interp_masm_sparc.cpp 2018-03-20 18:39:20.956660589 -0400 @@ -36,6 +36,7 @@ #include "prims/jvmtiThreadState.hpp" #include "runtime/basicLock.hpp" #include "runtime/biasedLocking.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/safepointMechanism.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/thread.inline.hpp" --- old/src/hotspot/cpu/sparc/interpreterRT_sparc.cpp 2018-03-20 18:39:22.636816515 -0400 +++ new/src/hotspot/cpu/sparc/interpreterRT_sparc.cpp 2018-03-20 18:39:21.865744956 -0400 @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" @@ -40,6 +41,10 @@ // Implementation of SignatureHandlerGenerator +InterpreterRuntime::SignatureHandlerGenerator::SignatureHandlerGenerator( + const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) { + _masm = new MacroAssembler(buffer); +} void InterpreterRuntime::SignatureHandlerGenerator::pass_word(int size_of_arg, int offset_in_arg) { Argument jni_arg(jni_offset() + offset_in_arg, false); --- old/src/hotspot/cpu/sparc/interpreterRT_sparc.hpp 2018-03-20 18:39:23.505897169 -0400 +++ new/src/hotspot/cpu/sparc/interpreterRT_sparc.hpp 2018-03-20 18:39:22.739826074 -0400 @@ -52,9 +52,7 @@ public: // Creation - SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) { - _masm = new MacroAssembler(buffer); - } + SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer); // Code generation void generate( uint64_t fingerprint ); --- old/src/hotspot/cpu/sparc/jvmciCodeInstaller_sparc.cpp 2018-03-20 18:39:24.335974204 -0400 +++ new/src/hotspot/cpu/sparc/jvmciCodeInstaller_sparc.cpp 2018-03-20 18:39:23.607906636 -0400 @@ -26,6 +26,7 @@ #include "jvmci/jvmciCompilerToVM.hpp" #include "jvmci/jvmciJavaClasses.hpp" #include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/sharedRuntime.hpp" #include "utilities/align.hpp" #include "vmreg_sparc.inline.hpp" --- old/src/hotspot/cpu/sparc/methodHandles_sparc.cpp 2018-03-20 18:39:25.210055322 -0400 +++ new/src/hotspot/cpu/sparc/methodHandles_sparc.cpp 2018-03-20 18:39:24.440983949 -0400 @@ -31,6 +31,7 @@ #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" #include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" #include "utilities/preserveException.hpp" #define __ _masm-> --- old/src/hotspot/cpu/sparc/templateTable_sparc.cpp 2018-03-20 18:39:26.091137090 -0400 +++ new/src/hotspot/cpu/sparc/templateTable_sparc.cpp 2018-03-20 18:39:25.322065717 -0400 @@ -32,6 +32,7 @@ #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" #include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/safepointMechanism.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" --- old/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp 2018-03-20 18:39:27.017223034 -0400 +++ new/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp 2018-03-20 18:39:26.272153889 -0400 @@ -37,6 +37,7 @@ #include "gc/shared/collectedHeap.hpp" #include "nativeInst_x86.hpp" #include "oops/objArrayKlass.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/safepointMechanism.hpp" #include "runtime/sharedRuntime.hpp" #include "vmreg_x86.inline.hpp" --- old/src/hotspot/cpu/x86/frame_x86.hpp 2018-03-20 18:39:27.856300903 -0400 +++ new/src/hotspot/cpu/x86/frame_x86.hpp 2018-03-20 18:39:27.209240854 -0400 @@ -154,4 +154,6 @@ // deoptimization support void interpreter_frame_set_last_sp(intptr_t* sp); + static jint interpreter_frame_expression_stack_direction() { return -1; } + #endif // CPU_X86_VM_FRAME_X86_HPP --- old/src/hotspot/cpu/x86/frame_x86.inline.hpp 2018-03-20 18:39:28.673376731 -0400 +++ new/src/hotspot/cpu/x86/frame_x86.inline.hpp 2018-03-20 18:39:27.956310185 -0400 @@ -223,10 +223,6 @@ return monitor_end-1; } - -inline jint frame::interpreter_frame_expression_stack_direction() { return -1; } - - // Entry frames inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const { --- old/src/hotspot/cpu/x86/interp_masm_x86.cpp 2018-03-20 18:39:29.351439658 -0400 +++ new/src/hotspot/cpu/x86/interp_masm_x86.cpp 2018-03-20 18:39:28.774386105 -0400 @@ -35,6 +35,7 @@ #include "prims/jvmtiThreadState.hpp" #include "runtime/basicLock.hpp" #include "runtime/biasedLocking.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/safepointMechanism.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/thread.inline.hpp" --- old/src/hotspot/cpu/x86/interpreterRT_x86.hpp 2018-03-20 18:39:30.177516321 -0400 +++ new/src/hotspot/cpu/x86/interpreterRT_x86.hpp 2018-03-20 18:39:29.497453208 -0400 @@ -25,8 +25,6 @@ #ifndef CPU_X86_VM_INTERPRETERRT_X86_HPP #define CPU_X86_VM_INTERPRETERRT_X86_HPP -#include "memory/allocation.hpp" - // native method calls class SignatureHandlerGenerator: public NativeSignatureIterator { @@ -55,19 +53,7 @@ public: // Creation - SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) { - _masm = new MacroAssembler(buffer); -#ifdef AMD64 -#ifdef _WIN64 - _num_args = (method->is_static() ? 1 : 0); - _stack_offset = (Argument::n_int_register_parameters_c+1)* wordSize; // don't overwrite return address -#else - _num_int_args = (method->is_static() ? 1 : 0); - _num_fp_args = 0; - _stack_offset = wordSize; // don't overwrite return address -#endif // _WIN64 -#endif // AMD64 - } + SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer); // Code generation void generate(uint64_t fingerprint); --- old/src/hotspot/cpu/x86/interpreterRT_x86_32.cpp 2018-03-20 18:39:31.041596510 -0400 +++ new/src/hotspot/cpu/x86/interpreterRT_x86_32.cpp 2018-03-20 18:39:30.277525602 -0400 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" @@ -39,6 +40,21 @@ // Implementation of SignatureHandlerGenerator +InterpreterRuntime::SignatureHandlerGenerator::SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer) : + NativeSignatureIterator(method) { + _masm = new MacroAssembler(buffer); +#ifdef AMD64 +#ifdef _WIN64 + _num_args = (method->is_static() ? 1 : 0); + _stack_offset = (Argument::n_int_register_parameters_c+1)* wordSize; // don't overwrite return address +#else + _num_int_args = (method->is_static() ? 1 : 0); + _num_fp_args = 0; + _stack_offset = wordSize; // don't overwrite return address +#endif // _WIN64 +#endif // AMD64 +} + void InterpreterRuntime::SignatureHandlerGenerator::pass_int() { move(offset(), jni_offset() + 1); } --- old/src/hotspot/cpu/x86/interpreterRT_x86_64.cpp 2018-03-20 18:39:31.789665933 -0400 +++ new/src/hotspot/cpu/x86/interpreterRT_x86_64.cpp 2018-03-20 18:39:31.143605977 -0400 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" @@ -38,6 +39,21 @@ // Implementation of SignatureHandlerGenerator +InterpreterRuntime::SignatureHandlerGenerator::SignatureHandlerGenerator(const methodHandle& method, CodeBuffer* buffer) : + NativeSignatureIterator(method) { + _masm = new MacroAssembler(buffer); +#ifdef AMD64 +#ifdef _WIN64 + _num_args = (method->is_static() ? 1 : 0); + _stack_offset = (Argument::n_int_register_parameters_c+1)* wordSize; // don't overwrite return address +#else + _num_int_args = (method->is_static() ? 1 : 0); + _num_fp_args = 0; + _stack_offset = wordSize; // don't overwrite return address +#endif // _WIN64 +#endif // AMD64 +} + Register InterpreterRuntime::SignatureHandlerGenerator::from() { return r14; } Register InterpreterRuntime::SignatureHandlerGenerator::to() { return rsp; } Register InterpreterRuntime::SignatureHandlerGenerator::temp() { return rscratch1; } --- old/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp 2018-03-20 18:39:32.421724591 -0400 +++ new/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp 2018-03-20 18:39:31.895675772 -0400 @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "compiler/disassembler.hpp" #include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" #include "runtime/sharedRuntime.hpp" #include "jvmci/jvmciEnv.hpp" --- old/src/hotspot/cpu/x86/methodHandles_x86.cpp 2018-03-20 18:39:33.184795406 -0400 +++ new/src/hotspot/cpu/x86/methodHandles_x86.cpp 2018-03-20 18:39:32.523734057 -0400 @@ -31,6 +31,7 @@ #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" #include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" #include "utilities/preserveException.hpp" #define __ _masm-> --- old/src/hotspot/cpu/x86/templateTable_x86.cpp 2018-03-20 18:39:34.068877452 -0400 +++ new/src/hotspot/cpu/x86/templateTable_x86.cpp 2018-03-20 18:39:33.298805986 -0400 @@ -33,6 +33,7 @@ #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" #include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/safepointMechanism.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" --- old/src/hotspot/cpu/zero/frame_zero.hpp 2018-03-20 18:39:34.977961817 -0400 +++ new/src/hotspot/cpu/zero/frame_zero.hpp 2018-03-20 18:39:34.267895921 -0400 @@ -75,4 +75,6 @@ char* buf, int buflen) const; + static jint interpreter_frame_expression_stack_direction() { return -1; } + #endif // CPU_ZERO_VM_FRAME_ZERO_HPP --- old/src/hotspot/cpu/zero/frame_zero.inline.hpp 2018-03-20 18:39:35.730031611 -0400 +++ new/src/hotspot/cpu/zero/frame_zero.inline.hpp 2018-03-20 18:39:35.074970820 -0400 @@ -130,10 +130,6 @@ return monitor_end - 1; } -inline jint frame::interpreter_frame_expression_stack_direction() { - return -1; -} - // Return a unique id for this frame. The id must have a value where // we can distinguish identity and younger/older relationship. NULL // represents an invalid (incomparable) frame. --- old/src/hotspot/cpu/zero/methodHandles_zero.cpp 2018-03-20 18:39:36.555108181 -0400 +++ new/src/hotspot/cpu/zero/methodHandles_zero.cpp 2018-03-20 18:39:35.835041357 -0400 @@ -30,6 +30,7 @@ #include "memory/resourceArea.hpp" #include "oops/method.inline.hpp" #include "oops/oop.inline.hpp" +#include "runtime/frame.inline.hpp" #include "prims/methodHandles.hpp" void MethodHandles::invoke_target(Method* method, TRAPS) { --- old/src/hotspot/cpu/zero/stack_zero.cpp 2018-03-20 18:39:37.333180388 -0400 +++ new/src/hotspot/cpu/zero/stack_zero.cpp 2018-03-20 18:39:36.660117926 -0400 @@ -24,10 +24,12 @@ */ #include "precompiled.hpp" +#include "interpreter/bytecodeInterpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "runtime/thread.hpp" #include "stack_zero.hpp" #include "stack_zero.inline.hpp" +#include "runtime/frame.inline.hpp" #include "utilities/align.hpp" // Inlined causes circular inclusion with thread.hpp --- old/src/hotspot/os_cpu/aix_ppc/thread_aix_ppc.cpp 2018-03-20 18:39:38.221262805 -0400 +++ new/src/hotspot/os_cpu/aix_ppc/thread_aix_ppc.cpp 2018-03-20 18:39:37.439190226 -0400 @@ -27,6 +27,19 @@ #include "runtime/frame.hpp" #include "runtime/thread.hpp" +frame JavaThread::pd_last_frame() { + assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); + + intptr_t* sp = last_Java_sp(); + address pc = _anchor.last_Java_pc(); + + // Last_Java_pc ist not set, if we come here from compiled code. + if (pc == NULL) + pc = (address) *(sp + 2); + + return frame(sp, pc); +} + // Forte Analyzer AsyncGetCallTrace profiling support is not implemented on Aix/PPC. bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava) { Unimplemented(); --- old/src/hotspot/os_cpu/aix_ppc/thread_aix_ppc.hpp 2018-03-20 18:39:39.079342436 -0400 +++ new/src/hotspot/os_cpu/aix_ppc/thread_aix_ppc.hpp 2018-03-20 18:39:38.317271714 -0400 @@ -32,18 +32,7 @@ } // The `last' frame is the youngest Java frame on the thread's stack. - frame pd_last_frame() { - assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - - intptr_t* sp = last_Java_sp(); - address pc = _anchor.last_Java_pc(); - - // Last_Java_pc ist not set, if we come here from compiled code. - if (pc == NULL) - pc = (address) *(sp + 2); - - return frame(sp, pc); - } + frame pd_last_frame(); public: void set_base_of_stack_pointer(intptr_t* base_sp) {} --- old/src/hotspot/os_cpu/bsd_x86/thread_bsd_x86.cpp 2018-03-20 18:39:39.929421326 -0400 +++ new/src/hotspot/os_cpu/bsd_x86/thread_bsd_x86.cpp 2018-03-20 18:39:39.177351532 -0400 @@ -27,6 +27,12 @@ #include "runtime/frame.inline.hpp" #include "runtime/thread.inline.hpp" +frame JavaThread::pd_last_frame() { + assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); + vmassert(_anchor.last_Java_pc() != NULL, "not walkable"); + return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); +} + // For Forte Analyzer AsyncGetCallTrace profiling support - thread is // currently interrupted by SIGPROF bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, --- old/src/hotspot/os_cpu/bsd_x86/thread_bsd_x86.hpp 2018-03-20 18:39:40.790501236 -0400 +++ new/src/hotspot/os_cpu/bsd_x86/thread_bsd_x86.hpp 2018-03-20 18:39:40.033430978 -0400 @@ -30,11 +30,7 @@ _anchor.clear(); } - frame pd_last_frame() { - assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - vmassert(_anchor.last_Java_pc() != NULL, "not walkable"); - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); - } + frame pd_last_frame(); public: // Mutators are highly dangerous.... --- old/src/hotspot/os_cpu/bsd_zero/thread_bsd_zero.cpp 2018-03-20 18:39:41.511568153 -0400 +++ new/src/hotspot/os_cpu/bsd_zero/thread_bsd_zero.cpp 2018-03-20 18:39:40.890510517 -0400 @@ -27,6 +27,11 @@ #include "runtime/frame.inline.hpp" #include "runtime/thread.inline.hpp" +frame JavaThread::pd_last_frame() { + assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); + return frame(last_Java_fp(), last_Java_sp()); +} + void JavaThread::cache_global_variables() { // nothing to do } --- old/src/hotspot/os_cpu/bsd_zero/thread_bsd_zero.hpp 2018-03-20 18:39:42.377648527 -0400 +++ new/src/hotspot/os_cpu/bsd_zero/thread_bsd_zero.hpp 2018-03-20 18:39:41.614577712 -0400 @@ -86,10 +86,7 @@ } private: - frame pd_last_frame() { - assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - return frame(last_Java_fp(), last_Java_sp()); - } + frame pd_last_frame(); public: static ByteSize last_Java_fp_offset() { --- old/src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.cpp 2018-03-20 18:39:43.172722311 -0400 +++ new/src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.cpp 2018-03-20 18:39:42.484658458 -0400 @@ -28,6 +28,11 @@ #include "runtime/frame.inline.hpp" #include "runtime/thread.inline.hpp" +frame JavaThread::pd_last_frame() { + assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); + return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); +} + // For Forte Analyzer AsyncGetCallTrace profiling support - thread is // currently interrupted by SIGPROF bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, --- old/src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.hpp 2018-03-20 18:39:43.882788207 -0400 +++ new/src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.hpp 2018-03-20 18:39:43.274731778 -0400 @@ -41,10 +41,7 @@ _anchor.clear(); } - frame pd_last_frame() { - assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); - } + frame pd_last_frame(); public: // Mutators are highly dangerous.... --- old/src/hotspot/os_cpu/linux_arm/thread_linux_arm.cpp 2018-03-20 18:39:44.753869045 -0400 +++ new/src/hotspot/os_cpu/linux_arm/thread_linux_arm.cpp 2018-03-20 18:39:43.983797581 -0400 @@ -30,6 +30,21 @@ #include "memory/metaspaceShared.hpp" #include "runtime/frame.inline.hpp" +frame JavaThread::pd_last_frame() { + assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); +#ifdef AARCH64 + assert (_anchor.last_Java_pc() != NULL, "pc should be stored"); + return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); +#else + if (_anchor.last_Java_pc() != NULL) { + return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); + } else { + // This will pick up pc from sp + return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp()); + } +#endif // AARCH64 +} + void JavaThread::cache_global_variables() { BarrierSet* bs = Universe::heap()->barrier_set(); --- old/src/hotspot/os_cpu/linux_arm/thread_linux_arm.hpp 2018-03-20 18:39:45.578945614 -0400 +++ new/src/hotspot/os_cpu/linux_arm/thread_linux_arm.hpp 2018-03-20 18:39:44.852878233 -0400 @@ -37,20 +37,7 @@ _in_top_frame_unsafe_section = NULL; } - frame pd_last_frame() { - assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); -#ifdef AARCH64 - assert (_anchor.last_Java_pc() != NULL, "pc should be stored"); - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); -#else - if (_anchor.last_Java_pc() != NULL) { - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); - } else { - // This will pick up pc from sp - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp()); - } -#endif // AARCH64 - } + frame pd_last_frame(); public: intptr_t* last_Java_fp() { return _anchor.last_Java_fp(); } --- old/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp 2018-03-20 18:39:46.431024688 -0400 +++ new/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp 2018-03-20 18:39:45.678954895 -0400 @@ -24,9 +24,23 @@ */ #include "precompiled.hpp" -#include "runtime/frame.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/thread.hpp" +frame JavaThread::pd_last_frame() { + assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); + + intptr_t* sp = last_Java_sp(); + address pc = _anchor.last_Java_pc(); + + // Last_Java_pc ist not set, if we come here from compiled code. + if (pc == NULL) { + pc = (address) *(sp + 2); + } + + return frame(sp, pc); +} + // Forte Analyzer AsyncGetCallTrace profiling support is not implemented on Linux/PPC. bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava) { Unimplemented(); --- old/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.hpp 2018-03-20 18:39:47.243100050 -0400 +++ new/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.hpp 2018-03-20 18:39:46.528033691 -0400 @@ -33,19 +33,7 @@ } // The `last' frame is the youngest Java frame on the thread's stack. - frame pd_last_frame() { - assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - - intptr_t* sp = last_Java_sp(); - address pc = _anchor.last_Java_pc(); - - // Last_Java_pc ist not set, if we come here from compiled code. - if (pc == NULL) { - pc = (address) *(sp + 2); - } - - return frame(sp, pc); - } + frame pd_last_frame(); public: --- old/src/hotspot/os_cpu/linux_s390/thread_linux_s390.cpp 2018-03-20 18:39:48.109180424 -0400 +++ new/src/hotspot/os_cpu/linux_s390/thread_linux_s390.cpp 2018-03-20 18:39:47.342109238 -0400 @@ -24,9 +24,23 @@ */ #include "precompiled.hpp" -#include "runtime/frame.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/thread.hpp" +frame JavaThread::pd_last_frame() { + assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); + + intptr_t* sp = last_Java_sp(); + address pc = _anchor.last_Java_pc(); + + // Last_Java_pc ist not set if we come here from compiled code. + if (pc == NULL) { + pc = (address) *(sp + 14); + } + + return frame(sp, pc); +} + // Forte Analyzer AsyncGetCallTrace profiling support is not implemented on Linux/S390x. bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava) { Unimplemented(); --- old/src/hotspot/os_cpu/linux_s390/thread_linux_s390.hpp 2018-03-20 18:39:48.964259776 -0400 +++ new/src/hotspot/os_cpu/linux_s390/thread_linux_s390.hpp 2018-03-20 18:39:48.207189519 -0400 @@ -33,19 +33,7 @@ } // The `last' frame is the youngest Java frame on the thread's stack. - frame pd_last_frame() { - assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - - intptr_t* sp = last_Java_sp(); - address pc = _anchor.last_Java_pc(); - - // Last_Java_pc ist not set if we come here from compiled code. - if (pc == NULL) { - pc = (address) *(sp + 14); - } - - return frame(sp, pc); - } + frame pd_last_frame(); public: void set_base_of_stack_pointer(intptr_t* base_sp) {} --- old/src/hotspot/os_cpu/linux_sparc/thread_linux_sparc.cpp 2018-03-20 18:39:49.702328270 -0400 +++ new/src/hotspot/os_cpu/linux_sparc/thread_linux_sparc.cpp 2018-03-20 18:39:49.061268779 -0400 @@ -27,6 +27,14 @@ #include "runtime/frame.inline.hpp" #include "runtime/thread.inline.hpp" +frame JavaThread::pd_last_frame() { + assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); + assert(_anchor.walkable(), "thread has not dumped its register windows yet"); + + assert(_anchor.last_Java_pc() != NULL, "Ack no pc!"); + return frame(last_Java_sp(), frame::unpatchable, _anchor.last_Java_pc()); +} + // For Forte Analyzer AsyncGetCallTrace profiling support - thread is // currently interrupted by SIGPROF bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, --- old/src/hotspot/os_cpu/linux_sparc/thread_linux_sparc.hpp 2018-03-20 18:39:50.453397970 -0400 +++ new/src/hotspot/os_cpu/linux_sparc/thread_linux_sparc.hpp 2018-03-20 18:39:49.803337644 -0400 @@ -32,13 +32,7 @@ _base_of_stack_pointer = NULL; } - frame pd_last_frame() { - assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - assert(_anchor.walkable(), "thread has not dumped its register windows yet"); - - assert(_anchor.last_Java_pc() != NULL, "Ack no pc!"); - return frame(last_Java_sp(), frame::unpatchable, _anchor.last_Java_pc()); - } + frame pd_last_frame(); // Sometimes the trap handler needs to record both PC and NPC. // This is a SPARC-specific companion to Thread::set_saved_exception_pc. --- old/src/hotspot/os_cpu/linux_x86/thread_linux_x86.cpp 2018-03-20 18:39:51.180465443 -0400 +++ new/src/hotspot/os_cpu/linux_x86/thread_linux_x86.cpp 2018-03-20 18:39:50.552407159 -0400 @@ -27,6 +27,12 @@ #include "runtime/frame.inline.hpp" #include "runtime/thread.inline.hpp" +frame JavaThread::pd_last_frame() { + assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); + vmassert(_anchor.last_Java_pc() != NULL, "not walkable"); + return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); +} + // For Forte Analyzer AsyncGetCallTrace profiling support - thread is // currently interrupted by SIGPROF bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, --- old/src/hotspot/os_cpu/linux_x86/thread_linux_x86.hpp 2018-03-20 18:39:51.923534401 -0400 +++ new/src/hotspot/os_cpu/linux_x86/thread_linux_x86.hpp 2018-03-20 18:39:51.279474631 -0400 @@ -30,11 +30,7 @@ _anchor.clear(); } - frame pd_last_frame() { - assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - vmassert(_anchor.last_Java_pc() != NULL, "not walkable"); - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); - } + frame pd_last_frame(); public: // Mutators are highly dangerous.... --- old/src/hotspot/os_cpu/linux_zero/thread_linux_zero.cpp 2018-03-20 18:39:52.798615609 -0400 +++ new/src/hotspot/os_cpu/linux_zero/thread_linux_zero.cpp 2018-03-20 18:39:52.024543775 -0400 @@ -27,6 +27,11 @@ #include "runtime/frame.inline.hpp" #include "runtime/thread.inline.hpp" +frame JavaThread::pd_last_frame() { + assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); + return frame(last_Java_fp(), last_Java_sp()); +} + void JavaThread::cache_global_variables() { // nothing to do } --- old/src/hotspot/os_cpu/linux_zero/thread_linux_zero.hpp 2018-03-20 18:39:53.642693941 -0400 +++ new/src/hotspot/os_cpu/linux_zero/thread_linux_zero.hpp 2018-03-20 18:39:52.895624612 -0400 @@ -86,10 +86,7 @@ } private: - frame pd_last_frame() { - assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - return frame(last_Java_fp(), last_Java_sp()); - } + frame pd_last_frame(); public: static ByteSize last_Java_fp_offset() { --- old/src/hotspot/os_cpu/solaris_sparc/thread_solaris_sparc.cpp 2018-03-20 18:39:54.383762713 -0400 +++ new/src/hotspot/os_cpu/solaris_sparc/thread_solaris_sparc.cpp 2018-03-20 18:39:53.746703593 -0400 @@ -27,6 +27,14 @@ #include "runtime/frame.inline.hpp" #include "runtime/thread.inline.hpp" +frame JavaThread::pd_last_frame() { + assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); + assert(_anchor.walkable(), "thread has not dumped its register windows yet"); + + assert(_anchor.last_Java_pc() != NULL, "Ack no pc!"); + return frame(last_Java_sp(), frame::unpatchable, _anchor.last_Java_pc()); +} + // For Forte Analyzer AsyncGetCallTrace profiling support - thread is // currently interrupted by SIGPROF // --- old/src/hotspot/os_cpu/solaris_sparc/thread_solaris_sparc.hpp 2018-03-20 18:39:55.240842250 -0400 +++ new/src/hotspot/os_cpu/solaris_sparc/thread_solaris_sparc.hpp 2018-03-20 18:39:54.485772179 -0400 @@ -31,13 +31,7 @@ _base_of_stack_pointer = NULL; } - frame pd_last_frame() { - assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - assert(_anchor.walkable(), "thread has not dumped its register windows yet"); - - assert(_anchor.last_Java_pc() != NULL, "Ack no pc!"); - return frame(last_Java_sp(), frame::unpatchable, _anchor.last_Java_pc()); - } + frame pd_last_frame(); // Sometimes the trap handler needs to record both PC and NPC. // This is a SPARC-specific companion to Thread::set_saved_exception_pc. --- old/src/hotspot/os_cpu/solaris_x86/thread_solaris_x86.cpp 2018-03-20 18:39:55.977910651 -0400 +++ new/src/hotspot/os_cpu/solaris_x86/thread_solaris_x86.cpp 2018-03-20 18:39:55.340851531 -0400 @@ -27,6 +27,12 @@ #include "runtime/frame.inline.hpp" #include "runtime/thread.inline.hpp" +frame JavaThread::pd_last_frame() { + assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); + vmassert(_anchor.last_Java_pc() != NULL, "not walkable"); + return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); +} + // For Forte Analyzer AsyncGetCallTrace profiling support - thread is // currently interrupted by SIGPROF bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, --- old/src/hotspot/os_cpu/solaris_x86/thread_solaris_x86.hpp 2018-03-20 18:39:56.778984991 -0400 +++ new/src/hotspot/os_cpu/solaris_x86/thread_solaris_x86.hpp 2018-03-20 18:39:56.081920303 -0400 @@ -28,11 +28,7 @@ private: void pd_initialize() { _anchor.clear(); } - frame pd_last_frame() { - assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - vmassert(_anchor.last_Java_pc() != NULL, "not walkable"); - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); - } + frame pd_last_frame(); public: // Mutators are highly dangerous.... --- old/src/hotspot/os_cpu/windows_x86/thread_windows_x86.cpp 2018-03-20 18:39:57.493051257 -0400 +++ new/src/hotspot/os_cpu/windows_x86/thread_windows_x86.cpp 2018-03-20 18:39:56.875993993 -0400 @@ -27,6 +27,12 @@ #include "runtime/frame.inline.hpp" #include "runtime/thread.inline.hpp" +frame JavaThread::pd_last_frame() { + assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); + vmassert(_anchor.last_Java_pc() != NULL, "not walkable"); + return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); +} + // For Forte Analyzer AsyncGetCallTrace profiling support - thread is // currently interrupted by SIGPROF bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, --- old/src/hotspot/os_cpu/windows_x86/thread_windows_x86.hpp 2018-03-20 18:39:58.356131351 -0400 +++ new/src/hotspot/os_cpu/windows_x86/thread_windows_x86.hpp 2018-03-20 18:39:57.595060723 -0400 @@ -30,11 +30,7 @@ _anchor.clear(); } - frame pd_last_frame() { - assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - vmassert(_anchor.last_Java_pc() != NULL, "not walkable"); - return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); - } + frame pd_last_frame(); public: // Mutators are highly dangerous.... --- old/src/hotspot/share/aot/aotCompiledMethod.cpp 2018-03-20 18:39:59.234212837 -0400 +++ new/src/hotspot/share/aot/aotCompiledMethod.cpp 2018-03-20 18:39:58.458140818 -0400 @@ -36,6 +36,7 @@ #include "jvmci/compilerRuntime.hpp" #include "jvmci/jvmciRuntime.hpp" #include "oops/method.inline.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/java.hpp" #include "runtime/os.hpp" @@ -70,6 +71,10 @@ } #endif +address* AOTCompiledMethod::orig_pc_addr(const frame* fr) { + return (address*) ((address)fr->unextended_sp() + _meta->orig_pc_offset()); +} + bool AOTCompiledMethod::do_unloading_oops(address low_boundary, BoolObjectClosure* is_alive, bool unloading_occurred) { return false; } --- old/src/hotspot/share/aot/aotCompiledMethod.hpp 2018-03-20 18:40:00.031286806 -0400 +++ new/src/hotspot/share/aot/aotCompiledMethod.hpp 2018-03-20 18:39:59.344223046 -0400 @@ -117,7 +117,7 @@ const int _method_index; oop _oop; // method()->method_holder()->klass_holder() - address* orig_pc_addr(const frame* fr) { return (address*) ((address)fr->unextended_sp() + _meta->orig_pc_offset()); } + address* orig_pc_addr(const frame* fr); bool make_not_entrant_helper(int new_state); public: --- old/src/hotspot/share/c1/c1_FrameMap.hpp 2018-03-20 18:40:00.801358269 -0400 +++ new/src/hotspot/share/c1/c1_FrameMap.hpp 2018-03-20 18:40:00.136296551 -0400 @@ -25,7 +25,7 @@ #ifndef SHARE_VM_C1_C1_FRAMEMAP_HPP #define SHARE_VM_C1_C1_FRAMEMAP_HPP -#include "asm/assembler.hpp" +#include "asm/macroAssembler.hpp" #include "c1/c1_Defs.hpp" #include "c1/c1_LIR.hpp" #include "code/vmreg.hpp" --- old/src/hotspot/share/c1/c1_Runtime1.cpp 2018-03-20 18:40:01.487421936 -0400 +++ new/src/hotspot/share/c1/c1_Runtime1.cpp 2018-03-20 18:40:00.907368107 -0400 @@ -54,10 +54,11 @@ #include "runtime/biasedLocking.hpp" #include "runtime/compilationPolicy.hpp" #include "runtime/interfaceSupport.inline.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/javaCalls.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/threadCritical.hpp" -#include "runtime/vframe.hpp" +#include "runtime/vframe.inline.hpp" #include "runtime/vframeArray.hpp" #include "runtime/vm_version.hpp" #include "utilities/copy.hpp" --- old/src/hotspot/share/ci/ciEnv.hpp 2018-03-20 18:40:02.188486995 -0400 +++ new/src/hotspot/share/ci/ciEnv.hpp 2018-03-20 18:40:01.617434001 -0400 @@ -32,6 +32,7 @@ #include "code/dependencies.hpp" #include "code/exceptionHandlerTable.hpp" #include "compiler/oopMap.hpp" +#include "oops/methodData.hpp" #include "runtime/thread.hpp" class CompileTask; --- old/src/hotspot/share/classfile/classFileParser.cpp 2018-03-20 18:40:03.015563747 -0400 +++ new/src/hotspot/share/classfile/classFileParser.cpp 2018-03-20 18:40:02.302497575 -0400 @@ -58,6 +58,7 @@ #include "oops/symbol.hpp" #include "prims/jvmtiExport.hpp" #include "prims/jvmtiThreadState.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" #include "runtime/perfData.hpp" #include "runtime/reflection.hpp" @@ -770,6 +771,13 @@ } // end of for } +Handle ClassFileParser::clear_cp_patch_at(int index) { + Handle patch = cp_patch_at(index); + _cp_patches->at_put(index, Handle()); + assert(!has_cp_patch_at(index), ""); + return patch; +} + void ClassFileParser::patch_class(ConstantPool* cp, int class_index, Klass* k, Symbol* name) { int name_index = _orig_cp_size + _num_patched_klasses; int resolved_klass_index = _first_patched_klass_resolved_index + _num_patched_klasses; --- old/src/hotspot/share/classfile/classFileParser.hpp 2018-03-20 18:40:03.921647832 -0400 +++ new/src/hotspot/share/classfile/classFileParser.hpp 2018-03-20 18:40:03.269587321 -0400 @@ -26,7 +26,7 @@ #define SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP #include "memory/referenceType.hpp" -#include "runtime/handles.inline.hpp" +#include "oops/annotations.hpp" #include "oops/constantPool.hpp" #include "oops/typeArrayOop.hpp" #include "utilities/accessFlags.hpp" @@ -434,12 +434,7 @@ return _cp_patches->at(index); } - Handle clear_cp_patch_at(int index) { - Handle patch = cp_patch_at(index); - _cp_patches->at_put(index, Handle()); - assert(!has_cp_patch_at(index), ""); - return patch; - } + Handle clear_cp_patch_at(int index); void patch_class(ConstantPool* cp, int class_index, Klass* k, Symbol* name); void patch_constant_pool(ConstantPool* cp, @@ -530,7 +525,7 @@ const GrowableArray* cp_patches() const { return _cp_patches; } ClassLoaderData* loader_data() const { return _loader_data; } const Symbol* class_name() const { return _class_name; } - const Klass* super_klass() const { return _super_klass; } + const InstanceKlass* super_klass() const { return _super_klass; } ReferenceType reference_type() const { return _rt; } AccessFlags access_flags() const { return _access_flags; } --- old/src/hotspot/share/classfile/classListParser.cpp 2018-03-20 18:40:04.709720965 -0400 +++ new/src/hotspot/share/classfile/classListParser.cpp 2018-03-20 18:40:04.038658690 -0400 @@ -31,6 +31,8 @@ #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/systemDictionaryShared.hpp" +#include "logging/log.hpp" +#include "logging/logTag.hpp" #include "memory/metaspaceShared.hpp" #include "memory/resourceArea.hpp" #include "runtime/fieldType.hpp" --- old/src/hotspot/share/classfile/javaClasses.cpp 2018-03-20 18:40:05.566800502 -0400 +++ new/src/hotspot/share/classfile/javaClasses.cpp 2018-03-20 18:40:04.821731359 -0400 @@ -50,6 +50,7 @@ #include "oops/typeArrayOop.inline.hpp" #include "prims/resolvedMethodTable.hpp" #include "runtime/fieldDescriptor.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/java.hpp" @@ -57,7 +58,7 @@ #include "runtime/jniHandles.inline.hpp" #include "runtime/safepoint.hpp" #include "runtime/thread.inline.hpp" -#include "runtime/vframe.hpp" +#include "runtime/vframe.inline.hpp" #include "utilities/align.hpp" #include "utilities/preserveException.hpp" --- old/src/hotspot/share/classfile/klassFactory.cpp 2018-03-20 18:40:06.548891639 -0400 +++ new/src/hotspot/share/classfile/klassFactory.cpp 2018-03-20 18:40:05.787821012 -0400 @@ -34,6 +34,7 @@ #include "memory/resourceArea.hpp" #include "prims/jvmtiEnvBase.hpp" #include "prims/jvmtiRedefineClasses.hpp" +#include "runtime/handles.inline.hpp" #include "trace/traceMacros.hpp" // called during initial loading of a shared class --- old/src/hotspot/share/classfile/sharedClassUtil.cpp 2018-03-20 18:40:07.381968949 -0400 +++ new/src/hotspot/share/classfile/sharedClassUtil.cpp 2018-03-20 18:40:06.652901291 -0400 @@ -38,7 +38,7 @@ #include "oops/instanceKlass.hpp" #include "runtime/arguments.hpp" #include "runtime/java.hpp" -#include "runtime/os.hpp" +#include "runtime/os.inline.hpp" class ManifestStream: public ResourceObj { private: --- old/src/hotspot/share/classfile/systemDictionary.hpp 2018-03-20 18:40:08.059031780 -0400 +++ new/src/hotspot/share/classfile/systemDictionary.hpp 2018-03-20 18:40:07.484978508 -0400 @@ -34,7 +34,6 @@ #include "runtime/reflectionUtils.hpp" #include "runtime/signature.hpp" #include "utilities/hashtable.hpp" -#include "utilities/hashtable.inline.hpp" // The dictionary in each ClassLoaderData stores all loaded classes, either // initiatied by its class loader or defined by its class loader: --- old/src/hotspot/share/code/compiledMethod.cpp 2018-03-20 18:40:08.849105098 -0400 +++ new/src/hotspot/share/code/compiledMethod.cpp 2018-03-20 18:40:08.183043288 -0400 @@ -27,10 +27,11 @@ #include "code/compiledMethod.inline.hpp" #include "code/scopeDesc.hpp" #include "code/codeCache.hpp" -#include "prims/methodHandles.hpp" #include "interpreter/bytecode.inline.hpp" #include "memory/resourceArea.hpp" +#include "oops/methodData.hpp" #include "oops/method.inline.hpp" +#include "prims/methodHandles.hpp" #include "runtime/handles.inline.hpp" #include "runtime/mutexLocker.hpp" --- old/src/hotspot/share/code/compiledMethod.hpp 2018-03-20 18:40:09.722186119 -0400 +++ new/src/hotspot/share/code/compiledMethod.hpp 2018-03-20 18:40:08.963115678 -0400 @@ -50,13 +50,15 @@ volatile int _count; ExceptionCache* _next; - address pc_at(int index) { assert(index >= 0 && index < count(),""); return _pc[index]; } - void set_pc_at(int index, address a) { assert(index >= 0 && index < cache_size,""); _pc[index] = a; } - address handler_at(int index) { assert(index >= 0 && index < count(),""); return _handler[index]; } - void set_handler_at(int index, address a) { assert(index >= 0 && index < cache_size,""); _handler[index] = a; } - int count(); + inline address pc_at(int index); + void set_pc_at(int index, address a) { assert(index >= 0 && index < cache_size,""); _pc[index] = a; } + + inline address handler_at(int index); + void set_handler_at(int index, address a) { assert(index >= 0 && index < cache_size,""); _handler[index] = a; } + + inline int count(); // increment_count is only called under lock, but there may be concurrent readers. - void increment_count(); + void increment_count(); public: @@ -306,9 +308,9 @@ virtual address get_original_pc(const frame* fr) = 0; // Deopt // Return true is the PC is one would expect if the frame is being deopted. - bool is_deopt_pc (address pc) { return is_deopt_entry(pc) || is_deopt_mh_entry(pc); } + inline bool is_deopt_pc(address pc); bool is_deopt_mh_entry(address pc) { return pc == deopt_mh_handler_begin(); } - bool is_deopt_entry(address pc); + inline bool is_deopt_entry(address pc); virtual bool can_convert_to_zombie() = 0; virtual const char* compile_kind() const = 0; --- old/src/hotspot/share/code/compiledMethod.inline.hpp 2018-03-20 18:40:10.593266955 -0400 +++ new/src/hotspot/share/code/compiledMethod.inline.hpp 2018-03-20 18:40:09.831196235 -0400 @@ -29,6 +29,8 @@ #include "code/nativeInst.hpp" #include "runtime/frame.hpp" +inline bool CompiledMethod::is_deopt_pc(address pc) { return is_deopt_entry(pc) || is_deopt_mh_entry(pc); } + // When using JVMCI the address might be off by the size of a call instruction. inline bool CompiledMethod::is_deopt_entry(address pc) { return pc == deopt_handler_begin() @@ -64,6 +66,16 @@ inline int ExceptionCache::count() { return OrderAccess::load_acquire(&_count); } +address ExceptionCache::pc_at(int index) { + assert(index >= 0 && index < count(),""); + return _pc[index]; +} + +address ExceptionCache::handler_at(int index) { + assert(index >= 0 && index < count(),""); + return _handler[index]; +} + // increment_count is only called under lock, but there may be concurrent readers. inline void ExceptionCache::increment_count() { OrderAccess::release_store(&_count, _count + 1); } --- old/src/hotspot/share/code/nmethod.cpp 2018-03-20 18:40:11.429344542 -0400 +++ new/src/hotspot/share/code/nmethod.cpp 2018-03-20 18:40:10.691276050 -0400 @@ -26,6 +26,7 @@ #include "jvm.h" #include "code/codeCache.hpp" #include "code/compiledIC.hpp" +#include "code/compiledMethod.inline.hpp" #include "code/dependencies.hpp" #include "code/nativeInst.hpp" #include "code/nmethod.hpp" @@ -40,17 +41,21 @@ #include "interpreter/bytecode.hpp" #include "logging/log.hpp" #include "logging/logStream.hpp" +#include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" #include "oops/method.inline.hpp" #include "oops/methodData.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiImpl.hpp" #include "runtime/atomic.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/jniHandles.inline.hpp" #include "runtime/orderAccess.inline.hpp" #include "runtime/os.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/sweeper.hpp" +#include "runtime/vmThread.hpp" #include "utilities/align.hpp" #include "utilities/dtrace.hpp" #include "utilities/events.hpp" @@ -381,6 +386,10 @@ nul_chk_table_size(); } +address* nmethod::orig_pc_addr(const frame* fr) { + return (address*) ((address)fr->unextended_sp() + _orig_pc_offset); +} + const char* nmethod::compile_kind() const { if (is_osr_method()) return "osr"; if (method() != NULL && is_native_method()) return "c2n"; --- old/src/hotspot/share/code/nmethod.hpp 2018-03-20 18:40:12.239419717 -0400 +++ new/src/hotspot/share/code/nmethod.hpp 2018-03-20 18:40:11.592359670 -0400 @@ -512,7 +512,7 @@ private: ScopeDesc* scope_desc_in(address begin, address end); - address* orig_pc_addr(const frame* fr) { return (address*) ((address)fr->unextended_sp() + _orig_pc_offset); } + address* orig_pc_addr(const frame* fr); public: // copying of debugging information --- old/src/hotspot/share/compiler/compileBroker.cpp 2018-03-20 18:40:13.064496283 -0400 +++ new/src/hotspot/share/compiler/compileBroker.cpp 2018-03-20 18:40:12.352430204 -0400 @@ -53,6 +53,7 @@ #include "runtime/sharedRuntime.hpp" #include "runtime/sweeper.hpp" #include "runtime/timerTrace.hpp" +#include "runtime/vframe.inline.hpp" #include "trace/tracing.hpp" #include "utilities/debug.hpp" #include "utilities/dtrace.hpp" --- old/src/hotspot/share/compiler/compileTask.cpp 2018-03-20 18:40:14.003583429 -0400 +++ new/src/hotspot/share/compiler/compileTask.cpp 2018-03-20 18:40:13.225511225 -0400 @@ -30,6 +30,7 @@ #include "logging/log.hpp" #include "logging/logStream.hpp" #include "memory/resourceArea.hpp" +#include "runtime/handles.inline.hpp" CompileTask* CompileTask::_task_free_list = NULL; #ifdef ASSERT --- old/src/hotspot/share/compiler/directivesParser.cpp 2018-03-20 18:40:14.779655448 -0400 +++ new/src/hotspot/share/compiler/directivesParser.cpp 2018-03-20 18:40:14.112593545 -0400 @@ -27,7 +27,7 @@ #include "compiler/directivesParser.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" -#include "runtime/os.hpp" +#include "runtime/os.inline.hpp" #include void DirectivesParser::push_tmp(CompilerDirectives* dir) { --- old/src/hotspot/share/compiler/methodMatcher.hpp 2018-03-20 18:40:15.663737489 -0400 +++ new/src/hotspot/share/compiler/methodMatcher.hpp 2018-03-20 18:40:14.894666120 -0400 @@ -26,7 +26,7 @@ #define SHARE_VM_COMPILER_METHODMATCHER_HPP #include "memory/allocation.hpp" -#include "runtime/handles.inline.hpp" +#include "runtime/handles.hpp" #include "memory/resourceArea.hpp" class MethodMatcher : public CHeapObj { --- old/src/hotspot/share/interpreter/abstractInterpreter.hpp 2018-03-20 18:40:16.511816190 -0400 +++ new/src/hotspot/share/interpreter/abstractInterpreter.hpp 2018-03-20 18:40:15.762746677 -0400 @@ -28,6 +28,7 @@ #include "asm/macroAssembler.hpp" #include "code/stubs.hpp" #include "interpreter/bytecodes.hpp" +#include "runtime/frame.hpp" #include "runtime/thread.hpp" #include "runtime/vmThread.hpp" --- old/src/hotspot/share/interpreter/bytecodeStream.cpp 2018-03-20 18:40:17.260885702 -0400 +++ new/src/hotspot/share/interpreter/bytecodeStream.cpp 2018-03-20 18:40:16.619826213 -0400 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "interpreter/bytecodeStream.hpp" #include "interpreter/bytecodes.hpp" +#include "runtime/handles.inline.hpp" Bytecodes::Code RawBytecodeStream::raw_next_special(Bytecodes::Code code) { assert(!is_last_bytecode(), "should have been checked"); @@ -53,6 +54,11 @@ return code; } +BaseBytecodeStream::BaseBytecodeStream(const methodHandle& method) : _method(method) { + set_interval(0, _method->code_size()); + _is_raw = false; +} + #ifdef ASSERT void BaseBytecodeStream::assert_raw_index_size(int size) const { if (raw_code() == Bytecodes::_invokedynamic && is_raw()) { --- old/src/hotspot/share/interpreter/bytecodeStream.hpp 2018-03-20 18:40:18.091962825 -0400 +++ new/src/hotspot/share/interpreter/bytecodeStream.hpp 2018-03-20 18:40:17.362895169 -0400 @@ -28,7 +28,6 @@ #include "interpreter/bytecode.hpp" #include "memory/allocation.hpp" #include "oops/method.hpp" -#include "runtime/handles.inline.hpp" #include "utilities/bytes.hpp" // A BytecodeStream is used for fast iteration over the bytecodes @@ -63,10 +62,7 @@ bool _is_raw; // false in 'cooked' BytecodeStream // Construction - BaseBytecodeStream(const methodHandle& method) : _method(method) { - set_interval(0, _method->code_size()); - _is_raw = false; - } + BaseBytecodeStream(const methodHandle& method); public: // Iteration control --- old/src/hotspot/share/interpreter/interpreterRuntime.cpp 2018-03-20 18:40:18.965043846 -0400 +++ new/src/hotspot/share/interpreter/interpreterRuntime.cpp 2018-03-20 18:40:18.195972477 -0400 @@ -53,6 +53,7 @@ #include "runtime/compilationPolicy.hpp" #include "runtime/deoptimization.hpp" #include "runtime/fieldDescriptor.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/icache.hpp" #include "runtime/interfaceSupport.inline.hpp" @@ -84,6 +85,58 @@ } }; +// Helper class to access current interpreter state +class LastFrameAccessor : public StackObj { + frame _last_frame; +public: + LastFrameAccessor(JavaThread* thread) { + assert(thread == Thread::current(), "sanity"); + _last_frame = thread->last_frame(); + } + bool is_interpreted_frame() const { return _last_frame.is_interpreted_frame(); } + Method* method() const { return _last_frame.interpreter_frame_method(); } + address bcp() const { return _last_frame.interpreter_frame_bcp(); } + int bci() const { return _last_frame.interpreter_frame_bci(); } + address mdp() const { return _last_frame.interpreter_frame_mdp(); } + + void set_bcp(address bcp) { _last_frame.interpreter_frame_set_bcp(bcp); } + void set_mdp(address dp) { _last_frame.interpreter_frame_set_mdp(dp); } + + // pass method to avoid calling unsafe bcp_to_method (partial fix 4926272) + Bytecodes::Code code() const { return Bytecodes::code_at(method(), bcp()); } + + Bytecode bytecode() const { return Bytecode(method(), bcp()); } + int get_index_u1(Bytecodes::Code bc) const { return bytecode().get_index_u1(bc); } + int get_index_u2(Bytecodes::Code bc) const { return bytecode().get_index_u2(bc); } + int get_index_u2_cpcache(Bytecodes::Code bc) const + { return bytecode().get_index_u2_cpcache(bc); } + int get_index_u4(Bytecodes::Code bc) const { return bytecode().get_index_u4(bc); } + int number_of_dimensions() const { return bcp()[3]; } + ConstantPoolCacheEntry* cache_entry_at(int i) const + { return method()->constants()->cache()->entry_at(i); } + ConstantPoolCacheEntry* cache_entry() const { return cache_entry_at(Bytes::get_native_u2(bcp() + 1)); } + + oop callee_receiver(Symbol* signature) { + return _last_frame.interpreter_callee_receiver(signature); + } + BasicObjectLock* monitor_begin() const { + return _last_frame.interpreter_frame_monitor_begin(); + } + BasicObjectLock* monitor_end() const { + return _last_frame.interpreter_frame_monitor_end(); + } + BasicObjectLock* next_monitor(BasicObjectLock* current) const { + return _last_frame.next_monitor_in_interpreter_frame(current); + } + + frame& get_frame() { return _last_frame; } +}; + + +bool InterpreterRuntime::is_breakpoint(JavaThread *thread) { + return Bytecodes::code_or_bp_at(LastFrameAccessor(thread).bcp()) == Bytecodes::_breakpoint; +} + //------------------------------------------------------------------------------------------------------------------------ // State accessors --- old/src/hotspot/share/interpreter/interpreterRuntime.hpp 2018-03-20 18:40:19.764117998 -0400 +++ new/src/hotspot/share/interpreter/interpreterRuntime.hpp 2018-03-20 18:40:19.101056467 -0400 @@ -29,7 +29,7 @@ #include "interpreter/linkResolver.hpp" #include "memory/universe.hpp" #include "oops/method.hpp" -#include "runtime/frame.inline.hpp" +#include "runtime/frame.hpp" #include "runtime/signature.hpp" #include "runtime/thread.hpp" #include "utilities/macros.hpp" @@ -42,52 +42,6 @@ friend class PrintingClosure; // for method and bcp private: - // Helper class to access current interpreter state - class LastFrameAccessor : public StackObj { - frame _last_frame; - public: - LastFrameAccessor(JavaThread* thread) { - assert(thread == Thread::current(), "sanity"); - _last_frame = thread->last_frame(); - } - bool is_interpreted_frame() const { return _last_frame.is_interpreted_frame(); } - Method* method() const { return _last_frame.interpreter_frame_method(); } - address bcp() const { return _last_frame.interpreter_frame_bcp(); } - int bci() const { return _last_frame.interpreter_frame_bci(); } - address mdp() const { return _last_frame.interpreter_frame_mdp(); } - - void set_bcp(address bcp) { _last_frame.interpreter_frame_set_bcp(bcp); } - void set_mdp(address dp) { _last_frame.interpreter_frame_set_mdp(dp); } - - // pass method to avoid calling unsafe bcp_to_method (partial fix 4926272) - Bytecodes::Code code() const { return Bytecodes::code_at(method(), bcp()); } - - Bytecode bytecode() const { return Bytecode(method(), bcp()); } - int get_index_u1(Bytecodes::Code bc) const { return bytecode().get_index_u1(bc); } - int get_index_u2(Bytecodes::Code bc) const { return bytecode().get_index_u2(bc); } - int get_index_u2_cpcache(Bytecodes::Code bc) const - { return bytecode().get_index_u2_cpcache(bc); } - int get_index_u4(Bytecodes::Code bc) const { return bytecode().get_index_u4(bc); } - int number_of_dimensions() const { return bcp()[3]; } - ConstantPoolCacheEntry* cache_entry_at(int i) const - { return method()->constants()->cache()->entry_at(i); } - ConstantPoolCacheEntry* cache_entry() const { return cache_entry_at(Bytes::get_native_u2(bcp() + 1)); } - - oop callee_receiver(Symbol* signature) { - return _last_frame.interpreter_callee_receiver(signature); - } - BasicObjectLock* monitor_begin() const { - return _last_frame.interpreter_frame_monitor_begin(); - } - BasicObjectLock* monitor_end() const { - return _last_frame.interpreter_frame_monitor_end(); - } - BasicObjectLock* next_monitor(BasicObjectLock* current) const { - return _last_frame.next_monitor_in_interpreter_frame(current); - } - - frame& get_frame() { return _last_frame; } - }; static void set_bcp_and_mdp(address bcp, JavaThread*thread); static void note_trap_inner(JavaThread* thread, int reason, @@ -172,7 +126,7 @@ static void _breakpoint(JavaThread* thread, Method* method, address bcp); static Bytecodes::Code get_original_bytecode_at(JavaThread* thread, Method* method, address bcp); static void set_original_bytecode_at(JavaThread* thread, Method* method, address bcp, Bytecodes::Code new_code); - static bool is_breakpoint(JavaThread *thread) { return Bytecodes::code_or_bp_at(LastFrameAccessor(thread).bcp()) == Bytecodes::_breakpoint; } + static bool is_breakpoint(JavaThread *thread); // Safepoints static void at_safepoint(JavaThread* thread); --- old/src/hotspot/share/interpreter/rewriter.cpp 2018-03-20 18:40:20.612196698 -0400 +++ new/src/hotspot/share/interpreter/rewriter.cpp 2018-03-20 18:40:19.872128021 -0400 @@ -31,6 +31,7 @@ #include "memory/resourceArea.hpp" #include "oops/generateOopMap.hpp" #include "prims/methodHandles.hpp" +#include "runtime/handles.inline.hpp" // Computes a CPC map (new_index -> original_index) for constant pool entries // that are referred to by the interpreter at runtime via the constant pool cache. --- old/src/hotspot/share/interpreter/rewriter.hpp 2018-03-20 18:40:21.445274006 -0400 +++ new/src/hotspot/share/interpreter/rewriter.hpp 2018-03-20 18:40:20.725207186 -0400 @@ -26,7 +26,6 @@ #define SHARE_VM_INTERPRETER_REWRITER_HPP #include "memory/allocation.hpp" -#include "runtime/handles.inline.hpp" #include "utilities/growableArray.hpp" // The Rewriter adds caches to the constant pool and rewrites bytecode indices --- old/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp 2018-03-20 18:40:22.303353634 -0400 +++ new/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp 2018-03-20 18:40:21.548283565 -0400 @@ -29,6 +29,7 @@ #include "interpreter/templateInterpreter.hpp" #include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" +#include "oops/methodData.hpp" #ifndef CC_INTERP --- old/src/hotspot/share/jvmci/compilerRuntime.cpp 2018-03-20 18:40:23.186435583 -0400 +++ new/src/hotspot/share/jvmci/compilerRuntime.cpp 2018-03-20 18:40:22.412363750 -0400 @@ -29,9 +29,10 @@ #include "oops/cpCache.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/compilationPolicy.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/deoptimization.hpp" #include "runtime/interfaceSupport.inline.hpp" -#include "runtime/vframe.hpp" +#include "runtime/vframe.inline.hpp" #include "aot/aotLoader.hpp" // Resolve and allocate String --- old/src/hotspot/share/jvmci/jvmciCompiler.cpp 2018-03-20 18:40:24.043515118 -0400 +++ new/src/hotspot/share/jvmci/jvmciCompiler.cpp 2018-03-20 18:40:23.291445327 -0400 @@ -34,6 +34,7 @@ #include "jvmci/jvmciRuntime.hpp" #include "runtime/compilationPolicy.hpp" #include "runtime/globals_extension.hpp" +#include "runtime/handles.inline.hpp" JVMCICompiler* JVMCICompiler::_instance = NULL; elapsedTimer JVMCICompiler::_codeInstallTimer; --- old/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp 2018-03-20 18:40:24.630569595 -0400 +++ new/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp 2018-03-20 18:40:24.146524677 -0400 @@ -36,6 +36,7 @@ #include "jvmci/jvmciCompilerToVM.hpp" #include "jvmci/jvmciCodeInstaller.hpp" #include "jvmci/jvmciRuntime.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/jniHandles.inline.hpp" #include "runtime/timerTrace.hpp" --- old/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp 2018-03-20 18:40:25.519652100 -0400 +++ new/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp 2018-03-20 18:40:24.759581567 -0400 @@ -28,6 +28,7 @@ #include "jvmci/jvmciRuntime.hpp" #include "jvmci/jvmciCompilerToVM.hpp" #include "jvmci/vmStructs_jvmci.hpp" +#include "runtime/handles.inline.hpp" #include "utilities/resourceHash.hpp" --- old/src/hotspot/share/jvmci/jvmciEnv.cpp 2018-03-20 18:40:26.399733769 -0400 +++ new/src/hotspot/share/jvmci/jvmciEnv.cpp 2018-03-20 18:40:25.633662680 -0400 @@ -29,7 +29,6 @@ #include "classfile/vmSymbols.hpp" #include "code/codeCache.hpp" #include "code/scopeDesc.hpp" -#include "runtime/sweeper.hpp" #include "compiler/compileBroker.hpp" #include "compiler/compileLog.hpp" #include "compiler/compilerOracle.hpp" @@ -45,9 +44,11 @@ #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/init.hpp" #include "runtime/reflection.hpp" #include "runtime/sharedRuntime.hpp" +#include "runtime/sweeper.hpp" #include "utilities/dtrace.hpp" #include "jvmci/jvmciRuntime.hpp" #include "jvmci/jvmciJavaClasses.hpp" --- old/src/hotspot/share/jvmci/jvmciRuntime.cpp 2018-03-20 18:40:27.187806900 -0400 +++ new/src/hotspot/share/jvmci/jvmciRuntime.cpp 2018-03-20 18:40:26.514744442 -0400 @@ -26,6 +26,7 @@ #include "asm/codeBuffer.hpp" #include "classfile/javaClasses.inline.hpp" #include "code/codeCache.hpp" +#include "code/compiledMethod.inline.hpp" #include "compiler/compileBroker.hpp" #include "compiler/disassembler.hpp" #include "jvmci/jvmciRuntime.hpp" @@ -40,6 +41,7 @@ #include "oops/oop.inline.hpp" #include "oops/objArrayOop.inline.hpp" #include "runtime/biasedLocking.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/jniHandles.inline.hpp" #include "runtime/reflection.hpp" --- old/src/hotspot/share/memory/metaspaceShared.cpp 2018-03-20 18:40:28.065888384 -0400 +++ new/src/hotspot/share/memory/metaspaceShared.cpp 2018-03-20 18:40:27.308818130 -0400 @@ -46,6 +46,7 @@ #include "logging/logMessage.hpp" #include "memory/filemap.hpp" #include "memory/metaspace.hpp" +#include "memory/metaspaceClosure.hpp" #include "memory/metaspaceShared.hpp" #include "memory/resourceArea.hpp" #include "oops/instanceClassLoaderKlass.hpp" @@ -56,15 +57,15 @@ #include "oops/oop.inline.hpp" #include "oops/typeArrayKlass.hpp" #include "prims/jvmtiRedefineClasses.hpp" -#include "runtime/timerTrace.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/os.hpp" #include "runtime/signature.hpp" +#include "runtime/timerTrace.hpp" #include "runtime/vmThread.hpp" #include "runtime/vm_operations.hpp" #include "utilities/align.hpp" #include "utilities/defaultStream.hpp" #include "utilities/hashtable.inline.hpp" -#include "memory/metaspaceClosure.hpp" ReservedSpace MetaspaceShared::_shared_rs; VirtualSpace MetaspaceShared::_shared_vs; @@ -1820,6 +1821,13 @@ os::vm_allocation_granularity()); } +unsigned MetaspaceShared::obj_hash(oop const& p) { + assert(!p->mark()->has_bias_pattern(), + "this object should never have been locked"); // so identity_hash won't safepoin + unsigned hash = (unsigned)p->identity_hash(); + return hash; +} + MetaspaceShared::ArchivedObjectCache* MetaspaceShared::_archive_object_cache = NULL; oop MetaspaceShared::find_archived_heap_object(oop obj) { assert(DumpSharedSpaces, "dump-time only"); --- old/src/hotspot/share/memory/metaspaceShared.hpp 2018-03-20 18:40:28.957971167 -0400 +++ new/src/hotspot/share/memory/metaspaceShared.hpp 2018-03-20 18:40:28.216902398 -0400 @@ -29,7 +29,7 @@ #include "memory/allocation.hpp" #include "memory/memRegion.hpp" #include "memory/virtualspace.hpp" -#include "oops/oop.inline.hpp" +#include "oops/oop.hpp" #include "utilities/exceptions.hpp" #include "utilities/macros.hpp" #include "utilities/resourceHash.hpp" @@ -96,12 +96,8 @@ static bool obj_equals(oop const& p1, oop const& p2) { return p1 == p2; } - static unsigned obj_hash(oop const& p) { - assert(!p->mark()->has_bias_pattern(), - "this object should never have been locked"); // so identity_hash won't safepoin - unsigned hash = (unsigned)p->identity_hash(); - return hash; - } + static unsigned obj_hash(oop const& p); + typedef ResourceHashtableat_acquire(which); } --- old/src/hotspot/share/oops/method.inline.hpp 2018-03-20 18:40:31.552211905 -0400 +++ new/src/hotspot/share/oops/method.inline.hpp 2018-03-20 18:40:30.788141001 -0400 @@ -26,7 +26,7 @@ #define SHARE_VM_OOPS_METHOD_INLINE_HPP #include "oops/method.hpp" -#include "runtime/orderAccess.hpp" +#include "runtime/orderAccess.inline.hpp" inline address Method::from_compiled_entry() const { return OrderAccess::load_acquire(&_from_compiled_entry); --- old/src/hotspot/share/oops/methodData.hpp 2018-03-20 18:40:32.295280860 -0400 +++ new/src/hotspot/share/oops/methodData.hpp 2018-03-20 18:40:31.653221279 -0400 @@ -27,6 +27,7 @@ #include "interpreter/bytecodes.hpp" #include "memory/universe.hpp" +#include "oops/metadata.hpp" #include "oops/method.hpp" #include "oops/oop.hpp" #include "utilities/align.hpp" --- old/src/hotspot/share/oops/typeArrayOop.hpp 2018-03-20 18:40:33.212365962 -0400 +++ new/src/hotspot/share/oops/typeArrayOop.hpp 2018-03-20 18:40:32.455295708 -0400 @@ -27,7 +27,6 @@ #include "oops/arrayOop.hpp" #include "oops/typeArrayKlass.hpp" -#include "runtime/orderAccess.inline.hpp" // A typeArrayOop is an array containing basic types (non oop elements). // It is used for arrays of {characters, singles, doubles, bytes, shorts, integers, longs} --- old/src/hotspot/share/opto/callnode.cpp 2018-03-20 18:40:34.091447538 -0400 +++ new/src/hotspot/share/opto/callnode.cpp 2018-03-20 18:40:33.315375521 -0400 @@ -26,6 +26,7 @@ #include "compiler/compileLog.hpp" #include "ci/bcEscapeAnalyzer.hpp" #include "compiler/oopMap.hpp" +#include "interpreter/interpreter.hpp" #include "opto/callGenerator.hpp" #include "opto/callnode.hpp" #include "opto/castnode.hpp" --- old/src/hotspot/share/opto/compile.hpp 2018-03-20 18:40:34.974529485 -0400 +++ new/src/hotspot/share/opto/compile.hpp 2018-03-20 18:40:34.237461088 -0400 @@ -34,6 +34,7 @@ #include "libadt/dict.hpp" #include "libadt/vectset.hpp" #include "memory/resourceArea.hpp" +#include "oops/methodData.hpp" #include "opto/idealGraphPrinter.hpp" #include "opto/phasetype.hpp" #include "opto/phase.hpp" --- old/src/hotspot/share/opto/graphKit.cpp 2018-03-20 18:40:35.737600295 -0400 +++ new/src/hotspot/share/opto/graphKit.cpp 2018-03-20 18:40:35.105541643 -0400 @@ -32,6 +32,7 @@ #include "gc/shared/cardTable.hpp" #include "gc/shared/cardTableBarrierSet.hpp" #include "gc/shared/collectedHeap.hpp" +#include "interpreter/interpreter.hpp" #include "memory/resourceArea.hpp" #include "opto/addnode.hpp" #include "opto/castnode.hpp" --- old/src/hotspot/share/opto/lcm.cpp 2018-03-20 18:40:36.736693008 -0400 +++ new/src/hotspot/share/opto/lcm.cpp 2018-03-20 18:40:35.959620898 -0400 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "asm/macroAssembler.inline.hpp" #include "memory/allocation.inline.hpp" #include "opto/ad.hpp" #include "opto/block.hpp" --- old/src/hotspot/share/opto/output.cpp 2018-03-20 18:40:37.642777089 -0400 +++ new/src/hotspot/share/opto/output.cpp 2018-03-20 18:40:36.871705537 -0400 @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "asm/assembler.inline.hpp" +#include "asm/macroAssembler.inline.hpp" #include "code/compiledIC.hpp" #include "code/debugInfo.hpp" #include "code/debugInfoRec.hpp" --- old/src/hotspot/share/opto/runtime.cpp 2018-03-20 18:40:38.585864604 -0400 +++ new/src/hotspot/share/opto/runtime.cpp 2018-03-20 18:40:37.809792588 -0400 @@ -26,6 +26,7 @@ #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "code/codeCache.hpp" +#include "code/compiledMethod.inline.hpp" #include "code/compiledIC.hpp" #include "code/icBuffer.hpp" #include "code/nmethod.hpp" @@ -60,6 +61,7 @@ #include "opto/runtime.hpp" #include "opto/subnode.hpp" #include "runtime/atomic.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/javaCalls.hpp" --- old/src/hotspot/share/prims/forte.cpp 2018-03-20 18:40:39.456945437 -0400 +++ new/src/hotspot/share/prims/forte.cpp 2018-03-20 18:40:38.726877690 -0400 @@ -30,9 +30,10 @@ #include "memory/universe.hpp" #include "oops/oop.inline.hpp" #include "prims/forte.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/javaCalls.hpp" #include "runtime/thread.inline.hpp" -#include "runtime/vframe.hpp" +#include "runtime/vframe.inline.hpp" #include "runtime/vframeArray.hpp" // call frame copied from old .h file and renamed --- old/src/hotspot/share/prims/jvm.cpp 2018-03-20 18:40:40.346027941 -0400 +++ new/src/hotspot/share/prims/jvm.cpp 2018-03-20 18:40:39.572956203 -0400 @@ -68,7 +68,7 @@ #include "runtime/reflection.hpp" #include "runtime/thread.inline.hpp" #include "runtime/threadSMR.hpp" -#include "runtime/vframe.hpp" +#include "runtime/vframe.inline.hpp" #include "runtime/vm_operations.hpp" #include "runtime/vm_version.hpp" #include "services/attachListener.hpp" --- old/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp 2018-03-20 18:40:41.307117126 -0400 +++ new/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp 2018-03-20 18:40:40.537045666 -0400 @@ -27,6 +27,7 @@ #include "interpreter/bytecodeStream.hpp" #include "oops/fieldStreams.hpp" #include "prims/jvmtiClassFileReconstituter.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/signature.hpp" #include "utilities/bytes.hpp" --- old/src/hotspot/share/prims/jvmtiEnv.cpp 2018-03-20 18:40:42.051186173 -0400 +++ new/src/hotspot/share/prims/jvmtiEnv.cpp 2018-03-20 18:40:41.427128263 -0400 @@ -59,13 +59,14 @@ #include "runtime/javaCalls.hpp" #include "runtime/jfieldIDWorkaround.hpp" #include "runtime/jniHandles.inline.hpp" +#include "runtime/objectMonitor.inline.hpp" #include "runtime/osThread.hpp" #include "runtime/reflectionUtils.hpp" #include "runtime/signature.hpp" #include "runtime/thread.inline.hpp" #include "runtime/threadSMR.hpp" #include "runtime/timerTrace.hpp" -#include "runtime/vframe.hpp" +#include "runtime/vframe.inline.hpp" #include "runtime/vmThread.hpp" #include "services/threadService.hpp" #include "utilities/exceptions.hpp" --- old/src/hotspot/share/prims/jvmtiEnvBase.cpp 2018-03-20 18:40:42.960270532 -0400 +++ new/src/hotspot/share/prims/jvmtiEnvBase.cpp 2018-03-20 18:40:42.246204269 -0400 @@ -38,6 +38,7 @@ #include "prims/jvmtiThreadState.inline.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/jfieldIDWorkaround.hpp" #include "runtime/jniHandles.inline.hpp" --- old/src/hotspot/share/prims/jvmtiEnvBase.hpp 2018-03-20 18:40:43.768345518 -0400 +++ new/src/hotspot/share/prims/jvmtiEnvBase.hpp 2018-03-20 18:40:43.100283524 -0400 @@ -29,11 +29,9 @@ #include "prims/jvmtiEnvThreadState.hpp" #include "prims/jvmtiEventController.hpp" #include "prims/jvmtiThreadState.hpp" -#include "prims/jvmtiThreadState.inline.hpp" #include "oops/oopHandle.hpp" #include "runtime/fieldDescriptor.hpp" #include "runtime/frame.hpp" -#include "runtime/handles.inline.hpp" #include "runtime/thread.hpp" #include "runtime/vm_operations.hpp" #include "utilities/growableArray.hpp" --- old/src/hotspot/share/prims/jvmtiExport.cpp 2018-03-20 18:40:44.635425979 -0400 +++ new/src/hotspot/share/prims/jvmtiExport.cpp 2018-03-20 18:40:43.881356005 -0400 @@ -56,7 +56,7 @@ #include "runtime/os.inline.hpp" #include "runtime/thread.inline.hpp" #include "runtime/threadSMR.hpp" -#include "runtime/vframe.hpp" +#include "runtime/vframe.inline.hpp" #include "services/serviceUtil.hpp" #include "utilities/macros.hpp" #if INCLUDE_ALL_GCS --- old/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp 2018-03-20 18:40:45.566512380 -0400 +++ new/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp 2018-03-20 18:40:44.795440828 -0400 @@ -27,6 +27,7 @@ #include "gc/shared/collectedHeap.hpp" #include "memory/universe.hpp" #include "prims/jvmtiGetLoadedClasses.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/jniHandles.inline.hpp" #include "runtime/thread.hpp" #include "utilities/stack.inline.hpp" --- old/src/hotspot/share/prims/jvmtiImpl.cpp 2018-03-20 18:40:46.452594604 -0400 +++ new/src/hotspot/share/prims/jvmtiImpl.cpp 2018-03-20 18:40:45.673522310 -0400 @@ -39,7 +39,7 @@ #include "prims/jvmtiRedefineClasses.hpp" #include "runtime/atomic.hpp" #include "runtime/deoptimization.hpp" -#include "runtime/handles.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/javaCalls.hpp" --- old/src/hotspot/share/prims/jvmtiRedefineClasses.cpp 2018-03-20 18:40:47.344677385 -0400 +++ new/src/hotspot/share/prims/jvmtiRedefineClasses.cpp 2018-03-20 18:40:46.576606112 -0400 @@ -47,6 +47,7 @@ #include "prims/resolvedMethodTable.hpp" #include "prims/methodComparator.hpp" #include "runtime/deoptimization.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/jniHandles.inline.hpp" #include "runtime/relocator.hpp" #include "utilities/bitMap.inline.hpp" --- old/src/hotspot/share/prims/jvmtiTagMap.cpp 2018-03-20 18:40:48.335769354 -0400 +++ new/src/hotspot/share/prims/jvmtiTagMap.cpp 2018-03-20 18:40:47.556697060 -0400 @@ -45,6 +45,8 @@ #include "prims/jvmtiImpl.hpp" #include "prims/jvmtiTagMap.hpp" #include "runtime/biasedLocking.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" #include "runtime/jniHandles.inline.hpp" #include "runtime/mutex.hpp" --- old/src/hotspot/share/prims/methodHandles.hpp 2018-03-20 18:40:49.261855290 -0400 +++ new/src/hotspot/share/prims/methodHandles.hpp 2018-03-20 18:40:48.508785409 -0400 @@ -27,12 +27,13 @@ #include "classfile/javaClasses.hpp" #include "classfile/vmSymbols.hpp" -#include "runtime/frame.inline.hpp" +#include "runtime/frame.hpp" #include "runtime/globals.hpp" #include "utilities/macros.hpp" #ifdef ZERO # include "entry_zero.hpp" +# include "interpreter/interpreter.hpp" #endif --- old/src/hotspot/share/prims/privilegedStack.cpp 2018-03-20 18:40:50.064929812 -0400 +++ new/src/hotspot/share/prims/privilegedStack.cpp 2018-03-20 18:40:49.362864664 -0400 @@ -28,7 +28,7 @@ #include "oops/method.hpp" #include "oops/oop.inline.hpp" #include "prims/privilegedStack.hpp" -#include "runtime/vframe.hpp" +#include "runtime/vframe.inline.hpp" void PrivilegedElement::initialize(vframeStream* vfst, oop context, PrivilegedElement* next, TRAPS) { Method* method = vfst->method(); --- old/src/hotspot/share/prims/stackwalk.cpp 2018-03-20 18:40:50.912008416 -0400 +++ new/src/hotspot/share/prims/stackwalk.cpp 2018-03-20 18:40:50.165939185 -0400 @@ -35,7 +35,7 @@ #include "runtime/globals.hpp" #include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" -#include "runtime/vframe.hpp" +#include "runtime/vframe.inline.hpp" #include "utilities/globalDefinitions.hpp" // setup and cleanup actions @@ -64,6 +64,8 @@ _need_method_info = StackWalk::need_method_info(mode); } +void JavaFrameStream::next() { _vfst.next();} + // Returns the BaseFrameStream for the current stack being traversed. // // Parameters: --- old/src/hotspot/share/prims/stackwalk.hpp 2018-03-20 18:40:51.798090641 -0400 +++ new/src/hotspot/share/prims/stackwalk.hpp 2018-03-20 18:40:51.024018810 -0400 @@ -80,7 +80,7 @@ public: JavaFrameStream(JavaThread* thread, int mode); - void next() { _vfst.next();} + void next(); bool at_end() { return _vfst.at_end(); } Method* method() { return _vfst.method(); } --- old/src/hotspot/share/prims/whitebox.cpp 2018-03-20 18:40:52.563161635 -0400 +++ new/src/hotspot/share/prims/whitebox.cpp 2018-03-20 18:40:51.899100013 -0400 @@ -51,6 +51,7 @@ #include "runtime/arguments.hpp" #include "runtime/compilationPolicy.hpp" #include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/handshake.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/javaCalls.hpp" --- old/src/hotspot/share/runtime/advancedThresholdPolicy.cpp 2018-03-20 18:40:53.310230959 -0400 +++ new/src/hotspot/share/runtime/advancedThresholdPolicy.cpp 2018-03-20 18:40:52.738177875 -0400 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "code/codeCache.hpp" #include "runtime/advancedThresholdPolicy.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/simpleThresholdPolicy.inline.hpp" #if INCLUDE_JVMCI #include "jvmci/jvmciRuntime.hpp" --- old/src/hotspot/share/runtime/deoptimization.cpp 2018-03-20 18:40:54.144308357 -0400 +++ new/src/hotspot/share/runtime/deoptimization.cpp 2018-03-20 18:40:53.424241539 -0400 @@ -46,6 +46,7 @@ #include "runtime/biasedLocking.hpp" #include "runtime/compilationPolicy.hpp" #include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/signature.hpp" --- old/src/hotspot/share/runtime/deoptimization.hpp 2018-03-20 18:40:54.944382600 -0400 +++ new/src/hotspot/share/runtime/deoptimization.hpp 2018-03-20 18:40:54.302323020 -0400 @@ -26,7 +26,7 @@ #define SHARE_VM_RUNTIME_DEOPTIMIZATION_HPP #include "memory/allocation.hpp" -#include "runtime/frame.inline.hpp" +#include "runtime/frame.hpp" class ProfileData; class vframeArray; --- old/src/hotspot/share/runtime/frame.hpp 2018-03-20 18:40:55.831464916 -0400 +++ new/src/hotspot/share/runtime/frame.hpp 2018-03-20 18:40:55.054392808 -0400 @@ -269,7 +269,6 @@ // expression stack (may go up or down, direction == 1 or -1) public: intptr_t* interpreter_frame_expression_stack() const; - static jint interpreter_frame_expression_stack_direction(); // The _at version returns a pointer because the address is used for GC. intptr_t* interpreter_frame_expression_stack_at(jint offset) const; @@ -462,7 +461,7 @@ StackFrameStream(JavaThread *thread, bool update = true); // Iteration - bool is_done() { return (_is_done) ? true : (_is_done = _fr.is_first_frame(), false); } + inline bool is_done(); void next() { if (!_is_done) _fr = _fr.sender(&_reg_map); } // Query --- old/src/hotspot/share/runtime/frame.inline.hpp 2018-03-20 18:40:56.635539530 -0400 +++ new/src/hotspot/share/runtime/frame.inline.hpp 2018-03-20 18:40:55.940475032 -0400 @@ -63,4 +63,8 @@ } } +inline bool StackFrameStream::is_done() { + return (_is_done) ? true : (_is_done = _fr.is_first_frame(), false); +} + #endif // SHARE_VM_RUNTIME_FRAME_INLINE_HPP --- old/src/hotspot/share/runtime/interfaceSupport.cpp 2018-03-20 18:40:57.334604399 -0400 +++ new/src/hotspot/share/runtime/interfaceSupport.cpp 2018-03-20 18:40:56.738549089 -0400 @@ -28,6 +28,7 @@ #include "gc/shared/genCollectedHeap.hpp" #include "memory/resourceArea.hpp" #include "runtime/atomic.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/init.hpp" #include "runtime/interfaceSupport.inline.hpp" @@ -35,6 +36,7 @@ #include "runtime/os.inline.hpp" #include "runtime/thread.inline.hpp" #include "runtime/vframe.hpp" +#include "runtime/vmThread.hpp" #include "utilities/preserveException.hpp" // Implementation of InterfaceSupport --- old/src/hotspot/share/runtime/javaFrameAnchor.hpp 2018-03-20 18:40:58.163681333 -0400 +++ new/src/hotspot/share/runtime/javaFrameAnchor.hpp 2018-03-20 18:40:57.441614329 -0400 @@ -25,7 +25,6 @@ #ifndef SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP #define SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP -#include "runtime/orderAccess.inline.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" @@ -33,6 +32,7 @@ // An object for encapsulating the machine/os dependent part of a JavaThread frame state // class JavaThread; +class MacroAssembler; class JavaFrameAnchor { // Too many friends... --- old/src/hotspot/share/runtime/reflection.cpp 2018-03-20 18:40:58.976756781 -0400 +++ new/src/hotspot/share/runtime/reflection.cpp 2018-03-20 18:40:58.264690706 -0400 @@ -47,7 +47,7 @@ #include "runtime/reflection.hpp" #include "runtime/reflectionUtils.hpp" #include "runtime/signature.hpp" -#include "runtime/vframe.hpp" +#include "runtime/vframe.inline.hpp" static void trace_class_resolution(const Klass* to_class) { ResourceMark rm; --- old/src/hotspot/share/runtime/rframe.hpp 2018-03-20 18:40:59.812834364 -0400 +++ new/src/hotspot/share/runtime/rframe.hpp 2018-03-20 18:40:59.105768753 -0400 @@ -26,7 +26,7 @@ #define SHARE_VM_RUNTIME_RFRAME_HPP #include "memory/allocation.hpp" -#include "runtime/frame.inline.hpp" +#include "runtime/frame.hpp" // rframes ("recompiler frames") decorate stack frames with some extra information // needed by the recompiler. The recompiler views the stack (at the time of recompilation) --- old/src/hotspot/share/runtime/sharedRuntime.cpp 2018-03-20 18:41:00.636910834 -0400 +++ new/src/hotspot/share/runtime/sharedRuntime.cpp 2018-03-20 18:40:59.915843923 -0400 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "jvm.h" #include "aot/aotLoader.hpp" +#include "code/compiledMethod.inline.hpp" #include "classfile/stringTable.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" @@ -54,6 +55,7 @@ #include "runtime/atomic.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/compilationPolicy.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/init.hpp" #include "runtime/interfaceSupport.inline.hpp" @@ -61,7 +63,7 @@ #include "runtime/javaCalls.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" -#include "runtime/vframe.hpp" +#include "runtime/vframe.inline.hpp" #include "runtime/vframeArray.hpp" #include "trace/tracing.hpp" #include "utilities/copy.hpp" --- old/src/hotspot/share/runtime/simpleThresholdPolicy.cpp 2018-03-20 18:41:01.489989994 -0400 +++ new/src/hotspot/share/runtime/simpleThresholdPolicy.cpp 2018-03-20 18:41:00.817927631 -0400 @@ -27,6 +27,7 @@ #include "gc/shared/gcLocker.hpp" #include "memory/resourceArea.hpp" #include "runtime/arguments.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/simpleThresholdPolicy.hpp" #include "runtime/simpleThresholdPolicy.inline.hpp" #include "code/scopeDesc.hpp" --- old/src/hotspot/share/runtime/sweeper.cpp 2018-03-20 18:41:02.329067856 -0400 +++ new/src/hotspot/share/runtime/sweeper.cpp 2018-03-20 18:41:01.599000110 -0400 @@ -42,6 +42,7 @@ #include "runtime/sweeper.hpp" #include "runtime/thread.inline.hpp" #include "runtime/vm_operations.hpp" +#include "runtime/vmThread.hpp" #include "trace/tracing.hpp" #include "utilities/events.hpp" #include "utilities/ticks.inline.hpp" --- old/src/hotspot/share/runtime/synchronizer.cpp 2018-03-20 18:41:03.188147573 -0400 +++ new/src/hotspot/share/runtime/synchronizer.cpp 2018-03-20 18:41:02.450079084 -0400 @@ -43,6 +43,7 @@ #include "runtime/synchronizer.hpp" #include "runtime/thread.inline.hpp" #include "runtime/vframe.hpp" +#include "runtime/vmThread.hpp" #include "trace/traceMacros.hpp" #include "trace/tracing.hpp" #include "utilities/align.hpp" --- old/src/hotspot/share/runtime/thread.cpp 2018-03-20 18:41:04.105232672 -0400 +++ new/src/hotspot/share/runtime/thread.cpp 2018-03-20 18:41:03.341161771 -0400 @@ -92,7 +92,7 @@ #include "runtime/threadSMR.inline.hpp" #include "runtime/timer.hpp" #include "runtime/timerTrace.hpp" -#include "runtime/vframe.hpp" +#include "runtime/vframe.inline.hpp" #include "runtime/vframeArray.hpp" #include "runtime/vframe_hp.hpp" #include "runtime/vmThread.hpp" --- old/src/hotspot/share/runtime/thread.inline.hpp 2018-03-20 18:41:05.089323990 -0400 +++ new/src/hotspot/share/runtime/thread.inline.hpp 2018-03-20 18:41:04.327253275 -0400 @@ -26,6 +26,7 @@ #define SHARE_VM_RUNTIME_THREAD_INLINE_HPP #include "runtime/atomic.hpp" +#include "runtime/orderAccess.inline.hpp" #include "runtime/os.inline.hpp" #include "runtime/thread.hpp" --- old/src/hotspot/share/runtime/vframe.cpp 2018-03-20 18:41:05.961404913 -0400 +++ new/src/hotspot/share/runtime/vframe.cpp 2018-03-20 18:41:05.192333548 -0400 @@ -36,13 +36,14 @@ #include "memory/resourceArea.hpp" #include "oops/instanceKlass.hpp" #include "oops/oop.inline.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/objectMonitor.hpp" #include "runtime/objectMonitor.inline.hpp" #include "runtime/signature.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/synchronizer.hpp" -#include "runtime/vframe.hpp" +#include "runtime/vframe.inline.hpp" #include "runtime/vframeArray.hpp" #include "runtime/vframe_hp.hpp" --- old/src/hotspot/share/runtime/vframe.hpp 2018-03-20 18:41:06.837486208 -0400 +++ new/src/hotspot/share/runtime/vframe.hpp 2018-03-20 18:41:06.078415771 -0400 @@ -30,7 +30,6 @@ #include "code/location.hpp" #include "oops/oop.hpp" #include "runtime/frame.hpp" -#include "runtime/frame.inline.hpp" #include "runtime/stackValue.hpp" #include "runtime/stackValueCollection.hpp" #include "utilities/growableArray.hpp" @@ -307,14 +306,12 @@ public: // Constructor - vframeStreamCommon(JavaThread* thread) : _reg_map(thread, false) { - _thread = thread; - } + vframeStreamCommon(JavaThread* thread); // Accessors Method* method() const { return _method; } int bci() const { return _bci; } - intptr_t* frame_id() const { return _frame.id(); } + intptr_t* frame_id() const; address frame_pc() const { return _frame.pc(); } CodeBlob* cb() const { return _frame.cb(); } @@ -324,19 +321,11 @@ } // Frame type - bool is_interpreted_frame() const { return _frame.is_interpreted_frame(); } - bool is_entry_frame() const { return _frame.is_entry_frame(); } + bool is_interpreted_frame() const; + bool is_entry_frame() const; // Iteration - void next() { - // handle frames with inlining - if (_mode == compiled_mode && fill_in_compiled_inlined_sender()) return; - - // handle general case - do { - _frame = _frame.sender(&_reg_map); - } while (!fill_from_frame()); - } + void next(); void security_next(); bool at_end() const { return _mode == at_end_mode; } @@ -353,182 +342,10 @@ class vframeStream : public vframeStreamCommon { public: // Constructors - vframeStream(JavaThread* thread, bool stop_at_java_call_stub = false) - : vframeStreamCommon(thread) { - _stop_at_java_call_stub = stop_at_java_call_stub; - - if (!thread->has_last_Java_frame()) { - _mode = at_end_mode; - return; - } - - _frame = _thread->last_frame(); - while (!fill_from_frame()) { - _frame = _frame.sender(&_reg_map); - } - } + vframeStream(JavaThread* thread, bool stop_at_java_call_stub = false); // top_frame may not be at safepoint, start with sender vframeStream(JavaThread* thread, frame top_frame, bool stop_at_java_call_stub = false); }; - -inline bool vframeStreamCommon::fill_in_compiled_inlined_sender() { - if (_sender_decode_offset == DebugInformationRecorder::serialized_null) { - return false; - } - fill_from_compiled_frame(_sender_decode_offset); - return true; -} - - -inline void vframeStreamCommon::fill_from_compiled_frame(int decode_offset) { - _mode = compiled_mode; - - // Range check to detect ridiculous offsets. - if (decode_offset == DebugInformationRecorder::serialized_null || - decode_offset < 0 || - decode_offset >= nm()->scopes_data_size()) { - // 6379830 AsyncGetCallTrace sometimes feeds us wild frames. - // If we read nmethod::scopes_data at serialized_null (== 0) - // or if read some at other invalid offset, invalid values will be decoded. - // Based on these values, invalid heap locations could be referenced - // that could lead to crashes in product mode. - // Therefore, do not use the decode offset if invalid, but fill the frame - // as it were a native compiled frame (no Java-level assumptions). -#ifdef ASSERT - if (WizardMode) { - ttyLocker ttyl; - tty->print_cr("Error in fill_from_frame: pc_desc for " - INTPTR_FORMAT " not found or invalid at %d", - p2i(_frame.pc()), decode_offset); - nm()->print(); - nm()->method()->print_codes(); - nm()->print_code(); - nm()->print_pcs(); - } - found_bad_method_frame(); -#endif - // Provide a cheap fallback in product mode. (See comment above.) - fill_from_compiled_native_frame(); - return; - } - - // Decode first part of scopeDesc - DebugInfoReadStream buffer(nm(), decode_offset); - _sender_decode_offset = buffer.read_int(); - _method = buffer.read_method(); - _bci = buffer.read_bci(); - - assert(_method->is_method(), "checking type of decoded method"); -} - -// The native frames are handled specially. We do not rely on ScopeDesc info -// since the pc might not be exact due to the _last_native_pc trick. -inline void vframeStreamCommon::fill_from_compiled_native_frame() { - _mode = compiled_mode; - _sender_decode_offset = DebugInformationRecorder::serialized_null; - _method = nm()->method(); - _bci = 0; -} - -inline bool vframeStreamCommon::fill_from_frame() { - // Interpreted frame - if (_frame.is_interpreted_frame()) { - fill_from_interpreter_frame(); - return true; - } - - // Compiled frame - - if (cb() != NULL && cb()->is_compiled()) { - if (nm()->is_native_method()) { - // Do not rely on scopeDesc since the pc might be unprecise due to the _last_native_pc trick. - fill_from_compiled_native_frame(); - } else { - PcDesc* pc_desc = nm()->pc_desc_at(_frame.pc()); - int decode_offset; - if (pc_desc == NULL) { - // Should not happen, but let fill_from_compiled_frame handle it. - - // If we are trying to walk the stack of a thread that is not - // at a safepoint (like AsyncGetCallTrace would do) then this is an - // acceptable result. [ This is assuming that safe_for_sender - // is so bullet proof that we can trust the frames it produced. ] - // - // So if we see that the thread is not safepoint safe - // then simply produce the method and a bci of zero - // and skip the possibility of decoding any inlining that - // may be present. That is far better than simply stopping (or - // asserting. If however the thread is safepoint safe this - // is the sign of a compiler bug and we'll let - // fill_from_compiled_frame handle it. - - - JavaThreadState state = _thread->thread_state(); - - // in_Java should be good enough to test safepoint safety - // if state were say in_Java_trans then we'd expect that - // the pc would have already been slightly adjusted to - // one that would produce a pcDesc since the trans state - // would be one that might in fact anticipate a safepoint - - if (state == _thread_in_Java ) { - // This will get a method a zero bci and no inlining. - // Might be nice to have a unique bci to signify this - // particular case but for now zero will do. - - fill_from_compiled_native_frame(); - - // There is something to be said for setting the mode to - // at_end_mode to prevent trying to walk further up the - // stack. There is evidence that if we walk any further - // that we could produce a bad stack chain. However until - // we see evidence that allowing this causes us to find - // frames bad enough to cause segv's or assertion failures - // we don't do it as while we may get a bad call chain the - // probability is much higher (several magnitudes) that we - // get good data. - - return true; - } - decode_offset = DebugInformationRecorder::serialized_null; - } else { - decode_offset = pc_desc->scope_decode_offset(); - } - fill_from_compiled_frame(decode_offset); - } - return true; - } - - // End of stack? - if (_frame.is_first_frame() || (_stop_at_java_call_stub && _frame.is_entry_frame())) { - _mode = at_end_mode; - return true; - } - - return false; -} - - -inline void vframeStreamCommon::fill_from_interpreter_frame() { - Method* method = _frame.interpreter_frame_method(); - address bcp = _frame.interpreter_frame_bcp(); - int bci = method->validate_bci_from_bcp(bcp); - // 6379830 AsyncGetCallTrace sometimes feeds us wild frames. - // AsyncGetCallTrace interrupts the VM asynchronously. As a result - // it is possible to access an interpreter frame for which - // no Java-level information is yet available (e.g., becasue - // the frame was being created when the VM interrupted it). - // In this scenario, pretend that the interpreter is at the point - // of entering the method. - if (bci < 0) { - DEBUG_ONLY(found_bad_method_frame();) - bci = 0; - } - _mode = interpreted_mode; - _method = method; - _bci = bci; -} - #endif // SHARE_VM_RUNTIME_VFRAME_HPP --- old/src/hotspot/share/runtime/vframeArray.cpp 2018-03-20 18:41:07.568554046 -0400 +++ new/src/hotspot/share/runtime/vframeArray.cpp 2018-03-20 18:41:06.951496787 -0400 @@ -33,6 +33,7 @@ #include "oops/methodData.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiThreadState.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/monitorChunk.hpp" #include "runtime/sharedRuntime.hpp" @@ -489,6 +490,9 @@ } +intptr_t* vframeArray::unextended_sp() const { + return _original.unextended_sp(); +} vframeArray* vframeArray::allocate(JavaThread* thread, int frame_size, GrowableArray* chunk, RegisterMap *reg_map, frame sender, frame caller, frame self, --- old/src/hotspot/share/runtime/vframeArray.hpp 2018-03-20 18:41:08.450635897 -0400 +++ new/src/hotspot/share/runtime/vframeArray.hpp 2018-03-20 18:41:07.682564625 -0400 @@ -28,7 +28,7 @@ #include "memory/allocation.hpp" #include "oops/arrayOop.hpp" #include "runtime/deoptimization.hpp" -#include "runtime/frame.inline.hpp" +#include "runtime/frame.hpp" #include "runtime/monitorChunk.hpp" #include "utilities/growableArray.hpp" @@ -189,7 +189,7 @@ // Accessors for sp intptr_t* sp() const { return _original.sp(); } - intptr_t* unextended_sp() const { return _original.unextended_sp(); } + intptr_t* unextended_sp() const; address original_pc() const { return _original.pc(); } --- old/src/hotspot/share/runtime/vframe_hp.cpp 2018-03-20 18:41:09.323716913 -0400 +++ new/src/hotspot/share/runtime/vframe_hp.cpp 2018-03-20 18:41:08.552645363 -0400 @@ -34,6 +34,7 @@ #include "oops/instanceKlass.hpp" #include "oops/oop.inline.hpp" #include "runtime/basicLock.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/monitorChunk.hpp" #include "runtime/signature.hpp" --- old/src/hotspot/share/runtime/vm_operations.cpp 2018-03-20 18:41:10.220800156 -0400 +++ new/src/hotspot/share/runtime/vm_operations.cpp 2018-03-20 18:41:09.438727585 -0400 @@ -35,6 +35,7 @@ #include "oops/symbol.hpp" #include "runtime/arguments.hpp" #include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/sweeper.hpp" #include "runtime/thread.inline.hpp" --- old/src/hotspot/share/services/diagnosticCommand.cpp 2018-03-20 18:41:11.108882564 -0400 +++ new/src/hotspot/share/services/diagnosticCommand.cpp 2018-03-20 18:41:10.331810457 -0400 @@ -30,9 +30,11 @@ #include "compiler/directivesParser.hpp" #include "gc/shared/vmGCOperations.hpp" #include "memory/resourceArea.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/typeArrayOop.inline.hpp" #include "runtime/globals.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" #include "runtime/os.hpp" #include "services/diagnosticArgument.hpp" @@ -44,7 +46,6 @@ #include "utilities/debug.hpp" #include "utilities/formatBuffer.hpp" #include "utilities/macros.hpp" -#include "oops/objArrayOop.inline.hpp" static void loadAgentModule(TRAPS) { --- old/src/hotspot/share/services/heapDumper.cpp 2018-03-20 18:41:12.015966735 -0400 +++ new/src/hotspot/share/services/heapDumper.cpp 2018-03-20 18:41:11.228893700 -0400 @@ -37,6 +37,7 @@ #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/typeArrayOop.inline.hpp" +#include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" #include "runtime/jniHandles.hpp" --- old/src/hotspot/share/services/memTracker.cpp 2018-03-20 18:41:12.804039862 -0400 +++ new/src/hotspot/share/services/memTracker.cpp 2018-03-20 18:41:12.165980655 -0400 @@ -25,6 +25,7 @@ #include "jvm.h" #include "runtime/mutex.hpp" +#include "runtime/orderAccess.inline.hpp" #include "runtime/vmThread.hpp" #include "runtime/vm_operations.hpp" #include "services/memBaseline.hpp" --- old/src/hotspot/share/services/threadService.cpp 2018-03-20 18:41:13.609114567 -0400 +++ new/src/hotspot/share/services/threadService.cpp 2018-03-20 18:41:12.913049978 -0400 @@ -34,6 +34,7 @@ #include "runtime/atomic.hpp" #include "runtime/handles.inline.hpp" #include "runtime/init.hpp" +#include "runtime/objectMonitor.inline.hpp" #include "runtime/thread.inline.hpp" #include "runtime/threadSMR.inline.hpp" #include "runtime/vframe.hpp" --- old/src/hotspot/share/services/threadService.hpp 2018-03-20 18:41:14.498197068 -0400 +++ new/src/hotspot/share/services/threadService.hpp 2018-03-20 18:41:13.731125889 -0400 @@ -30,7 +30,6 @@ #include "runtime/init.hpp" #include "runtime/jniHandles.hpp" #include "runtime/objectMonitor.hpp" -#include "runtime/objectMonitor.inline.hpp" #include "runtime/perfData.hpp" #include "runtime/thread.hpp" #include "runtime/threadSMR.hpp" --- old/src/hotspot/share/utilities/debug.cpp 2018-03-20 18:41:15.222264256 -0400 +++ new/src/hotspot/share/utilities/debug.cpp 2018-03-20 18:41:14.609207368 -0400 @@ -40,7 +40,8 @@ #include "prims/privilegedStack.hpp" #include "runtime/arguments.hpp" #include "runtime/atomic.hpp" -#include "runtime/frame.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/java.hpp" #include "runtime/os.hpp" #include "runtime/sharedRuntime.hpp" --- old/src/hotspot/share/utilities/exceptions.cpp 2018-03-20 18:41:15.988335341 -0400 +++ new/src/hotspot/share/utilities/exceptions.cpp 2018-03-20 18:41:15.338275021 -0400 @@ -30,6 +30,7 @@ #include "logging/logStream.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" #include "runtime/init.hpp" #include "runtime/java.hpp" #include "runtime/javaCalls.hpp" --- /dev/null 2018-02-03 04:43:52.625000053 -0500 +++ new/src/hotspot/share/runtime/vframe.inline.hpp 2018-03-20 18:41:16.101345828 -0400 @@ -0,0 +1,224 @@ +/* + * Copyright (c) 2018, 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. + * + */ + +#ifndef SHARE_VM_RUNTIME_VFRAME_INLINE_HPP +#define SHARE_VM_RUNTIME_VFRAME_INLINE_HPP + +#include "runtime/frame.inline.hpp" +#include "runtime/vframe.hpp" + +inline vframeStreamCommon::vframeStreamCommon(JavaThread* thread) : _reg_map(thread, false) { + _thread = thread; +} + +inline intptr_t* vframeStreamCommon::frame_id() const { return _frame.id(); } + +inline bool vframeStreamCommon::is_interpreted_frame() const { return _frame.is_interpreted_frame(); } + +inline bool vframeStreamCommon::is_entry_frame() const { return _frame.is_entry_frame(); } + +inline void vframeStreamCommon::next() { + // handle frames with inlining + if (_mode == compiled_mode && fill_in_compiled_inlined_sender()) return; + + // handle general case + do { + _frame = _frame.sender(&_reg_map); + } while (!fill_from_frame()); +} + +inline vframeStream::vframeStream(JavaThread* thread, bool stop_at_java_call_stub) + : vframeStreamCommon(thread) { + _stop_at_java_call_stub = stop_at_java_call_stub; + + if (!thread->has_last_Java_frame()) { + _mode = at_end_mode; + return; + } + + _frame = _thread->last_frame(); + while (!fill_from_frame()) { + _frame = _frame.sender(&_reg_map); + } +} + +inline bool vframeStreamCommon::fill_in_compiled_inlined_sender() { + if (_sender_decode_offset == DebugInformationRecorder::serialized_null) { + return false; + } + fill_from_compiled_frame(_sender_decode_offset); + return true; +} + + +inline void vframeStreamCommon::fill_from_compiled_frame(int decode_offset) { + _mode = compiled_mode; + + // Range check to detect ridiculous offsets. + if (decode_offset == DebugInformationRecorder::serialized_null || + decode_offset < 0 || + decode_offset >= nm()->scopes_data_size()) { + // 6379830 AsyncGetCallTrace sometimes feeds us wild frames. + // If we read nmethod::scopes_data at serialized_null (== 0) + // or if read some at other invalid offset, invalid values will be decoded. + // Based on these values, invalid heap locations could be referenced + // that could lead to crashes in product mode. + // Therefore, do not use the decode offset if invalid, but fill the frame + // as it were a native compiled frame (no Java-level assumptions). +#ifdef ASSERT + if (WizardMode) { + ttyLocker ttyl; + tty->print_cr("Error in fill_from_frame: pc_desc for " + INTPTR_FORMAT " not found or invalid at %d", + p2i(_frame.pc()), decode_offset); + nm()->print(); + nm()->method()->print_codes(); + nm()->print_code(); + nm()->print_pcs(); + } + found_bad_method_frame(); +#endif + // Provide a cheap fallback in product mode. (See comment above.) + fill_from_compiled_native_frame(); + return; + } + + // Decode first part of scopeDesc + DebugInfoReadStream buffer(nm(), decode_offset); + _sender_decode_offset = buffer.read_int(); + _method = buffer.read_method(); + _bci = buffer.read_bci(); + + assert(_method->is_method(), "checking type of decoded method"); +} + +// The native frames are handled specially. We do not rely on ScopeDesc info +// since the pc might not be exact due to the _last_native_pc trick. +inline void vframeStreamCommon::fill_from_compiled_native_frame() { + _mode = compiled_mode; + _sender_decode_offset = DebugInformationRecorder::serialized_null; + _method = nm()->method(); + _bci = 0; +} + +inline bool vframeStreamCommon::fill_from_frame() { + // Interpreted frame + if (_frame.is_interpreted_frame()) { + fill_from_interpreter_frame(); + return true; + } + + // Compiled frame + + if (cb() != NULL && cb()->is_compiled()) { + if (nm()->is_native_method()) { + // Do not rely on scopeDesc since the pc might be unprecise due to the _last_native_pc trick. + fill_from_compiled_native_frame(); + } else { + PcDesc* pc_desc = nm()->pc_desc_at(_frame.pc()); + int decode_offset; + if (pc_desc == NULL) { + // Should not happen, but let fill_from_compiled_frame handle it. + + // If we are trying to walk the stack of a thread that is not + // at a safepoint (like AsyncGetCallTrace would do) then this is an + // acceptable result. [ This is assuming that safe_for_sender + // is so bullet proof that we can trust the frames it produced. ] + // + // So if we see that the thread is not safepoint safe + // then simply produce the method and a bci of zero + // and skip the possibility of decoding any inlining that + // may be present. That is far better than simply stopping (or + // asserting. If however the thread is safepoint safe this + // is the sign of a compiler bug and we'll let + // fill_from_compiled_frame handle it. + + + JavaThreadState state = _thread->thread_state(); + + // in_Java should be good enough to test safepoint safety + // if state were say in_Java_trans then we'd expect that + // the pc would have already been slightly adjusted to + // one that would produce a pcDesc since the trans state + // would be one that might in fact anticipate a safepoint + + if (state == _thread_in_Java ) { + // This will get a method a zero bci and no inlining. + // Might be nice to have a unique bci to signify this + // particular case but for now zero will do. + + fill_from_compiled_native_frame(); + + // There is something to be said for setting the mode to + // at_end_mode to prevent trying to walk further up the + // stack. There is evidence that if we walk any further + // that we could produce a bad stack chain. However until + // we see evidence that allowing this causes us to find + // frames bad enough to cause segv's or assertion failures + // we don't do it as while we may get a bad call chain the + // probability is much higher (several magnitudes) that we + // get good data. + + return true; + } + decode_offset = DebugInformationRecorder::serialized_null; + } else { + decode_offset = pc_desc->scope_decode_offset(); + } + fill_from_compiled_frame(decode_offset); + } + return true; + } + + // End of stack? + if (_frame.is_first_frame() || (_stop_at_java_call_stub && _frame.is_entry_frame())) { + _mode = at_end_mode; + return true; + } + + return false; +} + + +inline void vframeStreamCommon::fill_from_interpreter_frame() { + Method* method = _frame.interpreter_frame_method(); + address bcp = _frame.interpreter_frame_bcp(); + int bci = method->validate_bci_from_bcp(bcp); + // 6379830 AsyncGetCallTrace sometimes feeds us wild frames. + // AsyncGetCallTrace interrupts the VM asynchronously. As a result + // it is possible to access an interpreter frame for which + // no Java-level information is yet available (e.g., becasue + // the frame was being created when the VM interrupted it). + // In this scenario, pretend that the interpreter is at the point + // of entering the method. + if (bci < 0) { + DEBUG_ONLY(found_bad_method_frame();) + bci = 0; + } + _mode = interpreted_mode; + _method = method; + _bci = bci; +} + +#endif // SHARE_VM_RUNTIME_VFRAME_INLINE_HPP