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 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1541 | 1541 |
1542 template<> | 1542 template<> |
1543 class MarkCompactMarkingVisitor::ObjectStatsTracker< | 1543 class MarkCompactMarkingVisitor::ObjectStatsTracker< |
1544 MarkCompactMarkingVisitor::kVisitMap> { | 1544 MarkCompactMarkingVisitor::kVisitMap> { |
1545 public: | 1545 public: |
1546 static inline void Visit(Map* map, HeapObject* obj) { | 1546 static inline void Visit(Map* map, HeapObject* obj) { |
1547 Heap* heap = map->GetHeap(); | 1547 Heap* heap = map->GetHeap(); |
1548 Map* map_obj = Map::cast(obj); | 1548 Map* map_obj = Map::cast(obj); |
1549 ASSERT(map->instance_type() == MAP_TYPE); | 1549 ASSERT(map->instance_type() == MAP_TYPE); |
1550 DescriptorArray* array = map_obj->instance_descriptors(); | 1550 DescriptorArray* array = map_obj->instance_descriptors(); |
1551 if (array != heap->empty_descriptor_array()) { | 1551 if (map_obj->owns_descriptors() && |
| 1552 array != heap->empty_descriptor_array()) { |
1552 int fixed_array_size = array->Size(); | 1553 int fixed_array_size = array->Size(); |
1553 heap->RecordObjectStats(FIXED_ARRAY_TYPE, | 1554 heap->RecordObjectStats(FIXED_ARRAY_TYPE, |
1554 DESCRIPTOR_ARRAY_SUB_TYPE, | 1555 DESCRIPTOR_ARRAY_SUB_TYPE, |
1555 fixed_array_size); | 1556 fixed_array_size); |
1556 } | 1557 } |
1557 if (map_obj->HasTransitionArray()) { | 1558 if (map_obj->HasTransitionArray()) { |
1558 int fixed_array_size = map_obj->transitions()->Size(); | 1559 int fixed_array_size = map_obj->transitions()->Size(); |
1559 heap->RecordObjectStats(FIXED_ARRAY_TYPE, | 1560 heap->RecordObjectStats(FIXED_ARRAY_TYPE, |
1560 TRANSITION_ARRAY_SUB_TYPE, | 1561 TRANSITION_ARRAY_SUB_TYPE, |
1561 fixed_array_size); | 1562 fixed_array_size); |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1935 base_marker()->MarkObjectAndPush(reinterpret_cast<HeapObject*>(obj)); | 1936 base_marker()->MarkObjectAndPush(reinterpret_cast<HeapObject*>(obj)); |
1936 } | 1937 } |
1937 } | 1938 } |
1938 | 1939 |
1939 | 1940 |
1940 template <class T> | 1941 template <class T> |
1941 void Marker<T>::MarkTransitionArray(TransitionArray* transitions) { | 1942 void Marker<T>::MarkTransitionArray(TransitionArray* transitions) { |
1942 if (!base_marker()->MarkObjectWithoutPush(transitions)) return; | 1943 if (!base_marker()->MarkObjectWithoutPush(transitions)) return; |
1943 Object** transitions_start = transitions->data_start(); | 1944 Object** transitions_start = transitions->data_start(); |
1944 | 1945 |
1945 DescriptorArray* descriptors = transitions->descriptors(); | 1946 // We don't have to record the descriptors_pointer slot since the cell space |
1946 base_marker()->MarkObjectAndPush(descriptors); | 1947 // is not compacted. |
1947 mark_compact_collector()->RecordSlot( | 1948 JSGlobalPropertyCell* descriptors_cell = transitions->descriptors_pointer(); |
1948 transitions_start, transitions->GetDescriptorsSlot(), descriptors); | 1949 base_marker()->MarkObjectAndPush(descriptors_cell); |
1949 | 1950 |
1950 if (transitions->HasPrototypeTransitions()) { | 1951 if (transitions->HasPrototypeTransitions()) { |
1951 // Mark prototype transitions array but don't push it into marking stack. | 1952 // Mark prototype transitions array but don't push it into marking stack. |
1952 // This will make references from it weak. We will clean dead prototype | 1953 // This will make references from it weak. We will clean dead prototype |
1953 // transitions in ClearNonLiveTransitions. | 1954 // transitions in ClearNonLiveTransitions. |
1954 Object** proto_trans_slot = transitions->GetPrototypeTransitionsSlot(); | 1955 Object** proto_trans_slot = transitions->GetPrototypeTransitionsSlot(); |
1955 HeapObject* prototype_transitions = HeapObject::cast(*proto_trans_slot); | 1956 HeapObject* prototype_transitions = HeapObject::cast(*proto_trans_slot); |
1956 base_marker()->MarkObjectWithoutPush(prototype_transitions); | 1957 base_marker()->MarkObjectWithoutPush(prototype_transitions); |
1957 mark_compact_collector()->RecordSlot( | 1958 mark_compact_collector()->RecordSlot( |
1958 transitions_start, proto_trans_slot, prototype_transitions); | 1959 transitions_start, proto_trans_slot, prototype_transitions); |
(...skipping 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4144 while (buffer != NULL) { | 4145 while (buffer != NULL) { |
4145 SlotsBuffer* next_buffer = buffer->next(); | 4146 SlotsBuffer* next_buffer = buffer->next(); |
4146 DeallocateBuffer(buffer); | 4147 DeallocateBuffer(buffer); |
4147 buffer = next_buffer; | 4148 buffer = next_buffer; |
4148 } | 4149 } |
4149 *buffer_address = NULL; | 4150 *buffer_address = NULL; |
4150 } | 4151 } |
4151 | 4152 |
4152 | 4153 |
4153 } } // namespace v8::internal | 4154 } } // namespace v8::internal |
OLD | NEW |