Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index aab918e231badf963241cf7e08c564180bdb5e86..e457ea9620a8a28e574a631e402be2a42469f4b1 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -9674,15 +9674,23 @@ bool Map::EquivalentToForNormalization(Map* other, |
void ConstantPoolArray::ConstantPoolIterateBody(ObjectVisitor* v) { |
- ConstantPoolArray::Iterator code_iter(this, ConstantPoolArray::CODE_PTR); |
- while (!code_iter.is_finished()) { |
- v->VisitCodeEntry(reinterpret_cast<Address>( |
- RawFieldOfElementAt(code_iter.next_index()))); |
- } |
- |
- ConstantPoolArray::Iterator heap_iter(this, ConstantPoolArray::HEAP_PTR); |
- while (!heap_iter.is_finished()) { |
- v->VisitPointer(RawFieldOfElementAt(heap_iter.next_index())); |
+ // Unfortunately the serializer relies on pointers being visited in-order, |
ulan
2014/07/01 13:29:48
Since we iterating first code pointers and the hea
rmcilroy
2014/07/02 16:35:55
In-order means that we visit the entries of the co
ulan
2014/07/03 09:19:55
Yes, the new comment makes it clear.
|
+ // so we have to iterate both the code and heap pointers in the small section |
+ // before doing so in the extended section. |
+ for (int s = 0; s <= final_section(); ++s) { |
+ LayoutSection section = static_cast<LayoutSection>(s); |
+ ConstantPoolArray::Iterator code_iter( |
+ this, ConstantPoolArray::CODE_PTR, section); |
+ while (!code_iter.is_finished()) { |
+ v->VisitCodeEntry(reinterpret_cast<Address>( |
+ RawFieldOfElementAt(code_iter.next_index()))); |
+ } |
+ |
+ ConstantPoolArray::Iterator heap_iter( |
+ this, ConstantPoolArray::HEAP_PTR, section); |
+ while (!heap_iter.is_finished()) { |
+ v->VisitPointer(RawFieldOfElementAt(heap_iter.next_index())); |
+ } |
} |
} |