| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
| 10 #include "src/ast/ast-numbering.h" | 10 #include "src/ast/ast-numbering.h" |
| (...skipping 5272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5283 break_info.break_block()); | 5283 break_info.break_block()); |
| 5284 set_current_block(loop_exit); | 5284 set_current_block(loop_exit); |
| 5285 } | 5285 } |
| 5286 | 5286 |
| 5287 | 5287 |
| 5288 void HOptimizedGraphBuilder::VisitForInStatement(ForInStatement* stmt) { | 5288 void HOptimizedGraphBuilder::VisitForInStatement(ForInStatement* stmt) { |
| 5289 DCHECK(!HasStackOverflow()); | 5289 DCHECK(!HasStackOverflow()); |
| 5290 DCHECK(current_block() != NULL); | 5290 DCHECK(current_block() != NULL); |
| 5291 DCHECK(current_block()->HasPredecessor()); | 5291 DCHECK(current_block()->HasPredecessor()); |
| 5292 | 5292 |
| 5293 if (!FLAG_optimize_for_in) { | |
| 5294 return Bailout(kForInStatementOptimizationIsDisabled); | |
| 5295 } | |
| 5296 | |
| 5297 if (!stmt->each()->IsVariableProxy() || | 5293 if (!stmt->each()->IsVariableProxy() || |
| 5298 !stmt->each()->AsVariableProxy()->var()->IsStackLocal()) { | 5294 !stmt->each()->AsVariableProxy()->var()->IsStackLocal()) { |
| 5299 return Bailout(kForInStatementWithNonLocalEachVariable); | 5295 return Bailout(kForInStatementWithNonLocalEachVariable); |
| 5300 } | 5296 } |
| 5301 | 5297 |
| 5302 Variable* each_var = stmt->each()->AsVariableProxy()->var(); | 5298 Variable* each_var = stmt->each()->AsVariableProxy()->var(); |
| 5303 | 5299 |
| 5304 CHECK_ALIVE(VisitForValue(stmt->enumerable())); | 5300 CHECK_ALIVE(VisitForValue(stmt->enumerable())); |
| 5305 HValue* enumerable = Top(); // Leave enumerable at the top. | 5301 HValue* enumerable = Top(); // Leave enumerable at the top. |
| 5306 | 5302 |
| (...skipping 8309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13616 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13612 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13617 } | 13613 } |
| 13618 | 13614 |
| 13619 #ifdef DEBUG | 13615 #ifdef DEBUG |
| 13620 graph_->Verify(false); // No full verify. | 13616 graph_->Verify(false); // No full verify. |
| 13621 #endif | 13617 #endif |
| 13622 } | 13618 } |
| 13623 | 13619 |
| 13624 } // namespace internal | 13620 } // namespace internal |
| 13625 } // namespace v8 | 13621 } // namespace v8 |
| OLD | NEW |