Changeset 34265 in webkit for trunk/JavaScriptCore/VM/Machine.cpp
- Timestamp:
- May 30, 2008, 1:10:38 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/Machine.cpp
r34258 r34265 1319 1319 JSValue* val = r[(++vPC)->u.operand].u.jsValue; 1320 1320 JSValue* shift = r[(++vPC)->u.operand].u.jsValue; 1321 JSValue* result = jsNumber((val->toInt32(exec)) << (shift->toUInt32(exec))); 1322 VM_CHECK_EXCEPTION(); 1321 JSValue* result; 1322 if (JSImmediate::areBothImmediateNumbers(val, shift)) 1323 result = jsNumber(JSImmediate::getTruncatedInt32(val) << (JSImmediate::toTruncatedUInt32(shift) & 0x1f)); 1324 else { 1325 result = jsNumber((val->toInt32(exec)) << (shift->toUInt32(exec) & 0x1f)); 1326 VM_CHECK_EXCEPTION(); 1327 } 1323 1328 dst = result; 1324 1329 … … 1359 1364 JSValue* shift = r[(++vPC)->u.operand].u.jsValue; 1360 1365 JSValue* result; 1361 result = jsNumber((val->toUInt32(exec)) >> (shift->toUInt32(exec) & 0x1f)); 1362 VM_CHECK_EXCEPTION(); 1366 if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val)) 1367 result = JSImmediate::rightShiftImmediateNumbers(val, shift); 1368 else { 1369 result = jsNumber((val->toUInt32(exec)) >> (shift->toUInt32(exec) & 0x1f)); 1370 VM_CHECK_EXCEPTION(); 1371 } 1363 1372 dst = result; 1364 1373
Note:
See TracChangeset
for help on using the changeset viewer.