Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: runtime/vm/megamorphic_cache_table.cc

Issue 1285293004: Migrate most uses of StackZone(Isolate*) to Thread*. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Final cleanup. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/gc_marker.cc ('k') | runtime/vm/native_entry.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 v->VisitPointer(reinterpret_cast<RawObject**>(&miss_handler_function_)); 81 v->VisitPointer(reinterpret_cast<RawObject**>(&miss_handler_function_));
82 for (intptr_t i = 0; i < length_; ++i) { 82 for (intptr_t i = 0; i < length_; ++i) {
83 v->VisitPointer(reinterpret_cast<RawObject**>(&table_[i].name)); 83 v->VisitPointer(reinterpret_cast<RawObject**>(&table_[i].name));
84 v->VisitPointer(reinterpret_cast<RawObject**>(&table_[i].descriptor)); 84 v->VisitPointer(reinterpret_cast<RawObject**>(&table_[i].descriptor));
85 v->VisitPointer(reinterpret_cast<RawObject**>(&table_[i].cache)); 85 v->VisitPointer(reinterpret_cast<RawObject**>(&table_[i].cache));
86 } 86 }
87 } 87 }
88 88
89 89
90 void MegamorphicCacheTable::PrintSizes() { 90 void MegamorphicCacheTable::PrintSizes() {
91 StackZone zone(Isolate::Current()); 91 StackZone zone(Thread::Current());
92 intptr_t size = 0; 92 intptr_t size = 0;
93 MegamorphicCache& cache = MegamorphicCache::Handle(); 93 MegamorphicCache& cache = MegamorphicCache::Handle();
94 Array& buckets = Array::Handle(); 94 Array& buckets = Array::Handle();
95 for (intptr_t i = 0; i < length_; ++i) { 95 for (intptr_t i = 0; i < length_; ++i) {
96 cache = table_[i].cache; 96 cache = table_[i].cache;
97 buckets = cache.buckets(); 97 buckets = cache.buckets();
98 size += MegamorphicCache::InstanceSize(); 98 size += MegamorphicCache::InstanceSize();
99 size += Array::InstanceSize(buckets.Length()); 99 size += Array::InstanceSize(buckets.Length());
100 } 100 }
101 OS::Print("%" Pd " megamorphic caches using %" Pd "KB.\n", 101 OS::Print("%" Pd " megamorphic caches using %" Pd "KB.\n",
102 length_, size / 1024); 102 length_, size / 1024);
103 } 103 }
104 104
105 } // namespace dart 105 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/gc_marker.cc ('k') | runtime/vm/native_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698