// Perform the assignment as if via '='.
{ EffectContext context(this);
EmitAssignment(stmt->each());
+ PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS);
}
// Generate code for the body of the loop.
// Perform the assignment as if via '='.
{ EffectContext context(this);
EmitAssignment(stmt->each());
+ PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS);
}
// Generate code for the body of the loop.
ForInType for_in_type() const { return for_in_type_; }
void set_for_in_type(ForInType type) { for_in_type_ = type; }
- static int num_ids() { return parent_num_ids() + 4; }
+ static int num_ids() { return parent_num_ids() + 5; }
BailoutId BodyId() const { return BailoutId(local_id(0)); }
BailoutId PrepareId() const { return BailoutId(local_id(1)); }
BailoutId EnumId() const { return BailoutId(local_id(2)); }
BailoutId ToObjectId() const { return BailoutId(local_id(3)); }
+ BailoutId AssignmentId() const { return BailoutId(local_id(4)); }
BailoutId ContinueId() const OVERRIDE { return EntryId(); }
BailoutId StackCheckId() const OVERRIDE { return BodyId(); }
}
value = environment()->Pop();
// Bind value and do loop body.
- VisitForInAssignment(stmt->each(), value);
+ VisitForInAssignment(stmt->each(), value, stmt->AssignmentId());
VisitIterationBody(stmt, &for_loop, 5);
for_loop.EndBody();
// Inc counter and continue.
}
-void AstGraphBuilder::VisitForInAssignment(Expression* expr, Node* value) {
+void AstGraphBuilder::VisitForInAssignment(Expression* expr, Node* value,
+ BailoutId bailout_id) {
DCHECK(expr->IsValidReferenceExpression());
// Left-hand side can only be a property, a global or a variable slot.
switch (assign_type) {
case VARIABLE: {
Variable* var = expr->AsVariableProxy()->var();
- // TODO(jarin) Fill in the correct bailout id.
- BuildVariableAssignment(var, value, Token::ASSIGN, BailoutId::None());
+ BuildVariableAssignment(var, value, Token::ASSIGN, bailout_id);
break;
}
case NAMED_PROPERTY: {
MakeUnique(property->key()->AsLiteral()->AsPropertyName());
Node* store =
NewNode(javascript()->StoreNamed(strict_mode(), name), object, value);
- // TODO(jarin) Fill in the correct bailout id.
- PrepareFrameState(store, BailoutId::None());
+ PrepareFrameState(store, bailout_id);
break;
}
case KEYED_PROPERTY: {
value = environment()->Pop();
Node* store = NewNode(javascript()->StoreProperty(strict_mode()), object,
key, value);
- // TODO(jarin) Fill in the correct bailout id.
- PrepareFrameState(store, BailoutId::None());
+ PrepareFrameState(store, bailout_id);
break;
}
}
void VisitArithmeticExpression(BinaryOperation* expr);
// Dispatched from VisitForInStatement.
- void VisitForInAssignment(Expression* expr, Node* value);
+ void VisitForInAssignment(Expression* expr, Node* value,
+ BailoutId bailout_id);
// Dispatched from VisitClassLiteral.
void VisitClassLiteralContents(ClassLiteral* expr);
// Perform the assignment as if via '='.
{ EffectContext context(this);
EmitAssignment(stmt->each());
+ PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS);
}
// Generate code for the body of the loop.
// Perform the assignment as if via '='.
{ EffectContext context(this);
EmitAssignment(stmt->each());
+ PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS);
}
// Generate code for the body of the loop.
// Perform the assignment as if via '='.
{ EffectContext context(this);
EmitAssignment(stmt->each());
+ PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS);
}
// Generate code for the body of the loop.
{
EffectContext context(this);
EmitAssignment(stmt->each());
+ PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS);
}
// Generate code for the body of the loop.
// Perform the assignment as if via '='.
{ EffectContext context(this);
EmitAssignment(stmt->each());
+ PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS);
}
// Generate code for the body of the loop.
// Perform the assignment as if via '='.
{ EffectContext context(this);
EmitAssignment(stmt->each());
+ PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS);
}
// Generate code for the body of the loop.
--- /dev/null
+// Copyright 2015 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.
+
+"use strict"
+function f() {
+ for (x in {a:0});
+}
+
+assertThrows(f);