6686407: Fix for 6666698 broke -XX:BiasedLockingStartupDelay=0

Thu, 10 Apr 2008 15:49:16 -0400

author
sbohne
date
Thu, 10 Apr 2008 15:49:16 -0400
changeset 528
c6ff24ceec1c
parent 527
ebec5b9731e2
child 545
a49a647afe9a

6686407: Fix for 6666698 broke -XX:BiasedLockingStartupDelay=0
Summary: Stack allocated VM_EnableBiasedLocking op must be marked as such
Reviewed-by: xlu, acorn, never, dholmes

src/share/vm/runtime/biasedLocking.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/runtime/biasedLocking.cpp	Thu Apr 10 12:21:01 2008 -0400
     1.2 +++ b/src/share/vm/runtime/biasedLocking.cpp	Thu Apr 10 15:49:16 2008 -0400
     1.3 @@ -1,4 +1,3 @@
     1.4 -
     1.5  /*
     1.6   * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8 @@ -37,11 +36,13 @@
     1.9  }
    1.10  
    1.11  class VM_EnableBiasedLocking: public VM_Operation {
    1.12 + private:
    1.13 +  bool _is_cheap_allocated;
    1.14   public:
    1.15 -  VM_EnableBiasedLocking()        {}
    1.16 +  VM_EnableBiasedLocking(bool is_cheap_allocated) { _is_cheap_allocated = is_cheap_allocated; }
    1.17    VMOp_Type type() const          { return VMOp_EnableBiasedLocking; }
    1.18 -  Mode evaluation_mode() const    { return _async_safepoint; }
    1.19 -  bool is_cheap_allocated() const { return true; }
    1.20 +  Mode evaluation_mode() const    { return _is_cheap_allocated ? _async_safepoint : _safepoint; }
    1.21 +  bool is_cheap_allocated() const { return _is_cheap_allocated; }
    1.22  
    1.23    void doit() {
    1.24      // Iterate the system dictionary enabling biased locking for all
    1.25 @@ -67,7 +68,7 @@
    1.26    virtual void task() {
    1.27      // Use async VM operation to avoid blocking the Watcher thread.
    1.28      // VM Thread will free C heap storage.
    1.29 -    VM_EnableBiasedLocking *op = new VM_EnableBiasedLocking();
    1.30 +    VM_EnableBiasedLocking *op = new VM_EnableBiasedLocking(true);
    1.31      VMThread::execute(op);
    1.32  
    1.33      // Reclaim our storage and disenroll ourself
    1.34 @@ -89,7 +90,7 @@
    1.35        EnableBiasedLockingTask* task = new EnableBiasedLockingTask(BiasedLockingStartupDelay);
    1.36        task->enroll();
    1.37      } else {
    1.38 -      VM_EnableBiasedLocking op;
    1.39 +      VM_EnableBiasedLocking op(false);
    1.40        VMThread::execute(&op);
    1.41      }
    1.42    }

mercurial