Skip to content

Commit 94eb25a

Browse files
committed
8256072: Eliminate JVMTI tagmap rehashing
Reviewed-by: kbarrett, eosterlund
1 parent 4338f52 commit 94eb25a

18 files changed

+19
-119
lines changed

src/hotspot/share/gc/shared/collectedHeap.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -652,11 +652,6 @@ bool CollectedHeap::is_archived_object(oop object) const {
652652
return false;
653653
}
654654

655-
uint32_t CollectedHeap::hash_oop(oop obj) const {
656-
const uintptr_t addr = cast_from_oop<uintptr_t>(obj);
657-
return static_cast<uint32_t>(addr >> LogMinObjAlignment);
658-
}
659-
660655
// It's the caller's responsibility to ensure glitch-freedom
661656
// (if required).
662657
void CollectedHeap::update_capacity_and_used_at_gc() {

src/hotspot/share/gc/shared/collectedHeap.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,6 @@ class CollectedHeap : public CHeapObj<mtGC> {
280280

281281
DEBUG_ONLY(bool is_in_or_null(const void* p) const { return p == NULL || is_in(p); })
282282

283-
virtual uint32_t hash_oop(oop obj) const;
284-
285283
void set_gc_cause(GCCause::Cause v);
286284
GCCause::Cause gc_cause() { return _gc_cause; }
287285

src/hotspot/share/gc/shared/weakProcessor.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -48,13 +48,6 @@ void notify_jvmti_tagmaps() {
4848
// the tagmap's oopstorage notification handler to not care whether it's
4949
// invoked by STW or concurrent reference processing.
5050
JvmtiTagMap::set_needs_cleaning();
51-
52-
// Notify JVMTI tagmaps that a STW collection may have moved objects, so
53-
// the tagmaps need rehashing. This isn't the right place for this, but
54-
// is convenient because all the STW collectors use WeakProcessor. One
55-
// problem is that the end of a G1 concurrent collection also comes here,
56-
// possibly triggering unnecessary rehashes.
57-
JvmtiTagMap::set_needs_rehashing();
5851
#endif // INCLUDE_JVMTI
5952
}
6053

src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,6 @@ void ShenandoahConcurrentGC::op_final_mark() {
606606
ShenandoahCodeRoots::arm_nmethods();
607607
ShenandoahStackWatermark::change_epoch_id();
608608

609-
// Notify JVMTI that oops are changed.
610-
JvmtiTagMap::set_needs_rehashing();
611-
612609
if (ShenandoahPacing) {
613610
heap->pacer()->setup_for_evac();
614611
}

src/hotspot/share/gc/z/zCollectedHeap.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,6 @@ bool ZCollectedHeap::requires_barriers(stackChunkOop obj) const {
145145
return false;
146146
}
147147

148-
uint32_t ZCollectedHeap::hash_oop(oop obj) const {
149-
return _heap.hash_oop(ZOop::to_address(obj));
150-
}
151-
152148
HeapWord* ZCollectedHeap::allocate_new_tlab(size_t min_size, size_t requested_size, size_t* actual_size) {
153149
const size_t size_in_bytes = ZUtils::words_to_bytes(align_object_size(requested_size));
154150
const uintptr_t addr = _heap.alloc_tlab(size_in_bytes);

src/hotspot/share/gc/z/zCollectedHeap.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ class ZCollectedHeap : public CollectedHeap {
7474
virtual bool is_in(const void* p) const;
7575
virtual bool requires_barriers(stackChunkOop obj) const;
7676

77-
virtual uint32_t hash_oop(oop obj) const;
78-
7977
virtual oop array_allocate(Klass* klass, size_t size, int length, bool do_zero, TRAPS);
8078
virtual HeapWord* mem_allocate(size_t size, bool* gc_overhead_limit_was_exceeded);
8179
virtual MetaWord* satisfy_failed_metadata_allocation(ClassLoaderData* loader_data,

src/hotspot/share/gc/z/zHeap.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,6 @@ void ZHeap::relocate_start() {
436436

437437
// Update statistics
438438
ZStatHeap::set_at_relocate_start(_page_allocator.stats());
439-
440-
// Notify JVMTI
441-
JvmtiTagMap::set_needs_rehashing();
442439
}
443440

444441
void ZHeap::relocate() {

src/hotspot/share/gc/z/zHeap.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ class ZHeap {
9090
size_t unsafe_max_tlab_alloc() const;
9191

9292
bool is_in(uintptr_t addr) const;
93-
uint32_t hash_oop(uintptr_t addr) const;
9493

9594
// Threads
9695
uint active_workers() const;

src/hotspot/share/gc/z/zHeap.inline.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
2828

2929
#include "gc/z/zAddress.inline.hpp"
3030
#include "gc/z/zForwardingTable.inline.hpp"
31-
#include "gc/z/zHash.inline.hpp"
3231
#include "gc/z/zMark.inline.hpp"
3332
#include "gc/z/zPage.inline.hpp"
3433
#include "gc/z/zPageTable.inline.hpp"
@@ -43,11 +42,6 @@ inline ReferenceDiscoverer* ZHeap::reference_discoverer() {
4342
return &_reference_processor;
4443
}
4544

46-
inline uint32_t ZHeap::hash_oop(uintptr_t addr) const {
47-
const uintptr_t offset = ZAddress::offset(addr);
48-
return ZHash::address_to_uint32(offset);
49-
}
50-
5145
inline bool ZHeap::is_object_live(uintptr_t addr) const {
5246
ZPage* page = _page_table.get(addr);
5347
return page->is_object_live(addr);

src/hotspot/share/oops/oop.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ void oopDesc::verify(oopDesc* oop_desc) {
9999
intptr_t oopDesc::slow_identity_hash() {
100100
// slow case; we have to acquire the micro lock in order to locate the header
101101
Thread* current = Thread::current();
102-
ResetNoHandleMark rnm; // Might be called from LEAF/QUICK ENTRY
103-
HandleMark hm(current);
104-
Handle object(current, this);
105-
return ObjectSynchronizer::identity_hash_value_for(object);
102+
return ObjectSynchronizer::FastHashCode(current, this);
106103
}
107104

108105
// used only for asserts and guarantees

0 commit comments

Comments
 (0)