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

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

Issue 10444055: Promoting elements transitions to their own field. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: renaming SearchMode fields and moving it into descriptor array class Created 8 years, 6 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 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1876 if (descriptors->HasEnumCache()) { 1876 if (descriptors->HasEnumCache()) {
1877 Object** enum_cache_slot = descriptors->GetEnumCacheSlot(); 1877 Object** enum_cache_slot = descriptors->GetEnumCacheSlot();
1878 Object* enum_cache = *enum_cache_slot; 1878 Object* enum_cache = *enum_cache_slot;
1879 base_marker()->MarkObjectAndPush( 1879 base_marker()->MarkObjectAndPush(
1880 reinterpret_cast<HeapObject*>(enum_cache)); 1880 reinterpret_cast<HeapObject*>(enum_cache));
1881 mark_compact_collector()->RecordSlot(descriptor_start, 1881 mark_compact_collector()->RecordSlot(descriptor_start,
1882 enum_cache_slot, 1882 enum_cache_slot,
1883 enum_cache); 1883 enum_cache);
1884 } 1884 }
1885 1885
1886 // TODO(verwaest) Make sure we free unused transitions.
1887 if (descriptors->elements_transition_map() != NULL) {
1888 Object** transitions_slot = descriptors->GetTransitionsSlot();
1889 Object* transitions = *transitions_slot;
1890 base_marker()->MarkObjectAndPush(
1891 reinterpret_cast<HeapObject*>(transitions));
1892 mark_compact_collector()->RecordSlot(descriptor_start,
1893 transitions_slot,
1894 transitions);
1895 }
1896
1886 // If the descriptor contains a transition (value is a Map), we don't mark the 1897 // If the descriptor contains a transition (value is a Map), we don't mark the
1887 // value as live. It might be set to the NULL_DESCRIPTOR in 1898 // value as live. It might be set to the NULL_DESCRIPTOR in
1888 // ClearNonLiveTransitions later. 1899 // ClearNonLiveTransitions later.
1889 for (int i = 0; i < descriptors->number_of_descriptors(); ++i) { 1900 for (int i = 0; i < descriptors->number_of_descriptors(); ++i) {
1890 Object** key_slot = descriptors->GetKeySlot(i); 1901 Object** key_slot = descriptors->GetKeySlot(i);
1891 Object* key = *key_slot; 1902 Object* key = *key_slot;
1892 if (key->IsHeapObject()) { 1903 if (key->IsHeapObject()) {
1893 base_marker()->MarkObjectAndPush(reinterpret_cast<HeapObject*>(key)); 1904 base_marker()->MarkObjectAndPush(reinterpret_cast<HeapObject*>(key));
1894 mark_compact_collector()->RecordSlot(descriptor_start, key_slot, key); 1905 mark_compact_collector()->RecordSlot(descriptor_start, key_slot, key);
1895 } 1906 }
(...skipping 18 matching lines...) Expand all
1914 break; 1925 break;
1915 case CALLBACKS: 1926 case CALLBACKS:
1916 if (!value->IsAccessorPair()) { 1927 if (!value->IsAccessorPair()) {
1917 base_marker()->MarkObjectAndPush(value); 1928 base_marker()->MarkObjectAndPush(value);
1918 } else if (base_marker()->MarkObjectWithoutPush(value)) { 1929 } else if (base_marker()->MarkObjectWithoutPush(value)) {
1919 AccessorPair* accessors = AccessorPair::cast(value); 1930 AccessorPair* accessors = AccessorPair::cast(value);
1920 MarkAccessorPairSlot(accessors, AccessorPair::kGetterOffset); 1931 MarkAccessorPairSlot(accessors, AccessorPair::kGetterOffset);
1921 MarkAccessorPairSlot(accessors, AccessorPair::kSetterOffset); 1932 MarkAccessorPairSlot(accessors, AccessorPair::kSetterOffset);
1922 } 1933 }
1923 break; 1934 break;
1924 case ELEMENTS_TRANSITION:
1925 // For maps with multiple elements transitions, the transition maps are
1926 // stored in a FixedArray. Keep the fixed array alive but not the maps
1927 // that it refers to.
1928 if (value->IsFixedArray()) base_marker()->MarkObjectWithoutPush(value);
1929 break;
1930 case MAP_TRANSITION: 1935 case MAP_TRANSITION:
1931 case CONSTANT_TRANSITION: 1936 case CONSTANT_TRANSITION:
1932 case NULL_DESCRIPTOR: 1937 case NULL_DESCRIPTOR:
1933 break; 1938 break;
1934 } 1939 }
1935 } 1940 }
1936 } 1941 }
1937 1942
1938 1943
1939 template <class T> 1944 template <class T>
(...skipping 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after
4118 while (buffer != NULL) { 4123 while (buffer != NULL) {
4119 SlotsBuffer* next_buffer = buffer->next(); 4124 SlotsBuffer* next_buffer = buffer->next();
4120 DeallocateBuffer(buffer); 4125 DeallocateBuffer(buffer);
4121 buffer = next_buffer; 4126 buffer = next_buffer;
4122 } 4127 }
4123 *buffer_address = NULL; 4128 *buffer_address = NULL;
4124 } 4129 }
4125 4130
4126 4131
4127 } } // namespace v8::internal 4132 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698