| Index: src/serialize.cc
|
| ===================================================================
|
| --- src/serialize.cc (revision 977)
|
| +++ src/serialize.cc (working copy)
|
| @@ -933,19 +933,17 @@
|
| // Serialize objects by writing them into the stream.
|
|
|
| void Serializer::VisitPointers(Object** start, Object** end) {
|
| - bool root = root_;
|
| - root_ = false;
|
| + TempAssign<bool> temp_root(&root_, false);
|
| for (Object** p = start; p < end; ++p) {
|
| bool serialized;
|
| Address a = Encode(*p, &serialized);
|
| - if (root) {
|
| + if (temp_root.old_value()) {
|
| roots_++;
|
| // If the object was not just serialized,
|
| // write its encoded address instead.
|
| if (!serialized) PutEncodedAddress(a);
|
| }
|
| }
|
| - root_ = root;
|
| }
|
|
|
|
|
| @@ -1236,10 +1234,9 @@
|
|
|
|
|
| void Deserializer::VisitPointers(Object** start, Object** end) {
|
| - bool root = root_;
|
| - root_ = false;
|
| + TempAssign<bool> temp_root(&root_, false);
|
| for (Object** p = start; p < end; ++p) {
|
| - if (root) {
|
| + if (temp_root.old_value()) {
|
| roots_++;
|
| // Read the next object or pointer from the stream
|
| // pointer in the stream.
|
| @@ -1256,7 +1253,6 @@
|
| *p = Resolve(reinterpret_cast<Address>(*p));
|
| }
|
| }
|
| - root_ = root;
|
| }
|
|
|
|
|
|
|