| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/object_graph.h" | 5 #include "vm/object_graph.h" |
| 6 | 6 |
| 7 #include "vm/dart.h" | 7 #include "vm/dart.h" |
| 8 #include "vm/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
| 9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 isolate()->heap()->new_space()->Evacuate(); | 627 isolate()->heap()->new_space()->Evacuate(); |
| 628 HeapIterationScope iteration_scope(Thread::Current(), true); | 628 HeapIterationScope iteration_scope(Thread::Current(), true); |
| 629 | 629 |
| 630 RawObject* kRootAddress = reinterpret_cast<RawObject*>(kHeapObjectTag); | 630 RawObject* kRootAddress = reinterpret_cast<RawObject*>(kHeapObjectTag); |
| 631 const intptr_t kRootCid = kIllegalCid; | 631 const intptr_t kRootCid = kIllegalCid; |
| 632 RawObject* kStackAddress = | 632 RawObject* kStackAddress = |
| 633 reinterpret_cast<RawObject*>(kObjectAlignment + kHeapObjectTag); | 633 reinterpret_cast<RawObject*>(kObjectAlignment + kHeapObjectTag); |
| 634 | 634 |
| 635 stream->WriteUnsigned(kObjectAlignment); | 635 stream->WriteUnsigned(kObjectAlignment); |
| 636 stream->WriteUnsigned(kStackCid); | 636 stream->WriteUnsigned(kStackCid); |
| 637 stream->WriteUnsigned(kFieldCid); |
| 638 stream->WriteUnsigned(isolate()->class_table()->NumCids()); |
| 637 | 639 |
| 638 if (roots == kVM) { | 640 if (roots == kVM) { |
| 639 // Write root "object". | 641 // Write root "object". |
| 640 WriteHeader(kRootAddress, 0, kRootCid, stream); | 642 WriteHeader(kRootAddress, 0, kRootCid, stream); |
| 641 WritePointerVisitor ptr_writer(isolate(), stream, false); | 643 WritePointerVisitor ptr_writer(isolate(), stream, false); |
| 642 isolate()->VisitObjectPointers(&ptr_writer, false); | 644 isolate()->VisitObjectPointers(&ptr_writer, false); |
| 643 stream->WriteUnsigned(0); | 645 stream->WriteUnsigned(0); |
| 644 } else { | 646 } else { |
| 645 { | 647 { |
| 646 // Write root "object". | 648 // Write root "object". |
| (...skipping 24 matching lines...) Expand all Loading... |
| 671 intptr_t object_count = visitor.count(); | 673 intptr_t object_count = visitor.count(); |
| 672 if (roots == kVM) { | 674 if (roots == kVM) { |
| 673 object_count += 1; // root | 675 object_count += 1; // root |
| 674 } else { | 676 } else { |
| 675 object_count += 2; // root and stack | 677 object_count += 2; // root and stack |
| 676 } | 678 } |
| 677 return object_count; | 679 return object_count; |
| 678 } | 680 } |
| 679 | 681 |
| 680 } // namespace dart | 682 } // namespace dart |
| OLD | NEW |