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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 UNREACHABLE(); | 635 UNREACHABLE(); |
636 return ""; | 636 return ""; |
637 } | 637 } |
638 } | 638 } |
639 | 639 |
640 | 640 |
641 int64_t Heap::PeerCount() const { | 641 int64_t Heap::PeerCount() const { |
642 return new_weak_tables_[kPeers]->count() + old_weak_tables_[kPeers]->count(); | 642 return new_weak_tables_[kPeers]->count() + old_weak_tables_[kPeers]->count(); |
643 } | 643 } |
644 | 644 |
645 | 645 #if !defined(HASH_IN_OBJECT_HEADER) |
646 int64_t Heap::HashCount() const { | 646 int64_t Heap::HashCount() const { |
647 return new_weak_tables_[kHashes]->count() + | 647 return new_weak_tables_[kHashes]->count() + |
648 old_weak_tables_[kHashes]->count(); | 648 old_weak_tables_[kHashes]->count(); |
649 } | 649 } |
| 650 #endif |
650 | 651 |
651 | 652 |
652 int64_t Heap::ObjectIdCount() const { | 653 int64_t Heap::ObjectIdCount() const { |
653 return new_weak_tables_[kObjectIds]->count() + | 654 return new_weak_tables_[kObjectIds]->count() + |
654 old_weak_tables_[kObjectIds]->count(); | 655 old_weak_tables_[kObjectIds]->count(); |
655 } | 656 } |
656 | 657 |
657 | 658 |
658 void Heap::ResetObjectIdTable() { | 659 void Heap::ResetObjectIdTable() { |
659 new_weak_tables_[kObjectIds]->Reset(); | 660 new_weak_tables_[kObjectIds]->Reset(); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 Dart::vm_isolate()->heap()->WriteProtect(false); | 855 Dart::vm_isolate()->heap()->WriteProtect(false); |
855 } | 856 } |
856 | 857 |
857 | 858 |
858 WritableVMIsolateScope::~WritableVMIsolateScope() { | 859 WritableVMIsolateScope::~WritableVMIsolateScope() { |
859 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); | 860 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); |
860 Dart::vm_isolate()->heap()->WriteProtect(true); | 861 Dart::vm_isolate()->heap()->WriteProtect(true); |
861 } | 862 } |
862 | 863 |
863 } // namespace dart | 864 } // namespace dart |
OLD | NEW |