| 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 <memory> | 7 #include <memory> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
| (...skipping 7067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7078 // TODO(adamk): Is this required? Legacy const variables are always | 7078 // TODO(adamk): Is this required? Legacy const variables are always |
| 7079 // initialized before use. | 7079 // initialized before use. |
| 7080 if (var->IsStackAllocated()) { | 7080 if (var->IsStackAllocated()) { |
| 7081 // We insert a use of the old value to detect unsupported uses of const | 7081 // We insert a use of the old value to detect unsupported uses of const |
| 7082 // variables (e.g. initialization inside a loop). | 7082 // variables (e.g. initialization inside a loop). |
| 7083 HValue* old_value = environment()->Lookup(var); | 7083 HValue* old_value = environment()->Lookup(var); |
| 7084 Add<HUseConst>(old_value); | 7084 Add<HUseConst>(old_value); |
| 7085 } | 7085 } |
| 7086 } | 7086 } |
| 7087 | 7087 |
| 7088 if (proxy->IsArguments()) return Bailout(kAssignmentToArguments); | 7088 if (var->is_arguments()) return Bailout(kAssignmentToArguments); |
| 7089 | 7089 |
| 7090 // Handle the assignment. | 7090 // Handle the assignment. |
| 7091 switch (var->location()) { | 7091 switch (var->location()) { |
| 7092 case VariableLocation::GLOBAL: | 7092 case VariableLocation::GLOBAL: |
| 7093 case VariableLocation::UNALLOCATED: | 7093 case VariableLocation::UNALLOCATED: |
| 7094 CHECK_ALIVE(VisitForValue(expr->value())); | 7094 CHECK_ALIVE(VisitForValue(expr->value())); |
| 7095 HandleGlobalVariableAssignment(var, Top(), expr->AssignmentSlot(), | 7095 HandleGlobalVariableAssignment(var, Top(), expr->AssignmentSlot(), |
| 7096 expr->AssignmentId()); | 7096 expr->AssignmentId()); |
| 7097 return ast_context()->ReturnValue(Pop()); | 7097 return ast_context()->ReturnValue(Pop()); |
| 7098 | 7098 |
| (...skipping 6333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13432 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13432 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13433 } | 13433 } |
| 13434 | 13434 |
| 13435 #ifdef DEBUG | 13435 #ifdef DEBUG |
| 13436 graph_->Verify(false); // No full verify. | 13436 graph_->Verify(false); // No full verify. |
| 13437 #endif | 13437 #endif |
| 13438 } | 13438 } |
| 13439 | 13439 |
| 13440 } // namespace internal | 13440 } // namespace internal |
| 13441 } // namespace v8 | 13441 } // namespace v8 |
| OLD | NEW |