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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 StubCode::GenerateMegamorphicMissStub)); | 57 StubCode::GenerateMegamorphicMissStub)); |
58 const Class& cls = | 58 const Class& cls = |
59 Class::Handle(Type::Handle(Type::Function()).type_class()); | 59 Class::Handle(Type::Handle(Type::Function()).type_class()); |
60 const Function& function = | 60 const Function& function = |
61 Function::Handle(Function::New(Symbols::MegamorphicMiss(), | 61 Function::Handle(Function::New(Symbols::MegamorphicMiss(), |
62 RawFunction::kRegularFunction, | 62 RawFunction::kRegularFunction, |
63 false, // Not static. | 63 false, // Not static. |
64 false, // Not const. | 64 false, // Not const. |
65 false, // Not abstract. | 65 false, // Not abstract. |
66 false, // Not external. | 66 false, // Not external. |
| 67 false, // Not native. |
67 cls, | 68 cls, |
68 0)); // No token position. | 69 0)); // No token position. |
69 miss_handler_code_ = code.raw(); | 70 miss_handler_code_ = code.raw(); |
70 miss_handler_function_ = function.raw(); | 71 miss_handler_function_ = function.raw(); |
71 function.SetCode(code); | 72 function.SetCode(code); |
72 } | 73 } |
73 | 74 |
74 | 75 |
75 void MegamorphicCacheTable::VisitObjectPointers(ObjectPointerVisitor* v) { | 76 void MegamorphicCacheTable::VisitObjectPointers(ObjectPointerVisitor* v) { |
76 ASSERT(v != NULL); | 77 ASSERT(v != NULL); |
(...skipping 16 matching lines...) Expand all Loading... |
93 cache = table_[i].cache; | 94 cache = table_[i].cache; |
94 buckets = cache.buckets(); | 95 buckets = cache.buckets(); |
95 size += MegamorphicCache::InstanceSize(); | 96 size += MegamorphicCache::InstanceSize(); |
96 size += Array::InstanceSize(buckets.Length()); | 97 size += Array::InstanceSize(buckets.Length()); |
97 } | 98 } |
98 OS::Print("%" Pd " megamorphic caches using %" Pd "KB.\n", | 99 OS::Print("%" Pd " megamorphic caches using %" Pd "KB.\n", |
99 length_, size / 1024); | 100 length_, size / 1024); |
100 } | 101 } |
101 | 102 |
102 } // namespace dart | 103 } // namespace dart |
OLD | NEW |