Skip to content

Commit 1418f0a

Browse files
Cleanups and Shenandoah-specific changes.
1 parent da0d4fe commit 1418f0a

File tree

14 files changed

+86
-186
lines changed

14 files changed

+86
-186
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ In some code parts, `Unimplemented()` serves as a placeholder for GC-specific fu
8181
- `src/hotspot/share/gc/shared/hSpaceCounters.cpp`
8282
- `src/hotspot/share/gc/shared/ageTable.cpp`
8383

84-
Besides that, the length of 0 for `GCThreadLocalData` in `src/hotspot/share/gc/shared/gcThreadLocalData.hpp` is a placeholder as well.
84+
Besides that, there are a few places where values are hardcoded at the moment.
85+
Those need to be replaced with the correct GC-specific values:
86+
- the length of `GCThreadLocalData` in `src/hotspot/share/gc/shared/gcThreadLocalData.hpp` is hardcoded to 0
87+
- `log_of_heap_region_grain_bytes` in `src/hotspot/svm/svmToGC.cpp` is hardcoded to 20
8588

8689
## Build
8790

src/hotspot/SubMakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ DEBUG_LEVEL_FILE_SUFFIX.debug := -debug
101101
DEBUG_LEVEL_FILE_SUFFIX := $(DEBUG_LEVEL_FILE_SUFFIX.$(DEBUG_LEVEL))
102102

103103
BUILD_DIR := $(BUILD_ROOT)/$(DEBUG_LEVEL)-$(COMPRESSED_REFERENCES_SUFFIX)$(TARGET_EXT)
104-
TARGET_FILE := $(BUILD_ROOT)/libsvmgc$(DEBUG_LEVEL_FILE_SUFFIX)-$(COMPRESSED_REFERENCES_SUFFIX)$(TARGET_EXT)
104+
TARGET_FILE := $(BUILD_ROOT)/libshenandoahgc$(DEBUG_LEVEL_FILE_SUFFIX)-$(COMPRESSED_REFERENCES_SUFFIX)$(TARGET_EXT)
105105

106106
CPP_FILES_TO_EXCLUDE.amd64 := aarch64
107107
CPP_FILES_TO_EXCLUDE.aarch64 := x86

src/hotspot/share/runtime/mutex.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ void Mutex::lock_contended(Thread* self) {
119119
if (thread->has_status_vm()) {
120120
while (true) {
121121
// do a transition to native thread status so that we can safely block below without preventing a safepoint
122-
SVMGlobalData::_transition_vm_to_native(heap_base, thread);
122+
SVMGlobalData::_transition_vm_to_native(thread);
123123

124124
_lock.lock();
125125

126126
// do a transition back to VM state so that this thread can be sure that no safepoints are happening concurrently
127127
assert(thread->has_status_native_or_safepoint(), "must be");
128-
if (SVMGlobalData::_try_fast_transition_native_to_vm(heap_base, thread)) {
128+
if (SVMGlobalData::_try_fast_transition_native_to_vm(thread)) {
129129
// The fast path succeeded, so we have the lock and we are back in VM state.
130130
assert(thread->has_status_vm(), "must be");
131131
break;
@@ -134,7 +134,7 @@ void Mutex::lock_contended(Thread* self) {
134134
// try to lock it again after the safepoint ends. Otherwise, we could end up with a deadlock between this thread
135135
// and the VM thread.
136136
_lock.unlock();
137-
SVMGlobalData::_slow_transition_native_to_vm(heap_base, thread);
137+
SVMGlobalData::_slow_transition_native_to_vm(thread);
138138
assert(thread->has_status_vm(), "must be");
139139
}
140140
}

src/hotspot/share/runtime/thread.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#endif
4646
#ifdef SVM
4747
#include "svmIsolateThread.hpp"
48-
#include "exports/sharedGCStructs.hpp"
48+
#include "exports/sharedGCStructs.h"
4949
#endif // SVM
5050

5151

src/hotspot/svm/exports/sharedGCStructs.hpp

Lines changed: 0 additions & 100 deletions
This file was deleted.

src/hotspot/svm/share/oops/stackChunkOop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include "runtime/smallRegisterMap.inline.hpp"
3838
#include "runtime/stackChunkFrameStream.inline.hpp"
3939
#ifdef SVM
40-
#include "exports/sharedGCStructs.hpp"
40+
#include "exports/sharedGCStructs.h"
4141
#include "svmCodeReferenceMapDecoder.hpp"
4242
#endif // SVM
4343

src/hotspot/svm/share/runtime/vmOperation.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace svm_gc {
6262

6363
class VM_Operation;
6464

65-
// The layout of this class must match the NativeVMOperationData on the Java-side.
65+
// The layout of this class must match the NativeGCVMOperationData on the Java-side.
6666
// It must always be allocated as a part of a VM_Operation (i.e., it must never exist on its own)
6767
// and it must not contain a vtable. The blackbox fields are only accessed on native-image side.
6868
class VM_OperationData {

src/hotspot/svm/share/runtime/vmThread.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void VMThread::execute(VM_Operation* op) {
104104

105105
assert(isolate_thread == nullptr || isolate_thread->has_status_vm(), "isolate thread must be in VM state");
106106
if (isolate_thread != nullptr && !current_thread->is_VM_thread()) {
107-
SVMGlobalData::_transition_vm_to_native(heap_base, isolate_thread);
107+
SVMGlobalData::_transition_vm_to_native(isolate_thread);
108108
}
109109

110110
VM_OperationData *op_data = op->data();
@@ -131,7 +131,7 @@ void VMThread::execute(VM_Operation* op) {
131131

132132
if (isolate_thread != nullptr) {
133133
// The fast transition is always possible because no one can request a safepoint while the VM operation thread is blocked.
134-
bool in_vm = SVMGlobalData::_try_fast_transition_native_to_vm(heap_base, isolate_thread);
134+
bool in_vm = SVMGlobalData::_try_fast_transition_native_to_vm(isolate_thread);
135135
assert(in_vm && isolate_thread->has_status_vm(), "must be back in VM state");
136136
}
137137

@@ -141,7 +141,7 @@ void VMThread::execute(VM_Operation* op) {
141141
} else {
142142
if (isolate_thread != nullptr) {
143143
// The fast transition is always possible because no one can request a safepoint while the VM operation thread is blocked.
144-
bool in_vm = SVMGlobalData::_try_fast_transition_native_to_vm(heap_base, isolate_thread);
144+
bool in_vm = SVMGlobalData::_try_fast_transition_native_to_vm(isolate_thread);
145145
assert(in_vm && isolate_thread->has_status_vm(), "must be back in VM state");
146146
}
147147

src/hotspot/svm/svmCodeReferenceMapDecoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#include "code/compressedStream.hpp"
2727
#include "compiler/oopMap.hpp"
28-
#include "exports/sharedGCStructs.hpp"
28+
#include "exports/sharedGCStructs.h"
2929
#include "svmCodeReferenceMapDecoder.hpp"
3030

3131
/**

src/hotspot/svm/svmGlobalData.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ char** SVMIsolateData::_argv = 0;
3535
size_t SVMIsolateData::_max_heap_address_space_size = 0;
3636

3737
char* SVMIsolateData::_heap_base = nullptr;
38+
typeArrayOop SVMIsolateData::_image_heap_region_types = nullptr;
39+
typeArrayOop SVMIsolateData::_image_heap_region_free_spaces = nullptr;
3840
objArrayOop SVMIsolateData::_static_object_fields = nullptr;
3941
typeArrayOop SVMIsolateData::_static_primitive_fields = nullptr;
4042
oop SVMIsolateData::_vm_operation_thread = nullptr;
@@ -46,6 +48,8 @@ bool SVMIsolateData::_during_teardown = false;
4648
size_t SVMGlobalData::_heap_base_alignment = 0;
4749
size_t SVMGlobalData::_null_regions_size = 0;
4850
size_t SVMGlobalData::_image_heap_size = 0;
51+
size_t SVMGlobalData::_image_heap_used = 0;
52+
size_t SVMGlobalData::_image_heap_waste = 0;
4953
char* SVMGlobalData::_image_build_hosted_args = 0;
5054
char* SVMGlobalData::_image_build_runtime_args = 0;
5155

@@ -54,6 +58,8 @@ jlong SVMGlobalData::_container_memory_limit_in_bytes = 0;
5458
int SVMGlobalData::_container_active_processor_count = 0;
5559

5660
SVMOffsets SVMGlobalData::_offsets;
61+
int SVMGlobalData::_closed_image_heap_regions = -1;
62+
int SVMGlobalData::_open_image_heap_regions = -1;
5763
SVMOopMap* SVMGlobalData::_thread_locals_reference_map = nullptr;
5864
bool SVMGlobalData::_use_string_inlining = false;
5965
bool SVMGlobalData::_closed_type_world = false;

0 commit comments

Comments
 (0)