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

Unified Diff: src/mark-compact.cc

Issue 10697015: Separating transitions from descriptors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Using WhitenessWitness in TransitionArray code. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mark-compact.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index d0b4ae48b8446815c415b68a98975f302064e03f..a9d0c166c8cc96fa440de8df46cc59ec99831cc9 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -1892,12 +1892,13 @@ void Marker<T>::MarkDescriptorArray(DescriptorArray* descriptors) {
enum_cache);
}
- if (descriptors->elements_transition_map() != NULL) {
+ if (descriptors->HasTransitionArray()) {
Object** transitions_slot = descriptors->GetTransitionsSlot();
Object* transitions = *transitions_slot;
mark_compact_collector()->RecordSlot(descriptor_start,
transitions_slot,
transitions);
+ MarkTransitionArray(reinterpret_cast<TransitionArray*>(transitions));
}
// If the descriptor contains a transition (value is a Map), we don't mark the
@@ -1906,7 +1907,7 @@ void Marker<T>::MarkDescriptorArray(DescriptorArray* descriptors) {
Object** key_slot = descriptors->GetKeySlot(i);
Object* key = *key_slot;
if (key->IsHeapObject()) {
- base_marker()->MarkObjectAndPush(reinterpret_cast<HeapObject*>(key));
+ base_marker()->MarkObjectAndPush(HeapObject::cast(key));
mark_compact_collector()->RecordSlot(descriptor_start, key_slot, key);
}
@@ -1937,9 +1938,7 @@ void Marker<T>::MarkDescriptorArray(DescriptorArray* descriptors) {
MarkAccessorPairSlot(accessors, AccessorPair::kSetterOffset);
}
break;
- case MAP_TRANSITION:
- case CONSTANT_TRANSITION:
- break;
+ case TRANSITION:
case NONEXISTENT:
UNREACHABLE();
break;
@@ -1947,6 +1946,42 @@ void Marker<T>::MarkDescriptorArray(DescriptorArray* descriptors) {
}
}
+template <class T>
+void Marker<T>::MarkTransitionArray(TransitionArray* transitions) {
+ if (!base_marker()->MarkObjectWithoutPush(transitions)) return;
+ Object** transitions_start = transitions->data_start();
+
+ if (transitions->HasElementsTransition()) {
+ mark_compact_collector()->RecordSlot(transitions_start,
+ transitions->GetElementsSlot(),
+ transitions->elements_transition());
+ }
+
+ for (int i = 0; i < transitions->number_of_transitions(); ++i) {
+ Object** key_slot = transitions->GetKeySlot(i);
+ Object* key = *key_slot;
+ if (key->IsHeapObject()) {
+ base_marker()->MarkObjectAndPush(HeapObject::cast(key));
+ mark_compact_collector()->RecordSlot(transitions_start, key_slot, key);
+ }
+
+ Object** value_slot = transitions->GetValueSlot(i);
+ if (!(*value_slot)->IsHeapObject()) continue;
+ HeapObject* value = HeapObject::cast(*value_slot);
+
+ if (value->IsAccessorPair()) {
+ mark_compact_collector()->RecordSlot(transitions_start,
+ value_slot,
+ value);
+
+ base_marker()->MarkObjectWithoutPush(value);
+ AccessorPair* accessors = AccessorPair::cast(value);
+ MarkAccessorPairSlot(accessors, AccessorPair::kGetterOffset);
+ MarkAccessorPairSlot(accessors, AccessorPair::kSetterOffset);
+ }
+ }
+}
+
template <class T>
void Marker<T>::MarkAccessorPairSlot(AccessorPair* accessors, int offset) {
« no previous file with comments | « src/mark-compact.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698