[JSC] Rename ANDEQUAL to BITANDEQUAL (etc.) throughout frontend
authorross.kirsling@sony.com <ross.kirsling@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Mar 2020 00:34:38 +0000 (00:34 +0000)
committerross.kirsling@sony.com <ross.kirsling@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Mar 2020 00:34:38 +0000 (00:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=209626

Reviewed by Mark Lam.

Our frontend refers to `&=` `|=` `^=` as `ANDEQUAL` `OREQUAL` `XOREQUAL`, leaving the bitwiseness implied.
It's important to resolve this ambiguity now, as `&&=` `||=` `??=` are expected to reach Stage 3 next week.

* bytecompiler/NodesCodegen.cpp:
(JSC::emitReadModifyAssignment):
* parser/Lexer.cpp:
(JSC::Lexer<T>::lexWithoutClearingLineTerminator):
* parser/Nodes.h:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseAssignmentExpression):
* parser/ParserTokens.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@259096 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
Source/JavaScriptCore/parser/Lexer.cpp
Source/JavaScriptCore/parser/Nodes.h
Source/JavaScriptCore/parser/Parser.cpp
Source/JavaScriptCore/parser/ParserTokens.h

index 5af22eb..fc32c48 100644 (file)
@@ -1,3 +1,22 @@
+2020-03-26  Ross Kirsling  <ross.kirsling@sony.com>
+
+        [JSC] Rename ANDEQUAL to BITANDEQUAL (etc.) throughout frontend
+        https://bugs.webkit.org/show_bug.cgi?id=209626
+
+        Reviewed by Mark Lam.
+
+        Our frontend refers to `&=` `|=` `^=` as `ANDEQUAL` `OREQUAL` `XOREQUAL`, leaving the bitwiseness implied.
+        It's important to resolve this ambiguity now, as `&&=` `||=` `??=` are expected to reach Stage 3 next week. 
+
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::emitReadModifyAssignment):
+        * parser/Lexer.cpp:
+        (JSC::Lexer<T>::lexWithoutClearingLineTerminator):
+        * parser/Nodes.h:
+        * parser/Parser.cpp:
+        (JSC::Parser<LexerType>::parseAssignmentExpression):
+        * parser/ParserTokens.h:
+
 2020-03-26  Michael Saboff  <msaboff@apple.com>
 
         Refactor YARR Stack Overflow Checks
index 69712aa..d14c306 100644 (file)
@@ -2779,13 +2779,13 @@ static ALWAYS_INLINE RegisterID* emitReadModifyAssignment(BytecodeGenerator& gen
         case OpURShift:
             opcodeID = op_urshift;
             break;
-        case OpAndEq:
+        case OpBitAndEq:
             opcodeID = op_bitand;
             break;
-        case OpXOrEq:
+        case OpBitXOrEq:
             opcodeID = op_bitxor;
             break;
-        case OpOrEq:
+        case OpBitOrEq:
             opcodeID = op_bitor;
             break;
         case OpModEq:
index 3a8c4ec..1ffc6ec 100644 (file)
@@ -2097,7 +2097,7 @@ start:
         }
         if (m_current == '=') {
             shift();
-            token = ANDEQUAL;
+            token = BITANDEQUAL;
             break;
         }
         token = BITAND;
@@ -2106,7 +2106,7 @@ start:
         shift();
         if (m_current == '=') {
             shift();
-            token = XOREQUAL;
+            token = BITXOREQUAL;
             break;
         }
         token = BITXOR;
@@ -2124,7 +2124,7 @@ start:
         shift();
         if (m_current == '=') {
             shift();
-            token = OREQUAL;
+            token = BITOREQUAL;
             break;
         }
         if (m_current == '|') {
index 49aac47..e3cf4bf 100644 (file)
@@ -63,9 +63,9 @@ namespace JSC {
         OpDivEq,
         OpPlusPlus,
         OpMinusMinus,
-        OpAndEq,
-        OpXOrEq,
-        OpOrEq,
+        OpBitAndEq,
+        OpBitXOrEq,
+        OpBitOrEq,
         OpModEq,
         OpPowEq,
         OpLShift,
index e2db005..a3a7e1b 100644 (file)
@@ -3832,7 +3832,7 @@ template <typename TreeBuilder> TreeExpression Parser<LexerType>::parseAssignmen
 
     failIfFalse(lhs, "Cannot parse expression");
     if (initialNonLHSCount != m_parserState.nonLHSCount) {
-        if (m_token.m_type >= EQUAL && m_token.m_type <= OREQUAL)
+        if (m_token.m_type >= EQUAL && m_token.m_type <= BITOREQUAL)
             semanticFail("Left hand side of operator '", getToken(), "' must be a reference");
 
         return lhs;
@@ -3851,9 +3851,9 @@ template <typename TreeBuilder> TreeExpression Parser<LexerType>::parseAssignmen
         case LSHIFTEQUAL: op = OpLShift; break;
         case RSHIFTEQUAL: op = OpRShift; break;
         case URSHIFTEQUAL: op = OpURShift; break;
-        case ANDEQUAL: op = OpAndEq; break;
-        case XOREQUAL: op = OpXOrEq; break;
-        case OREQUAL: op = OpOrEq; break;
+        case BITANDEQUAL: op = OpBitAndEq; break;
+        case BITXOREQUAL: op = OpBitXOrEq; break;
+        case BITOREQUAL: op = OpBitOrEq; break;
         case MODEQUAL: op = OpModEq; break;
         case POWEQUAL: op = OpPowEq; break;
         default:
@@ -3875,7 +3875,7 @@ template <typename TreeBuilder> TreeExpression Parser<LexerType>::parseAssignmen
         lhs = parseAssignmentExpression(context);
         failIfFalse(lhs, "Cannot parse the right hand side of an assignment expression");
         if (initialNonLHSCount != m_parserState.nonLHSCount) {
-            if (m_token.m_type >= EQUAL && m_token.m_type <= OREQUAL)
+            if (m_token.m_type >= EQUAL && m_token.m_type <= BITOREQUAL)
                 semanticFail("Left hand side of operator '", getToken(), "' must be a reference");
             break;
         }
index 98078d6..48181ae 100644 (file)
@@ -129,11 +129,11 @@ enum JSTokenType {
     LSHIFTEQUAL,
     RSHIFTEQUAL,
     URSHIFTEQUAL,
-    ANDEQUAL,
     MODEQUAL,
     POWEQUAL,
-    XOREQUAL,
-    OREQUAL,
+    BITANDEQUAL,
+    BITXOREQUAL,
+    BITOREQUAL,
     DOTDOTDOT,
     ARROWFUNCTION,
     QUESTIONDOT,