src/share/vm/runtime/basicLock.hpp

Tue, 02 Nov 2010 16:02:46 -0700

author
iveresov
date
Tue, 02 Nov 2010 16:02:46 -0700
changeset 2246
9de67bf4244d
parent 2233
fa83ab460c54
child 2314
f95d63e2154a
permissions
-rw-r--r--

6996136: VM crash in src/share/vm/runtime/virtualspace.cpp:424
Summary: Turn CDS off if compressed oops is on
Reviewed-by: ysr, kvn, jcoomes, phh

acorn@2233 1 /*
acorn@2233 2 * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
acorn@2233 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
acorn@2233 4 *
acorn@2233 5 * This code is free software; you can redistribute it and/or modify it
acorn@2233 6 * under the terms of the GNU General Public License version 2 only, as
acorn@2233 7 * published by the Free Software Foundation.
acorn@2233 8 *
acorn@2233 9 * This code is distributed in the hope that it will be useful, but WITHOUT
acorn@2233 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
acorn@2233 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
acorn@2233 12 * version 2 for more details (a copy is included in the LICENSE file that
acorn@2233 13 * accompanied this code).
acorn@2233 14 *
acorn@2233 15 * You should have received a copy of the GNU General Public License version
acorn@2233 16 * 2 along with this work; if not, write to the Free Software Foundation,
acorn@2233 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
acorn@2233 18 *
acorn@2233 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
acorn@2233 20 * or visit www.oracle.com if you need additional information or have any
acorn@2233 21 * questions.
acorn@2233 22 *
acorn@2233 23 */
acorn@2233 24
acorn@2233 25 class BasicLock VALUE_OBJ_CLASS_SPEC {
acorn@2233 26 friend class VMStructs;
acorn@2233 27 private:
acorn@2233 28 volatile markOop _displaced_header;
acorn@2233 29 public:
acorn@2233 30 markOop displaced_header() const { return _displaced_header; }
acorn@2233 31 void set_displaced_header(markOop header) { _displaced_header = header; }
acorn@2233 32
acorn@2233 33 void print_on(outputStream* st) const;
acorn@2233 34
acorn@2233 35 // move a basic lock (used during deoptimization
acorn@2233 36 void move_to(oop obj, BasicLock* dest);
acorn@2233 37
acorn@2233 38 static int displaced_header_offset_in_bytes() { return offset_of(BasicLock, _displaced_header); }
acorn@2233 39 };
acorn@2233 40
acorn@2233 41 // A BasicObjectLock associates a specific Java object with a BasicLock.
acorn@2233 42 // It is currently embedded in an interpreter frame.
acorn@2233 43
acorn@2233 44 // Because some machines have alignment restrictions on the control stack,
acorn@2233 45 // the actual space allocated by the interpreter may include padding words
acorn@2233 46 // after the end of the BasicObjectLock. Also, in order to guarantee
acorn@2233 47 // alignment of the embedded BasicLock objects on such machines, we
acorn@2233 48 // put the embedded BasicLock at the beginning of the struct.
acorn@2233 49
acorn@2233 50 class BasicObjectLock VALUE_OBJ_CLASS_SPEC {
acorn@2233 51 friend class VMStructs;
acorn@2233 52 private:
acorn@2233 53 BasicLock _lock; // the lock, must be double word aligned
acorn@2233 54 oop _obj; // object holds the lock;
acorn@2233 55
acorn@2233 56 public:
acorn@2233 57 // Manipulation
acorn@2233 58 oop obj() const { return _obj; }
acorn@2233 59 void set_obj(oop obj) { _obj = obj; }
acorn@2233 60 BasicLock* lock() { return &_lock; }
acorn@2233 61
acorn@2233 62 // Note: Use frame::interpreter_frame_monitor_size() for the size of BasicObjectLocks
acorn@2233 63 // in interpreter activation frames since it includes machine-specific padding.
acorn@2233 64 static int size() { return sizeof(BasicObjectLock)/wordSize; }
acorn@2233 65
acorn@2233 66 // GC support
acorn@2233 67 void oops_do(OopClosure* f) { f->do_oop(&_obj); }
acorn@2233 68
acorn@2233 69 static int obj_offset_in_bytes() { return offset_of(BasicObjectLock, _obj); }
acorn@2233 70 static int lock_offset_in_bytes() { return offset_of(BasicObjectLock, _lock); }
acorn@2233 71 };
acorn@2233 72

mercurial