Index: src/asmjs/asm-wasm-builder.cc |
diff --git a/src/asmjs/asm-wasm-builder.cc b/src/asmjs/asm-wasm-builder.cc |
index 61214f165c2dd8436dedd76ac6ef8b402203c565..27b1b4473a170ceb396c195ba96712ee69c7653f 100644 |
--- a/src/asmjs/asm-wasm-builder.cc |
+++ b/src/asmjs/asm-wasm-builder.cc |
@@ -142,31 +142,31 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> { |
DCHECK_EQ(kModuleScope, scope_); |
DCHECK_NULL(current_function_builder_); |
FunctionLiteral* old_func = decl->fun(); |
- Zone zone(isolate_->allocator(), ZONE_NAME); |
DeclarationScope* new_func_scope = nullptr; |
+ std::unique_ptr<ParseInfo> info; |
marja
2017/01/17 15:39:08
Hmm, now the Zone cannot outlive ParseInfo? That s
rmcilroy
2017/01/19 12:48:29
Acknowledged.
|
if (decl->fun()->body() == nullptr) { |
// TODO(titzer/bradnelson): Reuse SharedFunctionInfos used here when |
// compiling the wasm module. |
Handle<SharedFunctionInfo> shared = |
Compiler::GetSharedFunctionInfo(decl->fun(), script_, info_); |
shared->set_is_toplevel(false); |
- ParseInfo info(&zone, script_); |
- info.set_shared_info(shared); |
- info.set_toplevel(false); |
- info.set_language_mode(decl->fun()->scope()->language_mode()); |
- info.set_allow_lazy_parsing(false); |
- info.set_function_literal_id(shared->function_literal_id()); |
- info.set_ast_value_factory(ast_value_factory_); |
- info.set_ast_value_factory_owned(false); |
+ info.reset(new ParseInfo(script_)); |
+ info->set_shared_info(shared); |
+ info->set_toplevel(false); |
+ info->set_language_mode(decl->fun()->scope()->language_mode()); |
+ info->set_allow_lazy_parsing(false); |
+ info->set_function_literal_id(shared->function_literal_id()); |
+ info->set_ast_value_factory(ast_value_factory_); |
+ info->set_ast_value_factory_owned(false); |
// Create fresh function scope to use to parse the function in. |
- new_func_scope = new (info.zone()) DeclarationScope( |
- info.zone(), decl->fun()->scope()->outer_scope(), FUNCTION_SCOPE); |
- info.set_asm_function_scope(new_func_scope); |
- if (!Compiler::ParseAndAnalyze(&info)) { |
+ new_func_scope = new (info->zone()) DeclarationScope( |
+ info->zone(), decl->fun()->scope()->outer_scope(), FUNCTION_SCOPE); |
+ info->set_asm_function_scope(new_func_scope); |
+ if (!Compiler::ParseAndAnalyze(info.get())) { |
typer_failed_ = true; |
return; |
} |
- FunctionLiteral* func = info.literal(); |
+ FunctionLiteral* func = info->literal(); |
DCHECK_NOT_NULL(func); |
decl->set_fun(func); |
} |