Skip to content

Commit c396a9e

Browse files
committed
Fix compilation errors
1 parent 1af9ee2 commit c396a9e

File tree

8 files changed

+22
-97
lines changed

8 files changed

+22
-97
lines changed

openjdk/share/mmtk.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ extern bool process_bulk(char* options);
103103
extern void scan_region();
104104
extern void handle_user_collection_request(void *tls);
105105

106-
extern void start_control_collector(void *tls, void *context);
107106
extern void start_worker(void *tls, void* worker);
108107

109108
extern size_t mmtk_add_nmethod_oop(void* object);

openjdk/share/mmtkContextThread.cpp

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

openjdk/share/mmtkContextThread.hpp

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

openjdk/share/mmtkHeap.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "prims/jvmtiExport.hpp"
5050
#include "runtime/jniHandles.hpp"
5151
#include "runtime/atomic.hpp"
52+
#include "runtime/globals_extension.hpp"
5253
#include "runtime/handles.inline.hpp"
5354
#include "runtime/java.hpp"
5455
#include "runtime/thread.hpp"
@@ -76,7 +77,7 @@ MMTkHeap* MMTkHeap::_heap = NULL;
7677
MMTkHeap::MMTkHeap() :
7778
CollectedHeap(),
7879
_n_workers(0),
79-
_gc_lock(new Monitor(Mutex::safepoint, "MMTkHeap::_gc_lock", true, Monitor::_safepoint_check_never)),
80+
_gc_lock(new Monitor(Mutex::safepoint, "MMTkHeap::_gc_lock", true)),
8081
_num_root_scan_tasks(0),
8182
_soft_ref_policy(),
8283
_last_gc_time(0)
@@ -144,8 +145,8 @@ jint MMTkHeap::initialize() {
144145
ReservedHeapSpace heap_rs = Universe::reserve_heap(MaxHeapSize, HeapAlignment);
145146
// printf("start: %p, end: %p\n", _start, _end);
146147
if (UseCompressedOops) {
147-
Universe::set_narrow_oop_base((address) mmtk_narrow_oop_base());
148-
Universe::set_narrow_oop_shift(mmtk_narrow_oop_shift());
148+
CompressedOops::set_base((address) mmtk_narrow_oop_base());
149+
CompressedOops::set_shift(mmtk_narrow_oop_shift());
149150
}
150151

151152
initialize_reserved_region(heap_rs);
@@ -202,7 +203,9 @@ void MMTkHeap::post_initialize() {
202203
ScavengableNMethods::initialize(&_is_scavengable);
203204

204205
if (UseCompressedOops) {
205-
mmtk_set_compressed_klass_base_and_shift((void*) Universe::narrow_klass_base(), (size_t) Universe::narrow_klass_shift());
206+
mmtk_set_compressed_klass_base_and_shift(
207+
(void*)CompressedKlassPointers::base(),
208+
(size_t)CompressedKlassPointers::shift());
206209
}
207210
}
208211

openjdk/share/mmtkUpcalls.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static void mmtk_resume_mutators(void *tls) {
9191

9292
log_debug(gc)("Notifying mutators blocking on the start-the-world counter...");
9393
{
94-
MutexLockerEx locker(MMTkHeap::heap()->gc_lock(), Mutex::_no_safepoint_check_flag);
94+
MutexLocker locker(MMTkHeap::heap()->gc_lock(), Mutex::_no_safepoint_check_flag);
9595
MMTkHeap::heap()->gc_lock()->notify_all();
9696
}
9797
}
@@ -140,12 +140,12 @@ static void mmtk_block_for_gc() {
140140
ThreadBlockInVM tbivm(thread);
141141

142142
// No safepoint check. We are already in safepoint.
143-
MutexLockerEx locker(MMTkHeap::heap()->gc_lock(), Mutex::_no_safepoint_check_flag);
143+
MutexLocker locker(MMTkHeap::heap()->gc_lock(), Mutex::_no_safepoint_check_flag);
144144

145145
while (Atomic::load(&mmtk_start_the_world_count) < next_count) {
146146
// wait() may wake up spuriously, but the authoritative condition for unblocking is
147147
// mmtk_start_the_world_count being incremented.
148-
MMTkHeap::heap()->gc_lock()->wait(Mutex::_no_safepoint_check_flag);
148+
MMTkHeap::heap()->gc_lock()->wait_without_safepoint_check();
149149
}
150150
}
151151
log_debug(gc)("Resumed after GC finished.");

openjdk/share/mmtkVMCompanionThread.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void MMTkVMCompanionThread::run() {
5050
MutexLocker locker(_lock, Mutex::_no_safepoint_check_flag);
5151
assert(_reached_state == _threads_resumed, "Threads should be running at this moment.");
5252
while (_desired_state != _threads_suspended) {
53-
_lock->wait(Mutex::_no_safepoint_check_flag);
53+
_lock->wait_without_safepoint_check();
5454
}
5555
assert(_reached_state == _threads_resumed, "Threads should still be running at this moment.");
5656
}
@@ -88,7 +88,7 @@ void MMTkVMCompanionThread::request(stw_state desired_state, bool wait_until_rea
8888

8989
if (wait_until_reached) {
9090
while (_reached_state != desired_state) {
91-
_lock->wait(Mutex::_no_safepoint_check_flag);
91+
_lock->wait_without_safepoint_check();
9292
}
9393
}
9494
}
@@ -104,7 +104,7 @@ void MMTkVMCompanionThread::wait_for_reached(stw_state desired_state) {
104104
assert(_desired_state == desired_state, "State %d not requested.", desired_state);
105105

106106
while (_reached_state != desired_state) {
107-
_lock->wait(Mutex::_no_safepoint_check_flag);
107+
_lock->wait_without_safepoint_check();
108108
}
109109
}
110110

@@ -115,7 +115,7 @@ void MMTkVMCompanionThread::do_mmtk_stw_operation() {
115115
assert(Thread::current()->is_VM_thread(), "do_mmtk_stw_operation can only be executed by the VM thread");
116116

117117
{
118-
MutexLockerEx locker(_lock, Mutex::_no_safepoint_check_flag);
118+
MutexLocker locker(_lock, Mutex::_no_safepoint_check_flag);
119119

120120
// Tell the waiter thread that Java threads have stopped at yieldpoints.
121121
_reached_state = _threads_suspended;
@@ -124,7 +124,7 @@ void MMTkVMCompanionThread::do_mmtk_stw_operation() {
124124

125125
// Wait until resume-the-world is requested
126126
while (_desired_state != _threads_resumed) {
127-
_lock->wait(Mutex::_no_safepoint_check_flag);
127+
_lock->wait_without_safepoint_check();
128128
}
129129

130130
// Tell the waiter thread that Java threads will eventually resume from yieldpoints. This
@@ -165,7 +165,7 @@ void MMTkVMCompanionThread::do_mmtk_stw_operation() {
165165
}
166166

167167
{
168-
MutexLockerEx x(Heap_lock, Mutex::_no_safepoint_check_flag);
168+
MutexLocker x(Heap_lock, Mutex::_no_safepoint_check_flag);
169169
if (Universe::has_reference_pending_list()) {
170170
Heap_lock->notify_all();
171171
}

openjdk/share/thirdPartyHeapArguments.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void ThirdPartyHeapArguments::initialize() {
4343
assert(UseThirdPartyHeap , "Error, should UseThirdPartyHeap");
4444
FLAG_SET_DEFAULT(UseTLAB, false);
4545
FLAG_SET_DEFAULT(UseCompressedClassPointers, UseCompressedOops);
46-
FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
46+
FLAG_SET_DEFAULT(ParallelGCThreads, WorkerPolicy::parallel_worker_threads());
4747
if (ParallelGCThreads == 0) {
4848
assert(!FLAG_IS_DEFAULT(ParallelGCThreads), "ParallelGCThreads should not be 0.");
4949
vm_exit_during_initialization("The flag -XX:+UseUseThirdPartyHeap can not be combined with -XX:ParallelGCThreads=0", NULL);
@@ -52,6 +52,11 @@ void ThirdPartyHeapArguments::initialize() {
5252
// make sure to add appropriate code to MMTkHeap::set_mmtk_options.
5353
}
5454

55+
void ThirdPartyHeapArguments::initialize_alignments() {
56+
SpaceAlignment = 1 << 19;
57+
HeapAlignment = SpaceAlignment;
58+
}
59+
5560
CollectedHeap* ThirdPartyHeapArguments::create_heap() {
5661
return new MMTkHeap();
5762
}

openjdk/share/thirdPartyHeapArguments.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class CollectedHeap;
3232
class ThirdPartyHeapArguments : public GCArguments {
3333
private:
3434
virtual void initialize_alignments();
35-
3635
virtual void initialize();
3736
virtual size_t conservative_max_heap_alignment();
3837
virtual CollectedHeap* create_heap();

0 commit comments

Comments
 (0)