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

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

Issue 8017003: Cache multiple ElementsKind map transition per map. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback Created 9 years, 3 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 | « no previous file | 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 // If the pair (value, details) at index i, i+1 is not 1619 // If the pair (value, details) at index i, i+1 is not
1620 // a transition or null descriptor, mark the value. 1620 // a transition or null descriptor, mark the value.
1621 PropertyDetails details(Smi::cast(contents->get(i + 1))); 1621 PropertyDetails details(Smi::cast(contents->get(i + 1)));
1622 1622
1623 Object** slot = contents->data_start() + i; 1623 Object** slot = contents->data_start() + i;
1624 Object* value = *slot; 1624 Object* value = *slot;
1625 if (!value->IsHeapObject()) continue; 1625 if (!value->IsHeapObject()) continue;
1626 1626
1627 RecordSlot(slot, slot, *slot); 1627 RecordSlot(slot, slot, *slot);
1628 1628
1629 if (details.type() < FIRST_PHANTOM_PROPERTY_TYPE) { 1629 PropertyType type = details.type();
1630 if (type < FIRST_PHANTOM_PROPERTY_TYPE) {
1630 HeapObject* object = HeapObject::cast(value); 1631 HeapObject* object = HeapObject::cast(value);
1631 MarkBit mark = Marking::MarkBitFrom(HeapObject::cast(object)); 1632 MarkBit mark = Marking::MarkBitFrom(HeapObject::cast(object));
1632 if (!mark.Get()) { 1633 if (!mark.Get()) {
1633 SetMark(HeapObject::cast(object), mark); 1634 SetMark(HeapObject::cast(object), mark);
1634 marking_deque_.PushBlack(object); 1635 marking_deque_.PushBlack(object);
1635 } 1636 }
1637 } else if (type == ELEMENTS_TRANSITION && value->IsFixedArray()) {
1638 // For maps with multiple elements transitions, the transition maps are
1639 // stored in a FixedArray. Keep the fixed array alive but not the maps
1640 // that it refers to.
1641 HeapObject* object = HeapObject::cast(value);
1642 MarkBit mark = Marking::MarkBitFrom(HeapObject::cast(object));
1643 if (!mark.Get()) {
1644 SetMark(HeapObject::cast(object), mark);
1645 }
1636 } 1646 }
1637 } 1647 }
1638 // The DescriptorArray descriptors contains a pointer to its contents array, 1648 // The DescriptorArray descriptors contains a pointer to its contents array,
1639 // but the contents array is already marked. 1649 // but the contents array is already marked.
1640 marking_deque_.PushBlack(descriptors); 1650 marking_deque_.PushBlack(descriptors);
1641 } 1651 }
1642 1652
1643 1653
1644 void MarkCompactCollector::CreateBackPointers() { 1654 void MarkCompactCollector::CreateBackPointers() {
1645 HeapObjectIterator iterator(heap()->map_space()); 1655 HeapObjectIterator iterator(heap()->map_space());
(...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after
3818 while (buffer != NULL) { 3828 while (buffer != NULL) {
3819 SlotsBuffer* next_buffer = buffer->next(); 3829 SlotsBuffer* next_buffer = buffer->next();
3820 DeallocateBuffer(buffer); 3830 DeallocateBuffer(buffer);
3821 buffer = next_buffer; 3831 buffer = next_buffer;
3822 } 3832 }
3823 *buffer_address = NULL; 3833 *buffer_address = NULL;
3824 } 3834 }
3825 3835
3826 3836
3827 } } // namespace v8::internal 3837 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698