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

Side by Side Diff: src/mark-compact.cc

Issue 11072014: Reverting sharing of descriptor arrays: (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Bump version Created 8 years, 2 months 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/ia32/macro-assembler-ia32.cc ('k') | src/objects.h » ('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 // 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
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 (map_obj->owns_descriptors() && 1551 if (array != heap->empty_descriptor_array()) {
1552 array != heap->empty_descriptor_array()) {
1553 int fixed_array_size = array->Size(); 1552 int fixed_array_size = array->Size();
1554 heap->RecordObjectStats(FIXED_ARRAY_TYPE, 1553 heap->RecordObjectStats(FIXED_ARRAY_TYPE,
1555 DESCRIPTOR_ARRAY_SUB_TYPE, 1554 DESCRIPTOR_ARRAY_SUB_TYPE,
1556 fixed_array_size); 1555 fixed_array_size);
1557 } 1556 }
1558 if (map_obj->HasTransitionArray()) { 1557 if (map_obj->HasTransitionArray()) {
1559 int fixed_array_size = map_obj->transitions()->Size(); 1558 int fixed_array_size = map_obj->transitions()->Size();
1560 heap->RecordObjectStats(FIXED_ARRAY_TYPE, 1559 heap->RecordObjectStats(FIXED_ARRAY_TYPE,
1561 TRANSITION_ARRAY_SUB_TYPE, 1560 TRANSITION_ARRAY_SUB_TYPE,
1562 fixed_array_size); 1561 fixed_array_size);
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1936 base_marker()->MarkObjectAndPush(reinterpret_cast<HeapObject*>(obj)); 1935 base_marker()->MarkObjectAndPush(reinterpret_cast<HeapObject*>(obj));
1937 } 1936 }
1938 } 1937 }
1939 1938
1940 1939
1941 template <class T> 1940 template <class T>
1942 void Marker<T>::MarkTransitionArray(TransitionArray* transitions) { 1941 void Marker<T>::MarkTransitionArray(TransitionArray* transitions) {
1943 if (!base_marker()->MarkObjectWithoutPush(transitions)) return; 1942 if (!base_marker()->MarkObjectWithoutPush(transitions)) return;
1944 Object** transitions_start = transitions->data_start(); 1943 Object** transitions_start = transitions->data_start();
1945 1944
1946 // We don't have to record the descriptors_pointer slot since the cell space 1945 DescriptorArray* descriptors = transitions->descriptors();
1947 // is not compacted. 1946 base_marker()->MarkObjectAndPush(descriptors);
1948 JSGlobalPropertyCell* descriptors_cell = transitions->descriptors_pointer(); 1947 mark_compact_collector()->RecordSlot(
1949 base_marker()->MarkObjectAndPush(descriptors_cell); 1948 transitions_start, transitions->GetDescriptorsSlot(), descriptors);
1950 1949
1951 if (transitions->HasPrototypeTransitions()) { 1950 if (transitions->HasPrototypeTransitions()) {
1952 // Mark prototype transitions array but don't push it into marking stack. 1951 // Mark prototype transitions array but don't push it into marking stack.
1953 // This will make references from it weak. We will clean dead prototype 1952 // This will make references from it weak. We will clean dead prototype
1954 // transitions in ClearNonLiveTransitions. 1953 // transitions in ClearNonLiveTransitions.
1955 Object** proto_trans_slot = transitions->GetPrototypeTransitionsSlot(); 1954 Object** proto_trans_slot = transitions->GetPrototypeTransitionsSlot();
1956 HeapObject* prototype_transitions = HeapObject::cast(*proto_trans_slot); 1955 HeapObject* prototype_transitions = HeapObject::cast(*proto_trans_slot);
1957 base_marker()->MarkObjectWithoutPush(prototype_transitions); 1956 base_marker()->MarkObjectWithoutPush(prototype_transitions);
1958 mark_compact_collector()->RecordSlot( 1957 mark_compact_collector()->RecordSlot(
1959 transitions_start, proto_trans_slot, prototype_transitions); 1958 transitions_start, proto_trans_slot, prototype_transitions);
(...skipping 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after
4145 while (buffer != NULL) { 4144 while (buffer != NULL) {
4146 SlotsBuffer* next_buffer = buffer->next(); 4145 SlotsBuffer* next_buffer = buffer->next();
4147 DeallocateBuffer(buffer); 4146 DeallocateBuffer(buffer);
4148 buffer = next_buffer; 4147 buffer = next_buffer;
4149 } 4148 }
4150 *buffer_address = NULL; 4149 *buffer_address = NULL;
4151 } 4150 }
4152 4151
4153 4152
4154 } } // namespace v8::internal 4153 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698