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 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 inline Isolate* isolate(); | 1170 inline Isolate* isolate(); |
1171 | 1171 |
1172 MarkCompactCollector* mark_compact_collector() { | 1172 MarkCompactCollector* mark_compact_collector() { |
1173 return &mark_compact_collector_; | 1173 return &mark_compact_collector_; |
1174 } | 1174 } |
1175 | 1175 |
1176 // =========================================================================== | 1176 // =========================================================================== |
1177 // Root set access. ========================================================== | 1177 // Root set access. ========================================================== |
1178 // =========================================================================== | 1178 // =========================================================================== |
1179 | 1179 |
1180 // Heap root getters. We have versions with and without type::cast() here. | 1180 // Heap root getters. |
1181 // You can't use type::cast during GC because the assert fails. | 1181 #define ROOT_ACCESSOR(type, name, camel_name) inline type* name(); |
1182 // TODO(1490): Try removing the unchecked accessors, now that GC marking does | |
1183 // not corrupt the map. | |
1184 #define ROOT_ACCESSOR(type, name, camel_name) \ | |
1185 inline type* name(); \ | |
1186 type* raw_unchecked_##name() { \ | |
1187 return reinterpret_cast<type*>(roots_[k##camel_name##RootIndex]); \ | |
1188 } | |
1189 ROOT_LIST(ROOT_ACCESSOR) | 1182 ROOT_LIST(ROOT_ACCESSOR) |
1190 #undef ROOT_ACCESSOR | 1183 #undef ROOT_ACCESSOR |
1191 | 1184 |
1192 // Utility type maps. | 1185 // Utility type maps. |
1193 #define STRUCT_MAP_ACCESSOR(NAME, Name, name) inline Map* name##_map(); | 1186 #define STRUCT_MAP_ACCESSOR(NAME, Name, name) inline Map* name##_map(); |
1194 STRUCT_LIST(STRUCT_MAP_ACCESSOR) | 1187 STRUCT_LIST(STRUCT_MAP_ACCESSOR) |
1195 #undef STRUCT_MAP_ACCESSOR | 1188 #undef STRUCT_MAP_ACCESSOR |
1196 | 1189 |
1197 #define STRING_ACCESSOR(name, str) inline String* name(); | 1190 #define STRING_ACCESSOR(name, str) inline String* name(); |
1198 INTERNALIZED_STRING_LIST(STRING_ACCESSOR) | 1191 INTERNALIZED_STRING_LIST(STRING_ACCESSOR) |
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2801 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2794 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2802 | 2795 |
2803 private: | 2796 private: |
2804 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2797 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2805 }; | 2798 }; |
2806 #endif // DEBUG | 2799 #endif // DEBUG |
2807 } | 2800 } |
2808 } // namespace v8::internal | 2801 } // namespace v8::internal |
2809 | 2802 |
2810 #endif // V8_HEAP_HEAP_H_ | 2803 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |