| 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/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
| (...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 | 1132 |
| 1133 void AstGraphBuilder::VisitBlock(Block* stmt) { | 1133 void AstGraphBuilder::VisitBlock(Block* stmt) { |
| 1134 BlockBuilder block(this); | 1134 BlockBuilder block(this); |
| 1135 ControlScopeForBreakable scope(this, stmt, &block); | 1135 ControlScopeForBreakable scope(this, stmt, &block); |
| 1136 if (stmt->labels() != NULL) block.BeginBlock(); | 1136 if (stmt->labels() != NULL) block.BeginBlock(); |
| 1137 if (stmt->scope() == NULL) { | 1137 if (stmt->scope() == NULL) { |
| 1138 // Visit statements in the same scope, no declarations. | 1138 // Visit statements in the same scope, no declarations. |
| 1139 VisitStatements(stmt->statements()); | 1139 VisitStatements(stmt->statements()); |
| 1140 } else { | 1140 } else { |
| 1141 // Visit declarations and statements in a block scope. | 1141 // Visit declarations and statements in a block scope. |
| 1142 if (stmt->scope()->ContextLocalCount() > 0) { | 1142 if (stmt->scope()->NeedsContext()) { |
| 1143 Node* context = BuildLocalBlockContext(stmt->scope()); | 1143 Node* context = BuildLocalBlockContext(stmt->scope()); |
| 1144 ContextScope scope(this, stmt->scope(), context); | 1144 ContextScope scope(this, stmt->scope(), context); |
| 1145 VisitDeclarations(stmt->scope()->declarations()); | 1145 VisitDeclarations(stmt->scope()->declarations()); |
| 1146 VisitStatements(stmt->statements()); | 1146 VisitStatements(stmt->statements()); |
| 1147 } else { | 1147 } else { |
| 1148 VisitDeclarations(stmt->scope()->declarations()); | 1148 VisitDeclarations(stmt->scope()->declarations()); |
| 1149 VisitStatements(stmt->statements()); | 1149 VisitStatements(stmt->statements()); |
| 1150 } | 1150 } |
| 1151 } | 1151 } |
| 1152 if (stmt->labels() != NULL) block.EndBlock(); | 1152 if (stmt->labels() != NULL) block.EndBlock(); |
| (...skipping 3149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4302 // Phi does not exist yet, introduce one. | 4302 // Phi does not exist yet, introduce one. |
| 4303 value = NewPhi(inputs, value, control); | 4303 value = NewPhi(inputs, value, control); |
| 4304 value->ReplaceInput(inputs - 1, other); | 4304 value->ReplaceInput(inputs - 1, other); |
| 4305 } | 4305 } |
| 4306 return value; | 4306 return value; |
| 4307 } | 4307 } |
| 4308 | 4308 |
| 4309 } // namespace compiler | 4309 } // namespace compiler |
| 4310 } // namespace internal | 4310 } // namespace internal |
| 4311 } // namespace v8 | 4311 } // namespace v8 |
| OLD | NEW |