| Index: test/cctest/test-parsing.cc
|
| diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
|
| index fe95ab7b9aa4bd153c3051c30144dd873e4b1a14..eb1c408bb30afd438d1674bf3006967537374872 100644
|
| --- a/test/cctest/test-parsing.cc
|
| +++ b/test/cctest/test-parsing.cc
|
| @@ -173,7 +173,9 @@ TEST(ScanHTMLEndComments) {
|
| i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME);
|
| i::AstValueFactory ast_value_factory(
|
| &zone, CcTest::i_isolate()->heap()->HashSeed());
|
| - i::PreParser preparser(&zone, &scanner, &ast_value_factory, stack_limit);
|
| + i::PreParser preparser(
|
| + &zone, &scanner, &ast_value_factory,
|
| + CcTest::i_isolate()->counters()->runtime_call_stats(), stack_limit);
|
| preparser.set_allow_lazy(true);
|
| i::PreParser::PreParseResult result = preparser.PreParseProgram();
|
| CHECK_EQ(i::PreParser::kPreParseSuccess, result);
|
| @@ -188,7 +190,9 @@ TEST(ScanHTMLEndComments) {
|
| i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME);
|
| i::AstValueFactory ast_value_factory(
|
| &zone, CcTest::i_isolate()->heap()->HashSeed());
|
| - i::PreParser preparser(&zone, &scanner, &ast_value_factory, stack_limit);
|
| + i::PreParser preparser(
|
| + &zone, &scanner, &ast_value_factory,
|
| + CcTest::i_isolate()->counters()->runtime_call_stats(), stack_limit);
|
| preparser.set_allow_lazy(true);
|
| i::PreParser::PreParseResult result = preparser.PreParseProgram();
|
| // Even in the case of a syntax error, kPreParseSuccess is returned.
|
| @@ -360,7 +364,9 @@ TEST(StandAlonePreParser) {
|
| i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME);
|
| i::AstValueFactory ast_value_factory(
|
| &zone, CcTest::i_isolate()->heap()->HashSeed());
|
| - i::PreParser preparser(&zone, &scanner, &ast_value_factory, stack_limit);
|
| + i::PreParser preparser(
|
| + &zone, &scanner, &ast_value_factory,
|
| + CcTest::i_isolate()->counters()->runtime_call_stats(), stack_limit);
|
| preparser.set_allow_lazy(true);
|
| preparser.set_allow_natives(true);
|
| i::PreParser::PreParseResult result = preparser.PreParseProgram();
|
| @@ -373,6 +379,7 @@ TEST(StandAlonePreParser) {
|
| TEST(StandAlonePreParserNoNatives) {
|
| v8::V8::Initialize();
|
|
|
| + i::Isolate* isolate = CcTest::i_isolate();
|
| CcTest::i_isolate()->stack_guard()->SetStackLimit(
|
| i::GetCurrentStackPosition() - 128 * 1024);
|
|
|
| @@ -382,17 +389,18 @@ TEST(StandAlonePreParserNoNatives) {
|
| NULL
|
| };
|
|
|
| - uintptr_t stack_limit = CcTest::i_isolate()->stack_guard()->real_climit();
|
| + uintptr_t stack_limit = isolate->stack_guard()->real_climit();
|
| for (int i = 0; programs[i]; i++) {
|
| auto stream = i::ScannerStream::ForTesting(programs[i]);
|
| - i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
|
| + i::Scanner scanner(isolate->unicode_cache());
|
| scanner.Initialize(stream.get());
|
|
|
| // Preparser defaults to disallowing natives syntax.
|
| - i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME);
|
| - i::AstValueFactory ast_value_factory(
|
| - &zone, CcTest::i_isolate()->heap()->HashSeed());
|
| - i::PreParser preparser(&zone, &scanner, &ast_value_factory, stack_limit);
|
| + i::Zone zone(isolate->allocator(), ZONE_NAME);
|
| + i::AstValueFactory ast_value_factory(&zone, isolate->heap()->HashSeed());
|
| + i::PreParser preparser(&zone, &scanner, &ast_value_factory,
|
| + isolate->counters()->runtime_call_stats(),
|
| + stack_limit);
|
| preparser.set_allow_lazy(true);
|
| i::PreParser::PreParseResult result = preparser.PreParseProgram();
|
| CHECK_EQ(i::PreParser::kPreParseSuccess, result);
|
| @@ -458,6 +466,7 @@ TEST(RegressChromium62639) {
|
| i::AstValueFactory ast_value_factory(&zone,
|
| CcTest::i_isolate()->heap()->HashSeed());
|
| i::PreParser preparser(&zone, &scanner, &ast_value_factory,
|
| + isolate->counters()->runtime_call_stats(),
|
| CcTest::i_isolate()->stack_guard()->real_climit());
|
| preparser.set_allow_lazy(true);
|
| i::PreParser::PreParseResult result = preparser.PreParseProgram();
|
| @@ -512,25 +521,27 @@ TEST(Regress928) {
|
|
|
| TEST(PreParseOverflow) {
|
| v8::V8::Initialize();
|
| + i::Isolate* isolate = CcTest::i_isolate();
|
|
|
| - CcTest::i_isolate()->stack_guard()->SetStackLimit(
|
| - i::GetCurrentStackPosition() - 128 * 1024);
|
| + isolate->stack_guard()->SetStackLimit(i::GetCurrentStackPosition() -
|
| + 128 * 1024);
|
|
|
| size_t kProgramSize = 1024 * 1024;
|
| std::unique_ptr<char[]> program(i::NewArray<char>(kProgramSize + 1));
|
| memset(program.get(), '(', kProgramSize);
|
| program[kProgramSize] = '\0';
|
|
|
| - uintptr_t stack_limit = CcTest::i_isolate()->stack_guard()->real_climit();
|
| + uintptr_t stack_limit = isolate->stack_guard()->real_climit();
|
|
|
| auto stream = i::ScannerStream::ForTesting(program.get(), kProgramSize);
|
| - i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
|
| + i::Scanner scanner(isolate->unicode_cache());
|
| scanner.Initialize(stream.get());
|
|
|
| - i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME);
|
| - i::AstValueFactory ast_value_factory(&zone,
|
| - CcTest::i_isolate()->heap()->HashSeed());
|
| - i::PreParser preparser(&zone, &scanner, &ast_value_factory, stack_limit);
|
| + i::Zone zone(isolate->allocator(), ZONE_NAME);
|
| + i::AstValueFactory ast_value_factory(&zone, isolate->heap()->HashSeed());
|
| + i::PreParser preparser(&zone, &scanner, &ast_value_factory,
|
| + isolate->counters()->runtime_call_stats(),
|
| + stack_limit);
|
| preparser.set_allow_lazy(true);
|
| i::PreParser::PreParseResult result = preparser.PreParseProgram();
|
| CHECK_EQ(i::PreParser::kPreParseStackOverflow, result);
|
| @@ -1346,7 +1357,9 @@ void TestParserSyncWithFlags(i::Handle<i::String> source,
|
| i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME);
|
| i::AstValueFactory ast_value_factory(
|
| &zone, CcTest::i_isolate()->heap()->HashSeed());
|
| - i::PreParser preparser(&zone, &scanner, &ast_value_factory, stack_limit);
|
| + i::PreParser preparser(&zone, &scanner, &ast_value_factory,
|
| + isolate->counters()->runtime_call_stats(),
|
| + stack_limit);
|
| SetParserFlags(&preparser, flags);
|
| scanner.Initialize(stream.get());
|
| i::PreParser::PreParseResult result =
|
|
|