< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Mark.java

Print this page

131   }
132 
133   // Special temporary state of the markWord while being inflated.
134   // Code that looks at mark outside a lock need to take this into account.
135   public boolean isBeingInflated() {
136     return (value() == 0);
137   }
138 
139   // Should this header be preserved during GC?
140   public boolean mustBePreserved() {
141      return (!isUnlocked() || !hasNoHash());
142   }
143 
144   // WARNING: The following routines are used EXCLUSIVELY by
145   // synchronization functions. They are not really gc safe.
146   // They must get updated if markWord layout get changed.
147 
148   public boolean hasLocker() {
149     return ((value() & lockMaskInPlace) == lockedValue);
150   }
151   public BasicLock locker() {
152     if (Assert.ASSERTS_ENABLED) {
153       Assert.that(hasLocker(), "check");
154     }
155     return new BasicLock(valueAsAddress());
156   }
157   public boolean hasMonitor() {
158     return ((value() & monitorValue) != 0);
159   }
160   public ObjectMonitor monitor() {
161     if (Assert.ASSERTS_ENABLED) {
162       Assert.that(hasMonitor(), "check");
163     }
164     // Use xor instead of &~ to provide one extra tag-bit check.
165     Address monAddr = valueAsAddress().xorWithMask(monitorValue);
166     return new ObjectMonitor(monAddr);
167   }
168   public boolean hasDisplacedMarkHelper() {
169     return ((value() & unlockedValue) == 0);
170   }
171   public Mark displacedMarkHelper() {
172     if (Assert.ASSERTS_ENABLED) {
173       Assert.that(hasDisplacedMarkHelper(), "check");
174     }
175     Address addr = valueAsAddress().andWithMask(~monitorValue);
176     return new Mark(addr.getAddressAt(0));

131   }
132 
133   // Special temporary state of the markWord while being inflated.
134   // Code that looks at mark outside a lock need to take this into account.
135   public boolean isBeingInflated() {
136     return (value() == 0);
137   }
138 
139   // Should this header be preserved during GC?
140   public boolean mustBePreserved() {
141      return (!isUnlocked() || !hasNoHash());
142   }
143 
144   // WARNING: The following routines are used EXCLUSIVELY by
145   // synchronization functions. They are not really gc safe.
146   // They must get updated if markWord layout get changed.
147 
148   public boolean hasLocker() {
149     return ((value() & lockMaskInPlace) == lockedValue);
150   }






151   public boolean hasMonitor() {
152     return ((value() & monitorValue) != 0);
153   }
154   public ObjectMonitor monitor() {
155     if (Assert.ASSERTS_ENABLED) {
156       Assert.that(hasMonitor(), "check");
157     }
158     // Use xor instead of &~ to provide one extra tag-bit check.
159     Address monAddr = valueAsAddress().xorWithMask(monitorValue);
160     return new ObjectMonitor(monAddr);
161   }
162   public boolean hasDisplacedMarkHelper() {
163     return ((value() & unlockedValue) == 0);
164   }
165   public Mark displacedMarkHelper() {
166     if (Assert.ASSERTS_ENABLED) {
167       Assert.that(hasDisplacedMarkHelper(), "check");
168     }
169     Address addr = valueAsAddress().andWithMask(~monitorValue);
170     return new Mark(addr.getAddressAt(0));
< prev index next >