Commit eef603fe authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[crankshaft] Properly handle stack overflows happened during AST typing.

Bug: chromium:724820
Change-Id: If4d05326ad00d0d3efe8f58b361595f2655d90d2
Reviewed-on: https://chromium-review.googlesource.com/518142Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45550}
parent 481ea63d
...@@ -185,10 +185,13 @@ HCompilationJob::Status HCompilationJob::PrepareJobImpl() { ...@@ -185,10 +185,13 @@ HCompilationJob::Status HCompilationJob::PrepareJobImpl() {
: new (info()->zone()) HOptimizedGraphBuilder(info(), false); : new (info()->zone()) HOptimizedGraphBuilder(info(), false);
// Type-check the function. // Type-check the function.
AstTyper(info()->isolate(), info()->zone(), info()->closure(), AstTyper ast_typer(info()->isolate(), info()->zone(), info()->closure(),
info()->scope(), info()->osr_ast_id(), info()->literal(), info()->scope(), info()->osr_ast_id(), info()->literal(),
graph_builder->bounds()) graph_builder->bounds());
.Run(); ast_typer.Run();
if (ast_typer.HasStackOverflow()) {
return FAILED;
}
graph_ = graph_builder->CreateGraph(); graph_ = graph_builder->CreateGraph();
...@@ -7964,10 +7967,14 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target, ...@@ -7964,10 +7967,14 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
// Type-check the inlined function. // Type-check the inlined function.
DCHECK(target_shared->has_deoptimization_support()); DCHECK(target_shared->has_deoptimization_support());
AstTyper(target_info.isolate(), target_info.zone(), target_info.closure(), AstTyper ast_typer(target_info.isolate(), target_info.zone(),
target_info.scope(), target_info.osr_ast_id(), target_info.literal(), target_info.closure(), target_info.scope(),
&bounds_) target_info.osr_ast_id(), target_info.literal(), &bounds_);
.Run(); ast_typer.Run();
if (ast_typer.HasStackOverflow()) {
TraceInline(target, caller, "stack overflow");
return false;
}
// Save the pending call context. Set up new one for the inlined function. // Save the pending call context. Set up new one for the inlined function.
// The function state is new-allocated because we need to delete it // The function state is new-allocated because we need to delete it
......
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