| 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/ast/variables.h" | 5 #include "src/ast/variables.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 Variable::Variable(Scope* scope, const AstRawString* name, VariableMode mode, | 33 Variable::Variable(Scope* scope, const AstRawString* name, VariableMode mode, |
| 34 Kind kind, InitializationFlag initialization_flag, | 34 Kind kind, InitializationFlag initialization_flag, |
| 35 MaybeAssignedFlag maybe_assigned_flag) | 35 MaybeAssignedFlag maybe_assigned_flag) |
| 36 : scope_(scope), | 36 : scope_(scope), |
| 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), | |
| 44 strong_mode_reference_start_position_(RelocInfo::kNoPosition), | |
| 45 strong_mode_reference_end_position_(RelocInfo::kNoPosition), | |
| 46 local_if_not_shadowed_(NULL), | 43 local_if_not_shadowed_(NULL), |
| 47 is_from_eval_(false), | 44 is_from_eval_(false), |
| 48 force_context_allocation_(false), | 45 force_context_allocation_(false), |
| 49 is_used_(false), | 46 is_used_(false), |
| 50 initialization_flag_(initialization_flag), | 47 initialization_flag_(initialization_flag), |
| 51 maybe_assigned_(maybe_assigned_flag) { | 48 maybe_assigned_(maybe_assigned_flag) { |
| 52 // Var declared variables never need initialization. | 49 // Var declared variables never need initialization. |
| 53 DCHECK(!(mode == VAR && initialization_flag == kNeedsInitialization)); | 50 DCHECK(!(mode == VAR && initialization_flag == kNeedsInitialization)); |
| 54 } | 51 } |
| 55 | 52 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 73 | 70 |
| 74 int Variable::CompareIndex(Variable* const* v, Variable* const* w) { | 71 int Variable::CompareIndex(Variable* const* v, Variable* const* w) { |
| 75 int x = (*v)->index(); | 72 int x = (*v)->index(); |
| 76 int y = (*w)->index(); | 73 int y = (*w)->index(); |
| 77 // Consider sorting them according to type as well? | 74 // Consider sorting them according to type as well? |
| 78 return x - y; | 75 return x - y; |
| 79 } | 76 } |
| 80 | 77 |
| 81 } // namespace internal | 78 } // namespace internal |
| 82 } // namespace v8 | 79 } // namespace v8 |
| OLD | NEW |