Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 1425883004: [turbofan] Fix missing bailout point before calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update unittests. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast.h ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index c49b41b5f4357811f1058f2632313c2538016258..4c6ad4b572343ea833a57d40dd3cd3f6c4ff58d3 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -394,8 +394,9 @@ class AstGraphBuilder::FrameStateBeforeAndAfter {
: builder_->environment()->Checkpoint(id_before);
}
- void AddToNode(Node* node, BailoutId id_after,
- OutputFrameStateCombine combine) {
+ void AddToNode(
+ Node* node, BailoutId id_after,
+ OutputFrameStateCombine combine = OutputFrameStateCombine::Ignore()) {
int count = OperatorProperties::GetFrameStateInputCount(node->op());
DCHECK_LE(count, 2);
@@ -1962,21 +1963,24 @@ void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
if (subexpr->IsSpread()) {
VisitForValue(subexpr->AsSpread()->expression());
+ FrameStateBeforeAndAfter states(this,
+ subexpr->AsSpread()->expression()->id());
Node* iterable = environment()->Pop();
Node* function = BuildLoadNativeContextField(
Context::CONCAT_ITERABLE_TO_ARRAY_BUILTIN_INDEX);
result = NewNode(javascript()->CallFunction(3, NO_CALL_FUNCTION_FLAGS,
language_mode()),
function, array, iterable);
+ states.AddToNode(result, expr->GetIdForElement(array_index));
} else {
VisitForValue(subexpr);
Node* value = environment()->Pop();
const Operator* op =
javascript()->CallRuntime(Runtime::kAppendElement, 2);
result = NewNode(op, array, value);
+ PrepareFrameState(result, expr->GetIdForElement(array_index));
}
- PrepareFrameState(result, expr->GetIdForElement(array_index));
environment()->Push(result);
}
@@ -2489,9 +2493,10 @@ void AstGraphBuilder::VisitCall(Call* expr) {
VectorSlotPair feedback = CreateVectorSlotPair(expr->CallFeedbackICSlot());
const Operator* call = javascript()->CallFunction(
args->length() + 2, flags, language_mode(), feedback, receiver_hint);
+ FrameStateBeforeAndAfter states(this, expr->CallId());
Node* value = ProcessArguments(call, args->length() + 2);
environment()->Push(value->InputAt(0)); // The callee passed to the call.
- PrepareFrameState(value, expr->ReturnId(), OutputFrameStateCombine::Push());
+ states.AddToNode(value, expr->ReturnId(), OutputFrameStateCombine::Push());
environment()->Drop(1);
ast_context()->ProduceValue(value);
}
@@ -2561,8 +2566,9 @@ void AstGraphBuilder::VisitCallJSRuntime(CallRuntime* expr) {
// Create node to perform the JS runtime call.
const Operator* call =
javascript()->CallFunction(args->length() + 2, flags, language_mode());
+ FrameStateBeforeAndAfter states(this, expr->CallId());
Node* value = ProcessArguments(call, args->length() + 2);
- PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine());
+ states.AddToNode(value, expr->id(), ast_context()->GetStateCombine());
ast_context()->ProduceValue(value);
}
« no previous file with comments | « src/ast.h ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698