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

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

Issue 203523011: Introduce a lazy-compile stub for functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/gc_marker.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/stub_code.h" 9 #include "vm/stub_code.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 miss_handler_code_ = code.raw(); 70 miss_handler_code_ = code.raw();
71 miss_handler_function_ = function.raw(); 71 miss_handler_function_ = function.raw();
72 function.SetCode(code); 72 function.AttachCode(code);
73 } 73 }
74 74
75 75
76 void MegamorphicCacheTable::VisitObjectPointers(ObjectPointerVisitor* v) { 76 void MegamorphicCacheTable::VisitObjectPointers(ObjectPointerVisitor* v) {
77 ASSERT(v != NULL); 77 ASSERT(v != NULL);
78 v->VisitPointer(reinterpret_cast<RawObject**>(&miss_handler_code_)); 78 v->VisitPointer(reinterpret_cast<RawObject**>(&miss_handler_code_));
79 v->VisitPointer(reinterpret_cast<RawObject**>(&miss_handler_function_)); 79 v->VisitPointer(reinterpret_cast<RawObject**>(&miss_handler_function_));
80 for (intptr_t i = 0; i < length_; ++i) { 80 for (intptr_t i = 0; i < length_; ++i) {
81 v->VisitPointer(reinterpret_cast<RawObject**>(&table_[i].name)); 81 v->VisitPointer(reinterpret_cast<RawObject**>(&table_[i].name));
82 v->VisitPointer(reinterpret_cast<RawObject**>(&table_[i].descriptor)); 82 v->VisitPointer(reinterpret_cast<RawObject**>(&table_[i].descriptor));
(...skipping 11 matching lines...) Expand all
94 cache = table_[i].cache; 94 cache = table_[i].cache;
95 buckets = cache.buckets(); 95 buckets = cache.buckets();
96 size += MegamorphicCache::InstanceSize(); 96 size += MegamorphicCache::InstanceSize();
97 size += Array::InstanceSize(buckets.Length()); 97 size += Array::InstanceSize(buckets.Length());
98 } 98 }
99 OS::Print("%" Pd " megamorphic caches using %" Pd "KB.\n", 99 OS::Print("%" Pd " megamorphic caches using %" Pd "KB.\n",
100 length_, size / 1024); 100 length_, size / 1024);
101 } 101 }
102 102
103 } // namespace dart 103 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/gc_marker.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698