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

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

Issue 1584223006: Remove signature classes from the VM. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
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/object_store.h" 9 #include "vm/object_store.h"
10 #include "vm/stub_code.h" 10 #include "vm/stub_code.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 const Function& function = 65 const Function& function =
66 Function::Handle(Function::New(Symbols::MegamorphicMiss(), 66 Function::Handle(Function::New(Symbols::MegamorphicMiss(),
67 RawFunction::kRegularFunction, 67 RawFunction::kRegularFunction,
68 false, // Not static. 68 false, // Not static.
69 false, // Not const. 69 false, // Not const.
70 false, // Not abstract. 70 false, // Not abstract.
71 false, // Not external. 71 false, // Not external.
72 false, // Not native. 72 false, // Not native.
73 cls, 73 cls,
74 0)); // No token position. 74 0)); // No token position.
75 function.set_result_type(Type::Handle(Type::DynamicType()));
75 function.set_is_debuggable(false); 76 function.set_is_debuggable(false);
76 function.set_is_visible(false); 77 function.set_is_visible(false);
77 function.AttachCode(code); 78 function.AttachCode(code);
78 79
79 isolate->object_store()->SetMegamorphicMissHandler(code, function); 80 isolate->object_store()->SetMegamorphicMissHandler(code, function);
80 } 81 }
81 82
82 83
83 void MegamorphicCacheTable::PrintSizes(Isolate* isolate) { 84 void MegamorphicCacheTable::PrintSizes(Isolate* isolate) {
84 StackZone zone(Thread::Current()); 85 StackZone zone(Thread::Current());
85 intptr_t size = 0; 86 intptr_t size = 0;
86 MegamorphicCache& cache = MegamorphicCache::Handle(); 87 MegamorphicCache& cache = MegamorphicCache::Handle();
87 Array& buckets = Array::Handle(); 88 Array& buckets = Array::Handle();
88 const GrowableObjectArray& table = GrowableObjectArray::Handle( 89 const GrowableObjectArray& table = GrowableObjectArray::Handle(
89 isolate->object_store()->megamorphic_cache_table()); 90 isolate->object_store()->megamorphic_cache_table());
90 if (table.IsNull()) return; 91 if (table.IsNull()) return;
91 for (intptr_t i = 0; i < table.Length(); i++) { 92 for (intptr_t i = 0; i < table.Length(); i++) {
92 cache ^= table.At(i); 93 cache ^= table.At(i);
93 buckets = cache.buckets(); 94 buckets = cache.buckets();
94 size += MegamorphicCache::InstanceSize(); 95 size += MegamorphicCache::InstanceSize();
95 size += Array::InstanceSize(buckets.Length()); 96 size += Array::InstanceSize(buckets.Length());
96 } 97 }
97 OS::Print("%" Pd " megamorphic caches using %" Pd "KB.\n", 98 OS::Print("%" Pd " megamorphic caches using %" Pd "KB.\n",
98 table.Length(), size / 1024); 99 table.Length(), size / 1024);
99 } 100 }
100 101
101 } // namespace dart 102 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698