| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 7005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7016 | 7016 |
| 7017 Map* Next() { | 7017 Map* Next() { |
| 7018 ASSERT(IsIterating()); | 7018 ASSERT(IsIterating()); |
| 7019 int index = Smi::cast(*TransitionArrayHeader())->value(); | 7019 int index = Smi::cast(*TransitionArrayHeader())->value(); |
| 7020 int number_of_transitions = transition_array_->number_of_transitions(); | 7020 int number_of_transitions = transition_array_->number_of_transitions(); |
| 7021 while (index < number_of_transitions) { | 7021 while (index < number_of_transitions) { |
| 7022 *TransitionArrayHeader() = Smi::FromInt(index + 1); | 7022 *TransitionArrayHeader() = Smi::FromInt(index + 1); |
| 7023 return transition_array_->GetTarget(index); | 7023 return transition_array_->GetTarget(index); |
| 7024 } | 7024 } |
| 7025 | 7025 |
| 7026 if (index == number_of_transitions && | |
| 7027 transition_array_->HasElementsTransition()) { | |
| 7028 Map* elements_transition = transition_array_->elements_transition(); | |
| 7029 *TransitionArrayHeader() = Smi::FromInt(index + 1); | |
| 7030 return elements_transition; | |
| 7031 } | |
| 7032 *TransitionArrayHeader() = transition_array_->GetHeap()->fixed_array_map(); | 7026 *TransitionArrayHeader() = transition_array_->GetHeap()->fixed_array_map(); |
| 7033 return NULL; | 7027 return NULL; |
| 7034 } | 7028 } |
| 7035 | 7029 |
| 7036 private: | 7030 private: |
| 7037 Object** TransitionArrayHeader() { | 7031 Object** TransitionArrayHeader() { |
| 7038 return HeapObject::RawField(transition_array_, TransitionArray::kMapOffset); | 7032 return HeapObject::RawField(transition_array_, TransitionArray::kMapOffset); |
| 7039 } | 7033 } |
| 7040 | 7034 |
| 7041 TransitionArray* transition_array_; | 7035 TransitionArray* transition_array_; |
| (...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9138 t->SetKey(transition_index, key); | 9132 t->SetKey(transition_index, key); |
| 9139 Object** key_slot = t->GetKeySlot(transition_index); | 9133 Object** key_slot = t->GetKeySlot(transition_index); |
| 9140 collector->RecordSlot(key_slot, key_slot, key); | 9134 collector->RecordSlot(key_slot, key_slot, key); |
| 9141 // Target slots do not need to be recorded since maps are not compacted. | 9135 // Target slots do not need to be recorded since maps are not compacted. |
| 9142 t->SetTarget(transition_index, t->GetTarget(i)); | 9136 t->SetTarget(transition_index, t->GetTarget(i)); |
| 9143 } | 9137 } |
| 9144 transition_index++; | 9138 transition_index++; |
| 9145 } | 9139 } |
| 9146 } | 9140 } |
| 9147 | 9141 |
| 9148 if (t->HasElementsTransition() && | 9142 // If there are no transitions to be cleared, return. |
| 9149 ClearBackPointer(heap, t->elements_transition())) { | 9143 // TODO(verwaest) Should be an assert, otherwise back pointers are not |
| 9150 if (t->elements_transition()->instance_descriptors() == descriptors) { | 9144 // properly cleared. |
| 9151 descriptors_owner_died = true; | 9145 if (transition_index == t->number_of_transitions()) return; |
| 9152 } | |
| 9153 t->ClearElementsTransition(); | |
| 9154 } else { | |
| 9155 // If there are no transitions to be cleared, return. | |
| 9156 // TODO(verwaest) Should be an assert, otherwise back pointers are not | |
| 9157 // properly cleared. | |
| 9158 if (transition_index == t->number_of_transitions()) return; | |
| 9159 } | |
| 9160 | 9146 |
| 9161 int number_of_own_descriptors = NumberOfOwnDescriptors(); | 9147 int number_of_own_descriptors = NumberOfOwnDescriptors(); |
| 9162 | 9148 |
| 9163 if (descriptors_owner_died) { | 9149 if (descriptors_owner_died) { |
| 9164 if (number_of_own_descriptors > 0) { | 9150 if (number_of_own_descriptors > 0) { |
| 9165 TrimDescriptorArray(heap, this, descriptors, number_of_own_descriptors); | 9151 TrimDescriptorArray(heap, this, descriptors, number_of_own_descriptors); |
| 9166 ASSERT(descriptors->number_of_descriptors() == number_of_own_descriptors); | 9152 ASSERT(descriptors->number_of_descriptors() == number_of_own_descriptors); |
| 9167 } else { | 9153 } else { |
| 9168 ASSERT(descriptors == GetHeap()->empty_descriptor_array()); | 9154 ASSERT(descriptors == GetHeap()->empty_descriptor_array()); |
| 9169 } | 9155 } |
| (...skipping 6802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15972 | 15958 |
| 15973 void PropertyCell::AddDependentCode(Handle<Code> code) { | 15959 void PropertyCell::AddDependentCode(Handle<Code> code) { |
| 15974 Handle<DependentCode> codes = DependentCode::Insert( | 15960 Handle<DependentCode> codes = DependentCode::Insert( |
| 15975 Handle<DependentCode>(dependent_code()), | 15961 Handle<DependentCode>(dependent_code()), |
| 15976 DependentCode::kPropertyCellChangedGroup, code); | 15962 DependentCode::kPropertyCellChangedGroup, code); |
| 15977 if (*codes != dependent_code()) set_dependent_code(*codes); | 15963 if (*codes != dependent_code()) set_dependent_code(*codes); |
| 15978 } | 15964 } |
| 15979 | 15965 |
| 15980 | 15966 |
| 15981 } } // namespace v8::internal | 15967 } } // namespace v8::internal |
| OLD | NEW |