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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/ast.h" | 7 #include "src/ast.h" |
8 #include "src/scopes.h" | 8 #include "src/scopes.h" |
9 #include "src/variables.h" | 9 #include "src/variables.h" |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 case INTERNAL: return "INTERNAL"; | 26 case INTERNAL: return "INTERNAL"; |
27 case TEMPORARY: return "TEMPORARY"; | 27 case TEMPORARY: return "TEMPORARY"; |
28 } | 28 } |
29 UNREACHABLE(); | 29 UNREACHABLE(); |
30 return NULL; | 30 return NULL; |
31 } | 31 } |
32 | 32 |
33 | 33 |
34 Variable::Variable(Scope* scope, const AstRawString* name, VariableMode mode, | 34 Variable::Variable(Scope* scope, const AstRawString* name, VariableMode mode, |
35 bool is_valid_ref, Kind kind, | 35 bool is_valid_ref, Kind kind, |
36 InitializationFlag initialization_flag, | 36 InitializationFlag initialization_flag, int position, |
37 MaybeAssignedFlag maybe_assigned_flag) | 37 MaybeAssignedFlag maybe_assigned_flag) |
38 : scope_(scope), | 38 : scope_(scope), |
39 name_(name), | 39 name_(name), |
40 mode_(mode), | 40 mode_(mode), |
41 kind_(kind), | 41 kind_(kind), |
| 42 position_(position), |
42 location_(UNALLOCATED), | 43 location_(UNALLOCATED), |
43 index_(-1), | 44 index_(-1), |
44 initializer_position_(RelocInfo::kNoPosition), | 45 initializer_position_(RelocInfo::kNoPosition), |
45 local_if_not_shadowed_(NULL), | 46 local_if_not_shadowed_(NULL), |
46 is_valid_ref_(is_valid_ref), | 47 is_valid_ref_(is_valid_ref), |
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. |
(...skipping 11 matching lines...) Expand all Loading... |
63 | 64 |
64 | 65 |
65 int Variable::CompareIndex(Variable* const* v, Variable* const* w) { | 66 int Variable::CompareIndex(Variable* const* v, Variable* const* w) { |
66 int x = (*v)->index(); | 67 int x = (*v)->index(); |
67 int y = (*w)->index(); | 68 int y = (*w)->index(); |
68 // Consider sorting them according to type as well? | 69 // Consider sorting them according to type as well? |
69 return x - y; | 70 return x - y; |
70 } | 71 } |
71 | 72 |
72 } } // namespace v8::internal | 73 } } // namespace v8::internal |
OLD | NEW |