src/share/vm/opto/type.cpp

changeset 8886
fbb8f75498f4
parent 8424
2094cac55c59
child 9041
95a08233f46c
child 9333
2fccf735a116
     1.1 --- a/src/share/vm/opto/type.cpp	Wed Jul 19 09:00:13 2017 +0200
     1.2 +++ b/src/share/vm/opto/type.cpp	Fri Aug 11 03:30:28 2017 -0400
     1.3 @@ -1001,21 +1001,10 @@
     1.4  
     1.5  //------------------------------eq---------------------------------------------
     1.6  // Structural equality check for Type representations
     1.7 -bool TypeF::eq( const Type *t ) const {
     1.8 -  if( g_isnan(_f) ||
     1.9 -      g_isnan(t->getf()) ) {
    1.10 -    // One or both are NANs.  If both are NANs return true, else false.
    1.11 -    return (g_isnan(_f) && g_isnan(t->getf()));
    1.12 -  }
    1.13 -  if (_f == t->getf()) {
    1.14 -    // (NaN is impossible at this point, since it is not equal even to itself)
    1.15 -    if (_f == 0.0) {
    1.16 -      // difference between positive and negative zero
    1.17 -      if (jint_cast(_f) != jint_cast(t->getf()))  return false;
    1.18 -    }
    1.19 -    return true;
    1.20 -  }
    1.21 -  return false;
    1.22 +bool TypeF::eq(const Type *t) const {
    1.23 +  // Bitwise comparison to distinguish between +/-0. These values must be treated
    1.24 +  // as different to be consistent with C1 and the interpreter.
    1.25 +  return (jint_cast(_f) == jint_cast(t->getf()));
    1.26  }
    1.27  
    1.28  //------------------------------hash-------------------------------------------
    1.29 @@ -1116,21 +1105,10 @@
    1.30  
    1.31  //------------------------------eq---------------------------------------------
    1.32  // Structural equality check for Type representations
    1.33 -bool TypeD::eq( const Type *t ) const {
    1.34 -  if( g_isnan(_d) ||
    1.35 -      g_isnan(t->getd()) ) {
    1.36 -    // One or both are NANs.  If both are NANs return true, else false.
    1.37 -    return (g_isnan(_d) && g_isnan(t->getd()));
    1.38 -  }
    1.39 -  if (_d == t->getd()) {
    1.40 -    // (NaN is impossible at this point, since it is not equal even to itself)
    1.41 -    if (_d == 0.0) {
    1.42 -      // difference between positive and negative zero
    1.43 -      if (jlong_cast(_d) != jlong_cast(t->getd()))  return false;
    1.44 -    }
    1.45 -    return true;
    1.46 -  }
    1.47 -  return false;
    1.48 +bool TypeD::eq(const Type *t) const {
    1.49 +  // Bitwise comparison to distinguish between +/-0. These values must be treated
    1.50 +  // as different to be consistent with C1 and the interpreter.
    1.51 +  return (jlong_cast(_d) == jlong_cast(t->getd()));
    1.52  }
    1.53  
    1.54  //------------------------------hash-------------------------------------------

mercurial