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

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

Issue 99373002: Mark native functions when they are created. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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/compiler.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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698