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/megamorphic_cache_table.h" | 5 #include "vm/megamorphic_cache_table.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include "vm/object.h" | 8 #include "vm/object.h" |
9 #include "vm/stub_code.h" | 9 #include "vm/stub_code.h" |
10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 StackZone zone(Isolate::Current()); | 85 StackZone zone(Isolate::Current()); |
86 intptr_t size = 0; | 86 intptr_t size = 0; |
87 MegamorphicCache& cache = MegamorphicCache::Handle(); | 87 MegamorphicCache& cache = MegamorphicCache::Handle(); |
88 Array& buckets = Array::Handle(); | 88 Array& buckets = Array::Handle(); |
89 for (intptr_t i = 0; i < length_; ++i) { | 89 for (intptr_t i = 0; i < length_; ++i) { |
90 cache = table_[i].cache; | 90 cache = table_[i].cache; |
91 buckets = cache.buckets(); | 91 buckets = cache.buckets(); |
92 size += MegamorphicCache::InstanceSize(); | 92 size += MegamorphicCache::InstanceSize(); |
93 size += Array::InstanceSize(buckets.Length()); | 93 size += Array::InstanceSize(buckets.Length()); |
94 } | 94 } |
95 OS::Print("%"Pd" megamorphic caches using %"Pd"KB.\n", length_, size / 1024); | 95 OS::Print("%" Pd " megamorphic caches using %" Pd "KB.\n", |
| 96 length_, size / 1024); |
96 } | 97 } |
97 | 98 |
98 } // namespace dart | 99 } // namespace dart |
OLD | NEW |