OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 kStringTableRootIndex, | 1159 kStringTableRootIndex, |
1160 | 1160 |
1161 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, | 1161 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, |
1162 SMI_ROOT_LIST(ROOT_INDEX_DECLARATION) | 1162 SMI_ROOT_LIST(ROOT_INDEX_DECLARATION) |
1163 #undef ROOT_INDEX_DECLARATION | 1163 #undef ROOT_INDEX_DECLARATION |
1164 kRootListLength, | 1164 kRootListLength, |
1165 kStrongRootListLength = kStringTableRootIndex, | 1165 kStrongRootListLength = kStringTableRootIndex, |
1166 kSmiRootsStart = kStringTableRootIndex + 1 | 1166 kSmiRootsStart = kStringTableRootIndex + 1 |
1167 }; | 1167 }; |
1168 | 1168 |
| 1169 // Get the root list index for {object} if such a root list index exists. |
| 1170 bool GetRootListIndex(Handle<HeapObject> object, |
| 1171 Heap::RootListIndex* index_return); |
| 1172 |
1169 Object* root(RootListIndex index) { return roots_[index]; } | 1173 Object* root(RootListIndex index) { return roots_[index]; } |
1170 | 1174 |
1171 STATIC_ASSERT(kUndefinedValueRootIndex == | 1175 STATIC_ASSERT(kUndefinedValueRootIndex == |
1172 Internals::kUndefinedValueRootIndex); | 1176 Internals::kUndefinedValueRootIndex); |
1173 STATIC_ASSERT(kNullValueRootIndex == Internals::kNullValueRootIndex); | 1177 STATIC_ASSERT(kNullValueRootIndex == Internals::kNullValueRootIndex); |
1174 STATIC_ASSERT(kTrueValueRootIndex == Internals::kTrueValueRootIndex); | 1178 STATIC_ASSERT(kTrueValueRootIndex == Internals::kTrueValueRootIndex); |
1175 STATIC_ASSERT(kFalseValueRootIndex == Internals::kFalseValueRootIndex); | 1179 STATIC_ASSERT(kFalseValueRootIndex == Internals::kFalseValueRootIndex); |
1176 STATIC_ASSERT(kempty_stringRootIndex == Internals::kEmptyStringRootIndex); | 1180 STATIC_ASSERT(kempty_stringRootIndex == Internals::kEmptyStringRootIndex); |
1177 | 1181 |
1178 // Generated code can embed direct references to non-writable roots if | 1182 // Generated code can embed direct references to non-writable roots if |
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2608 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2612 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2609 | 2613 |
2610 private: | 2614 private: |
2611 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2615 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2612 }; | 2616 }; |
2613 #endif // DEBUG | 2617 #endif // DEBUG |
2614 } | 2618 } |
2615 } // namespace v8::internal | 2619 } // namespace v8::internal |
2616 | 2620 |
2617 #endif // V8_HEAP_HEAP_H_ | 2621 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |