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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 false, // Not native. |
68 cls, | 68 cls, |
69 0)); // No token position. | 69 0)); // No token position. |
70 function.set_is_debuggable(false); | 70 function.set_is_debuggable(false); |
| 71 function.set_is_visible(false); |
71 miss_handler_code_ = code.raw(); | 72 miss_handler_code_ = code.raw(); |
72 miss_handler_function_ = function.raw(); | 73 miss_handler_function_ = function.raw(); |
73 function.AttachCode(code); | 74 function.AttachCode(code); |
74 } | 75 } |
75 | 76 |
76 | 77 |
77 void MegamorphicCacheTable::VisitObjectPointers(ObjectPointerVisitor* v) { | 78 void MegamorphicCacheTable::VisitObjectPointers(ObjectPointerVisitor* v) { |
78 ASSERT(v != NULL); | 79 ASSERT(v != NULL); |
79 v->VisitPointer(reinterpret_cast<RawObject**>(&miss_handler_code_)); | 80 v->VisitPointer(reinterpret_cast<RawObject**>(&miss_handler_code_)); |
80 v->VisitPointer(reinterpret_cast<RawObject**>(&miss_handler_function_)); | 81 v->VisitPointer(reinterpret_cast<RawObject**>(&miss_handler_function_)); |
(...skipping 14 matching lines...) Expand all Loading... |
95 cache = table_[i].cache; | 96 cache = table_[i].cache; |
96 buckets = cache.buckets(); | 97 buckets = cache.buckets(); |
97 size += MegamorphicCache::InstanceSize(); | 98 size += MegamorphicCache::InstanceSize(); |
98 size += Array::InstanceSize(buckets.Length()); | 99 size += Array::InstanceSize(buckets.Length()); |
99 } | 100 } |
100 OS::Print("%" Pd " megamorphic caches using %" Pd "KB.\n", | 101 OS::Print("%" Pd " megamorphic caches using %" Pd "KB.\n", |
101 length_, size / 1024); | 102 length_, size / 1024); |
102 } | 103 } |
103 | 104 |
104 } // namespace dart | 105 } // namespace dart |
OLD | NEW |