Chromium Code Reviews| Index: runtime/vm/object_graph.cc |
| diff --git a/runtime/vm/object_graph.cc b/runtime/vm/object_graph.cc |
| index 6c4699778345b30fac3d8b6a0f4c7ffc4006ed9f..145b84e3ef4570e9b12a99950c36390a9f924011 100644 |
| --- a/runtime/vm/object_graph.cc |
| +++ b/runtime/vm/object_graph.cc |
| @@ -511,9 +511,13 @@ class WriteGraphVisitor : public ObjectGraph::Visitor { |
| }; |
| -intptr_t ObjectGraph::Serialize(WriteStream* stream) { |
| +intptr_t ObjectGraph::Serialize(WriteStream* stream, bool collect_garbage) { |
| + if (collect_garbage) { |
| + isolate()->heap()->CollectAllGarbage(); |
| + } |
| // Current encoding assumes objects do not move, so promote everything to old. |
| isolate()->heap()->new_space()->Evacuate(); |
|
Ivan Posva
2016/03/18 23:38:58
You could also run a scavenge followed by the call
|
| + |
| WriteGraphVisitor visitor(isolate(), stream); |
| stream->WriteUnsigned(kObjectAlignment); |
| stream->WriteUnsigned(0); |