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

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

Issue 10575032: In-place shrinking of descriptor arrays with non-live transitions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing comments Created 8 years, 5 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
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 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after
1883 1883
1884 if (descriptors->elements_transition_map() != NULL) { 1884 if (descriptors->elements_transition_map() != NULL) {
1885 Object** transitions_slot = descriptors->GetTransitionsSlot(); 1885 Object** transitions_slot = descriptors->GetTransitionsSlot();
1886 Object* transitions = *transitions_slot; 1886 Object* transitions = *transitions_slot;
1887 mark_compact_collector()->RecordSlot(descriptor_start, 1887 mark_compact_collector()->RecordSlot(descriptor_start,
1888 transitions_slot, 1888 transitions_slot,
1889 transitions); 1889 transitions);
1890 } 1890 }
1891 1891
1892 // If the descriptor contains a transition (value is a Map), we don't mark the 1892 // If the descriptor contains a transition (value is a Map), we don't mark the
1893 // value as live. It might be set to the NULL_DESCRIPTOR in 1893 // value as live. It might be removed by ClearNonLiveTransitions later.
1894 // ClearNonLiveTransitions later.
1895 for (int i = 0; i < descriptors->number_of_descriptors(); ++i) { 1894 for (int i = 0; i < descriptors->number_of_descriptors(); ++i) {
1896 Object** key_slot = descriptors->GetKeySlot(i); 1895 Object** key_slot = descriptors->GetKeySlot(i);
1897 Object* key = *key_slot; 1896 Object* key = *key_slot;
1898 if (key->IsHeapObject()) { 1897 if (key->IsHeapObject()) {
1899 base_marker()->MarkObjectAndPush(reinterpret_cast<HeapObject*>(key)); 1898 base_marker()->MarkObjectAndPush(reinterpret_cast<HeapObject*>(key));
1900 mark_compact_collector()->RecordSlot(descriptor_start, key_slot, key); 1899 mark_compact_collector()->RecordSlot(descriptor_start, key_slot, key);
1901 } 1900 }
1902 1901
1903 Object** value_slot = descriptors->GetValueSlot(i); 1902 Object** value_slot = descriptors->GetValueSlot(i);
1904 if (!(*value_slot)->IsHeapObject()) continue; 1903 if (!(*value_slot)->IsHeapObject()) continue;
(...skipping 17 matching lines...) Expand all
1922 if (!value->IsAccessorPair()) { 1921 if (!value->IsAccessorPair()) {
1923 base_marker()->MarkObjectAndPush(value); 1922 base_marker()->MarkObjectAndPush(value);
1924 } else if (base_marker()->MarkObjectWithoutPush(value)) { 1923 } else if (base_marker()->MarkObjectWithoutPush(value)) {
1925 AccessorPair* accessors = AccessorPair::cast(value); 1924 AccessorPair* accessors = AccessorPair::cast(value);
1926 MarkAccessorPairSlot(accessors, AccessorPair::kGetterOffset); 1925 MarkAccessorPairSlot(accessors, AccessorPair::kGetterOffset);
1927 MarkAccessorPairSlot(accessors, AccessorPair::kSetterOffset); 1926 MarkAccessorPairSlot(accessors, AccessorPair::kSetterOffset);
1928 } 1927 }
1929 break; 1928 break;
1930 case MAP_TRANSITION: 1929 case MAP_TRANSITION:
1931 case CONSTANT_TRANSITION: 1930 case CONSTANT_TRANSITION:
1932 case NULL_DESCRIPTOR: 1931 break;
1932 case NONEXISTENT:
1933 UNREACHABLE();
1933 break; 1934 break;
1934 } 1935 }
1935 } 1936 }
1936 } 1937 }
1937 1938
1938 1939
1939 template <class T> 1940 template <class T>
1940 void Marker<T>::MarkAccessorPairSlot(AccessorPair* accessors, int offset) { 1941 void Marker<T>::MarkAccessorPairSlot(AccessorPair* accessors, int offset) {
1941 Object** slot = HeapObject::RawField(accessors, offset); 1942 Object** slot = HeapObject::RawField(accessors, offset);
1942 HeapObject* accessor = HeapObject::cast(*slot); 1943 HeapObject* accessor = HeapObject::cast(*slot);
(...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after
4119 while (buffer != NULL) { 4120 while (buffer != NULL) {
4120 SlotsBuffer* next_buffer = buffer->next(); 4121 SlotsBuffer* next_buffer = buffer->next();
4121 DeallocateBuffer(buffer); 4122 DeallocateBuffer(buffer);
4122 buffer = next_buffer; 4123 buffer = next_buffer;
4123 } 4124 }
4124 *buffer_address = NULL; 4125 *buffer_address = NULL;
4125 } 4126 }
4126 4127
4127 4128
4128 } } // namespace v8::internal 4129 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698