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 #ifndef V8_SCOPEINFO_H_ | 5 #ifndef V8_SCOPEINFO_H_ |
6 #define V8_SCOPEINFO_H_ | 6 #define V8_SCOPEINFO_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/variables.h" | 9 #include "src/variables.h" |
10 #include "src/zone-inl.h" | 10 #include "src/zone-inl.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 static const int kLength = 256; | 54 static const int kLength = 256; |
55 struct Key { | 55 struct Key { |
56 Object* data; | 56 Object* data; |
57 String* name; | 57 String* name; |
58 }; | 58 }; |
59 | 59 |
60 struct Value { | 60 struct Value { |
61 Value(VariableMode mode, InitializationFlag init_flag, | 61 Value(VariableMode mode, InitializationFlag init_flag, |
62 MaybeAssignedFlag maybe_assigned_flag, int index) { | 62 MaybeAssignedFlag maybe_assigned_flag, int index) { |
63 ASSERT(ModeField::is_valid(mode)); | 63 DCHECK(ModeField::is_valid(mode)); |
64 ASSERT(InitField::is_valid(init_flag)); | 64 DCHECK(InitField::is_valid(init_flag)); |
65 ASSERT(MaybeAssignedField::is_valid(maybe_assigned_flag)); | 65 DCHECK(MaybeAssignedField::is_valid(maybe_assigned_flag)); |
66 ASSERT(IndexField::is_valid(index)); | 66 DCHECK(IndexField::is_valid(index)); |
67 value_ = ModeField::encode(mode) | IndexField::encode(index) | | 67 value_ = ModeField::encode(mode) | IndexField::encode(index) | |
68 InitField::encode(init_flag) | | 68 InitField::encode(init_flag) | |
69 MaybeAssignedField::encode(maybe_assigned_flag); | 69 MaybeAssignedField::encode(maybe_assigned_flag); |
70 ASSERT(mode == this->mode()); | 70 DCHECK(mode == this->mode()); |
71 ASSERT(init_flag == this->initialization_flag()); | 71 DCHECK(init_flag == this->initialization_flag()); |
72 ASSERT(maybe_assigned_flag == this->maybe_assigned_flag()); | 72 DCHECK(maybe_assigned_flag == this->maybe_assigned_flag()); |
73 ASSERT(index == this->index()); | 73 DCHECK(index == this->index()); |
74 } | 74 } |
75 | 75 |
76 explicit inline Value(uint32_t value) : value_(value) {} | 76 explicit inline Value(uint32_t value) : value_(value) {} |
77 | 77 |
78 uint32_t raw() { return value_; } | 78 uint32_t raw() { return value_; } |
79 | 79 |
80 VariableMode mode() { return ModeField::decode(value_); } | 80 VariableMode mode() { return ModeField::decode(value_); } |
81 | 81 |
82 InitializationFlag initialization_flag() { | 82 InitializationFlag initialization_flag() { |
83 return InitField::decode(value_); | 83 return InitField::decode(value_); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 } | 165 } |
166 void set_index(int i, int index) { | 166 void set_index(int i, int index) { |
167 set(index_offset(i), Smi::FromInt(index)); | 167 set(index_offset(i), Smi::FromInt(index)); |
168 } | 168 } |
169 }; | 169 }; |
170 | 170 |
171 | 171 |
172 } } // namespace v8::internal | 172 } } // namespace v8::internal |
173 | 173 |
174 #endif // V8_SCOPEINFO_H_ | 174 #endif // V8_SCOPEINFO_H_ |
OLD | NEW |