[es6] Ship rest parameters.
authorneis <neis@chromium.org>
Mon, 28 Sep 2015 11:16:55 +0000 (04:16 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 28 Sep 2015 11:19:35 +0000 (11:19 +0000)
R=rossberg
BUG=

Review URL: https://codereview.chromium.org/1371963002

Cr-Commit-Position: refs/heads/master@{#30970}

12 files changed:
src/bootstrapper.cc
src/flag-definitions.h
src/parser.cc
src/preparser.h
test/cctest/test-parsing.cc
test/js-perf-test/JSTests.json
test/mjsunit/harmony/spread-call-new-class.js
test/mjsunit/harmony/spread-call-new.js
test/mjsunit/harmony/spread-call-super-property.js
test/mjsunit/harmony/spread-call.js
test/mjsunit/harmony/super.js
test/mjsunit/strong/function-arity.js

index 4bcebaa8d687d6679a3562f0e4ce9d320486a1e2..778c7bd5b5273fa7c0df4ead24bdec5eaa32cc65 100644 (file)
@@ -1861,7 +1861,7 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy_function)
 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy_let)
 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters)
 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_default_parameters)
-EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spreadcalls)
+EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spread_calls)
 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring)
 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_observe)
 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spread_arrays)
@@ -2565,7 +2565,7 @@ bool Genesis::InstallExperimentalNatives() {
   static const char* harmony_default_parameters_natives[] = {nullptr};
   static const char* harmony_reflect_natives[] = {"native harmony-reflect.js",
                                                   nullptr};
-  static const char* harmony_spreadcalls_natives[] = {
+  static const char* harmony_spread_calls_natives[] = {
       "native harmony-spread.js", nullptr};
   static const char* harmony_destructuring_natives[] = {nullptr};
   static const char* harmony_object_observe_natives[] = {
index 857882045094f739896a0b3c79edf6fe7445fbdc..2c2a0fa4209cf71fbb2a5e3bd58bdca14c22ae01 100644 (file)
@@ -204,7 +204,6 @@ DEFINE_BOOL(legacy_const, true, "legacy semantics for const in sloppy mode")
 #define HARMONY_STAGED(V)                                             \
   V(harmony_tostring, "harmony toString")                             \
   V(harmony_concat_spreadable, "harmony isConcatSpreadable")          \
-  V(harmony_rest_parameters, "harmony rest parameters")               \
   V(harmony_sloppy, "harmony features in sloppy mode")                \
   V(harmony_sloppy_function, "harmony sloppy function block scoping") \
   V(harmony_sloppy_let, "harmony let in sloppy mode")
@@ -215,7 +214,8 @@ DEFINE_BOOL(legacy_const, true, "legacy semantics for const in sloppy mode")
   V(harmony_array_includes, "harmony Array.prototype.includes") \
   V(harmony_new_target, "harmony new.target")                   \
   V(harmony_object_observe, "harmony Object.observe")           \
-  V(harmony_spreadcalls, "harmony spread-calls")                \
+  V(harmony_rest_parameters, "harmony rest parameters")         \
+  V(harmony_spread_calls, "harmony spread-calls")               \
   V(harmony_spread_arrays, "harmony spread in array literals")
 
 // Once a shipping feature has proved stable in the wild, it will be dropped
index e3ce0f0172a4c340c0a904d30c6511b7b9bb476a..e2b99ec73b6e3b4235730c7258d3ecc8a4364e3d 100644 (file)
@@ -919,7 +919,7 @@ Parser::Parser(ParseInfo* info)
   set_allow_harmony_sloppy_let(FLAG_harmony_sloppy_let);
   set_allow_harmony_rest_parameters(FLAG_harmony_rest_parameters);
   set_allow_harmony_default_parameters(FLAG_harmony_default_parameters);
-  set_allow_harmony_spreadcalls(FLAG_harmony_spreadcalls);
+  set_allow_harmony_spread_calls(FLAG_harmony_spread_calls);
   set_allow_harmony_destructuring(FLAG_harmony_destructuring);
   set_allow_harmony_spread_arrays(FLAG_harmony_spread_arrays);
   set_allow_harmony_new_target(FLAG_harmony_new_target);
@@ -4737,7 +4737,7 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
     SET_ALLOW(harmony_sloppy_let);
     SET_ALLOW(harmony_rest_parameters);
     SET_ALLOW(harmony_default_parameters);
-    SET_ALLOW(harmony_spreadcalls);
+    SET_ALLOW(harmony_spread_calls);
     SET_ALLOW(harmony_destructuring);
     SET_ALLOW(harmony_spread_arrays);
     SET_ALLOW(harmony_new_target);
index e9e0f4bfb8b620ef0872c356d07ce0ffa4edb432..50dbcf1a46310b5bbed950705c2438dec70caae8 100644 (file)
@@ -113,7 +113,7 @@ class ParserBase : public Traits {
         allow_harmony_sloppy_let_(false),
         allow_harmony_rest_parameters_(false),
         allow_harmony_default_parameters_(false),
-        allow_harmony_spreadcalls_(false),
+        allow_harmony_spread_calls_(false),
         allow_harmony_destructuring_(false),
         allow_harmony_spread_arrays_(false),
         allow_harmony_new_target_(false),
@@ -132,7 +132,7 @@ class ParserBase : public Traits {
   ALLOW_ACCESSORS(harmony_sloppy_let);
   ALLOW_ACCESSORS(harmony_rest_parameters);
   ALLOW_ACCESSORS(harmony_default_parameters);
-  ALLOW_ACCESSORS(harmony_spreadcalls);
+  ALLOW_ACCESSORS(harmony_spread_calls);
   ALLOW_ACCESSORS(harmony_destructuring);
   ALLOW_ACCESSORS(harmony_spread_arrays);
   ALLOW_ACCESSORS(harmony_new_target);
@@ -833,7 +833,7 @@ class ParserBase : public Traits {
   bool allow_harmony_sloppy_let_;
   bool allow_harmony_rest_parameters_;
   bool allow_harmony_default_parameters_;
-  bool allow_harmony_spreadcalls_;
+  bool allow_harmony_spread_calls_;
   bool allow_harmony_destructuring_;
   bool allow_harmony_spread_arrays_;
   bool allow_harmony_new_target_;
@@ -2835,7 +2835,8 @@ typename Traits::Type::ExpressionList ParserBase<Traits>::ParseArguments(
   bool was_unspread = false;
   int unspread_sequences_count = 0;
   while (!done) {
-    bool is_spread = allow_harmony_spreadcalls() && (peek() == Token::ELLIPSIS);
+    bool is_spread =
+        allow_harmony_spread_calls() && (peek() == Token::ELLIPSIS);
     int start_pos = peek_position();
     if (is_spread) Consume(Token::ELLIPSIS);
 
index 19b4619550d0b9f0fffe52c77e5a1a15b1176518..6300c0987d91602075d9a34735ff5ea3958ca181 100644 (file)
@@ -1528,7 +1528,7 @@ void SetParserFlags(i::ParserBase<Traits>* parser,
       flags.Contains(kAllowHarmonyDefaultParameters));
   parser->set_allow_harmony_rest_parameters(
       flags.Contains(kAllowHarmonyRestParameters));
-  parser->set_allow_harmony_spreadcalls(
+  parser->set_allow_harmony_spread_calls(
       flags.Contains(kAllowHarmonySpreadCalls));
   parser->set_allow_harmony_sloppy(flags.Contains(kAllowHarmonySloppy));
   parser->set_allow_harmony_sloppy_let(flags.Contains(kAllowHarmonySloppyLet));
index 4e238a90f9b1330bf54268cc5ba09ea94d2f6c43..911f9f3289c594e38c94b6ca8bcdbdc2eff230d9 100644 (file)
@@ -26,7 +26,7 @@
       "path": ["SpreadCalls"],
       "main": "run.js",
       "resources": ["spreadcalls.js"],
-      "flags": ["--harmony-spreadcalls"],
+      "flags": ["--harmony-spread_calls"],
       "run_count": 5,
       "units": "score",
       "results_regexp": "^%s\\-SpreadCalls\\(Score\\): (.+)$",
index fcd0a21bc9aaa143d17ea7a66aaed7b5b8e9d731..ed95e6cad7e4f57f0a2f6cb46162eebabd7dcfee 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-// Flags: --harmony-spreadcalls --harmony-sloppy --harmony-rest-parameters
+// Flags: --harmony-spread-calls --harmony-sloppy --harmony-rest-parameters
 
 
 (function testConstructClassStrict() {
index 78f873e14b1aad8144792eb1897b6af78027068d..4ae115e791c7e778b42962253b182e52a285c951 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-// Flags: --harmony-spreadcalls
+// Flags: --harmony-spread-calls
 
 (function testNonConstructorStrict() {
   "use strict";
index 1eb2abc3b0433a99051b39f8b76775fbfea81b2a..cc6cf849bd2607556958fe353e81b0ff59dc1e5f 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-// Flags: --harmony-spreadcalls --harmony-sloppy --harmony-rest-parameters
+// Flags: --harmony-spread-calls --harmony-sloppy --harmony-rest-parameters
 
 (function testCallSuperPropertyStrict() {
   "use strict";
index e10a3ec7939aadc4b90e1fd665f5a63bd5718ba8..7c19ec1ef14a9fac5306677f98534c4c19956b3e 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-// Flags: --harmony-spreadcalls
+// Flags: --harmony-spread-calls
 
 (function testSpreadCallsStrict() {
   "use strict"
index f7584702b603270446725bc30b233c4dc90f6bc5..d74484ea048b5eb58576adfdfa9b99c4f05727bc 100644 (file)
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 // Flags: --harmony-arrow-functions --allow-natives-syntax
-// Flags: --harmony-spreadcalls --harmony-destructuring
+// Flags: --harmony-spread-calls --harmony-destructuring
 // Flags: --harmony-rest-parameters --harmony-sloppy
 
 (function TestSuperNamedLoads() {
index 9a4f2fc8473efc0d0c06b1e0e934fa95efeefa9d..67c0d1f195cf1e13ce619135e89cd85a8f2f8d13 100644 (file)
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 // Flags: --strong-mode --harmony-arrow-functions --harmony-reflect
-// Flags: --harmony-spreadcalls --harmony-rest-parameters --allow-natives-syntax
+// Flags: --harmony-spread-calls --harmony-rest-parameters --allow-natives-syntax
 
 'use strict';