src/share/vm/runtime/synchronizer.cpp

changeset 5784
190899198332
parent 5237
f2110083203d
child 6472
2b8e28fdf503
     1.1 --- a/src/share/vm/runtime/synchronizer.cpp	Wed Sep 25 17:47:51 2013 +0200
     1.2 +++ b/src/share/vm/runtime/synchronizer.cpp	Thu Sep 26 10:25:02 2013 -0400
     1.3 @@ -154,7 +154,7 @@
     1.4  static volatile intptr_t ListLock = 0 ;      // protects global monitor free-list cache
     1.5  static volatile int MonitorFreeCount  = 0 ;      // # on gFreeList
     1.6  static volatile int MonitorPopulation = 0 ;      // # Extant -- in circulation
     1.7 -#define CHAINMARKER ((oop)-1)
     1.8 +#define CHAINMARKER (cast_to_oop<intptr_t>(-1))
     1.9  
    1.10  // -----------------------------------------------------------------------------
    1.11  //  Fast Monitor Enter/Exit
    1.12 @@ -510,7 +510,7 @@
    1.13           // then for each thread on the list, set the flag and unpark() the thread.
    1.14           // This is conceptually similar to muxAcquire-muxRelease, except that muxRelease
    1.15           // wakes at most one thread whereas we need to wake the entire list.
    1.16 -         int ix = (intptr_t(obj) >> 5) & (NINFLATIONLOCKS-1) ;
    1.17 +         int ix = (cast_from_oop<intptr_t>(obj) >> 5) & (NINFLATIONLOCKS-1) ;
    1.18           int YieldThenBlock = 0 ;
    1.19           assert (ix >= 0 && ix < NINFLATIONLOCKS, "invariant") ;
    1.20           assert ((NINFLATIONLOCKS & (NINFLATIONLOCKS-1)) == 0, "invariant") ;
    1.21 @@ -565,7 +565,7 @@
    1.22       // This variation has the property of being stable (idempotent)
    1.23       // between STW operations.  This can be useful in some of the 1-0
    1.24       // synchronization schemes.
    1.25 -     intptr_t addrBits = intptr_t(obj) >> 3 ;
    1.26 +     intptr_t addrBits = cast_from_oop<intptr_t>(obj) >> 3 ;
    1.27       value = addrBits ^ (addrBits >> 5) ^ GVars.stwRandom ;
    1.28    } else
    1.29    if (hashCode == 2) {
    1.30 @@ -575,7 +575,7 @@
    1.31       value = ++GVars.hcSequence ;
    1.32    } else
    1.33    if (hashCode == 4) {
    1.34 -     value = intptr_t(obj) ;
    1.35 +     value = cast_from_oop<intptr_t>(obj) ;
    1.36    } else {
    1.37       // Marsaglia's xor-shift scheme with thread-specific state
    1.38       // This is probably the best overall implementation -- we'll
    1.39 @@ -1321,7 +1321,7 @@
    1.40              if (object->is_instance()) {
    1.41                ResourceMark rm;
    1.42                tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
    1.43 -                (intptr_t) object, (intptr_t) object->mark(),
    1.44 +                (void *) object, (intptr_t) object->mark(),
    1.45                  object->klass()->external_name());
    1.46              }
    1.47            }
    1.48 @@ -1371,7 +1371,7 @@
    1.49          if (object->is_instance()) {
    1.50            ResourceMark rm;
    1.51            tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
    1.52 -            (intptr_t) object, (intptr_t) object->mark(),
    1.53 +            (void *) object, (intptr_t) object->mark(),
    1.54              object->klass()->external_name());
    1.55          }
    1.56        }
    1.57 @@ -1439,7 +1439,7 @@
    1.58         if (obj->is_instance()) {
    1.59           ResourceMark rm;
    1.60             tty->print_cr("Deflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
    1.61 -                (intptr_t) obj, (intptr_t) obj->mark(), obj->klass()->external_name());
    1.62 +                (void *) obj, (intptr_t) obj->mark(), obj->klass()->external_name());
    1.63         }
    1.64       }
    1.65  

mercurial