Commit 08ef00fd authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[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}
parent 5b822b31
......@@ -1198,14 +1198,8 @@ bool Compiler::EnsureDeoptimizationSupport(CompilationInfo* info) {
DCHECK_NOT_NULL(info->scope());
Handle<SharedFunctionInfo> 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment