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

Unified Diff: test/cctest/test-parsing.cc

Issue 2513563002: Remove FLAG_min_preparse_length. (Closed)
Patch Set: test262 expectations Created 4 years, 1 month 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 | « test/cctest/test-api.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index 00ddf6cbfb3f7e7d4d6c212e9650f51e5d5ac226..dd3dc0625bb890b50983f67f4bdd29f2d718306e 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -251,7 +251,6 @@ TEST(UsingCachedData) {
v8::String::NewExternalOneByte(isolate,
new ScriptResource(source, source_length))
.ToLocalChecked());
- i::FLAG_min_preparse_length = 0;
v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &script_source,
v8::ScriptCompiler::kProduceParserCache)
.ToLocalChecked();
@@ -278,9 +277,6 @@ TEST(PreparseFunctionDataIsUsed) {
// This tests that we actually do use the function data generated by the
// preparser.
- // Make preparsing work for short scripts.
- i::FLAG_min_preparse_length = 0;
-
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope handles(isolate);
v8::Local<v8::Context> context = v8::Context::New(isolate);
@@ -484,7 +480,6 @@ TEST(RegressChromium62639) {
TEST(Regress928) {
// Test only applies when lazy parsing.
if (!i::FLAG_lazy) return;
- i::FLAG_min_preparse_length = 0;
// Tests that the first non-toplevel function is not included in the preparse
// data.
@@ -822,6 +817,8 @@ TEST(ScopeUsesArgumentsSuperThis) {
i::Handle<i::Script> script = factory->NewScript(source);
i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME);
i::ParseInfo info(&zone, script);
+ // The information we're checking is only produced when eager parsing.
+ info.set_allow_lazy_parsing(false);
i::Parser parser(&info);
CHECK(parser.Parse(&info));
CHECK(i::Rewriter::Rewrite(&info));
@@ -1178,7 +1175,6 @@ TEST(ScopePositions) {
i::ParseInfo info(&zone, script);
i::Parser parser(&info);
info.set_language_mode(source_data[i].language_mode);
- info.set_allow_lazy_parsing();
parser.Parse(&info);
CHECK_NOT_NULL(info.literal());
@@ -1225,7 +1221,6 @@ TEST(DiscardFunctionBody) {
i::Handle<i::Script> script = factory->NewScript(source_code);
i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME);
i::ParseInfo info(&zone, script);
- info.set_allow_lazy_parsing();
i::Parser parser(&info);
parser.Parse(&info);
function = info.literal();
@@ -2482,7 +2477,6 @@ TEST(DontRegressPreParserDataSizes) {
i::ScriptData* sd = NULL;
info.set_cached_data(&sd);
info.set_compile_options(v8::ScriptCompiler::kProduceParserCache);
- info.set_allow_lazy_parsing();
i::Parser::ParseStatic(&info);
i::ParseData* pd = i::ParseData::FromCachedData(sd);
@@ -3148,7 +3142,6 @@ TEST(RegressionLazyFunctionWithErrorWithArg) {
v8::HandleScope scope(isolate);
LocalContext env;
i::FLAG_lazy = true;
- i::FLAG_min_preparse_length = 0;
CompileRun("function this_is_lazy() {\n"
" break p;\n"
"}\n"
@@ -3377,6 +3370,7 @@ TEST(InnerAssignment) {
printf("\n");
i::Handle<i::Script> script = factory->NewScript(source);
info = std::unique_ptr<i::ParseInfo>(new i::ParseInfo(&zone, script));
+ info->set_allow_lazy_parsing(false);
}
i::Parser parser(info.get());
CHECK(parser.Parse(info.get()));
@@ -3552,6 +3546,8 @@ TEST(SloppyModeUseCount) {
LocalContext env;
int use_counts[v8::Isolate::kUseCounterFeatureCount] = {};
global_use_counts = use_counts;
+ // Force eager parsing (preparser doesn't update use counts).
+ i::FLAG_lazy = false;
CcTest::isolate()->SetUseCounterCallback(MockUseCounterCallback);
CompileRun("function bar() { var baz = 1; }");
CHECK_LT(0, use_counts[v8::Isolate::kSloppyMode]);
@@ -3565,6 +3561,8 @@ TEST(BothModesUseCount) {
LocalContext env;
int use_counts[v8::Isolate::kUseCounterFeatureCount] = {};
global_use_counts = use_counts;
+ // Force eager parsing (preparser doesn't update use counts).
+ i::FLAG_lazy = false;
CcTest::isolate()->SetUseCounterCallback(MockUseCounterCallback);
CompileRun("function bar() { 'use strict'; var baz = 1; }");
CHECK_LT(0, use_counts[v8::Isolate::kSloppyMode]);
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698