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

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

Issue 6685073: Remember and reuse derived map for external arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback Created 9 years, 9 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/factory.cc ('k') | src/mirror-debugger.js » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 ASSERT(descriptors != HEAP->raw_unchecked_empty_descriptor_array()); 1094 ASSERT(descriptors != HEAP->raw_unchecked_empty_descriptor_array());
1095 SetMark(descriptors); 1095 SetMark(descriptors);
1096 1096
1097 FixedArray* contents = reinterpret_cast<FixedArray*>( 1097 FixedArray* contents = reinterpret_cast<FixedArray*>(
1098 descriptors->get(DescriptorArray::kContentArrayIndex)); 1098 descriptors->get(DescriptorArray::kContentArrayIndex));
1099 ASSERT(contents->IsHeapObject()); 1099 ASSERT(contents->IsHeapObject());
1100 ASSERT(!contents->IsMarked()); 1100 ASSERT(!contents->IsMarked());
1101 ASSERT(contents->IsFixedArray()); 1101 ASSERT(contents->IsFixedArray());
1102 ASSERT(contents->length() >= 2); 1102 ASSERT(contents->length() >= 2);
1103 SetMark(contents); 1103 SetMark(contents);
1104 // Contents contains (value, details) pairs. If the details say that 1104 // Contents contains (value, details) pairs. If the details say that the type
1105 // the type of descriptor is MAP_TRANSITION, CONSTANT_TRANSITION, or 1105 // of descriptor is MAP_TRANSITION, CONSTANT_TRANSITION,
1106 // NULL_DESCRIPTOR, we don't mark the value as live. Only for 1106 // EXTERNAL_ARRAY_TRANSITION or NULL_DESCRIPTOR, we don't mark the value as
1107 // MAP_TRANSITION and CONSTANT_TRANSITION is the value an Object* (a 1107 // live. Only for MAP_TRANSITION, EXTERNAL_ARRAY_TRANSITION and
1108 // Map*). 1108 // CONSTANT_TRANSITION is the value an Object* (a Map*).
1109 for (int i = 0; i < contents->length(); i += 2) { 1109 for (int i = 0; i < contents->length(); i += 2) {
1110 // If the pair (value, details) at index i, i+1 is not 1110 // If the pair (value, details) at index i, i+1 is not
1111 // a transition or null descriptor, mark the value. 1111 // a transition or null descriptor, mark the value.
1112 PropertyDetails details(Smi::cast(contents->get(i + 1))); 1112 PropertyDetails details(Smi::cast(contents->get(i + 1)));
1113 if (details.type() < FIRST_PHANTOM_PROPERTY_TYPE) { 1113 if (details.type() < FIRST_PHANTOM_PROPERTY_TYPE) {
1114 HeapObject* object = reinterpret_cast<HeapObject*>(contents->get(i)); 1114 HeapObject* object = reinterpret_cast<HeapObject*>(contents->get(i));
1115 if (object->IsHeapObject() && !object->IsMarked()) { 1115 if (object->IsHeapObject() && !object->IsMarked()) {
1116 SetMark(object); 1116 SetMark(object);
1117 marking_stack_.Push(object); 1117 marking_stack_.Push(object);
1118 } 1118 }
(...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after
3067 } 3067 }
3068 3068
3069 3069
3070 void MarkCompactCollector::Initialize() { 3070 void MarkCompactCollector::Initialize() {
3071 StaticPointersToNewGenUpdatingVisitor::Initialize(); 3071 StaticPointersToNewGenUpdatingVisitor::Initialize();
3072 StaticMarkingVisitor::Initialize(); 3072 StaticMarkingVisitor::Initialize();
3073 } 3073 }
3074 3074
3075 3075
3076 } } // namespace v8::internal 3076 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/mirror-debugger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698