| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::kAppJIT. | 76 // For inclusion in Snapshot::kAppJIT. |
| 77 function.set_unoptimized_code(code); | 77 function.set_unoptimized_code(code); |
| 78 | 78 |
| 79 ASSERT(isolate->object_store()->megamorphic_miss_function() == |
| 80 Function::null()); |
| 79 isolate->object_store()->SetMegamorphicMissHandler(code, function); | 81 isolate->object_store()->SetMegamorphicMissHandler(code, function); |
| 80 } | 82 } |
| 81 | 83 |
| 82 | 84 |
| 83 void MegamorphicCacheTable::PrintSizes(Isolate* isolate) { | 85 void MegamorphicCacheTable::PrintSizes(Isolate* isolate) { |
| 84 StackZone zone(Thread::Current()); | 86 StackZone zone(Thread::Current()); |
| 85 intptr_t size = 0; | 87 intptr_t size = 0; |
| 86 MegamorphicCache& cache = MegamorphicCache::Handle(); | 88 MegamorphicCache& cache = MegamorphicCache::Handle(); |
| 87 Array& buckets = Array::Handle(); | 89 Array& buckets = Array::Handle(); |
| 88 const GrowableObjectArray& table = GrowableObjectArray::Handle( | 90 const GrowableObjectArray& table = GrowableObjectArray::Handle( |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 for (intptr_t i = 0; i <= max_probe_count; i++) { | 143 for (intptr_t i = 0; i <= max_probe_count; i++) { |
| 142 cumulative_entries += probe_counts[i]; | 144 cumulative_entries += probe_counts[i]; |
| 143 OS::Print("Megamorphic probe %" Pd ": %" Pd " (%lf)\n", i, probe_counts[i], | 145 OS::Print("Megamorphic probe %" Pd ": %" Pd " (%lf)\n", i, probe_counts[i], |
| 144 static_cast<double>(cumulative_entries) / | 146 static_cast<double>(cumulative_entries) / |
| 145 static_cast<double>(entry_count)); | 147 static_cast<double>(entry_count)); |
| 146 } | 148 } |
| 147 delete[] probe_counts; | 149 delete[] probe_counts; |
| 148 } | 150 } |
| 149 | 151 |
| 150 } // namespace dart | 152 } // namespace dart |
| OLD | NEW |