Reviewers: rossberg,

Message:
rossberg, ptal.

Description:
Make test-parsing faster: don't run parsing tests with all experimental flag
combinations.

Instead, make it possible for indifidual tests to pass "always true flags" which
are not part of the varying flag set.

The downside is that if an experimental flag changes parsing of some of the
unrelated code snippets, it's noticed later (only after the flag is turned on by
default). But this is a reasonable trade off for faster tests.

Additional fix: Some tests (ErrorsFutureStrictReservedWords) were using
always_flags incorrectly (running two different tests with different
always_flags basically iterates over every flag combination anyway - most of
them twice).

BUG=v8:3707
LOG=N

Please review this at https://codereview.chromium.org/772823002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+6, -23 lines):
  M test/cctest/test-parsing.cc


Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index 0939e08a9fd23dc544a6d4cb8a7ac0f1097174ae..2aa4eaf5cd13e5c623ec8ac7176e89230be2a235 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -1673,16 +1673,9 @@ void RunParserSyncTest(const char* context_data[][2],
   CcTest::i_isolate()->stack_guard()->SetStackLimit(
       i::GetCurrentStackPosition() - 128 * 1024);

+  // Experimental feature flags should not go here; pass the flags as
+  // always_true_flags if the test needs them.
   static const ParserFlag default_flags[] = {
-    kAllowHarmonyArrowFunctions,
-    kAllowHarmonyClasses,
-    kAllowHarmonyNumericLiterals,
-    kAllowHarmonyObjectLiterals,
-    kAllowHarmonyScoping,
-    kAllowHarmonyModules,
-    kAllowHarmonyTemplates,
-    kAllowHarmonySloppy,
-    kAllowHarmonyUnicode,
     kAllowLazy,
     kAllowNatives,
   };
@@ -1691,13 +1684,10 @@ void RunParserSyncTest(const char* context_data[][2],
     flags = default_flags;
     flags_len = arraysize(default_flags);
     if (always_true_flags != NULL || always_false_flags != NULL) {
-      // Remove always_true/false_flags from default_flags.
+      // Remove always_true/false_flags from default_flags (if present).
       CHECK((always_true_flags != NULL) == (always_true_len > 0));
       CHECK((always_false_flags != NULL) == (always_false_len > 0));
-      CHECK(always_true_flags == NULL || always_true_len < flags_len);
-      CHECK(always_false_flags == NULL || always_false_len < flags_len);
-      generated_flags =
-          new ParserFlag[flags_len - always_true_len - always_false_len];
+      generated_flags = new ParserFlag[flags_len + always_true_len];
       int flag_index = 0;
       for (int i = 0; i < flags_len; ++i) {
         bool use_flag = true;
@@ -1709,7 +1699,6 @@ void RunParserSyncTest(const char* context_data[][2],
         }
         if (use_flag) generated_flags[flag_index++] = flags[i];
       }
-      CHECK(flag_index == flags_len - always_true_len - always_false_len);
       flags_len = flag_index;
       flags = generated_flags;
     }
@@ -1899,14 +1888,8 @@ TEST(ErrorsFutureStrictReservedWords) {
     NULL
   };

-  static const ParserFlag always_flags[] = {kAllowHarmonyArrowFunctions};
- RunParserSyncTest(context_data, statement_data, kError, NULL, 0, always_flags,
-                    arraysize(always_flags));
-
-  static const ParserFlag classes_flags[] = {
- kAllowHarmonyArrowFunctions, kAllowHarmonyClasses, kAllowHarmonyScoping};
-  RunParserSyncTest(context_data, statement_data, kError, NULL, 0,
-                    classes_flags, arraysize(classes_flags));
+  RunParserSyncTest(context_data, statement_data, kError);
+  RunParserSyncTest(context_data, statement_data, kError);
 }




--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to