@@ -290,34 +290,41 @@ class markWord {
290290 // fixes up biased locks to be compatible with it when a bias is
291291 // revoked.
292292 bool has_bias_pattern () const {
293+ ShouldNotReachHere (); // Valhalla: unused
293294 return (mask_bits (value (), biased_lock_mask_in_place) == biased_lock_pattern);
294295 }
295296 JavaThread* biased_locker () const {
297+ ShouldNotReachHere (); // Valhalla: unused
296298 assert (has_bias_pattern (), " should not call this otherwise" );
297299 return (JavaThread*) mask_bits (value (), ~(biased_lock_mask_in_place | age_mask_in_place | epoch_mask_in_place));
298300 }
299301 // Indicates that the mark has the bias bit set but that it has not
300302 // yet been biased toward a particular thread
301303 bool is_biased_anonymously () const {
304+ ShouldNotReachHere (); // Valhalla: unused
302305 return (has_bias_pattern () && (biased_locker () == NULL ));
303306 }
304307 // Indicates epoch in which this bias was acquired. If the epoch
305308 // changes due to too many bias revocations occurring, the biases
306309 // from the previous epochs are all considered invalid.
307310 int bias_epoch () const {
311+ ShouldNotReachHere (); // Valhalla: unused
308312 assert (has_bias_pattern (), " should not call this otherwise" );
309313 return (mask_bits (value (), epoch_mask_in_place) >> epoch_shift);
310314 }
311315 markWord set_bias_epoch (int epoch) {
316+ ShouldNotReachHere (); // Valhalla: unused
312317 assert (has_bias_pattern (), " should not call this otherwise" );
313318 assert ((epoch & (~epoch_mask)) == 0 , " epoch overflow" );
314319 return markWord (mask_bits (value (), ~epoch_mask_in_place) | (epoch << epoch_shift));
315320 }
316321 markWord incr_bias_epoch () {
322+ ShouldNotReachHere (); // Valhalla: unused
317323 return set_bias_epoch ((1 + bias_epoch ()) & epoch_mask);
318324 }
319325 // Prototype mark for initialization
320326 static markWord biased_locking_prototype () {
327+ ShouldNotReachHere (); // Valhalla: unused
321328 return markWord ( biased_lock_pattern );
322329 }
323330
@@ -326,12 +333,15 @@ class markWord {
326333 return (mask_bits (value (), lock_mask_in_place) != unlocked_value);
327334 }
328335 bool is_unlocked () const {
329- return (mask_bits (value (), biased_lock_mask_in_place ) == unlocked_value);
336+ return (mask_bits (value (), lock_mask_in_place ) == unlocked_value);
330337 }
331338 bool is_marked () const {
332339 return (mask_bits (value (), lock_mask_in_place) == marked_value);
333340 }
334- bool is_neutral () const { return (mask_bits (value (), biased_lock_mask_in_place) == unlocked_value); }
341+
342+ // is unlocked and not an inline type (which cannot be involved in locking, displacement or inflation)
343+ // i.e. test both lock bits and the inline type bit together
344+ bool is_neutral () const { return (mask_bits (value (), inline_type_mask_in_place) == unlocked_value); }
335345
336346 // Special temporary state of the markWord while being inflated.
337347 // Code that looks at mark outside a lock need to take this into account.
0 commit comments