Changeset 194560 in webkit


Ignore:
Timestamp:
Jan 4, 2016 2:53:57 PM (8 years ago)
Author:
mark.lam@apple.com
Message:

isUntypedSpeculationForArithmetic is wrong.
https://bugs.webkit.org/show_bug.cgi?id=152708

Reviewed by Filip Pizlo.

The isUntypedSpeculation...() checks should return true is we ever see
non-numeric types, regardless of whether numeric types are seen or not.
Previously, they only return true if we only see non-numeric types, and false if
we ever see numeric types.

This patch is perf neutral on both x86_64 and x86.

  • bytecode/SpeculatedType.h:

(JSC::isUntypedSpeculationForArithmetic):
(JSC::isUntypedSpeculationForBitOps):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r194559 r194560  
     12016-01-04  Mark Lam  <mark.lam@apple.com>
     2
     3        isUntypedSpeculationForArithmetic is wrong.
     4        https://bugs.webkit.org/show_bug.cgi?id=152708
     5
     6        Reviewed by Filip Pizlo.
     7
     8        The isUntypedSpeculation...() checks should return true is we ever see
     9        non-numeric types, regardless of whether numeric types are seen or not.
     10        Previously, they only return true if we only see non-numeric types, and false if
     11        we ever see numeric types.
     12
     13        This patch is perf neutral on both x86_64 and x86.
     14
     15        * bytecode/SpeculatedType.h:
     16        (JSC::isUntypedSpeculationForArithmetic):
     17        (JSC::isUntypedSpeculationForBitOps):
     18
    1192016-01-04  Tim Horton  <timothy_horton@apple.com>
    220
  • trunk/Source/JavaScriptCore/bytecode/SpeculatedType.h

    r194113 r194560  
    388388inline bool isUntypedSpeculationForArithmetic(SpeculatedType value)
    389389{
    390     return !(value & (SpecFullNumber | SpecBoolean));
     390    return !!(value & ~(SpecFullNumber | SpecBoolean));
    391391}
    392392
    393393inline bool isUntypedSpeculationForBitOps(SpeculatedType value)
    394394{
    395     return !(value & (SpecFullNumber | SpecBoolean | SpecOther));
     395    return !!(value & ~(SpecFullNumber | SpecBoolean | SpecOther));
    396396}
    397397
Note: See TracChangeset for help on using the changeset viewer.