OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 value); | 1904 value); |
1905 | 1905 |
1906 PropertyDetails details(descriptors->GetDetails(i)); | 1906 PropertyDetails details(descriptors->GetDetails(i)); |
1907 | 1907 |
1908 switch (details.type()) { | 1908 switch (details.type()) { |
1909 case NORMAL: | 1909 case NORMAL: |
1910 case FIELD: | 1910 case FIELD: |
1911 case CONSTANT_FUNCTION: | 1911 case CONSTANT_FUNCTION: |
1912 case HANDLER: | 1912 case HANDLER: |
1913 case INTERCEPTOR: | 1913 case INTERCEPTOR: |
| 1914 case CALLBACKS: |
1914 base_marker()->MarkObjectAndPush(value); | 1915 base_marker()->MarkObjectAndPush(value); |
1915 break; | 1916 break; |
1916 case CALLBACKS: | |
1917 if (!value->IsAccessorPair()) { | |
1918 base_marker()->MarkObjectAndPush(value); | |
1919 } else if (base_marker()->MarkObjectWithoutPush(value)) { | |
1920 AccessorPair* accessors = AccessorPair::cast(value); | |
1921 MarkAccessorPairSlot(accessors, AccessorPair::kGetterOffset); | |
1922 MarkAccessorPairSlot(accessors, AccessorPair::kSetterOffset); | |
1923 } | |
1924 break; | |
1925 case TRANSITION: | 1917 case TRANSITION: |
1926 case NONEXISTENT: | 1918 case NONEXISTENT: |
1927 UNREACHABLE(); | 1919 UNREACHABLE(); |
1928 break; | 1920 break; |
1929 } | 1921 } |
1930 } | 1922 } |
1931 } | 1923 } |
1932 | 1924 |
1933 template <class T> | 1925 template <class T> |
1934 void Marker<T>::MarkTransitionArray(TransitionArray* transitions) { | 1926 void Marker<T>::MarkTransitionArray(TransitionArray* transitions) { |
(...skipping 18 matching lines...) Expand all Loading... |
1953 transitions_start, proto_trans_slot, prototype_transitions); | 1945 transitions_start, proto_trans_slot, prototype_transitions); |
1954 } | 1946 } |
1955 | 1947 |
1956 for (int i = 0; i < transitions->number_of_transitions(); ++i) { | 1948 for (int i = 0; i < transitions->number_of_transitions(); ++i) { |
1957 Object** key_slot = transitions->GetKeySlot(i); | 1949 Object** key_slot = transitions->GetKeySlot(i); |
1958 Object* key = *key_slot; | 1950 Object* key = *key_slot; |
1959 if (key->IsHeapObject()) { | 1951 if (key->IsHeapObject()) { |
1960 base_marker()->MarkObjectAndPush(HeapObject::cast(key)); | 1952 base_marker()->MarkObjectAndPush(HeapObject::cast(key)); |
1961 mark_compact_collector()->RecordSlot(transitions_start, key_slot, key); | 1953 mark_compact_collector()->RecordSlot(transitions_start, key_slot, key); |
1962 } | 1954 } |
1963 | |
1964 Object** value_slot = transitions->GetValueSlot(i); | |
1965 if (!(*value_slot)->IsHeapObject()) continue; | |
1966 HeapObject* value = HeapObject::cast(*value_slot); | |
1967 | |
1968 if (value->IsAccessorPair()) { | |
1969 mark_compact_collector()->RecordSlot(transitions_start, | |
1970 value_slot, | |
1971 value); | |
1972 | |
1973 base_marker()->MarkObjectWithoutPush(value); | |
1974 AccessorPair* accessors = AccessorPair::cast(value); | |
1975 MarkAccessorPairSlot(accessors, AccessorPair::kGetterOffset); | |
1976 MarkAccessorPairSlot(accessors, AccessorPair::kSetterOffset); | |
1977 } | |
1978 } | 1955 } |
1979 } | 1956 } |
1980 | 1957 |
1981 | 1958 |
1982 template <class T> | 1959 template <class T> |
1983 void Marker<T>::MarkAccessorPairSlot(AccessorPair* accessors, int offset) { | 1960 void Marker<T>::MarkAccessorPairSlot(AccessorPair* accessors, int offset) { |
1984 Object** slot = HeapObject::RawField(accessors, offset); | 1961 Object** slot = HeapObject::RawField(accessors, offset); |
1985 HeapObject* accessor = HeapObject::cast(*slot); | 1962 HeapObject* accessor = HeapObject::cast(*slot); |
1986 if (accessor->IsMap()) return; | 1963 if (accessor->IsMap()) return; |
1987 mark_compact_collector()->RecordSlot(slot, slot, accessor); | 1964 mark_compact_collector()->RecordSlot(slot, slot, accessor); |
(...skipping 2168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4156 while (buffer != NULL) { | 4133 while (buffer != NULL) { |
4157 SlotsBuffer* next_buffer = buffer->next(); | 4134 SlotsBuffer* next_buffer = buffer->next(); |
4158 DeallocateBuffer(buffer); | 4135 DeallocateBuffer(buffer); |
4159 buffer = next_buffer; | 4136 buffer = next_buffer; |
4160 } | 4137 } |
4161 *buffer_address = NULL; | 4138 *buffer_address = NULL; |
4162 } | 4139 } |
4163 | 4140 |
4164 | 4141 |
4165 } } // namespace v8::internal | 4142 } } // namespace v8::internal |
OLD | NEW |