Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/heap/heap.h

Issue 722723002: Move public symbols to the root set. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 V(normal_ic_symbol) \ 292 V(normal_ic_symbol) \
293 V(home_object_symbol) \ 293 V(home_object_symbol) \
294 V(intl_initialized_marker_symbol) \ 294 V(intl_initialized_marker_symbol) \
295 V(intl_impl_object_symbol) \ 295 V(intl_impl_object_symbol) \
296 V(promise_debug_marker_symbol) \ 296 V(promise_debug_marker_symbol) \
297 V(promise_has_handler_symbol) \ 297 V(promise_has_handler_symbol) \
298 V(class_script_symbol) \ 298 V(class_script_symbol) \
299 V(class_start_position_symbol) \ 299 V(class_start_position_symbol) \
300 V(class_end_position_symbol) 300 V(class_end_position_symbol)
301 301
302 #define PUBLIC_SYMBOL_LIST(V) \
303 V(has_instance_symbol, symbolHasInstance, Symbol.hasInstance) \
304 V(is_concat_spreadable_symbol, symbolIsConcatSpreadable, \
305 Symbol.isConcatSpreadable) \
306 V(is_regexp_symbol, symbolIsRegExp, Symbol.isRegExp) \
307 V(iterator_symbol, symbolIterator, Symbol.iterator) \
308 V(to_string_tag_symbol, symbolToStringTag, Symbol.toStringTag) \
309 V(unscopables_symbol, symbolUnscopables, Symbol.unscopables)
310
302 // Heap roots that are known to be immortal immovable, for which we can safely 311 // Heap roots that are known to be immortal immovable, for which we can safely
303 // skip write barriers. This list is not complete and has omissions. 312 // skip write barriers. This list is not complete and has omissions.
304 #define IMMORTAL_IMMOVABLE_ROOT_LIST(V) \ 313 #define IMMORTAL_IMMOVABLE_ROOT_LIST(V) \
305 V(ByteArrayMap) \ 314 V(ByteArrayMap) \
306 V(FreeSpaceMap) \ 315 V(FreeSpaceMap) \
307 V(OnePointerFillerMap) \ 316 V(OnePointerFillerMap) \
308 V(TwoPointerFillerMap) \ 317 V(TwoPointerFillerMap) \
309 V(UndefinedValue) \ 318 V(UndefinedValue) \
310 V(TheHoleValue) \ 319 V(TheHoleValue) \
311 V(NullValue) \ 320 V(NullValue) \
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 #define STRING_ACCESSOR(name, str) \ 811 #define STRING_ACCESSOR(name, str) \
803 String* name() { return String::cast(roots_[k##name##RootIndex]); } 812 String* name() { return String::cast(roots_[k##name##RootIndex]); }
804 INTERNALIZED_STRING_LIST(STRING_ACCESSOR) 813 INTERNALIZED_STRING_LIST(STRING_ACCESSOR)
805 #undef STRING_ACCESSOR 814 #undef STRING_ACCESSOR
806 815
807 #define SYMBOL_ACCESSOR(name) \ 816 #define SYMBOL_ACCESSOR(name) \
808 Symbol* name() { return Symbol::cast(roots_[k##name##RootIndex]); } 817 Symbol* name() { return Symbol::cast(roots_[k##name##RootIndex]); }
809 PRIVATE_SYMBOL_LIST(SYMBOL_ACCESSOR) 818 PRIVATE_SYMBOL_LIST(SYMBOL_ACCESSOR)
810 #undef SYMBOL_ACCESSOR 819 #undef SYMBOL_ACCESSOR
811 820
821 #define SYMBOL_ACCESSOR(name, varname, description) \
822 Symbol* name() { return Symbol::cast(roots_[k##name##RootIndex]); }
823 PUBLIC_SYMBOL_LIST(SYMBOL_ACCESSOR)
824 #undef SYMBOL_ACCESSOR
825
812 // The hidden_string is special because it is the empty string, but does 826 // The hidden_string is special because it is the empty string, but does
813 // not match the empty string. 827 // not match the empty string.
814 String* hidden_string() { return hidden_string_; } 828 String* hidden_string() { return hidden_string_; }
815 829
816 void set_native_contexts_list(Object* object) { 830 void set_native_contexts_list(Object* object) {
817 native_contexts_list_ = object; 831 native_contexts_list_ = object;
818 } 832 }
819 Object* native_contexts_list() const { return native_contexts_list_; } 833 Object* native_contexts_list() const { return native_contexts_list_; }
820 834
821 void set_array_buffers_list(Object* object) { array_buffers_list_ = object; } 835 void set_array_buffers_list(Object* object) { array_buffers_list_ = object; }
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 #undef ROOT_INDEX_DECLARATION 1113 #undef ROOT_INDEX_DECLARATION
1100 1114
1101 #define STRING_INDEX_DECLARATION(name, str) k##name##RootIndex, 1115 #define STRING_INDEX_DECLARATION(name, str) k##name##RootIndex,
1102 INTERNALIZED_STRING_LIST(STRING_INDEX_DECLARATION) 1116 INTERNALIZED_STRING_LIST(STRING_INDEX_DECLARATION)
1103 #undef STRING_DECLARATION 1117 #undef STRING_DECLARATION
1104 1118
1105 #define SYMBOL_INDEX_DECLARATION(name) k##name##RootIndex, 1119 #define SYMBOL_INDEX_DECLARATION(name) k##name##RootIndex,
1106 PRIVATE_SYMBOL_LIST(SYMBOL_INDEX_DECLARATION) 1120 PRIVATE_SYMBOL_LIST(SYMBOL_INDEX_DECLARATION)
1107 #undef SYMBOL_INDEX_DECLARATION 1121 #undef SYMBOL_INDEX_DECLARATION
1108 1122
1123 #define SYMBOL_INDEX_DECLARATION(name, varname, description) k##name##RootIndex,
1124 PUBLIC_SYMBOL_LIST(SYMBOL_INDEX_DECLARATION)
1125 #undef SYMBOL_INDEX_DECLARATION
1126
1109 // Utility type maps 1127 // Utility type maps
1110 #define DECLARE_STRUCT_MAP(NAME, Name, name) k##Name##MapRootIndex, 1128 #define DECLARE_STRUCT_MAP(NAME, Name, name) k##Name##MapRootIndex,
1111 STRUCT_LIST(DECLARE_STRUCT_MAP) 1129 STRUCT_LIST(DECLARE_STRUCT_MAP)
1112 #undef DECLARE_STRUCT_MAP 1130 #undef DECLARE_STRUCT_MAP
1113 kStringTableRootIndex, 1131 kStringTableRootIndex,
1114 1132
1115 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, 1133 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex,
1116 SMI_ROOT_LIST(ROOT_INDEX_DECLARATION) 1134 SMI_ROOT_LIST(ROOT_INDEX_DECLARATION)
1117 #undef ROOT_INDEX_DECLARATION 1135 #undef ROOT_INDEX_DECLARATION
1118 kRootListLength, 1136 kRootListLength,
(...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after
2554 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2572 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2555 2573
2556 private: 2574 private:
2557 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2575 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2558 }; 2576 };
2559 #endif // DEBUG 2577 #endif // DEBUG
2560 } 2578 }
2561 } // namespace v8::internal 2579 } // namespace v8::internal
2562 2580
2563 #endif // V8_HEAP_HEAP_H_ 2581 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698