Changeset 91938 in webkit
- Timestamp:
- Jul 28, 2011 10:32:40 AM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r91933 r91938 1 2011-07-28 Gavin Barraclough <barraclough@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=65325 4 Performance tweak to parseInt 5 6 Reviewed by Oliver Hunt. 7 8 * runtime/JSGlobalObjectFunctions.cpp: 9 (JSC::globalFuncParseInt): 10 - parseInt applied to small positive numbers = floor. 11 1 12 2011-07-28 Dan Bernstein <mitz@apple.com> 2 13 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
r89219 r91938 461 461 { 462 462 JSValue value = exec->argument(0); 463 464 // Optimized case: If the argument is a positive number in the integer 465 // range, and the exponent is 10, then parseInt is equivalent to floor. 466 double n; 467 if (value.getNumber(n) && n >= 0 && n < INT_MAX && exec->argument(1).isUndefined()) 468 return JSValue::encode(jsNumber(static_cast<int>(n))); 469 463 470 int32_t radix = exec->argument(1).toInt32(exec); 464 471
Note: See TracChangeset
for help on using the changeset viewer.