Changeset 155466 in webkit for trunk/Source/JavaScriptCore
- Timestamp:
- Sep 10, 2013, 12:33:22 PM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r155457 r155466 1 2013-09-10 Filip Pizlo <[email protected]> 2 3 SpecType should have SpecInt48AsDouble 4 https://bugs.webkit.org/show_bug.cgi?id=121065 5 6 Reviewed by Oliver Hunt. 7 8 * bytecode/SpeculatedType.cpp: 9 (JSC::dumpSpeculation): 10 (JSC::speculationToAbbreviatedString): 11 (JSC::speculationFromValue): 12 * bytecode/SpeculatedType.h: 13 (JSC::isInt48AsDoubleSpeculation): 14 (JSC::isIntegerSpeculation): 15 (JSC::isDoubleRealSpeculation): 16 1 17 2013-09-10 Filip Pizlo <[email protected]> 2 18 -
trunk/Source/JavaScriptCore/bytecode/SpeculatedType.cpp
r154403 r155466 162 162 myOut.print("Double"); 163 163 else { 164 if (value & SpecDoubleReal) 165 myOut.print("Doublereal"); 164 if (value & SpecInt48AsDouble) 165 myOut.print("Int48asdouble"); 166 else 167 isTop = false; 168 169 if (value & SpecNonIntAsDouble) 170 myOut.print("Nonintasdouble"); 166 171 else 167 172 isTop = false; … … 234 239 if (isInt32Speculation(prediction)) 235 240 return "<Int32>"; 241 if (isInt48AsDoubleSpeculation(prediction)) 242 return "<Int48AsDouble>"; 236 243 if (isDoubleSpeculation(prediction)) 237 244 return "<Double>"; … … 332 339 if (value.isDouble()) { 333 340 double number = value.asNumber(); 334 if (number == number) 341 if (number == number) { 342 int64_t asInt64 = static_cast<int64_t>(number); 343 if (asInt64 == number && (!asInt64 || std::signbit(number)) 344 && asInt64 < (static_cast<int64_t>(1) << 47) 345 && asInt64 >= -(static_cast<int64_t>(1) << 47)) 346 return SpecInt48AsDouble; 335 347 return SpecDoubleReal; 348 } 336 349 return SpecDoubleNaN; 337 350 } -
trunk/Source/JavaScriptCore/bytecode/SpeculatedType.h
r154403 r155466 63 63 static const SpeculatedType SpecCell = 0x0007ffff; // It's definitely a JSCell. 64 64 static const SpeculatedType SpecInt32 = 0x00800000; // It's definitely an Int32. 65 static const SpeculatedType SpecDoubleReal = 0x01000000; // It's definitely a non-NaN double. 66 static const SpeculatedType SpecDoubleNaN = 0x02000000; // It's definitely a NaN. 67 static const SpeculatedType SpecDouble = 0x03000000; // It's either a non-NaN or a NaN double. 68 static const SpeculatedType SpecRealNumber = 0x01800000; // It's either an Int32 or a DoubleReal. 69 static const SpeculatedType SpecNumber = 0x03800000; // It's either an Int32 or a Double. 70 static const SpeculatedType SpecBoolean = 0x04000000; // It's definitely a Boolean. 71 static const SpeculatedType SpecOther = 0x08000000; // It's definitely none of the above. 72 static const SpeculatedType SpecTop = 0x0fffffff; // It can be any of the above. 73 static const SpeculatedType SpecEmpty = 0x10000000; // It's definitely an empty value marker. 74 static const SpeculatedType SpecEmptyOrTop = 0x1fffffff; // It can be any of the above. 75 static const SpeculatedType FixedIndexedStorageMask = SpecInt8Array | SpecInt16Array | SpecInt32Array | SpecUint8Array | SpecUint8ClampedArray | SpecUint16Array | SpecUint32Array | SpecFloat32Array | SpecFloat64Array; 65 static const SpeculatedType SpecInt48AsDouble = 0x01000000; // It's definitely an Int48 and it's inside a double. 66 static const SpeculatedType SpecInteger = 0x01800000; // It's definitely some kind of integer. 67 static const SpeculatedType SpecNonIntAsDouble = 0x02000000; // It's definitely not an Int48 but it's a real number and it's a double. 68 static const SpeculatedType SpecDoubleReal = 0x03000000; // It's definitely a non-NaN double. 69 static const SpeculatedType SpecDoubleNaN = 0x04000000; // It's definitely a NaN. 70 static const SpeculatedType SpecDouble = 0x07000000; // It's either a non-NaN or a NaN double. 71 static const SpeculatedType SpecRealNumber = 0x03800000; // It's either an Int32 or a DoubleReal. 72 static const SpeculatedType SpecNumber = 0x07800000; // It's either an Int32 or a Double. 73 static const SpeculatedType SpecBoolean = 0x08000000; // It's definitely a Boolean. 74 static const SpeculatedType SpecOther = 0x10000000; // It's definitely none of the above. 75 static const SpeculatedType SpecTop = 0x1fffffff; // It can be any of the above. 76 static const SpeculatedType SpecEmpty = 0x20000000; // It's definitely an empty value marker. 77 static const SpeculatedType SpecEmptyOrTop = 0x3fffffff; // It can be any of the above. 76 78 77 79 typedef bool (*SpeculatedTypeChecker)(SpeculatedType); … … 106 108 { 107 109 return !!(value & (SpecFinalObject | SpecOther)) && !(value & ~(SpecFinalObject | SpecOther)); 108 }109 110 inline bool isFixedIndexedStorageObjectSpeculation(SpeculatedType value)111 {112 return !!value && (value & FixedIndexedStorageMask) == value;113 110 } 114 111 … … 249 246 } 250 247 248 inline bool isInt48AsDoubleSpeculation(SpeculatedType value) 249 { 250 return value == SpecInt48AsDouble; 251 } 252 253 inline bool isIntegerSpeculation(SpeculatedType value) 254 { 255 return !!value && (value & SpecInteger) == value; 256 } 257 251 258 inline bool isDoubleRealSpeculation(SpeculatedType value) 252 259 { 253 return value == SpecDoubleReal;260 return !!value && (value & SpecDoubleReal) == value; 254 261 } 255 262
Note:
See TracChangeset
for help on using the changeset viewer.