comparison src/share/vm/opto/type.cpp @ 628:7bb995fbd3c0

Merge
author trims
date Thu, 12 Mar 2009 18:16:36 -0700
parents 0fbdb4381b99 337400e7a5dd
children 915cc9c5ebc6
comparison
equal deleted inserted replaced
580:ce2272390558 628:7bb995fbd3c0
224 TypeInt::CC_GT = TypeInt::make( 1, 1, WidenMin); // == TypeInt::ONE 224 TypeInt::CC_GT = TypeInt::make( 1, 1, WidenMin); // == TypeInt::ONE
225 TypeInt::CC_EQ = TypeInt::make( 0, 0, WidenMin); // == TypeInt::ZERO 225 TypeInt::CC_EQ = TypeInt::make( 0, 0, WidenMin); // == TypeInt::ZERO
226 TypeInt::CC_LE = TypeInt::make(-1, 0, WidenMin); 226 TypeInt::CC_LE = TypeInt::make(-1, 0, WidenMin);
227 TypeInt::CC_GE = TypeInt::make( 0, 1, WidenMin); // == TypeInt::BOOL 227 TypeInt::CC_GE = TypeInt::make( 0, 1, WidenMin); // == TypeInt::BOOL
228 TypeInt::BYTE = TypeInt::make(-128,127, WidenMin); // Bytes 228 TypeInt::BYTE = TypeInt::make(-128,127, WidenMin); // Bytes
229 TypeInt::UBYTE = TypeInt::make(0, 255, WidenMin); // Unsigned Bytes
229 TypeInt::CHAR = TypeInt::make(0,65535, WidenMin); // Java chars 230 TypeInt::CHAR = TypeInt::make(0,65535, WidenMin); // Java chars
230 TypeInt::SHORT = TypeInt::make(-32768,32767, WidenMin); // Java shorts 231 TypeInt::SHORT = TypeInt::make(-32768,32767, WidenMin); // Java shorts
231 TypeInt::POS = TypeInt::make(0,max_jint, WidenMin); // Non-neg values 232 TypeInt::POS = TypeInt::make(0,max_jint, WidenMin); // Non-neg values
232 TypeInt::POS1 = TypeInt::make(1,max_jint, WidenMin); // Positive values 233 TypeInt::POS1 = TypeInt::make(1,max_jint, WidenMin); // Positive values
233 TypeInt::INT = TypeInt::make(min_jint,max_jint, WidenMax); // 32-bit integers 234 TypeInt::INT = TypeInt::make(min_jint,max_jint, WidenMax); // 32-bit integers
1020 const TypeInt *TypeInt::CC_GT; // [1] == ONE 1021 const TypeInt *TypeInt::CC_GT; // [1] == ONE
1021 const TypeInt *TypeInt::CC_EQ; // [0] == ZERO 1022 const TypeInt *TypeInt::CC_EQ; // [0] == ZERO
1022 const TypeInt *TypeInt::CC_LE; // [-1,0] 1023 const TypeInt *TypeInt::CC_LE; // [-1,0]
1023 const TypeInt *TypeInt::CC_GE; // [0,1] == BOOL (!) 1024 const TypeInt *TypeInt::CC_GE; // [0,1] == BOOL (!)
1024 const TypeInt *TypeInt::BYTE; // Bytes, -128 to 127 1025 const TypeInt *TypeInt::BYTE; // Bytes, -128 to 127
1026 const TypeInt *TypeInt::UBYTE; // Unsigned Bytes, 0 to 255
1025 const TypeInt *TypeInt::CHAR; // Java chars, 0-65535 1027 const TypeInt *TypeInt::CHAR; // Java chars, 0-65535
1026 const TypeInt *TypeInt::SHORT; // Java shorts, -32768-32767 1028 const TypeInt *TypeInt::SHORT; // Java shorts, -32768-32767
1027 const TypeInt *TypeInt::POS; // Positive 32-bit integers or zero 1029 const TypeInt *TypeInt::POS; // Positive 32-bit integers or zero
1028 const TypeInt *TypeInt::POS1; // Positive 32-bit integers 1030 const TypeInt *TypeInt::POS1; // Positive 32-bit integers
1029 const TypeInt *TypeInt::INT; // 32-bit integers 1031 const TypeInt *TypeInt::INT; // 32-bit integers
2453 // directly manipulates the addresses of oops. Rather, it only has a pointer 2455 // directly manipulates the addresses of oops. Rather, it only has a pointer
2454 // to a handle at compile time. This handle is embedded in the generated 2456 // to a handle at compile time. This handle is embedded in the generated
2455 // code and dereferenced at the time the nmethod is made. Until that time, 2457 // code and dereferenced at the time the nmethod is made. Until that time,
2456 // it is not reasonable to do arithmetic with the addresses of oops (we don't 2458 // it is not reasonable to do arithmetic with the addresses of oops (we don't
2457 // have access to the addresses!). This does not seem to currently happen, 2459 // have access to the addresses!). This does not seem to currently happen,
2458 // but this assertion here is to help prevent its occurrance. 2460 // but this assertion here is to help prevent its occurence.
2459 tty->print_cr("Found oop constant with non-zero offset"); 2461 tty->print_cr("Found oop constant with non-zero offset");
2460 ShouldNotReachHere(); 2462 ShouldNotReachHere();
2461 } 2463 }
2462 2464
2463 return (intptr_t)const_oop()->encoding(); 2465 return (intptr_t)const_oop()->encoding();
2759 case NotNull: 2761 case NotNull:
2760 case BotPTR: // Fall down to object klass 2762 case BotPTR: // Fall down to object klass
2761 // LCA is object_klass, but if we subclass from the top we can do better 2763 // LCA is object_klass, but if we subclass from the top we can do better
2762 if( above_centerline(_ptr) ) { // if( _ptr == TopPTR || _ptr == AnyNull ) 2764 if( above_centerline(_ptr) ) { // if( _ptr == TopPTR || _ptr == AnyNull )
2763 // If 'this' (InstPtr) is above the centerline and it is Object class 2765 // If 'this' (InstPtr) is above the centerline and it is Object class
2764 // then we can subclass in the Java class heirarchy. 2766 // then we can subclass in the Java class hierarchy.
2765 if (klass()->equals(ciEnv::current()->Object_klass())) { 2767 if (klass()->equals(ciEnv::current()->Object_klass())) {
2766 // that is, tp's array type is a subtype of my klass 2768 // that is, tp's array type is a subtype of my klass
2767 return TypeAryPtr::make(ptr, tp->ary(), tp->klass(), tp->klass_is_exact(), offset, instance_id); 2769 return TypeAryPtr::make(ptr, tp->ary(), tp->klass(), tp->klass_is_exact(), offset, instance_id);
2768 } 2770 }
2769 } 2771 }
3020 } 3022 }
3021 3023
3022 3024
3023 //------------------------------xdual------------------------------------------ 3025 //------------------------------xdual------------------------------------------
3024 // Dual: do NOT dual on klasses. This means I do NOT understand the Java 3026 // Dual: do NOT dual on klasses. This means I do NOT understand the Java
3025 // inheritence mechanism. 3027 // inheritance mechanism.
3026 const Type *TypeInstPtr::xdual() const { 3028 const Type *TypeInstPtr::xdual() const {
3027 return new TypeInstPtr( dual_ptr(), klass(), klass_is_exact(), const_oop(), dual_offset(), dual_instance_id() ); 3029 return new TypeInstPtr( dual_ptr(), klass(), klass_is_exact(), const_oop(), dual_offset(), dual_instance_id() );
3028 } 3030 }
3029 3031
3030 //------------------------------eq--------------------------------------------- 3032 //------------------------------eq---------------------------------------------
3174 jint max_hi = max_array_length(elem()->basic_type()); 3176 jint max_hi = max_array_length(elem()->basic_type());
3175 //if (index_not_size) --max_hi; // type of a valid array index, FTR 3177 //if (index_not_size) --max_hi; // type of a valid array index, FTR
3176 bool chg = false; 3178 bool chg = false;
3177 if (lo < min_lo) { lo = min_lo; chg = true; } 3179 if (lo < min_lo) { lo = min_lo; chg = true; }
3178 if (hi > max_hi) { hi = max_hi; chg = true; } 3180 if (hi > max_hi) { hi = max_hi; chg = true; }
3179 // Negative length arrays will produce weird intermediate dead fath-path code 3181 // Negative length arrays will produce weird intermediate dead fast-path code
3180 if (lo > hi) 3182 if (lo > hi)
3181 return TypeInt::ZERO; 3183 return TypeInt::ZERO;
3182 if (!chg) 3184 if (!chg)
3183 return size; 3185 return size;
3184 return TypeInt::make(lo, hi, Type::WidenMin); 3186 return TypeInt::make(lo, hi, Type::WidenMin);
3356 case NotNull: 3358 case NotNull:
3357 case BotPTR: // Fall down to object klass 3359 case BotPTR: // Fall down to object klass
3358 // LCA is object_klass, but if we subclass from the top we can do better 3360 // LCA is object_klass, but if we subclass from the top we can do better
3359 if (above_centerline(tp->ptr())) { 3361 if (above_centerline(tp->ptr())) {
3360 // If 'tp' is above the centerline and it is Object class 3362 // If 'tp' is above the centerline and it is Object class
3361 // then we can subclass in the Java class heirarchy. 3363 // then we can subclass in the Java class hierarchy.
3362 if( tp->klass()->equals(ciEnv::current()->Object_klass()) ) { 3364 if( tp->klass()->equals(ciEnv::current()->Object_klass()) ) {
3363 // that is, my array type is a subtype of 'tp' klass 3365 // that is, my array type is a subtype of 'tp' klass
3364 return make( ptr, _ary, _klass, _klass_is_exact, offset, instance_id ); 3366 return make( ptr, _ary, _klass, _klass_is_exact, offset, instance_id );
3365 } 3367 }
3366 } 3368 }