Title: [237096] trunk/Source/_javascript_Core
Revision
237096
Author
yusukesuz...@slowstart.org
Date
2018-10-15 06:49:17 -0700 (Mon, 15 Oct 2018)

Log Message

[JSC] Remove Options::useObjectRestSpread
https://bugs.webkit.org/show_bug.cgi?id=190568

Reviewed by Saam Barati.

Options::useObjectRestSpread is enabled by default at 2017-06-27. It is already shipped in several releases,
and we can think that it is mature. Let's drop Options::useObjectRestSpread() flag.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::Parser):
(JSC::Parser<LexerType>::parseDestructuringPattern):
(JSC::Parser<LexerType>::parseProperty):
* parser/Parser.h:
* runtime/Options.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (237095 => 237096)


--- trunk/Source/_javascript_Core/ChangeLog	2018-10-15 13:48:11 UTC (rev 237095)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-10-15 13:49:17 UTC (rev 237096)
@@ -1,3 +1,20 @@
+2018-10-14  Yusuke Suzuki  <yusukesuz...@slowstart.org>
+
+        [JSC] Remove Options::useObjectRestSpread
+        https://bugs.webkit.org/show_bug.cgi?id=190568
+
+        Reviewed by Saam Barati.
+
+        Options::useObjectRestSpread is enabled by default at 2017-06-27. It is already shipped in several releases,
+        and we can think that it is mature. Let's drop Options::useObjectRestSpread() flag.
+
+        * parser/Parser.cpp:
+        (JSC::Parser<LexerType>::Parser):
+        (JSC::Parser<LexerType>::parseDestructuringPattern):
+        (JSC::Parser<LexerType>::parseProperty):
+        * parser/Parser.h:
+        * runtime/Options.h:
+
 2018-10-13  Yusuke Suzuki  <yusukesuz...@slowstart.org>
 
         [JSC] JSON.stringify can accept call-with-no-arguments

Modified: trunk/Source/_javascript_Core/parser/Parser.cpp (237095 => 237096)


--- trunk/Source/_javascript_Core/parser/Parser.cpp	2018-10-15 13:48:11 UTC (rev 237095)
+++ trunk/Source/_javascript_Core/parser/Parser.cpp	2018-10-15 13:49:17 UTC (rev 237096)
@@ -147,7 +147,6 @@
     m_token.m_location.lineStartOffset = source.startOffset();
     m_functionCache = vm->addSourceProviderCache(source.provider());
     m_expressionErrorClassifier = nullptr;
-    m_useObjectRestSpread = Options::useObjectRestSpread();
 
     ScopeRef scope = pushScope();
     scope->setSourceParseMode(parseMode);
@@ -1174,7 +1173,7 @@
             if (match(CLOSEBRACE))
                 break;
 
-            if (match(DOTDOTDOT) && m_useObjectRestSpread) {
+            if (match(DOTDOTDOT)) {
                 JSTokenLocation location = m_token.m_location;
                 next();
                 auto innerPattern = parseObjectRestBindingOrAssignmentElement(context, kind, exportType, duplicateIdentifier, bindingContext);
@@ -4046,17 +4045,14 @@
         return context.createProperty(propertyName, node, static_cast<PropertyNode::Type>(PropertyNode::Constant | PropertyNode::Computed), PropertyNode::Unknown, complete, SuperBinding::NotNeeded, ClassElementTag::No);
     }
     case DOTDOTDOT: {
-        if (m_useObjectRestSpread) {
-            auto spreadLocation = m_token.m_location;
-            auto start = m_token.m_startPosition;
-            auto divot = m_token.m_endPosition;
-            next();
-            TreeExpression elem = parseAssignmentExpressionOrPropagateErrorClass(context);
-            failIfFalse(elem, "Cannot parse subject of a spread operation");
-            auto node = context.createObjectSpreadExpression(spreadLocation, elem, start, divot, m_lastTokenEndPosition);
-            return context.createProperty(node, PropertyNode::Spread, PropertyNode::Unknown, complete, SuperBinding::NotNeeded, ClassElementTag::No);
-        }
-        FALLTHROUGH;
+        auto spreadLocation = m_token.m_location;
+        auto start = m_token.m_startPosition;
+        auto divot = m_token.m_endPosition;
+        next();
+        TreeExpression elem = parseAssignmentExpressionOrPropagateErrorClass(context);
+        failIfFalse(elem, "Cannot parse subject of a spread operation");
+        auto node = context.createObjectSpreadExpression(spreadLocation, elem, start, divot, m_lastTokenEndPosition);
+        return context.createProperty(node, PropertyNode::Spread, PropertyNode::Unknown, complete, SuperBinding::NotNeeded, ClassElementTag::No);
     }
     default:
         failIfFalse(m_token.m_type & KeywordTokenFlag, "Expected a property name");

Modified: trunk/Source/_javascript_Core/parser/Parser.h (237095 => 237096)


--- trunk/Source/_javascript_Core/parser/Parser.h	2018-10-15 13:48:11 UTC (rev 237095)
+++ trunk/Source/_javascript_Core/parser/Parser.h	2018-10-15 13:49:17 UTC (rev 237096)
@@ -1817,7 +1817,6 @@
 
     ParserState m_parserState;
     
-    bool m_useObjectRestSpread;
     bool m_hasStackOverflow;
     String m_errorMessage;
     JSToken m_token;

Modified: trunk/Source/_javascript_Core/runtime/Options.h (237095 => 237096)


--- trunk/Source/_javascript_Core/runtime/Options.h	2018-10-15 13:48:11 UTC (rev 237095)
+++ trunk/Source/_javascript_Core/runtime/Options.h	2018-10-15 13:49:17 UTC (rev 237096)
@@ -506,7 +506,6 @@
     v(bool, useWebAssemblyStreamingApi, enableWebAssemblyStreamingApi, Normal, "Allow to run WebAssembly's Streaming API") \
     v(bool, useCallICsForWebAssemblyToJSCalls, true, Normal, "If true, we will use CallLinkInfo to inline cache Wasm to JS calls.") \
     v(bool, useEagerWebAssemblyModuleHashing, false, Normal, "Unnamed WebAssembly modules are identified in backtraces through their hash, if available.") \
-    v(bool, useObjectRestSpread, true, Normal, "If true, we will enable Object Rest/Spread feature.") \
     v(bool, useBigInt, false, Normal, "If true, we will enable BigInt support.") \
     v(bool, useIntlNumberFormatToParts, enableIntlNumberFormatToParts, Normal, "If true, we will enable Intl.NumberFormat.prototype.formatToParts") \
     v(bool, useIntlPluralRules, enableIntlPluralRules, Normal, "If true, we will enable Intl.PluralRules.") \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to