Skip to content

Commit 4af8029

Browse files
mstarzingerCommit bot
authored andcommitted
[turbofan] Fix missing lazy deopt in object literals.
This adds a missing lazy bailout point when defining data properties with computed property names in object literals. The runtime call to Runtime::kDefineDataPropertyInLiteral can trigger deopts. The necessary bailout ID already exists and is now properly used. R=jarin@chromium.org TEST=mjsunit/regress/regress-crbug-621816 BUG=chromium:621816 Review-Url: https://codereview.chromium.org/2099133003 Cr-Commit-Position: refs/heads/master@{#37294}
1 parent e89d8b6 commit 4af8029

12 files changed

Lines changed: 40 additions & 3 deletions

File tree

src/compiler/ast-graph-builder.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,8 @@ void AstGraphBuilder::VisitClassLiteralContents(ClassLiteral* expr) {
16681668
jsgraph()->Constant(property->NeedsSetFunctionName());
16691669
const Operator* op =
16701670
javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral);
1671-
NewNode(op, receiver, key, value, attr, set_function_name);
1671+
Node* call = NewNode(op, receiver, key, value, attr, set_function_name);
1672+
PrepareFrameState(call, BailoutId::None());
16721673
break;
16731674
}
16741675
case ObjectLiteral::Property::GETTER: {
@@ -1916,7 +1917,8 @@ void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
19161917
jsgraph()->Constant(property->NeedsSetFunctionName());
19171918
const Operator* op =
19181919
javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral);
1919-
NewNode(op, receiver, key, value, attr, set_function_name);
1920+
Node* call = NewNode(op, receiver, key, value, attr, set_function_name);
1921+
PrepareFrameState(call, expr->GetIdForPropertySet(property_index));
19201922
break;
19211923
}
19221924
case ObjectLiteral::Property::PROTOTYPE:

src/compiler/linkage.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ bool Linkage::NeedsFrameStateInput(Runtime::FunctionId function) {
139139
case Runtime::kAbort:
140140
case Runtime::kAllocateInTargetSpace:
141141
case Runtime::kCreateIterResultObject:
142-
case Runtime::kDefineDataPropertyInLiteral:
143142
case Runtime::kDefineGetterPropertyUnchecked: // TODO(jarin): Is it safe?
144143
case Runtime::kDefineSetterPropertyUnchecked: // TODO(jarin): Is it safe?
145144
case Runtime::kForInDone:

src/full-codegen/arm/full-codegen-arm.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
15481548
PushOperand(Smi::FromInt(NONE));
15491549
PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
15501550
CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
1551+
PrepareForBailoutForId(expr->GetIdForPropertySet(property_index),
1552+
BailoutState::NO_REGISTERS);
15511553
} else {
15521554
DropOperands(3);
15531555
}

src/full-codegen/arm64/full-codegen-arm64.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
15311531
PushOperand(Smi::FromInt(NONE));
15321532
PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
15331533
CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
1534+
PrepareForBailoutForId(expr->GetIdForPropertySet(property_index),
1535+
BailoutState::NO_REGISTERS);
15341536
} else {
15351537
DropOperands(3);
15361538
}

src/full-codegen/ia32/full-codegen-ia32.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,6 +1466,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
14661466
PushOperand(Smi::FromInt(NONE));
14671467
PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
14681468
CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
1469+
PrepareForBailoutForId(expr->GetIdForPropertySet(property_index),
1470+
BailoutState::NO_REGISTERS);
14691471
} else {
14701472
DropOperands(3);
14711473
}

src/full-codegen/mips/full-codegen-mips.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,6 +1542,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
15421542
PushOperand(Smi::FromInt(NONE));
15431543
PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
15441544
CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
1545+
PrepareForBailoutForId(expr->GetIdForPropertySet(property_index),
1546+
BailoutState::NO_REGISTERS);
15451547
} else {
15461548
DropOperands(3);
15471549
}

src/full-codegen/mips64/full-codegen-mips64.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,6 +1543,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
15431543
PushOperand(Smi::FromInt(NONE));
15441544
PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
15451545
CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
1546+
PrepareForBailoutForId(expr->GetIdForPropertySet(property_index),
1547+
BailoutState::NO_REGISTERS);
15461548
} else {
15471549
DropOperands(3);
15481550
}

src/full-codegen/ppc/full-codegen-ppc.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,6 +1508,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
15081508
PushOperand(Smi::FromInt(NONE));
15091509
PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
15101510
CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
1511+
PrepareForBailoutForId(expr->GetIdForPropertySet(property_index),
1512+
BailoutState::NO_REGISTERS);
15111513
} else {
15121514
DropOperands(3);
15131515
}

src/full-codegen/s390/full-codegen-s390.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,6 +1469,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
14691469
PushOperand(Smi::FromInt(NONE));
14701470
PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
14711471
CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
1472+
PrepareForBailoutForId(expr->GetIdForPropertySet(property_index),
1473+
BailoutState::NO_REGISTERS);
14721474
} else {
14731475
DropOperands(3);
14741476
}

src/full-codegen/x64/full-codegen-x64.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,6 +1494,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
14941494
PushOperand(Smi::FromInt(NONE));
14951495
PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
14961496
CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
1497+
PrepareForBailoutForId(expr->GetIdForPropertySet(property_index),
1498+
BailoutState::NO_REGISTERS);
14971499
} else {
14981500
DropOperands(3);
14991501
}

0 commit comments

Comments
 (0)