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

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: fix handling of empty property name 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
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 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 ASSERT(descriptors != HEAP->raw_unchecked_empty_descriptor_array()); 1093 ASSERT(descriptors != HEAP->raw_unchecked_empty_descriptor_array());
1094 SetMark(descriptors); 1094 SetMark(descriptors);
1095 1095
1096 FixedArray* contents = reinterpret_cast<FixedArray*>( 1096 FixedArray* contents = reinterpret_cast<FixedArray*>(
1097 descriptors->get(DescriptorArray::kContentArrayIndex)); 1097 descriptors->get(DescriptorArray::kContentArrayIndex));
1098 ASSERT(contents->IsHeapObject()); 1098 ASSERT(contents->IsHeapObject());
1099 ASSERT(!contents->IsMarked()); 1099 ASSERT(!contents->IsMarked());
1100 ASSERT(contents->IsFixedArray()); 1100 ASSERT(contents->IsFixedArray());
1101 ASSERT(contents->length() >= 2); 1101 ASSERT(contents->length() >= 2);
1102 SetMark(contents); 1102 SetMark(contents);
1103 // Contents contains (value, details) pairs. If the details say that 1103 // Contents contains (value, details) pairs. If the details say that the type
1104 // the type of descriptor is MAP_TRANSITION, CONSTANT_TRANSITION, or 1104 // of descriptor is MAP_TRANSITION, CONSTANT_TRANSITION,
1105 // NULL_DESCRIPTOR, we don't mark the value as live. Only for 1105 // EXTERNAL_ARRAY_TRANSITION or NULL_DESCRIPTOR, we don't mark the value as
1106 // MAP_TRANSITION and CONSTANT_TRANSITION is the value an Object* (a 1106 // live. Only for MAP_TRANSITION, EXTERNAL_ARRAY_TRANSITION and
1107 // Map*). 1107 // CONSTANT_TRANSITION is the value an Object* (a Map*).
1108 for (int i = 0; i < contents->length(); i += 2) { 1108 for (int i = 0; i < contents->length(); i += 2) {
1109 // If the pair (value, details) at index i, i+1 is not 1109 // If the pair (value, details) at index i, i+1 is not
1110 // a transition or null descriptor, mark the value. 1110 // a transition or null descriptor, mark the value.
1111 PropertyDetails details(Smi::cast(contents->get(i + 1))); 1111 PropertyDetails details(Smi::cast(contents->get(i + 1)));
1112 if (details.type() < FIRST_PHANTOM_PROPERTY_TYPE) { 1112 if (details.type() < FIRST_PHANTOM_PROPERTY_TYPE) {
1113 HeapObject* object = reinterpret_cast<HeapObject*>(contents->get(i)); 1113 HeapObject* object = reinterpret_cast<HeapObject*>(contents->get(i));
1114 if (object->IsHeapObject() && !object->IsMarked()) { 1114 if (object->IsHeapObject() && !object->IsMarked()) {
1115 SetMark(object); 1115 SetMark(object);
1116 marking_stack_.Push(object); 1116 marking_stack_.Push(object);
1117 } 1117 }
(...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after
3066 } 3066 }
3067 3067
3068 3068
3069 void MarkCompactCollector::Initialize() { 3069 void MarkCompactCollector::Initialize() {
3070 StaticPointersToNewGenUpdatingVisitor::Initialize(); 3070 StaticPointersToNewGenUpdatingVisitor::Initialize();
3071 StaticMarkingVisitor::Initialize(); 3071 StaticMarkingVisitor::Initialize();
3072 } 3072 }
3073 3073
3074 3074
3075 } } // namespace v8::internal 3075 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698