OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/heap.h" | 5 #include "vm/heap.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 UNREACHABLE(); | 646 UNREACHABLE(); |
647 return ""; | 647 return ""; |
648 } | 648 } |
649 } | 649 } |
650 | 650 |
651 | 651 |
652 int64_t Heap::PeerCount() const { | 652 int64_t Heap::PeerCount() const { |
653 return new_weak_tables_[kPeers]->count() + old_weak_tables_[kPeers]->count(); | 653 return new_weak_tables_[kPeers]->count() + old_weak_tables_[kPeers]->count(); |
654 } | 654 } |
655 | 655 |
656 | 656 #if !defined(HASH_IN_OBJECT_HEADER) |
657 int64_t Heap::HashCount() const { | 657 int64_t Heap::HashCount() const { |
658 return new_weak_tables_[kHashes]->count() + | 658 return new_weak_tables_[kHashes]->count() + |
659 old_weak_tables_[kHashes]->count(); | 659 old_weak_tables_[kHashes]->count(); |
660 } | 660 } |
| 661 #endif |
661 | 662 |
662 | 663 |
663 int64_t Heap::ObjectIdCount() const { | 664 int64_t Heap::ObjectIdCount() const { |
664 return new_weak_tables_[kObjectIds]->count() + | 665 return new_weak_tables_[kObjectIds]->count() + |
665 old_weak_tables_[kObjectIds]->count(); | 666 old_weak_tables_[kObjectIds]->count(); |
666 } | 667 } |
667 | 668 |
668 | 669 |
669 void Heap::ResetObjectIdTable() { | 670 void Heap::ResetObjectIdTable() { |
670 new_weak_tables_[kObjectIds]->Reset(); | 671 new_weak_tables_[kObjectIds]->Reset(); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 Dart::vm_isolate()->heap()->WriteProtect(false); | 866 Dart::vm_isolate()->heap()->WriteProtect(false); |
866 } | 867 } |
867 | 868 |
868 | 869 |
869 WritableVMIsolateScope::~WritableVMIsolateScope() { | 870 WritableVMIsolateScope::~WritableVMIsolateScope() { |
870 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); | 871 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); |
871 Dart::vm_isolate()->heap()->WriteProtect(true); | 872 Dart::vm_isolate()->heap()->WriteProtect(true); |
872 } | 873 } |
873 | 874 |
874 } // namespace dart | 875 } // namespace dart |
OLD | NEW |