mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
6692235: Fix for 6666698 broke -XX:BiasedLockingStartupDelay=0
Stack allocated VM_EnableBiasedLocking op must be marked as such Reviewed-by: xlu, acorn, never, dholmes
This commit is contained in:
parent
659a8dc7d5
commit
7ea0891458
1 changed files with 7 additions and 6 deletions
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
|
* Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
@ -37,11 +36,13 @@ static void enable_biased_locking(klassOop k) {
|
||||||
}
|
}
|
||||||
|
|
||||||
class VM_EnableBiasedLocking: public VM_Operation {
|
class VM_EnableBiasedLocking: public VM_Operation {
|
||||||
|
private:
|
||||||
|
bool _is_cheap_allocated;
|
||||||
public:
|
public:
|
||||||
VM_EnableBiasedLocking() {}
|
VM_EnableBiasedLocking(bool is_cheap_allocated) { _is_cheap_allocated = is_cheap_allocated; }
|
||||||
VMOp_Type type() const { return VMOp_EnableBiasedLocking; }
|
VMOp_Type type() const { return VMOp_EnableBiasedLocking; }
|
||||||
Mode evaluation_mode() const { return _async_safepoint; }
|
Mode evaluation_mode() const { return _is_cheap_allocated ? _async_safepoint : _safepoint; }
|
||||||
bool is_cheap_allocated() const { return true; }
|
bool is_cheap_allocated() const { return _is_cheap_allocated; }
|
||||||
|
|
||||||
void doit() {
|
void doit() {
|
||||||
// Iterate the system dictionary enabling biased locking for all
|
// Iterate the system dictionary enabling biased locking for all
|
||||||
|
@ -67,7 +68,7 @@ class EnableBiasedLockingTask : public PeriodicTask {
|
||||||
virtual void task() {
|
virtual void task() {
|
||||||
// Use async VM operation to avoid blocking the Watcher thread.
|
// Use async VM operation to avoid blocking the Watcher thread.
|
||||||
// VM Thread will free C heap storage.
|
// VM Thread will free C heap storage.
|
||||||
VM_EnableBiasedLocking *op = new VM_EnableBiasedLocking();
|
VM_EnableBiasedLocking *op = new VM_EnableBiasedLocking(true);
|
||||||
VMThread::execute(op);
|
VMThread::execute(op);
|
||||||
|
|
||||||
// Reclaim our storage and disenroll ourself
|
// Reclaim our storage and disenroll ourself
|
||||||
|
@ -89,7 +90,7 @@ void BiasedLocking::init() {
|
||||||
EnableBiasedLockingTask* task = new EnableBiasedLockingTask(BiasedLockingStartupDelay);
|
EnableBiasedLockingTask* task = new EnableBiasedLockingTask(BiasedLockingStartupDelay);
|
||||||
task->enroll();
|
task->enroll();
|
||||||
} else {
|
} else {
|
||||||
VM_EnableBiasedLocking op;
|
VM_EnableBiasedLocking op(false);
|
||||||
VMThread::execute(&op);
|
VMThread::execute(&op);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue