| Index: src/compiler/ast-graph-builder.cc
|
| diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
|
| index ba10bf57f31f6a0594dfd226ee342e4c9a7bf24c..b230090888cbf25df65a1c01cf536678b97f3e61 100644
|
| --- a/src/compiler/ast-graph-builder.cc
|
| +++ b/src/compiler/ast-graph-builder.cc
|
| @@ -17,14 +17,15 @@ namespace v8 {
|
| namespace internal {
|
| namespace compiler {
|
|
|
| -AstGraphBuilder::AstGraphBuilder(CompilationInfo* info, JSGraph* jsgraph)
|
| - : StructuredGraphBuilder(jsgraph->graph(), jsgraph->common()),
|
| +AstGraphBuilder::AstGraphBuilder(Zone* local_zone, CompilationInfo* info,
|
| + JSGraph* jsgraph)
|
| + : StructuredGraphBuilder(local_zone, jsgraph->graph(), jsgraph->common()),
|
| info_(info),
|
| jsgraph_(jsgraph),
|
| - globals_(0, info->zone()),
|
| + globals_(0, local_zone),
|
| breakable_(NULL),
|
| execution_context_(NULL) {
|
| - InitializeAstVisitor(info->zone());
|
| + InitializeAstVisitor(local_zone);
|
| }
|
|
|
|
|
| @@ -610,6 +611,8 @@ void AstGraphBuilder::VisitForStatement(ForStatement* stmt) {
|
| VisitForTest(stmt->cond());
|
| Node* condition = environment()->Pop();
|
| for_loop.BreakUnless(condition);
|
| + } else {
|
| + for_loop.BreakUnless(jsgraph()->TrueConstant());
|
| }
|
| VisitIterationBody(stmt, &for_loop, 0);
|
| for_loop.EndBody();
|
| @@ -639,11 +642,14 @@ void AstGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
|
| // Convert object to jsobject.
|
| // PrepareForBailoutForId(stmt->PrepareId(), TOS_REG);
|
| obj = NewNode(javascript()->ToObject(), obj);
|
| + PrepareFrameState(obj, stmt->ToObjectId(), OutputFrameStateCombine::Push());
|
| environment()->Push(obj);
|
| // TODO(dcarney): should do a fast enum cache check here to skip runtime.
|
| environment()->Push(obj);
|
| Node* cache_type = ProcessArguments(
|
| javascript()->CallRuntime(Runtime::kGetPropertyNamesFast, 1), 1);
|
| + PrepareFrameState(cache_type, stmt->EnumId(),
|
| + OutputFrameStateCombine::Push());
|
| // TODO(dcarney): these next runtime calls should be removed in favour of
|
| // a few simplified instructions.
|
| environment()->Push(obj);
|
| @@ -879,6 +885,8 @@ void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
|
| const Operator* op =
|
| javascript()->CallRuntime(Runtime::kCreateObjectLiteral, 4);
|
| Node* literal = NewNode(op, literals_array, literal_index, constants, flags);
|
| + PrepareFrameState(literal, expr->CreateLiteralId(),
|
| + OutputFrameStateCombine::Push());
|
|
|
| // The object is expected on the operand stack during computation of the
|
| // property values and is the value of the entire expression.
|
| @@ -939,8 +947,11 @@ void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
|
| Node* receiver = environment()->Pop();
|
| if (property->emit_store()) {
|
| const Operator* op =
|
| - javascript()->CallRuntime(Runtime::kSetPrototype, 2);
|
| - NewNode(op, receiver, value);
|
| + javascript()->CallRuntime(Runtime::kInternalSetPrototype, 2);
|
| + Node* set_prototype = NewNode(op, receiver, value);
|
| + // SetPrototype should not lazy deopt on an object
|
| + // literal.
|
| + PrepareFrameState(set_prototype, BailoutId::None());
|
| }
|
| break;
|
| }
|
| @@ -967,7 +978,8 @@ void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
|
| const Operator* op =
|
| javascript()->CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5);
|
| Node* call = NewNode(op, literal, name, getter, setter, attr);
|
| - PrepareFrameState(call, it->first->id());
|
| + // This should not lazy deopt on a new literal.
|
| + PrepareFrameState(call, BailoutId::None());
|
| }
|
|
|
| // Transform literals that contain functions to fast properties.
|
| @@ -1234,7 +1246,7 @@ void AstGraphBuilder::VisitCall(Call* expr) {
|
| receiver_value = NewNode(common()->Projection(1), pair);
|
|
|
| PrepareFrameState(pair, expr->EvalOrLookupId(),
|
| - OutputFrameStateCombine::Push());
|
| + OutputFrameStateCombine::Push(2));
|
| break;
|
| }
|
| case Call::PROPERTY_CALL: {
|
| @@ -1717,7 +1729,7 @@ StrictMode AstGraphBuilder::strict_mode() const {
|
|
|
|
|
| VectorSlotPair AstGraphBuilder::CreateVectorSlotPair(
|
| - FeedbackVectorSlot slot) const {
|
| + FeedbackVectorICSlot slot) const {
|
| return VectorSlotPair(handle(info()->shared_info()->feedback_vector()), slot);
|
| }
|
|
|
|
|