From 08ef00fd064666569641e06114f27b65aab12519 Mon Sep 17 00:00:00 2001 From: mstarzinger Date: Tue, 19 Apr 2016 04:20:13 -0700 Subject: [PATCH] [compiler] Reuse parse info when ensuring deopt support. R=titzer@chromium.org Review URL: https://codereview.chromium.org/1901653003 Cr-Commit-Position: refs/heads/master@{#35612} --- src/compiler.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/compiler.cc b/src/compiler.cc index da4ab78eb6..8164a030c7 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -1198,14 +1198,8 @@ bool Compiler::EnsureDeoptimizationSupport(CompilationInfo* info) { DCHECK_NOT_NULL(info->scope()); Handle shared = info->shared_info(); if (!shared->has_deoptimization_support()) { - // TODO(titzer): just reuse the ParseInfo for the unoptimized compile. - CompilationInfoWithZone unoptimized(info->closure()); - // Note that we use the same AST that we will use for generating the - // optimized code. - ParseInfo* parse_info = unoptimized.parse_info(); - parse_info->set_literal(info->literal()); - parse_info->set_scope(info->scope()); - parse_info->set_context(info->context()); + Zone zone(info->isolate()->allocator()); + CompilationInfo unoptimized(info->parse_info(), info->closure()); unoptimized.EnableDeoptimizationSupport(); // If the current code has reloc info for serialization, also include // reloc info for serialization for the new code, so that deopt support