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/object_store.h" | 9 #include "vm/object_store.h" |
10 #include "vm/stub_code.h" | 10 #include "vm/stub_code.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 true, // Static, but called as a method. | 66 true, // Static, but called as a method. |
67 false, // Not const. | 67 false, // Not const. |
68 false, // Not abstract. | 68 false, // Not abstract. |
69 false, // Not external. | 69 false, // Not external. |
70 false, // Not native. | 70 false, // Not native. |
71 cls, TokenPosition::kNoSource)); | 71 cls, TokenPosition::kNoSource)); |
72 function.set_result_type(Type::Handle(Type::DynamicType())); | 72 function.set_result_type(Type::Handle(Type::DynamicType())); |
73 function.set_is_debuggable(false); | 73 function.set_is_debuggable(false); |
74 function.set_is_visible(false); | 74 function.set_is_visible(false); |
75 function.AttachCode(code); // Has a single entry point, as a static function. | 75 function.AttachCode(code); // Has a single entry point, as a static function. |
76 // For inclusion in Snapshot::kAppWithJIT. | 76 // For inclusion in Snapshot::kAppJIT. |
77 function.set_unoptimized_code(code); | 77 function.set_unoptimized_code(code); |
78 | 78 |
79 isolate->object_store()->SetMegamorphicMissHandler(code, function); | 79 isolate->object_store()->SetMegamorphicMissHandler(code, function); |
80 } | 80 } |
81 | 81 |
82 | 82 |
83 void MegamorphicCacheTable::PrintSizes(Isolate* isolate) { | 83 void MegamorphicCacheTable::PrintSizes(Isolate* isolate) { |
84 StackZone zone(Thread::Current()); | 84 StackZone zone(Thread::Current()); |
85 intptr_t size = 0; | 85 intptr_t size = 0; |
86 MegamorphicCache& cache = MegamorphicCache::Handle(); | 86 MegamorphicCache& cache = MegamorphicCache::Handle(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 for (intptr_t i = 0; i <= max_probe_count; i++) { | 141 for (intptr_t i = 0; i <= max_probe_count; i++) { |
142 cumulative_entries += probe_counts[i]; | 142 cumulative_entries += probe_counts[i]; |
143 OS::Print("Megamorphic probe %" Pd ": %" Pd " (%lf)\n", i, probe_counts[i], | 143 OS::Print("Megamorphic probe %" Pd ": %" Pd " (%lf)\n", i, probe_counts[i], |
144 static_cast<double>(cumulative_entries) / | 144 static_cast<double>(cumulative_entries) / |
145 static_cast<double>(entry_count)); | 145 static_cast<double>(entry_count)); |
146 } | 146 } |
147 delete[] probe_counts; | 147 delete[] probe_counts; |
148 } | 148 } |
149 | 149 |
150 } // namespace dart | 150 } // namespace dart |
OLD | NEW |