| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
| 6 | 6 |
| 7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
| 8 #include "src/compiler/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
| 9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
| 10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 Node* control = NewNode(common()->Return(), result); | 535 Node* control = NewNode(common()->Return(), result); |
| 536 UpdateControlDependencyToLeaveFunction(control); | 536 UpdateControlDependencyToLeaveFunction(control); |
| 537 } | 537 } |
| 538 | 538 |
| 539 | 539 |
| 540 void AstGraphBuilder::VisitWithStatement(WithStatement* stmt) { | 540 void AstGraphBuilder::VisitWithStatement(WithStatement* stmt) { |
| 541 VisitForValue(stmt->expression()); | 541 VisitForValue(stmt->expression()); |
| 542 Node* value = environment()->Pop(); | 542 Node* value = environment()->Pop(); |
| 543 const Operator* op = javascript()->CreateWithContext(); | 543 const Operator* op = javascript()->CreateWithContext(); |
| 544 Node* context = NewNode(op, value, GetFunctionClosure()); | 544 Node* context = NewNode(op, value, GetFunctionClosure()); |
| 545 PrepareFrameState(context, stmt->EntryId()); |
| 545 ContextScope scope(this, stmt->scope(), context); | 546 ContextScope scope(this, stmt->scope(), context); |
| 546 Visit(stmt->statement()); | 547 Visit(stmt->statement()); |
| 547 } | 548 } |
| 548 | 549 |
| 549 | 550 |
| 550 void AstGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) { | 551 void AstGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) { |
| 551 ZoneList<CaseClause*>* clauses = stmt->cases(); | 552 ZoneList<CaseClause*>* clauses = stmt->cases(); |
| 552 SwitchBuilder compare_switch(this, clauses->length()); | 553 SwitchBuilder compare_switch(this, clauses->length()); |
| 553 BreakableScope scope(this, stmt, &compare_switch, 0); | 554 BreakableScope scope(this, stmt, &compare_switch, 0); |
| 554 compare_switch.BeginSwitch(); | 555 compare_switch.BeginSwitch(); |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 } | 1077 } |
| 1077 case ObjectLiteral::Property::PROTOTYPE: { | 1078 case ObjectLiteral::Property::PROTOTYPE: { |
| 1078 environment()->Push(literal); // Duplicate receiver. | 1079 environment()->Push(literal); // Duplicate receiver. |
| 1079 VisitForValue(property->value()); | 1080 VisitForValue(property->value()); |
| 1080 Node* value = environment()->Pop(); | 1081 Node* value = environment()->Pop(); |
| 1081 Node* receiver = environment()->Pop(); | 1082 Node* receiver = environment()->Pop(); |
| 1082 if (property->emit_store()) { | 1083 if (property->emit_store()) { |
| 1083 const Operator* op = | 1084 const Operator* op = |
| 1084 javascript()->CallRuntime(Runtime::kInternalSetPrototype, 2); | 1085 javascript()->CallRuntime(Runtime::kInternalSetPrototype, 2); |
| 1085 Node* set_prototype = NewNode(op, receiver, value); | 1086 Node* set_prototype = NewNode(op, receiver, value); |
| 1086 // SetPrototype should not lazy deopt on an object | 1087 // SetPrototype should not lazy deopt on an object literal. |
| 1087 // literal. | |
| 1088 PrepareFrameState(set_prototype, BailoutId::None()); | 1088 PrepareFrameState(set_prototype, BailoutId::None()); |
| 1089 } | 1089 } |
| 1090 break; | 1090 break; |
| 1091 } | 1091 } |
| 1092 case ObjectLiteral::Property::GETTER: | 1092 case ObjectLiteral::Property::GETTER: |
| 1093 accessor_table.lookup(key)->second->getter = property->value(); | 1093 accessor_table.lookup(key)->second->getter = property->value(); |
| 1094 break; | 1094 break; |
| 1095 case ObjectLiteral::Property::SETTER: | 1095 case ObjectLiteral::Property::SETTER: |
| 1096 accessor_table.lookup(key)->second->setter = property->value(); | 1096 accessor_table.lookup(key)->second->setter = property->value(); |
| 1097 break; | 1097 break; |
| (...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2431 | 2431 |
| 2432 BitVector* AstGraphBuilder::GetVariablesAssignedInLoop( | 2432 BitVector* AstGraphBuilder::GetVariablesAssignedInLoop( |
| 2433 IterationStatement* stmt) { | 2433 IterationStatement* stmt) { |
| 2434 if (loop_assignment_analysis_ == NULL) return NULL; | 2434 if (loop_assignment_analysis_ == NULL) return NULL; |
| 2435 return loop_assignment_analysis_->GetVariablesAssignedInLoop(stmt); | 2435 return loop_assignment_analysis_->GetVariablesAssignedInLoop(stmt); |
| 2436 } | 2436 } |
| 2437 | 2437 |
| 2438 } // namespace compiler | 2438 } // namespace compiler |
| 2439 } // namespace internal | 2439 } // namespace internal |
| 2440 } // namespace v8 | 2440 } // namespace v8 |
| OLD | NEW |