mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
8256754: Deoptimization::revoke_for_object_deoptimization: stack processing start call is redundant
Reviewed-by: dlong, eosterlund
This commit is contained in:
parent
738efea9c6
commit
e77aed624e
4 changed files with 21 additions and 4 deletions
|
@ -63,6 +63,7 @@
|
||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
#include "runtime/interfaceSupport.inline.hpp"
|
#include "runtime/interfaceSupport.inline.hpp"
|
||||||
#include "runtime/jniHandles.inline.hpp"
|
#include "runtime/jniHandles.inline.hpp"
|
||||||
|
#include "runtime/keepStackGCProcessed.hpp"
|
||||||
#include "runtime/objectMonitor.inline.hpp"
|
#include "runtime/objectMonitor.inline.hpp"
|
||||||
#include "runtime/safepointVerifiers.hpp"
|
#include "runtime/safepointVerifiers.hpp"
|
||||||
#include "runtime/sharedRuntime.hpp"
|
#include "runtime/sharedRuntime.hpp"
|
||||||
|
@ -1651,10 +1652,7 @@ void Deoptimization::revoke_for_object_deoptimization(JavaThread* deoptee_thread
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GrowableArray<Handle>* objects_to_revoke = new GrowableArray<Handle>();
|
GrowableArray<Handle>* objects_to_revoke = new GrowableArray<Handle>();
|
||||||
if (deoptee_thread != thread) {
|
assert(KeepStackGCProcessedMark::stack_is_kept_gc_processed(deoptee_thread), "must be");
|
||||||
// Process stack of deoptee thread as we will access oops during object deoptimization.
|
|
||||||
StackWatermarkSet::start_processing(deoptee_thread, StackWatermarkKind::gc);
|
|
||||||
}
|
|
||||||
// Collect monitors but only those with eliminated locking.
|
// Collect monitors but only those with eliminated locking.
|
||||||
get_monitors_from_stack(objects_to_revoke, deoptee_thread, fr, map, true);
|
get_monitors_from_stack(objects_to_revoke, deoptee_thread, fr, map, true);
|
||||||
|
|
||||||
|
|
|
@ -58,3 +58,19 @@ KeepStackGCProcessedMark::~KeepStackGCProcessedMark() {
|
||||||
void KeepStackGCProcessedMark::finish_processing() {
|
void KeepStackGCProcessedMark::finish_processing() {
|
||||||
StackWatermarkSet::finish_processing(_jt, NULL /* context */, StackWatermarkKind::gc);
|
StackWatermarkSet::finish_processing(_jt, NULL /* context */, StackWatermarkKind::gc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ASSERT
|
||||||
|
bool KeepStackGCProcessedMark::stack_is_kept_gc_processed(JavaThread* jt) {
|
||||||
|
if (!Thread::current()->is_Java_thread()) {
|
||||||
|
assert(SafepointSynchronize::is_at_safepoint() && Thread::current()->is_VM_thread(),
|
||||||
|
"must be either Java thread or VM thread in a safepoint");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
StackWatermark* our_watermark = StackWatermarkSet::get(JavaThread::current(), StackWatermarkKind::gc);
|
||||||
|
if (our_watermark == nullptr) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
StackWatermark* their_watermark = StackWatermarkSet::get(jt, StackWatermarkKind::gc);
|
||||||
|
return our_watermark->linked_watermark() == their_watermark;
|
||||||
|
}
|
||||||
|
#endif // ASSERT
|
||||||
|
|
|
@ -43,6 +43,8 @@ class KeepStackGCProcessedMark : public StackObj {
|
||||||
public:
|
public:
|
||||||
KeepStackGCProcessedMark(JavaThread* jt);
|
KeepStackGCProcessedMark(JavaThread* jt);
|
||||||
~KeepStackGCProcessedMark();
|
~KeepStackGCProcessedMark();
|
||||||
|
|
||||||
|
static bool stack_is_kept_gc_processed(JavaThread* jt) NOT_DEBUG({ return true; }) ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -130,6 +130,7 @@ public:
|
||||||
void set_next(StackWatermark* n) { _next = n; }
|
void set_next(StackWatermark* n) { _next = n; }
|
||||||
|
|
||||||
void link_watermark(StackWatermark* watermark);
|
void link_watermark(StackWatermark* watermark);
|
||||||
|
DEBUG_ONLY(StackWatermark* linked_watermark() const { return _linked_watermark; })
|
||||||
|
|
||||||
uintptr_t watermark();
|
uintptr_t watermark();
|
||||||
uintptr_t last_processed();
|
uintptr_t last_processed();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue