| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/variables.h" | 5 #include "src/variables.h" |
| 6 | 6 |
| 7 #include "src/ast.h" | 7 #include "src/ast.h" |
| 8 #include "src/scopes.h" | 8 #include "src/scopes.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 name_(name), | 37 name_(name), |
| 38 mode_(mode), | 38 mode_(mode), |
| 39 kind_(kind), | 39 kind_(kind), |
| 40 location_(VariableLocation::UNALLOCATED), | 40 location_(VariableLocation::UNALLOCATED), |
| 41 index_(-1), | 41 index_(-1), |
| 42 initializer_position_(RelocInfo::kNoPosition), | 42 initializer_position_(RelocInfo::kNoPosition), |
| 43 has_strong_mode_reference_(false), | 43 has_strong_mode_reference_(false), |
| 44 strong_mode_reference_start_position_(RelocInfo::kNoPosition), | 44 strong_mode_reference_start_position_(RelocInfo::kNoPosition), |
| 45 strong_mode_reference_end_position_(RelocInfo::kNoPosition), | 45 strong_mode_reference_end_position_(RelocInfo::kNoPosition), |
| 46 local_if_not_shadowed_(NULL), | 46 local_if_not_shadowed_(NULL), |
| 47 is_from_eval_(false), |
| 47 force_context_allocation_(false), | 48 force_context_allocation_(false), |
| 48 is_used_(false), | 49 is_used_(false), |
| 49 initialization_flag_(initialization_flag), | 50 initialization_flag_(initialization_flag), |
| 50 maybe_assigned_(maybe_assigned_flag) { | 51 maybe_assigned_(maybe_assigned_flag) { |
| 51 // Var declared variables never need initialization. | 52 // Var declared variables never need initialization. |
| 52 DCHECK(!(mode == VAR && initialization_flag == kNeedsInitialization)); | 53 DCHECK(!(mode == VAR && initialization_flag == kNeedsInitialization)); |
| 53 } | 54 } |
| 54 | 55 |
| 55 | 56 |
| 56 bool Variable::IsGlobalObjectProperty() const { | 57 bool Variable::IsGlobalObjectProperty() const { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 72 | 73 |
| 73 int Variable::CompareIndex(Variable* const* v, Variable* const* w) { | 74 int Variable::CompareIndex(Variable* const* v, Variable* const* w) { |
| 74 int x = (*v)->index(); | 75 int x = (*v)->index(); |
| 75 int y = (*w)->index(); | 76 int y = (*w)->index(); |
| 76 // Consider sorting them according to type as well? | 77 // Consider sorting them according to type as well? |
| 77 return x - y; | 78 return x - y; |
| 78 } | 79 } |
| 79 | 80 |
| 80 } // namespace internal | 81 } // namespace internal |
| 81 } // namespace v8 | 82 } // namespace v8 |
| OLD | NEW |