Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index b3b8822aaeecebefc2bf7c11f377610a0d19b33a..58b0acd14ce4bc51a0e8d47a143186e3b833ef11 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -825,7 +825,8 @@ |
factory->NewStringFromUtf8(i::CStrVector(program.start())) |
.ToHandleChecked(); |
i::Handle<i::Script> script = factory->NewScript(source); |
- i::ParseInfo info(script); |
+ 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); |
CHECK(i::parsing::ParseProgram(&info)); |
@@ -881,7 +882,7 @@ |
i::Handle<i::Script> script = factory->NewScript(source_code); |
- i::ParseInfo info(script); |
+ i::ParseInfo info(handles.main_zone(), script); |
i::Parser parser(&info); |
info.set_allow_lazy_parsing(false); |
info.set_toplevel(true); |
@@ -1179,7 +1180,8 @@ |
i::CStrVector(program.start())).ToHandleChecked(); |
CHECK_EQ(source->length(), kProgramSize); |
i::Handle<i::Script> script = factory->NewScript(source); |
- i::ParseInfo info(script); |
+ i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME); |
+ i::ParseInfo info(&zone, script); |
info.set_language_mode(source_data[i].language_mode); |
i::parsing::ParseProgram(&info); |
CHECK_NOT_NULL(info.literal()); |
@@ -1225,7 +1227,8 @@ |
i::Handle<i::String> source_code = |
factory->NewStringFromUtf8(i::CStrVector(source)).ToHandleChecked(); |
i::Handle<i::Script> script = factory->NewScript(source_code); |
- i::ParseInfo info(script); |
+ i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME); |
+ i::ParseInfo info(&zone, script); |
i::parsing::ParseProgram(&info); |
function = info.literal(); |
CHECK_NOT_NULL(function); |
@@ -1351,7 +1354,8 @@ |
i::FunctionLiteral* function; |
{ |
i::Handle<i::Script> script = factory->NewScript(source); |
- i::ParseInfo info(script); |
+ i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME); |
+ i::ParseInfo info(&zone, script); |
info.set_allow_lazy_parsing(flags.Contains(kAllowLazy)); |
SetGlobalFlags(flags); |
if (is_module) info.set_module(); |
@@ -2482,7 +2486,8 @@ |
i::Handle<i::String> source = |
factory->NewStringFromUtf8(i::CStrVector(program)).ToHandleChecked(); |
i::Handle<i::Script> script = factory->NewScript(source); |
- i::ParseInfo info(script); |
+ i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME); |
+ i::ParseInfo info(&zone, script); |
i::ScriptData* sd = NULL; |
info.set_cached_data(&sd); |
info.set_compile_options(v8::ScriptCompiler::kProduceParserCache); |
@@ -3369,6 +3374,7 @@ |
i::SNPrintF(program, "%s%s%s%s%s", prefix, outer, midfix, inner, |
suffix); |
+ i::Zone zone(isolate->allocator(), ZONE_NAME); |
std::unique_ptr<i::ParseInfo> info; |
if (lazy) { |
printf("%s\n", program.start()); |
@@ -3376,7 +3382,7 @@ |
i::Handle<i::Object> o = v8::Utils::OpenHandle(*v); |
i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(o); |
i::Handle<i::SharedFunctionInfo> shared = i::handle(f->shared()); |
- info = std::unique_ptr<i::ParseInfo>(new i::ParseInfo(shared)); |
+ info = std::unique_ptr<i::ParseInfo>(new i::ParseInfo(&zone, shared)); |
CHECK(i::parsing::ParseFunction(info.get())); |
} else { |
i::Handle<i::String> source = |
@@ -3384,7 +3390,7 @@ |
source->PrintOn(stdout); |
printf("\n"); |
i::Handle<i::Script> script = factory->NewScript(source); |
- info = std::unique_ptr<i::ParseInfo>(new i::ParseInfo(script)); |
+ info = std::unique_ptr<i::ParseInfo>(new i::ParseInfo(&zone, script)); |
info->set_allow_lazy_parsing(false); |
CHECK(i::parsing::ParseProgram(info.get())); |
} |
@@ -3483,13 +3489,14 @@ |
i::ScopedVector<char> program(Utf8LengthHelper(source) + |
Utf8LengthHelper(suffix) + 1); |
i::SNPrintF(program, "%s%s", source, suffix); |
+ i::Zone zone(isolate->allocator(), ZONE_NAME); |
std::unique_ptr<i::ParseInfo> info; |
printf("%s\n", program.start()); |
v8::Local<v8::Value> v = CompileRun(program.start()); |
i::Handle<i::Object> o = v8::Utils::OpenHandle(*v); |
i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(o); |
i::Handle<i::SharedFunctionInfo> shared = i::handle(f->shared()); |
- info = std::unique_ptr<i::ParseInfo>(new i::ParseInfo(shared)); |
+ info = std::unique_ptr<i::ParseInfo>(new i::ParseInfo(&zone, shared)); |
info->set_allow_lazy_parsing(allow_lazy); |
CHECK(i::parsing::ParseFunction(info.get())); |
CHECK(i::Compiler::Analyze(info.get())); |
@@ -3534,6 +3541,7 @@ |
i::ScopedVector<char> program(Utf8LengthHelper(prefix) + |
Utf8LengthHelper(source) + 1); |
i::SNPrintF(program, "%s%s", prefix, source); |
+ i::Zone zone(isolate->allocator(), ZONE_NAME); |
i::Handle<i::String> string = |
factory->InternalizeUtf8String(program.start()); |
@@ -3544,7 +3552,7 @@ |
for (unsigned allow_lazy = 0; allow_lazy < 2; ++allow_lazy) { |
for (unsigned module = 0; module < 2; ++module) { |
std::unique_ptr<i::ParseInfo> info; |
- info = std::unique_ptr<i::ParseInfo>(new i::ParseInfo(script)); |
+ info = std::unique_ptr<i::ParseInfo>(new i::ParseInfo(&zone, script)); |
info->set_module(module); |
info->set_allow_lazy_parsing(allow_lazy); |
@@ -5863,7 +5871,8 @@ |
// Show that parsing as a module works |
{ |
i::Handle<i::Script> script = factory->NewScript(source); |
- i::ParseInfo info(script); |
+ i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME); |
+ i::ParseInfo info(&zone, script); |
info.set_module(); |
if (!i::parsing::ParseProgram(&info)) { |
i::Handle<i::JSObject> exception_handle( |
@@ -5887,7 +5896,8 @@ |
// And that parsing a script does not. |
{ |
i::Handle<i::Script> script = factory->NewScript(source); |
- i::ParseInfo info(script); |
+ i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME); |
+ i::ParseInfo info(&zone, script); |
CHECK(!i::parsing::ParseProgram(&info)); |
isolate->clear_pending_exception(); |
} |
@@ -5977,7 +5987,8 @@ |
factory->NewStringFromAsciiChecked(kErrorSources[i]); |
i::Handle<i::Script> script = factory->NewScript(source); |
- i::ParseInfo info(script); |
+ i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME); |
+ i::ParseInfo info(&zone, script); |
info.set_module(); |
CHECK(!i::parsing::ParseProgram(&info)); |
isolate->clear_pending_exception(); |
@@ -6013,7 +6024,8 @@ |
factory->NewStringFromAsciiChecked(kErrorSources[i]); |
i::Handle<i::Script> script = factory->NewScript(source); |
- i::ParseInfo info(script); |
+ i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME); |
+ i::ParseInfo info(&zone, script); |
info.set_module(); |
CHECK(!i::parsing::ParseProgram(&info)); |
isolate->clear_pending_exception(); |
@@ -6210,7 +6222,8 @@ |
"export {foob};"; |
i::Handle<i::String> source = factory->NewStringFromAsciiChecked(kSource); |
i::Handle<i::Script> script = factory->NewScript(source); |
- i::ParseInfo info(script); |
+ i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME); |
+ i::ParseInfo info(&zone, script); |
info.set_module(); |
CHECK(i::parsing::ParseProgram(&info)); |
CHECK(i::Compiler::Analyze(&info)); |
@@ -6469,7 +6482,8 @@ |
i::Handle<i::Script> script = |
factory->NewScript(factory->NewStringFromAsciiChecked(source)); |
- i::ParseInfo info(script); |
+ i::Zone zone(CcTest::i_isolate()->allocator(), ZONE_NAME); |
+ i::ParseInfo info(&zone, script); |
i::parsing::ParseProgram(&info); |
CHECK(info.literal() != NULL); |
CHECK_EQ(expected_language_mode, info.literal()->language_mode()); |
@@ -8915,7 +8929,8 @@ |
printf("\n"); |
i::Handle<i::Script> script = factory->NewScript(source); |
- i::ParseInfo info(script); |
+ i::Zone zone(isolate->allocator(), ZONE_NAME); |
+ i::ParseInfo info(&zone, script); |
CHECK(i::parsing::ParseProgram(&info)); |
CHECK(i::Compiler::Analyze(&info)); |