src/hotspot/share/opto/type.cpp
changeset 55605 91050b1e0fe8
parent 55519 c59f36ed7b52
parent 55604 a30c86af2eb7
child 58273 08a5148e7c4e
equal deleted inserted replaced
55597:a128ba0b5f94 55605:91050b1e0fe8
   409 int Type::uhash( const Type *const t ) {
   409 int Type::uhash( const Type *const t ) {
   410   return t->hash();
   410   return t->hash();
   411 }
   411 }
   412 
   412 
   413 #define SMALLINT ((juint)3)  // a value too insignificant to consider widening
   413 #define SMALLINT ((juint)3)  // a value too insignificant to consider widening
   414 
   414 #define POSITIVE_INFINITE_F 0x7f800000 // hex representation for IEEE 754 single precision positive infinite
   415 static double pos_dinf() {
   415 #define POSITIVE_INFINITE_D 0x7ff0000000000000 // hex representation for IEEE 754 double precision positive infinite
   416   union { int64_t i; double d; } v;
       
   417   v.i = CONST64(0x7ff0000000000000);
       
   418   return v.d;
       
   419 }
       
   420 
       
   421 static float pos_finf() {
       
   422   union { int32_t i; float f; } v;
       
   423   v.i = 0x7f800000;
       
   424   return v.f;
       
   425 }
       
   426 
   416 
   427 //--------------------------Initialize_shared----------------------------------
   417 //--------------------------Initialize_shared----------------------------------
   428 void Type::Initialize_shared(Compile* current) {
   418 void Type::Initialize_shared(Compile* current) {
   429   // This method does not need to be locked because the first system
   419   // This method does not need to be locked because the first system
   430   // compilations (stub compilations) occur serially.  If they are
   420   // compilations (stub compilations) occur serially.  If they are
   451   BOTTOM  = make(Bottom);       // Everything
   441   BOTTOM  = make(Bottom);       // Everything
   452   HALF    = make(Half);         // Placeholder half of doublewide type
   442   HALF    = make(Half);         // Placeholder half of doublewide type
   453 
   443 
   454   TypeF::ZERO = TypeF::make(0.0); // Float 0 (positive zero)
   444   TypeF::ZERO = TypeF::make(0.0); // Float 0 (positive zero)
   455   TypeF::ONE  = TypeF::make(1.0); // Float 1
   445   TypeF::ONE  = TypeF::make(1.0); // Float 1
   456   TypeF::POS_INF = TypeF::make(pos_finf());
   446   TypeF::POS_INF = TypeF::make(jfloat_cast(POSITIVE_INFINITE_F));
   457   TypeF::NEG_INF = TypeF::make(-pos_finf());
   447   TypeF::NEG_INF = TypeF::make(-jfloat_cast(POSITIVE_INFINITE_F));
   458 
   448 
   459   TypeD::ZERO = TypeD::make(0.0); // Double 0 (positive zero)
   449   TypeD::ZERO = TypeD::make(0.0); // Double 0 (positive zero)
   460   TypeD::ONE  = TypeD::make(1.0); // Double 1
   450   TypeD::ONE  = TypeD::make(1.0); // Double 1
   461   TypeD::POS_INF = TypeD::make(pos_dinf());
   451   TypeD::POS_INF = TypeD::make(jdouble_cast(POSITIVE_INFINITE_D));
   462   TypeD::NEG_INF = TypeD::make(-pos_dinf());
   452   TypeD::NEG_INF = TypeD::make(-jdouble_cast(POSITIVE_INFINITE_D));
   463 
   453 
   464   TypeInt::MINUS_1 = TypeInt::make(-1);  // -1
   454   TypeInt::MINUS_1 = TypeInt::make(-1);  // -1
   465   TypeInt::ZERO    = TypeInt::make( 0);  //  0
   455   TypeInt::ZERO    = TypeInt::make( 0);  //  0
   466   TypeInt::ONE     = TypeInt::make( 1);  //  1
   456   TypeInt::ONE     = TypeInt::make( 1);  //  1
   467   TypeInt::BOOL    = TypeInt::make(0,1,   WidenMin);  // 0 or 1, FALSE or TRUE.
   457   TypeInt::BOOL    = TypeInt::make(0,1,   WidenMin);  // 0 or 1, FALSE or TRUE.