Ignore:
Timestamp:
Apr 16, 2014, 1:54:43 PM (11 years ago)
Author:
[email protected]
Message:

Fix JSC Debug Regressions on Windows
https://bugs.webkit.org/show_bug.cgi?id=131182

Patch by [email protected] <[email protected]> on 2014-04-16
Reviewed by Brent Fulgham.

The cast static_cast<int64_t>(number) in JSValue::isMachineInt() can generate a floating point error,
and set the st floating point register tags, if the value of the number parameter is infinite.
If the st floating point register tags are not cleared, this can cause strange floating point behavior later on.
This can be avoided by checking for infinity first.

  • runtime/JSCJSValueInlines.h:

(JSC::JSValue::isMachineInt): Avoid floating point error by checking for infinity first.

  • runtime/Options.cpp:

(JSC::recomputeDependentOptions): Re-enable jit for Windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h

    r167220 r167382  
    505505    if (number != number)
    506506        return false;
     507#if OS(WINDOWS)
     508    // Need to check for infinity on Windows to avoid floating point error on following cast, see bug 131182.
     509    if (std::isinf(number))
     510        return false;
     511#endif
    507512    int64_t asInt64 = static_cast<int64_t>(number);
    508513    if (asInt64 != number)
Note: See TracChangeset for help on using the changeset viewer.