| 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/ast/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1229 VisitForValue(stmt->expression()); | 1229 VisitForValue(stmt->expression()); |
| 1230 Node* result = environment()->Pop(); | 1230 Node* result = environment()->Pop(); |
| 1231 execution_control()->ReturnValue(result); | 1231 execution_control()->ReturnValue(result); |
| 1232 } | 1232 } |
| 1233 | 1233 |
| 1234 | 1234 |
| 1235 void AstGraphBuilder::VisitWithStatement(WithStatement* stmt) { | 1235 void AstGraphBuilder::VisitWithStatement(WithStatement* stmt) { |
| 1236 VisitForValue(stmt->expression()); | 1236 VisitForValue(stmt->expression()); |
| 1237 Node* value = environment()->Pop(); | 1237 Node* value = environment()->Pop(); |
| 1238 Node* object = BuildToObject(value, stmt->ToObjectId()); | 1238 Node* object = BuildToObject(value, stmt->ToObjectId()); |
| 1239 const Operator* op = javascript()->CreateWithContext(); | 1239 Handle<ScopeInfo> scope_info = stmt->scope()->scope_info(); |
| 1240 const Operator* op = javascript()->CreateWithContext(scope_info); |
| 1240 Node* context = NewNode(op, object, GetFunctionClosureForContext()); | 1241 Node* context = NewNode(op, object, GetFunctionClosureForContext()); |
| 1241 PrepareFrameState(context, stmt->EntryId()); | 1242 PrepareFrameState(context, stmt->EntryId()); |
| 1242 VisitInScope(stmt->statement(), stmt->scope(), context); | 1243 VisitInScope(stmt->statement(), stmt->scope(), context); |
| 1243 } | 1244 } |
| 1244 | 1245 |
| 1245 | 1246 |
| 1246 void AstGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) { | 1247 void AstGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) { |
| 1247 ZoneList<CaseClause*>* clauses = stmt->cases(); | 1248 ZoneList<CaseClause*>* clauses = stmt->cases(); |
| 1248 SwitchBuilder compare_switch(this, clauses->length()); | 1249 SwitchBuilder compare_switch(this, clauses->length()); |
| 1249 ControlScopeForBreakable scope(this, stmt, &compare_switch); | 1250 ControlScopeForBreakable scope(this, stmt, &compare_switch); |
| (...skipping 3083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4333 // Phi does not exist yet, introduce one. | 4334 // Phi does not exist yet, introduce one. |
| 4334 value = NewPhi(inputs, value, control); | 4335 value = NewPhi(inputs, value, control); |
| 4335 value->ReplaceInput(inputs - 1, other); | 4336 value->ReplaceInput(inputs - 1, other); |
| 4336 } | 4337 } |
| 4337 return value; | 4338 return value; |
| 4338 } | 4339 } |
| 4339 | 4340 |
| 4340 } // namespace compiler | 4341 } // namespace compiler |
| 4341 } // namespace internal | 4342 } // namespace internal |
| 4342 } // namespace v8 | 4343 } // namespace v8 |
| OLD | NEW |