| 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: return "VAR"; |
| 19 case CONST_LEGACY: return "CONST_LEGACY"; | 19 case CONST_LEGACY: return "CONST_LEGACY"; |
| 20 case LET: return "LET"; | 20 case LET: return "LET"; |
| 21 case CONST: return "CONST"; | 21 case CONST: return "CONST"; |
| 22 case IMPORT: return "IMPORT"; | |
| 23 case DYNAMIC: return "DYNAMIC"; | 22 case DYNAMIC: return "DYNAMIC"; |
| 24 case DYNAMIC_GLOBAL: return "DYNAMIC_GLOBAL"; | 23 case DYNAMIC_GLOBAL: return "DYNAMIC_GLOBAL"; |
| 25 case DYNAMIC_LOCAL: return "DYNAMIC_LOCAL"; | 24 case DYNAMIC_LOCAL: return "DYNAMIC_LOCAL"; |
| 26 case TEMPORARY: return "TEMPORARY"; | 25 case TEMPORARY: return "TEMPORARY"; |
| 27 } | 26 } |
| 28 UNREACHABLE(); | 27 UNREACHABLE(); |
| 29 return NULL; | 28 return NULL; |
| 30 } | 29 } |
| 31 | 30 |
| 32 | 31 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 69 |
| 71 int Variable::CompareIndex(Variable* const* v, Variable* const* w) { | 70 int Variable::CompareIndex(Variable* const* v, Variable* const* w) { |
| 72 int x = (*v)->index(); | 71 int x = (*v)->index(); |
| 73 int y = (*w)->index(); | 72 int y = (*w)->index(); |
| 74 // Consider sorting them according to type as well? | 73 // Consider sorting them according to type as well? |
| 75 return x - y; | 74 return x - y; |
| 76 } | 75 } |
| 77 | 76 |
| 78 } // namespace internal | 77 } // namespace internal |
| 79 } // namespace v8 | 78 } // namespace v8 |
| OLD | NEW |