| 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 { |
| 11 namespace internal { | 11 namespace internal { |
| 12 | 12 |
| 13 // ---------------------------------------------------------------------------- | 13 // ---------------------------------------------------------------------------- |
| 14 // Implementation Variable. | 14 // Implementation Variable. |
| 15 | 15 |
| 16 const char* Variable::Mode2String(VariableMode mode) { | 16 const char* Variable::Mode2String(VariableMode mode) { |
| 17 switch (mode) { | 17 switch (mode) { |
| 18 case VAR: return "VAR"; | 18 case VAR: |
| 19 case CONST_LEGACY: return "CONST_LEGACY"; | 19 return "VAR"; |
| 20 case LET: return "LET"; | 20 case CONST_LEGACY: |
| 21 case CONST: return "CONST"; | 21 return "CONST_LEGACY"; |
| 22 case IMPORT: return "IMPORT"; | 22 case LET: |
| 23 case DYNAMIC: return "DYNAMIC"; | 23 return "LET"; |
| 24 case DYNAMIC_GLOBAL: return "DYNAMIC_GLOBAL"; | 24 case CONST: |
| 25 case DYNAMIC_LOCAL: return "DYNAMIC_LOCAL"; | 25 return "CONST"; |
| 26 case TEMPORARY: return "TEMPORARY"; | 26 case IMPORT: |
| 27 return "IMPORT"; |
| 28 case DYNAMIC: |
| 29 return "DYNAMIC"; |
| 30 case DYNAMIC_GLOBAL: |
| 31 return "DYNAMIC_GLOBAL"; |
| 32 case DYNAMIC_LOCAL: |
| 33 return "DYNAMIC_LOCAL"; |
| 34 case TEMPORARY: |
| 35 return "TEMPORARY"; |
| 27 } | 36 } |
| 28 UNREACHABLE(); | 37 UNREACHABLE(); |
| 29 return NULL; | 38 return NULL; |
| 30 } | 39 } |
| 31 | 40 |
| 32 | 41 |
| 33 Variable::Variable(Scope* scope, const AstRawString* name, VariableMode mode, | 42 Variable::Variable(Scope* scope, const AstRawString* name, VariableMode mode, |
| 34 Kind kind, InitializationFlag initialization_flag, | 43 Kind kind, InitializationFlag initialization_flag, |
| 35 MaybeAssignedFlag maybe_assigned_flag) | 44 MaybeAssignedFlag maybe_assigned_flag) |
| 36 : scope_(scope), | 45 : scope_(scope), |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 82 |
| 74 int Variable::CompareIndex(Variable* const* v, Variable* const* w) { | 83 int Variable::CompareIndex(Variable* const* v, Variable* const* w) { |
| 75 int x = (*v)->index(); | 84 int x = (*v)->index(); |
| 76 int y = (*w)->index(); | 85 int y = (*w)->index(); |
| 77 // Consider sorting them according to type as well? | 86 // Consider sorting them according to type as well? |
| 78 return x - y; | 87 return x - y; |
| 79 } | 88 } |
| 80 | 89 |
| 81 } // namespace internal | 90 } // namespace internal |
| 82 } // namespace v8 | 91 } // namespace v8 |
| OLD | NEW |