enum_cache);
}
- // TODO(verwaest) Make sure we free unused transitions.
if (descriptors->elements_transition_map() != NULL) {
Object** transitions_slot = descriptors->GetTransitionsSlot();
Object* transitions = *transitions_slot;
- base_marker()->MarkObjectAndPush(
- reinterpret_cast<HeapObject*>(transitions));
mark_compact_collector()->RecordSlot(descriptor_start,
transitions_slot,
transitions);
bool DescriptorArray::IsConsistentWithBackPointers(Map* current_map) {
+ Map* elements_transition = elements_transition_map();
+ if (elements_transition != NULL &&
+ !CheckOneBackPointer(current_map, elements_transition)) {
+ return false;
+ }
for (int i = 0; i < number_of_descriptors(); ++i) {
switch (GetType(i)) {
case MAP_TRANSITION:
}
+void DescriptorArray::ClearElementsTransition() {
+ WRITE_FIELD(this, kTransitionsOffset, Smi::FromInt(0));
+}
+
+
Object** DescriptorArray::GetKeySlot(int descriptor_number) {
ASSERT(descriptor_number < number_of_descriptors());
return HeapObject::RawField(
DescriptorArray* d = DescriptorArray::cast(
*RawField(this, Map::kInstanceDescriptorsOrBitField3Offset));
if (d->IsEmpty()) return;
+ Map* elements_transition = d->elements_transition_map();
+ if (elements_transition != NULL &&
+ ClearBackPointer(heap, elements_transition)) {
+ d->ClearElementsTransition();
+ }
Smi* NullDescriptorDetails =
PropertyDetails(NONE, NULL_DESCRIPTOR).AsSmi();
for (int i = 0; i < d->number_of_descriptors(); ++i) {
inline bool MayContainTransitions();
DECL_ACCESSORS(elements_transition_map, Map)
+ inline void ClearElementsTransition();
// Returns the number of descriptors in the array.
int number_of_descriptors() {