Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Unified Diff: test/cctest/compiler/test-run-bytecode-graph-builder.cc

Issue 1819123002: Remove support for legacy const, part 1 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased, deleted one more file Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/preparser.cc ('k') | test/cctest/compiler/test-run-jsops.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-bytecode-graph-builder.cc
diff --git a/test/cctest/compiler/test-run-bytecode-graph-builder.cc b/test/cctest/compiler/test-run-bytecode-graph-builder.cc
index 8970809f865ba37cd0381e480616672d8cbc6e8a..e2d980bf032ffe1b0863b998526cd84aadaee31a 100644
--- a/test/cctest/compiler/test-run-bytecode-graph-builder.cc
+++ b/test/cctest/compiler/test-run-bytecode-graph-builder.cc
@@ -2857,29 +2857,6 @@ TEST(BytecodeGraphBuilderConstInLookupContextChain) {
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*const_decl[i].return_value()));
}
-
- // Tests for Legacy constant.
- bool old_flag_legacy_const = FLAG_legacy_const;
- FLAG_legacy_const = true;
-
- ExpectedSnippet<0> legacy_const_decl[] = {
- {"return outerConst = 23;", {handle(Smi::FromInt(23), isolate)}},
- {"outerConst = 30; return outerConst;",
- {handle(Smi::FromInt(10), isolate)}},
- };
-
- for (size_t i = 0; i < arraysize(legacy_const_decl); i++) {
- ScopedVector<char> script(1024);
- SNPrintF(script, "%s %s %s", prologue, legacy_const_decl[i].code_snippet,
- epilogue);
-
- BytecodeGraphTester tester(isolate, zone, script.start(), "*");
- auto callable = tester.GetCallable<>();
- Handle<Object> return_value = callable().ToHandleChecked();
- CHECK(return_value->SameValue(*legacy_const_decl[i].return_value()));
- }
-
- FLAG_legacy_const = old_flag_legacy_const;
}
TEST(BytecodeGraphBuilderIllegalConstDeclaration) {
@@ -2933,43 +2910,6 @@ TEST(BytecodeGraphBuilderIllegalConstDeclaration) {
}
}
-TEST(BytecodeGraphBuilderLegacyConstDeclaration) {
- bool old_flag_legacy_const = FLAG_legacy_const;
- FLAG_legacy_const = true;
-
- HandleAndZoneScope scope;
- Isolate* isolate = scope.main_isolate();
- Zone* zone = scope.main_zone();
-
- ExpectedSnippet<0> snippets[] = {
- {"const x = (x = 10) + 3; return x;",
- {handle(Smi::FromInt(13), isolate)}},
- {"const x = 10; x = 20; return x;", {handle(Smi::FromInt(10), isolate)}},
- {"var a = 10;\n"
- "for (var i = 0; i < 10; ++i) {\n"
- " const x = i;\n" // Legacy constants are not block scoped.
- " a = a + x;\n"
- "}\n"
- "return a;\n",
- {handle(Smi::FromInt(10), isolate)}},
- {"const x = 20; eval('x = 10;'); return x;",
- {handle(Smi::FromInt(20), isolate)}},
- };
-
- for (size_t i = 0; i < arraysize(snippets); i++) {
- ScopedVector<char> script(1024);
- SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
- snippets[i].code_snippet, kFunctionName);
-
- BytecodeGraphTester tester(isolate, zone, script.start());
- auto callable = tester.GetCallable<>();
- Handle<Object> return_value = callable().ToHandleChecked();
- CHECK(return_value->SameValue(*snippets[i].return_value()));
- }
-
- FLAG_legacy_const = old_flag_legacy_const;
-}
-
TEST(BytecodeGraphBuilderDebuggerStatement) {
FLAG_expose_debug_as = "debug";
HandleAndZoneScope scope;
« no previous file with comments | « src/parsing/preparser.cc ('k') | test/cctest/compiler/test-run-jsops.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698