7 #include "src/elements-kind.h" 8 #include "src/visitors.h" 13 const char* RootsTable::root_names_[RootsTable::kEntriesCount] = {
14 #define ROOT_NAME(type, name, CamelName) #name, 20 RootIndex RootsTable::RootIndexForFixedTypedArray(
21 ExternalArrayType array_type) {
23 #define ARRAY_TYPE_TO_ROOT_INDEX(Type, type, TYPE, ctype) \ 24 case kExternal##Type##Array: \ 25 return RootIndex::kFixed##Type##ArrayMap; 27 TYPED_ARRAYS(ARRAY_TYPE_TO_ROOT_INDEX)
28 #undef ARRAY_TYPE_TO_ROOT_INDEX 34 RootIndex RootsTable::RootIndexForFixedTypedArray(ElementsKind elements_kind) {
35 switch (elements_kind) {
36 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype) \ 37 case TYPE##_ELEMENTS: \ 38 return RootIndex::kFixed##Type##ArrayMap; 39 TYPED_ARRAYS(TYPED_ARRAY_CASE)
42 #undef TYPED_ARRAY_CASE 47 RootIndex RootsTable::RootIndexForEmptyFixedTypedArray(
48 ElementsKind elements_kind) {
49 switch (elements_kind) {
50 #define ELEMENT_KIND_TO_ROOT_INDEX(Type, type, TYPE, ctype) \ 51 case TYPE##_ELEMENTS: \ 52 return RootIndex::kEmptyFixed##Type##Array; 54 TYPED_ARRAYS(ELEMENT_KIND_TO_ROOT_INDEX)
55 #undef ELEMENT_KIND_TO_ROOT_INDEX 61 void ReadOnlyRoots::Iterate(RootVisitor* visitor) {
62 visitor->VisitRootPointers(Root::kReadOnlyRootList,
nullptr,
63 roots_table_.read_only_roots_begin(),
64 roots_table_.read_only_roots_end());
65 visitor->Synchronize(VisitorSynchronization::kReadOnlyRootList);