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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 UNREACHABLE(); | 658 UNREACHABLE(); |
659 return ""; | 659 return ""; |
660 } | 660 } |
661 } | 661 } |
662 | 662 |
663 | 663 |
664 int64_t Heap::PeerCount() const { | 664 int64_t Heap::PeerCount() const { |
665 return new_weak_tables_[kPeers]->count() + old_weak_tables_[kPeers]->count(); | 665 return new_weak_tables_[kPeers]->count() + old_weak_tables_[kPeers]->count(); |
666 } | 666 } |
667 | 667 |
668 | 668 #if !defined(HASH_IN_OBJECT_HEADER) |
669 int64_t Heap::HashCount() const { | 669 int64_t Heap::HashCount() const { |
670 return new_weak_tables_[kHashes]->count() + | 670 return new_weak_tables_[kHashes]->count() + |
671 old_weak_tables_[kHashes]->count(); | 671 old_weak_tables_[kHashes]->count(); |
672 } | 672 } |
| 673 #endif |
673 | 674 |
674 | 675 |
675 int64_t Heap::ObjectIdCount() const { | 676 int64_t Heap::ObjectIdCount() const { |
676 return new_weak_tables_[kObjectIds]->count() + | 677 return new_weak_tables_[kObjectIds]->count() + |
677 old_weak_tables_[kObjectIds]->count(); | 678 old_weak_tables_[kObjectIds]->count(); |
678 } | 679 } |
679 | 680 |
680 | 681 |
681 void Heap::ResetObjectIdTable() { | 682 void Heap::ResetObjectIdTable() { |
682 new_weak_tables_[kObjectIds]->Reset(); | 683 new_weak_tables_[kObjectIds]->Reset(); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 Dart::vm_isolate()->heap()->WriteProtect(false); | 878 Dart::vm_isolate()->heap()->WriteProtect(false); |
878 } | 879 } |
879 | 880 |
880 | 881 |
881 WritableVMIsolateScope::~WritableVMIsolateScope() { | 882 WritableVMIsolateScope::~WritableVMIsolateScope() { |
882 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); | 883 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); |
883 Dart::vm_isolate()->heap()->WriteProtect(true); | 884 Dart::vm_isolate()->heap()->WriteProtect(true); |
884 } | 885 } |
885 | 886 |
886 } // namespace dart | 887 } // namespace dart |
OLD | NEW |