Commit c2cf8b11 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Handle stack overflow during inlining.

This handles the case where generating bytecode for inlining purposes
causes a stack overflow. We just abort inlining but also need to clear
pending exceptions.

R=bmeurer@chromium.org
TEST=mjsunit/regress/regress-crbug-647217
BUG=chromium:647217

Review-Url: https://codereview.chromium.org/2339383002
Cr-Commit-Position: refs/heads/master@{#39448}
parent 0e938d4a
......@@ -482,7 +482,9 @@ Reduction JSInliner::ReduceJSCall(Node* node, Handle<JSFunction> function) {
TRACE("Not inlining %s into %s because bytecode generation failed\n",
shared_info->DebugName()->ToCString().get(),
info_->shared_info()->DebugName()->ToCString().get());
DCHECK(!info_->isolate()->has_pending_exception());
if (info_->isolate()->has_pending_exception()) {
info_->isolate()->clear_pending_exception();
}
return NoChange();
}
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax --stack-size=100 --ignition-staging --turbo
var source = "return 1" + new Array(2048).join(' + a') + "";
eval("function g(a) {" + source + "}");
%SetForceInlineFlag(g);
function f(a) { return g(a) }
%OptimizeFunctionOnNextCall(f);
try { f(0) } catch(e) {}
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