Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Automatic merge of jdk:master into master
  • Loading branch information
duke committed Sep 11, 2020
2 parents 4a8f2d2 + 976acdd commit 389eab6fe85ce8de842e98368bb5c353169160f2
Showing with 360 additions and 456 deletions.
  1. +3 −6 src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp
  2. +2 −4 src/hotspot/cpu/x86/gc/shared/barrierSetNMethod_x86.cpp
  3. +1 −1 src/hotspot/cpu/zero/frame_zero.cpp
  4. +6 −6 src/hotspot/cpu/zero/methodHandles_zero.cpp
  5. +1 −1 src/hotspot/cpu/zero/stack_zero.cpp
  6. +3 −3 src/hotspot/cpu/zero/stubGenerator_zero.cpp
  7. +9 −9 src/hotspot/cpu/zero/zeroInterpreter_zero.cpp
  8. +3 −5 src/hotspot/os/linux/os_linux.cpp
  9. +2 −4 src/hotspot/os/posix/os_posix.cpp
  10. +6 −7 src/hotspot/os/windows/os_windows.cpp
  11. +1 −1 src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
  12. +1 −1 src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp
  13. +4 −7 src/hotspot/os_cpu/bsd_x86/thread_bsd_x86.cpp
  14. +1 −1 src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp
  15. +1 −1 src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
  16. +4 −8 src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.cpp
  17. +1 −1 src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp
  18. +5 −9 src/hotspot/os_cpu/linux_arm/thread_linux_arm.cpp
  19. +1 −1 src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
  20. +1 −2 src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp
  21. +1 −1 src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp
  22. +0 −1 src/hotspot/os_cpu/linux_s390/thread_linux_s390.cpp
  23. +1 −1 src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
  24. +4 −8 src/hotspot/os_cpu/linux_x86/thread_linux_x86.cpp
  25. +1 −1 src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp
  26. +4 −9 src/hotspot/os_cpu/windows_x86/thread_windows_x86.cpp
  27. +1 −1 src/hotspot/share/ci/ciMethod.cpp
  28. +1 −1 src/hotspot/share/classfile/classLoaderExt.cpp
  29. +3 −5 src/hotspot/share/classfile/javaClasses.cpp
  30. +1 −2 src/hotspot/share/classfile/klassFactory.cpp
  31. +15 −21 src/hotspot/share/classfile/systemDictionary.cpp
  32. +1 −2 src/hotspot/share/classfile/systemDictionaryShared.cpp
  33. +2 −2 src/hotspot/share/classfile/verifier.cpp
  34. +6 −4 src/hotspot/share/code/dependencies.cpp
  35. +1 −1 src/hotspot/share/compiler/compileBroker.cpp
  36. +1 −2 src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
  37. +2 −2 src/hotspot/share/gc/shared/cardTableBarrierSet.cpp
  38. +1 −2 src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp
  39. +3 −2 src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
  40. +1 −1 src/hotspot/share/gc/z/zFuture.inline.hpp
  41. +2 −2 src/hotspot/share/gc/z/zObjArrayAllocator.cpp
  42. +6 −12 src/hotspot/share/jfr/instrumentation/jfrJvmtiAgent.cpp
  43. +4 −7 src/hotspot/share/jfr/jni/jfrJavaSupport.cpp
  44. +2 −2 src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp
  45. +2 −3 src/hotspot/share/jfr/periodic/jfrPeriodic.cpp
  46. +1 −1 src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp
  47. +7 −8 src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp
  48. +2 −3 src/hotspot/share/jfr/recorder/checkpoint/jfrMetadataEvent.cpp
  49. +3 −5 src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.cpp
  50. +2 −2 src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp
  51. +2 −2 src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp
  52. +1 −1 src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp
  53. +1 −1 src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.cpp
  54. +2 −2 src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.cpp
  55. +1 −1 src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp
  56. +2 −2 src/hotspot/share/jfr/recorder/service/jfrPostBox.cpp
  57. +2 −2 src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp
  58. +2 −2 src/hotspot/share/jfr/recorder/stacktrace/jfrStackTraceRepository.cpp
  59. +2 −3 src/hotspot/share/jfr/support/jfrAllocationTracer.cpp
  60. +2 −5 src/hotspot/share/jfr/support/jfrEpochSynchronization.cpp
  61. +2 −2 src/hotspot/share/jfr/support/jfrThreadLocal.cpp
  62. +1 −1 src/hotspot/share/jfr/writers/jfrJavaEventWriter.cpp
  63. +1 −1 src/hotspot/share/jvmci/jvmciCompiler.cpp
  64. +1 −2 src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
  65. +6 −5 src/hotspot/share/jvmci/jvmciEnv.cpp
  66. +1 −2 src/hotspot/share/oops/constantPool.cpp
  67. +5 −9 src/hotspot/share/oops/instanceKlass.cpp
  68. +1 −1 src/hotspot/share/oops/objArrayKlass.cpp
  69. +1 −1 src/hotspot/share/oops/typeArrayKlass.cpp
  70. +4 −4 src/hotspot/share/prims/jni.cpp
  71. +3 −2 src/hotspot/share/prims/jniCheck.cpp
  72. +6 −10 src/hotspot/share/prims/jvm.cpp
  73. +64 −64 src/hotspot/share/prims/jvmtiEnter.xsl
  74. +1 −1 src/hotspot/share/prims/jvmtiEnv.cpp
  75. +6 −11 src/hotspot/share/prims/jvmtiEnvBase.cpp
  76. +1 −1 src/hotspot/share/prims/jvmtiEnvThreadState.cpp
  77. +2 −4 src/hotspot/share/prims/jvmtiEventController.cpp
  78. +4 −4 src/hotspot/share/prims/jvmtiExport.cpp
  79. +0 −1 src/hotspot/share/prims/jvmtiImpl.cpp
  80. +4 −4 src/hotspot/share/prims/jvmtiRawMonitor.cpp
  81. +2 −2 src/hotspot/share/prims/jvmtiThreadState.cpp
  82. +2 −3 src/hotspot/share/prims/jvmtiTrace.cpp
  83. +2 −3 src/hotspot/share/prims/stackwalk.cpp
  84. +1 −2 src/hotspot/share/prims/whitebox.cpp
  85. +4 −5 src/hotspot/share/runtime/biasedLocking.cpp
  86. +2 −3 src/hotspot/share/runtime/deoptimization.cpp
  87. +1 −2 src/hotspot/share/runtime/handshake.cpp
  88. +1 −1 src/hotspot/share/runtime/interfaceSupport.cpp
  89. +2 −2 src/hotspot/share/runtime/interfaceSupport.inline.hpp
  90. +2 −2 src/hotspot/share/runtime/java.cpp
  91. +3 −4 src/hotspot/share/runtime/javaCalls.cpp
  92. +2 −2 src/hotspot/share/runtime/jniHandles.cpp
  93. +7 −7 src/hotspot/share/runtime/mutex.cpp
  94. +10 −14 src/hotspot/share/runtime/objectMonitor.cpp
  95. +1 −1 src/hotspot/share/runtime/os.cpp
  96. +2 −2 src/hotspot/share/runtime/reflection.cpp
  97. +0 −2 src/hotspot/share/runtime/safepoint.cpp
  98. +1 −1 src/hotspot/share/runtime/safepointMechanism.inline.hpp
  99. +2 −3 src/hotspot/share/runtime/sharedRuntime.cpp
  100. +1 −2 src/hotspot/share/runtime/sweeper.cpp
  101. +3 −7 src/hotspot/share/runtime/synchronizer.cpp
  102. +14 −17 src/hotspot/share/runtime/thread.cpp
  103. +15 −3 src/hotspot/share/runtime/thread.hpp
  104. +1 −1 src/hotspot/share/runtime/vframeArray.cpp
  105. +1 −3 src/hotspot/share/runtime/vmOperations.cpp
  106. +2 −5 src/hotspot/share/runtime/vmThread.cpp
  107. +1 −1 src/hotspot/share/services/diagnosticCommand.cpp
  108. +2 −6 src/hotspot/share/services/management.cpp
  109. +2 −3 src/hotspot/share/services/threadService.cpp
  110. +3 −4 src/hotspot/share/utilities/vmError.cpp
@@ -101,7 +101,7 @@ void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {

frame_pointers_t *new_frame = (frame_pointers_t *)(return_address_ptr - 5);

JavaThread *thread = (JavaThread*)Thread::current();
JavaThread *thread = JavaThread::current();
RegisterMap reg_map(thread, false);
frame frame = thread->last_frame();

@@ -111,14 +111,11 @@ void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {

LogTarget(Trace, nmethod, barrier) out;
if (out.is_enabled()) {
Thread* thread = Thread::current();
assert(thread->is_Java_thread(), "must be JavaThread");
JavaThread* jth = (JavaThread*) thread;
ResourceMark mark;
log_trace(nmethod, barrier)("deoptimize(nmethod: %s(%p), return_addr: %p, osr: %d, thread: %p(%s), making rsp: %p) -> %p",
nm->method()->name_and_sig_as_C_string(),
nm, *(address *) return_address_ptr, nm->is_osr_method(), jth,
jth->get_thread_name(), frame.sp(), nm->verified_entry_point());
nm, *(address *) return_address_ptr, nm->is_osr_method(), thread,
thread->get_thread_name(), frame.sp(), nm->verified_entry_point());
}

new_frame->sp = frame.sp();
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -128,9 +128,7 @@ void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {

LogTarget(Trace, nmethod, barrier) out;
if (out.is_enabled()) {
Thread* thread = Thread::current();
assert(thread->is_Java_thread(), "must be JavaThread");
JavaThread* jth = (JavaThread*) thread;
JavaThread* jth = JavaThread::current();
ResourceMark mark;
log_trace(nmethod, barrier)("deoptimize(nmethod: %p, return_addr: %p, osr: %d, thread: %p(%s), making rsp: %p) -> %p",
nm, (address *) return_address_ptr, nm->is_osr_method(), jth,
@@ -94,7 +94,7 @@ void frame::patch_pc(Thread* thread, address pc) {
// We borrow this call to set the thread pointer in the interpreter
// state; the hook to set up deoptimized frames isn't supplied it.
assert(pc == NULL, "should be");
get_interpreterState()->set_thread((JavaThread *) thread);
get_interpreterState()->set_thread(thread->as_Java_thread());
}
}

@@ -38,7 +38,7 @@

void MethodHandles::invoke_target(Method* method, TRAPS) {

JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();
ZeroStack *stack = thread->zero_stack();
InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame();
interpreterState istate = frame->interpreter_state();
@@ -55,7 +55,7 @@ void MethodHandles::invoke_target(Method* method, TRAPS) {

oop MethodHandles::popFromStack(TRAPS) {

JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();
InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame();
interpreterState istate = frame->interpreter_state();
intptr_t* topOfStack = istate->stack();
@@ -70,7 +70,7 @@ oop MethodHandles::popFromStack(TRAPS) {

void MethodHandles::throw_AME(Klass* rcvr, Method* interface_method, TRAPS) {

JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();
// Set up the frame anchor if it isn't already
bool has_last_Java_frame = thread->has_last_Java_frame();
if (!has_last_Java_frame) {
@@ -101,7 +101,7 @@ void MethodHandles::throw_AME(Klass* rcvr, Method* interface_method, TRAPS) {

int MethodHandles::method_handle_entry_invokeBasic(Method* method, intptr_t UNUSED, TRAPS) {

JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();
InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame();
interpreterState istate = frame->interpreter_state();
intptr_t* topOfStack = istate->stack();
@@ -132,7 +132,7 @@ int MethodHandles::method_handle_entry_linkToStaticOrSpecial(Method* method, int
}

int MethodHandles::method_handle_entry_linkToInterface(Method* method, intptr_t UNUSED, TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();
InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame();
interpreterState istate = frame->interpreter_state();

@@ -172,7 +172,7 @@ int MethodHandles::method_handle_entry_linkToInterface(Method* method, intptr_t
}

int MethodHandles::method_handle_entry_linkToVirtual(Method* method, intptr_t UNUSED, TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();

InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame();
interpreterState istate = frame->interpreter_state();
@@ -46,7 +46,7 @@ int ZeroStack::suggest_size(Thread *thread) const {
}

void ZeroStack::handle_overflow(TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();

// Set up the frame anchor if it isn't already
bool has_last_Java_frame = thread->has_last_Java_frame();
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2010, 2015 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -72,7 +72,7 @@ class StubGenerator: public StubCodeGenerator {
intptr_t* parameters,
int parameter_words,
TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();
ZeroStack *stack = thread->zero_stack();

// Make sure we have no pending exceptions
@@ -316,7 +316,7 @@ EntryFrame *EntryFrame::build(const intptr_t* parameters,
JavaCallWrapper* call_wrapper,
TRAPS) {

ZeroStack *stack = ((JavaThread *) THREAD)->zero_stack();
ZeroStack *stack = THREAD->as_Java_thread()->zero_stack();
stack->overflow_check(header_words + parameter_words, CHECK_NULL);

stack->push(0); // next_frame, filled in later
@@ -106,7 +106,7 @@ InterpreterCodelet* ZeroInterpreter::codelet_containing(address pc) {
fixup_after_potential_safepoint()

int ZeroInterpreter::normal_entry(Method* method, intptr_t UNUSED, TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();

// Allocate and initialize our frame.
InterpreterFrame *frame = InterpreterFrame::build(method, CHECK_0);
@@ -144,7 +144,7 @@ intptr_t narrow(BasicType type, intptr_t result) {


void ZeroInterpreter::main_loop(int recurse, TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();
ZeroStack *stack = thread->zero_stack();

// If we are entering from a deopt we may need to call
@@ -277,7 +277,7 @@ int ZeroInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) {
// Make sure method is native and not abstract
assert(method->is_native() && !method->is_abstract(), "should be");

JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();
ZeroStack *stack = thread->zero_stack();

// Allocate and initialize our frame
@@ -546,7 +546,7 @@ int ZeroInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) {
}

int ZeroInterpreter::accessor_entry(Method* method, intptr_t UNUSED, TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();
ZeroStack *stack = thread->zero_stack();
intptr_t *locals = stack->sp();

@@ -679,7 +679,7 @@ int ZeroInterpreter::accessor_entry(Method* method, intptr_t UNUSED, TRAPS) {
}

int ZeroInterpreter::empty_entry(Method* method, intptr_t UNUSED, TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();
ZeroStack *stack = thread->zero_stack();

// Drop into the slow path if we need a safepoint check
@@ -698,7 +698,7 @@ int ZeroInterpreter::empty_entry(Method* method, intptr_t UNUSED, TRAPS) {
// Slots < insert_before will have the same slot number after the insert.
// Slots >= insert_before will become old_slot + num_slots.
void ZeroInterpreter::insert_vmslots(int insert_before, int num_slots, TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();
ZeroStack *stack = thread->zero_stack();

// Allocate the space
@@ -712,7 +712,7 @@ void ZeroInterpreter::insert_vmslots(int insert_before, int num_slots, TRAPS) {
}

void ZeroInterpreter::remove_vmslots(int first_slot, int num_slots, TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();
ZeroStack *stack = thread->zero_stack();
intptr_t *vmslots = stack->sp();

@@ -745,7 +745,7 @@ JRT_ENTRY(void, ZeroInterpreter::throw_exception(JavaThread* thread,
JRT_END

InterpreterFrame *InterpreterFrame::build(Method* const method, TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
JavaThread *thread = THREAD->as_Java_thread();
ZeroStack *stack = thread->zero_stack();

// Calculate the size of the frame we'll build, including
@@ -821,7 +821,7 @@ InterpreterFrame *InterpreterFrame::build(Method* const method, TRAPS) {
}

InterpreterFrame *InterpreterFrame::build(int size, TRAPS) {
ZeroStack *stack = ((JavaThread *) THREAD)->zero_stack();
ZeroStack *stack = THREAD->as_Java_thread()->zero_stack();

int size_in_words = size >> LogBytesPerWord;
assert(size_in_words * wordSize == size, "unaligned");
@@ -1040,13 +1040,12 @@ bool os::create_attached_thread(JavaThread* thread) {
// enabling yellow zone first will crash JVM on SuSE Linux), so there
// is no gap between the last two virtual memory regions.

JavaThread *jt = (JavaThread *)thread;
address addr = jt->stack_reserved_zone_base();
address addr = thread->stack_reserved_zone_base();
assert(addr != NULL, "initialization problem?");
assert(jt->stack_available(addr) > 0, "stack guard should not be enabled");
assert(thread->stack_available(addr) > 0, "stack guard should not be enabled");

osthread->set_expanding_stack();
os::Linux::manually_expand_stack(jt, addr);
os::Linux::manually_expand_stack(thread, addr);
osthread->clear_expanding_stack();
}

@@ -1781,7 +1780,6 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
"'execstack -c <libfile>', or link it with '-z noexecstack'.",
filename);

assert(Thread::current()->is_Java_thread(), "must be Java thread");
JavaThread *jt = JavaThread::current();
if (jt->thread_state() != _thread_in_native) {
// This happens when a compiler thread tries to load a hsdis-<arch>.so file
@@ -2073,9 +2073,7 @@ void Parker::park(bool isAbsolute, jlong time) {
// since we are doing a lock-free update to _counter.
if (Atomic::xchg(&_counter, 0) > 0) return;

Thread* thread = Thread::current();
assert(thread->is_Java_thread(), "Must be JavaThread");
JavaThread *jt = (JavaThread *)thread;
JavaThread *jt = JavaThread::current();

// Optional optimization -- avoid state transitions if there's
// an interrupt pending.
@@ -2120,7 +2118,7 @@ void Parker::park(bool isAbsolute, jlong time) {
return;
}

OSThreadWaitState osts(thread->osthread(), false /* not Object.wait() */);
OSThreadWaitState osts(jt->osthread(), false /* not Object.wait() */);
jt->set_suspend_equivalent();
// cleared by handle_special_suspend_equivalent_condition() or java_suspend_self()

@@ -2136,19 +2136,19 @@ int os::signal_wait() {

LONG Handle_Exception(struct _EXCEPTION_POINTERS* exceptionInfo,
address handler) {
JavaThread* thread = (JavaThread*) Thread::current_or_null();
Thread* thread = Thread::current_or_null();
// Save pc in thread
#ifdef _M_AMD64
// Do not blow up if no thread info available.
if (thread) {
thread->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->Rip);
if (thread != NULL) {
thread->as_Java_thread()->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->Rip);
}
// Set pc to handler
exceptionInfo->ContextRecord->Rip = (DWORD64)handler;
#else
// Do not blow up if no thread info available.
if (thread) {
thread->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->Eip);
if (thread != NULL) {
thread->as_Java_thread()->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->Eip);
}
// Set pc to handler
exceptionInfo->ContextRecord->Eip = (DWORD)(DWORD_PTR)handler;
@@ -2477,7 +2477,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
}

if (t != NULL && t->is_Java_thread()) {
JavaThread* thread = (JavaThread*) t;
JavaThread* thread = t->as_Java_thread();
bool in_java = thread->thread_state() == _thread_in_Java;
bool in_native = thread->thread_state() == _thread_in_native;
bool in_vm = thread->thread_state() == _thread_in_vm;
@@ -2570,7 +2570,6 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {

if (exception_code == EXCEPTION_IN_PAGE_ERROR) {
CompiledMethod* nm = NULL;
JavaThread* thread = (JavaThread*)t;
if (in_java) {
CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
@@ -228,7 +228,7 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
if (os::Aix::signal_handlers_are_installed) {
if (t != NULL) {
if(t->is_Java_thread()) {
thread = (JavaThread*)t;
thread = t->as_Java_thread();
}
else if(t->is_VM_thread()) {
vmthread = (VMThread *)t;
@@ -457,7 +457,7 @@ JVM_handle_bsd_signal(int sig,
if (os::Bsd::signal_handlers_are_installed) {
if (t != NULL ){
if(t->is_Java_thread()) {
thread = (JavaThread*)t;
thread = t->as_Java_thread();
}
else if(t->is_VM_thread()){
vmthread = (VMThread *)t;
@@ -46,13 +46,10 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext,
}

bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava) {
assert(this->is_Java_thread(), "must be JavaThread");
JavaThread* jt = (JavaThread *)this;

// If we have a last_Java_frame, then we should use it even if
// isInJava == true. It should be more reliable than ucontext info.
if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) {
*fr_addr = jt->pd_last_frame();
if (has_last_Java_frame() && frame_anchor()->walkable()) {
*fr_addr = pd_last_frame();
return true;
}

@@ -77,11 +74,11 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
}

frame ret_frame(ret_sp, ret_fp, addr);
if (!ret_frame.safe_for_sender(jt)) {
if (!ret_frame.safe_for_sender(this)) {
#if COMPILER2_OR_JVMCI
// C2 and JVMCI use ebp as a general register see if NULL fp helps
frame ret_frame2(ret_sp, NULL, addr);
if (!ret_frame2.safe_for_sender(jt)) {
if (!ret_frame2.safe_for_sender(this)) {
// nothing else to try if the frame isn't good
return false;
}
@@ -156,7 +156,7 @@ JVM_handle_bsd_signal(int sig,
if (os::Bsd::signal_handlers_are_installed) {
if (t != NULL ){
if(t->is_Java_thread()) {
thread = (JavaThread*)t;
thread = t->as_Java_thread();
}
else if(t->is_VM_thread()){
vmthread = (VMThread *)t;
@@ -237,7 +237,7 @@ JVM_handle_linux_signal(int sig,
if (os::Linux::signal_handlers_are_installed) {
if (t != NULL ){
if(t->is_Java_thread()) {
thread = (JavaThread*)t;
thread = t->as_Java_thread();
}
else if(t->is_VM_thread()){
vmthread = (VMThread *)t;

0 comments on commit 389eab6

Please sign in to comment.