Changeset 167382 in webkit


Ignore:
Timestamp:
Apr 16, 2014 1:54:43 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by peavo@outlook.com <peavo@outlook.com> 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.

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r167380 r167382  
     12014-04-16  peavo@outlook.com  <peavo@outlook.com>
     2
     3        Fix JSC Debug Regressions on Windows
     4        https://bugs.webkit.org/show_bug.cgi?id=131182
     5
     6        Reviewed by Brent Fulgham.
     7
     8        The cast static_cast<int64_t>(number) in JSValue::isMachineInt() can generate a floating point error,
     9        and set the st floating point register tags, if the value of the number parameter is infinite.
     10        If the st floating point register tags are not cleared, this can cause strange floating point behavior later on.
     11        This can be avoided by checking for infinity first.
     12
     13        * runtime/JSCJSValueInlines.h:
     14        (JSC::JSValue::isMachineInt): Avoid floating point error by checking for infinity first.
     15        * runtime/Options.cpp:
     16        (JSC::recomputeDependentOptions): Re-enable jit for Windows.
     17
    1182014-04-16  Oliver Hunt  <oliver@apple.com>
    219
  • 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)
  • trunk/Source/JavaScriptCore/runtime/Options.cpp

    r167061 r167382  
    226226#if !ENABLE(FTL_JIT)
    227227    Options::useFTLJIT() = false;
    228 #endif
    229 #if OS(WINDOWS)
    230     // Temporarily disable the JIT on Windows until we have a fix for
    231     // https://webkit.org/b/131182.
    232     Options::useJIT() = false;
    233228#endif
    234229
Note: See TracChangeset for help on using the changeset viewer.