8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "oops/klass.inline.hpp"
27 #include "oops/markOop.hpp"
28 #include "runtime/atomic.inline.hpp"
29 #include "runtime/basicLock.hpp"
30 #include "runtime/biasedLocking.hpp"
31 #include "runtime/task.hpp"
32 #include "runtime/vframe.hpp"
33 #include "runtime/vmThread.hpp"
34 #include "runtime/vm_operations.hpp"
35
36 static bool _biased_locking_enabled = false;
37 BiasedLockingCounters BiasedLocking::_counters;
38
39 static GrowableArray<Handle>* _preserved_oop_stack = NULL;
40 static GrowableArray<markOop>* _preserved_mark_stack = NULL;
41
42 static void enable_biased_locking(Klass* k) {
43 k->set_prototype_header(markOopDesc::biased_locking_prototype());
44 }
45
46 class VM_EnableBiasedLocking: public VM_Operation {
47 private:
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "oops/klass.inline.hpp"
27 #include "oops/markOop.hpp"
28 #include "oops/oop.inline.hpp"
29 #include "runtime/atomic.inline.hpp"
30 #include "runtime/basicLock.hpp"
31 #include "runtime/biasedLocking.hpp"
32 #include "runtime/task.hpp"
33 #include "runtime/vframe.hpp"
34 #include "runtime/vmThread.hpp"
35 #include "runtime/vm_operations.hpp"
36
37 static bool _biased_locking_enabled = false;
38 BiasedLockingCounters BiasedLocking::_counters;
39
40 static GrowableArray<Handle>* _preserved_oop_stack = NULL;
41 static GrowableArray<markOop>* _preserved_mark_stack = NULL;
42
43 static void enable_biased_locking(Klass* k) {
44 k->set_prototype_header(markOopDesc::biased_locking_prototype());
45 }
46
47 class VM_EnableBiasedLocking: public VM_Operation {
48 private:
|