Changeset 209293 in webkit


Ignore:
Timestamp:
Dec 2, 2016 7:39:42 PM (7 years ago)
Author:
caitp@igalia.com
Message:

[JSC] add additional bit to JSTokenType bitfield
https://bugs.webkit.org/show_bug.cgi?id=165091

Reviewed by Geoffrey Garen.

JSTests:

  • stress/bug-165091.js: Added.

(shouldThrowSyntaxError):

Source/JavaScriptCore:

Avoid overflow which causes keyword tokens to be treated as unary
tokens now that "async" is tokenized as a keyword, by granting an
additional 64 bits to be occupied by token IDs.

  • parser/ParserTokens.h:
Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r209283 r209293  
     12016-12-02  Caitlin Potter  <caitp@igalia.com>
     2
     3[JSC] add additional bit to JSTokenType bitfield
     4        https://bugs.webkit.org/show_bug.cgi?id=165091
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * stress/bug-165091.js: Added.
     9        (shouldThrowSyntaxError):
     10
    1112016-12-02  Commit Queue  <commit-queue@webkit.org>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r209288 r209293  
     12016-12-02  Caitlin Potter  <caitp@igalia.com>
     2
     3[JSC] add additional bit to JSTokenType bitfield
     4        https://bugs.webkit.org/show_bug.cgi?id=165091
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Avoid overflow which causes keyword tokens to be treated as unary
     9        tokens now that "async" is tokenized as a keyword, by granting an
     10        additional 64 bits to be occupied by token IDs.
     11
     12        * parser/ParserTokens.h:
     13
    1142016-12-02  Andy Estes  <aestes@apple.com>
    215
  • trunk/Source/JavaScriptCore/parser/ParserTokens.h

    r208933 r209293  
    3535
    3636enum {
    37     UnaryOpTokenFlag = 64,
    38     KeywordTokenFlag = 128,
    39     BinaryOpTokenPrecedenceShift = 8,
     37    // Token Bitfield: 0b000000000RTEIIIIIIIIPPPPKUXXXXXX
     38    // R = right-associative bit
     39    // T = unterminated error flag
     40    // E = error flag
     41    // I = binary operator allows 'in'
     42    // P = binary operator precedence
     43    // K = keyword flag
     44    // U = unary operator flag
     45    UnaryOpTokenFlag = 128,
     46    KeywordTokenFlag = 256,
     47    BinaryOpTokenPrecedenceShift = 9,
    4048    BinaryOpTokenAllowsInPrecedenceAdditionalShift = 4,
    4149    BinaryOpTokenPrecedenceMask = 15 << BinaryOpTokenPrecedenceShift,
     
    8391
    8492    // Contextual keywords
     93   
    8594    LET,
    8695    YIELD,
Note: See TracChangeset for help on using the changeset viewer.