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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 V(normal_ic_symbol) \ | 293 V(normal_ic_symbol) \ |
294 V(home_object_symbol) \ | 294 V(home_object_symbol) \ |
295 V(intl_initialized_marker_symbol) \ | 295 V(intl_initialized_marker_symbol) \ |
296 V(intl_impl_object_symbol) \ | 296 V(intl_impl_object_symbol) \ |
297 V(promise_debug_marker_symbol) \ | 297 V(promise_debug_marker_symbol) \ |
298 V(promise_has_handler_symbol) \ | 298 V(promise_has_handler_symbol) \ |
299 V(class_script_symbol) \ | 299 V(class_script_symbol) \ |
300 V(class_start_position_symbol) \ | 300 V(class_start_position_symbol) \ |
301 V(class_end_position_symbol) | 301 V(class_end_position_symbol) |
302 | 302 |
| 303 #define PUBLIC_SYMBOL_LIST(V) \ |
| 304 V(has_instance_symbol, symbolHasInstance, Symbol.hasInstance) \ |
| 305 V(is_concat_spreadable_symbol, symbolIsConcatSpreadable, \ |
| 306 Symbol.isConcatSpreadable) \ |
| 307 V(is_regexp_symbol, symbolIsRegExp, Symbol.isRegExp) \ |
| 308 V(iterator_symbol, symbolIterator, Symbol.iterator) \ |
| 309 V(to_string_tag_symbol, symbolToStringTag, Symbol.toStringTag) \ |
| 310 V(unscopables_symbol, symbolUnscopables, Symbol.unscopables) |
| 311 |
303 // Heap roots that are known to be immortal immovable, for which we can safely | 312 // Heap roots that are known to be immortal immovable, for which we can safely |
304 // skip write barriers. This list is not complete and has omissions. | 313 // skip write barriers. This list is not complete and has omissions. |
305 #define IMMORTAL_IMMOVABLE_ROOT_LIST(V) \ | 314 #define IMMORTAL_IMMOVABLE_ROOT_LIST(V) \ |
306 V(ByteArrayMap) \ | 315 V(ByteArrayMap) \ |
307 V(FreeSpaceMap) \ | 316 V(FreeSpaceMap) \ |
308 V(OnePointerFillerMap) \ | 317 V(OnePointerFillerMap) \ |
309 V(TwoPointerFillerMap) \ | 318 V(TwoPointerFillerMap) \ |
310 V(UndefinedValue) \ | 319 V(UndefinedValue) \ |
311 V(TheHoleValue) \ | 320 V(TheHoleValue) \ |
312 V(NullValue) \ | 321 V(NullValue) \ |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 #define STRING_ACCESSOR(name, str) \ | 812 #define STRING_ACCESSOR(name, str) \ |
804 String* name() { return String::cast(roots_[k##name##RootIndex]); } | 813 String* name() { return String::cast(roots_[k##name##RootIndex]); } |
805 INTERNALIZED_STRING_LIST(STRING_ACCESSOR) | 814 INTERNALIZED_STRING_LIST(STRING_ACCESSOR) |
806 #undef STRING_ACCESSOR | 815 #undef STRING_ACCESSOR |
807 | 816 |
808 #define SYMBOL_ACCESSOR(name) \ | 817 #define SYMBOL_ACCESSOR(name) \ |
809 Symbol* name() { return Symbol::cast(roots_[k##name##RootIndex]); } | 818 Symbol* name() { return Symbol::cast(roots_[k##name##RootIndex]); } |
810 PRIVATE_SYMBOL_LIST(SYMBOL_ACCESSOR) | 819 PRIVATE_SYMBOL_LIST(SYMBOL_ACCESSOR) |
811 #undef SYMBOL_ACCESSOR | 820 #undef SYMBOL_ACCESSOR |
812 | 821 |
| 822 #define SYMBOL_ACCESSOR(name, varname, description) \ |
| 823 Symbol* name() { return Symbol::cast(roots_[k##name##RootIndex]); } |
| 824 PUBLIC_SYMBOL_LIST(SYMBOL_ACCESSOR) |
| 825 #undef SYMBOL_ACCESSOR |
| 826 |
813 // The hidden_string is special because it is the empty string, but does | 827 // The hidden_string is special because it is the empty string, but does |
814 // not match the empty string. | 828 // not match the empty string. |
815 String* hidden_string() { return hidden_string_; } | 829 String* hidden_string() { return hidden_string_; } |
816 | 830 |
817 void set_native_contexts_list(Object* object) { | 831 void set_native_contexts_list(Object* object) { |
818 native_contexts_list_ = object; | 832 native_contexts_list_ = object; |
819 } | 833 } |
820 Object* native_contexts_list() const { return native_contexts_list_; } | 834 Object* native_contexts_list() const { return native_contexts_list_; } |
821 | 835 |
822 void set_array_buffers_list(Object* object) { array_buffers_list_ = object; } | 836 void set_array_buffers_list(Object* object) { array_buffers_list_ = object; } |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 #undef ROOT_INDEX_DECLARATION | 1114 #undef ROOT_INDEX_DECLARATION |
1101 | 1115 |
1102 #define STRING_INDEX_DECLARATION(name, str) k##name##RootIndex, | 1116 #define STRING_INDEX_DECLARATION(name, str) k##name##RootIndex, |
1103 INTERNALIZED_STRING_LIST(STRING_INDEX_DECLARATION) | 1117 INTERNALIZED_STRING_LIST(STRING_INDEX_DECLARATION) |
1104 #undef STRING_DECLARATION | 1118 #undef STRING_DECLARATION |
1105 | 1119 |
1106 #define SYMBOL_INDEX_DECLARATION(name) k##name##RootIndex, | 1120 #define SYMBOL_INDEX_DECLARATION(name) k##name##RootIndex, |
1107 PRIVATE_SYMBOL_LIST(SYMBOL_INDEX_DECLARATION) | 1121 PRIVATE_SYMBOL_LIST(SYMBOL_INDEX_DECLARATION) |
1108 #undef SYMBOL_INDEX_DECLARATION | 1122 #undef SYMBOL_INDEX_DECLARATION |
1109 | 1123 |
| 1124 #define SYMBOL_INDEX_DECLARATION(name, varname, description) k##name##RootIndex, |
| 1125 PUBLIC_SYMBOL_LIST(SYMBOL_INDEX_DECLARATION) |
| 1126 #undef SYMBOL_INDEX_DECLARATION |
| 1127 |
1110 // Utility type maps | 1128 // Utility type maps |
1111 #define DECLARE_STRUCT_MAP(NAME, Name, name) k##Name##MapRootIndex, | 1129 #define DECLARE_STRUCT_MAP(NAME, Name, name) k##Name##MapRootIndex, |
1112 STRUCT_LIST(DECLARE_STRUCT_MAP) | 1130 STRUCT_LIST(DECLARE_STRUCT_MAP) |
1113 #undef DECLARE_STRUCT_MAP | 1131 #undef DECLARE_STRUCT_MAP |
1114 kStringTableRootIndex, | 1132 kStringTableRootIndex, |
1115 | 1133 |
1116 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, | 1134 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, |
1117 SMI_ROOT_LIST(ROOT_INDEX_DECLARATION) | 1135 SMI_ROOT_LIST(ROOT_INDEX_DECLARATION) |
1118 #undef ROOT_INDEX_DECLARATION | 1136 #undef ROOT_INDEX_DECLARATION |
1119 kRootListLength, | 1137 kRootListLength, |
(...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2555 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2573 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2556 | 2574 |
2557 private: | 2575 private: |
2558 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2576 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2559 }; | 2577 }; |
2560 #endif // DEBUG | 2578 #endif // DEBUG |
2561 } | 2579 } |
2562 } // namespace v8::internal | 2580 } // namespace v8::internal |
2563 | 2581 |
2564 #endif // V8_HEAP_HEAP_H_ | 2582 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |