3030 }
3031 }
3032
3033 Compile::TracePhase::~TracePhase() {
3034 if (_log != NULL) {
3035 _log->done("phase nodes='%d'", C->unique());
3036 }
3037 }
3038
3039 //=============================================================================
3040 // Two Constant's are equal when the type and the value are equal.
3041 bool Compile::Constant::operator==(const Constant& other) {
3042 if (type() != other.type() ) return false;
3043 if (can_be_reused() != other.can_be_reused()) return false;
3044 // For floating point values we compare the bit pattern.
3045 switch (type()) {
3046 case T_FLOAT: return (_v._value.i == other._v._value.i);
3047 case T_LONG:
3048 case T_DOUBLE: return (_v._value.j == other._v._value.j);
3049 case T_OBJECT:
3050 case T_METADATA: return (_v._metadata == other._v._metadata);
3051 case T_ADDRESS: return (_v._value.l == other._v._value.l);
3052 case T_VOID: return (_v._value.l == other._v._value.l); // jump-table entries
3053 default: ShouldNotReachHere();
3054 }
3055 return false;
3056 }
3057
3058 static int type_to_size_in_bytes(BasicType t) {
3059 switch (t) {
3060 case T_LONG: return sizeof(jlong );
3061 case T_FLOAT: return sizeof(jfloat );
3062 case T_DOUBLE: return sizeof(jdouble);
3063 case T_METADATA: return sizeof(Metadata*);
3064 // We use T_VOID as marker for jump-table entries (labels) which
3065 // need an internal word relocation.
3066 case T_VOID:
3067 case T_ADDRESS:
3068 case T_OBJECT: return sizeof(jobject);
3069 }
3070
3071 ShouldNotReachHere();
3072 return -1;
|
3030 }
3031 }
3032
3033 Compile::TracePhase::~TracePhase() {
3034 if (_log != NULL) {
3035 _log->done("phase nodes='%d'", C->unique());
3036 }
3037 }
3038
3039 //=============================================================================
3040 // Two Constant's are equal when the type and the value are equal.
3041 bool Compile::Constant::operator==(const Constant& other) {
3042 if (type() != other.type() ) return false;
3043 if (can_be_reused() != other.can_be_reused()) return false;
3044 // For floating point values we compare the bit pattern.
3045 switch (type()) {
3046 case T_FLOAT: return (_v._value.i == other._v._value.i);
3047 case T_LONG:
3048 case T_DOUBLE: return (_v._value.j == other._v._value.j);
3049 case T_OBJECT:
3050 case T_ADDRESS: return (_v._value.l == other._v._value.l);
3051 case T_VOID: return (_v._value.l == other._v._value.l); // jump-table entries
3052 case T_METADATA: return (_v._metadata == other._v._metadata);
3053 default: ShouldNotReachHere();
3054 }
3055 return false;
3056 }
3057
3058 static int type_to_size_in_bytes(BasicType t) {
3059 switch (t) {
3060 case T_LONG: return sizeof(jlong );
3061 case T_FLOAT: return sizeof(jfloat );
3062 case T_DOUBLE: return sizeof(jdouble);
3063 case T_METADATA: return sizeof(Metadata*);
3064 // We use T_VOID as marker for jump-table entries (labels) which
3065 // need an internal word relocation.
3066 case T_VOID:
3067 case T_ADDRESS:
3068 case T_OBJECT: return sizeof(jobject);
3069 }
3070
3071 ShouldNotReachHere();
3072 return -1;
|