hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Mark.java
Print this page
rev 611 : Merge
*** 1,7 ****
/*
! * Copyright 2001-2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 77,86 ****
--- 77,91 ----
biasedLockPattern = db.lookupLongConstant("markOopDesc::biased_lock_pattern").longValue();
noHash = db.lookupLongConstant("markOopDesc::no_hash").longValue();
noHashInPlace = db.lookupLongConstant("markOopDesc::no_hash_in_place").longValue();
noLockInPlace = db.lookupLongConstant("markOopDesc::no_lock_in_place").longValue();
maxAge = db.lookupLongConstant("markOopDesc::max_age").longValue();
+
+ /* Constants in markOop used by CMS. */
+ cmsShift = db.lookupLongConstant("markOopDesc::cms_shift").longValue();
+ cmsMask = db.lookupLongConstant("markOopDesc::cms_mask").longValue();
+ sizeShift = db.lookupLongConstant("markOopDesc::size_shift").longValue();
}
// Field accessors
private static CIntegerField markField;
*** 118,127 ****
--- 123,137 ----
private static long noHashInPlace;
private static long noLockInPlace;
private static long maxAge;
+ /* Constants in markOop used by CMS. */
+ private static long cmsShift;
+ private static long cmsMask;
+ private static long sizeShift;
+
public Mark(Address addr) {
super(addr);
}
public long value() {
*** 288,293 ****
--- 298,310 ----
// // Prepare address of oop for placement into mark
// inline static markOop encode_pointer_as_mark(void* p) { return markOop(p)->set_marked(); }
//
// // Recover address of oop from encoded form used in mark
// inline void* decode_pointer() { return clear_lock_bits(); }
+
+ // Copy markOop methods for CMS here.
+ public boolean isCmsFreeChunk() {
+ return isUnlocked() &&
+ (Bits.maskBitsLong(value() >> cmsShift, cmsMask) & 0x1L) == 0x1L;
+ }
+ public long getSize() { return (long)(value() >> sizeShift); }
}