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

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

Issue 1186113011: Some cleanup and be more conservative when guessing cids: use only current leaf classes; otherwise … (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: y Created 5 years, 6 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
« no previous file with comments | « runtime/vm/cha.h ('k') | runtime/vm/cha_test.cc » ('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/cha.h" 5 #include "vm/cha.h"
6 #include "vm/class_table.h" 6 #include "vm/class_table.h"
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/freelist.h" 8 #include "vm/freelist.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/raw_object.h" 10 #include "vm/raw_object.h"
(...skipping 18 matching lines...) Expand all
29 // read-only. 29 // read-only.
30 // TODO(fschneider): Enable tracking of CHA dependent code for VM heap 30 // TODO(fschneider): Enable tracking of CHA dependent code for VM heap
31 // classes. 31 // classes.
32 if (cls.InVMHeap()) return true; 32 if (cls.InVMHeap()) return true;
33 33
34 if (cls.IsObjectClass()) { 34 if (cls.IsObjectClass()) {
35 // Class Object has subclasses, although we do not keep track of them. 35 // Class Object has subclasses, although we do not keep track of them.
36 return true; 36 return true;
37 } 37 }
38 const GrowableObjectArray& direct_subclasses = 38 const GrowableObjectArray& direct_subclasses =
39 GrowableObjectArray::Handle(thread_->zone(), cls.direct_subclasses()); 39 GrowableObjectArray::Handle(cls.direct_subclasses());
40 return !direct_subclasses.IsNull() && (direct_subclasses.Length() > 0); 40 return !direct_subclasses.IsNull() && (direct_subclasses.Length() > 0);
41 } 41 }
42 42
43 43
44 bool CHA::HasSubclasses(intptr_t cid) { 44 bool CHA::HasSubclasses(intptr_t cid) const {
45 const ClassTable& class_table = *thread_->isolate()->class_table(); 45 const ClassTable& class_table = *thread_->isolate()->class_table();
46 Class& cls = Class::Handle(thread_->zone(), class_table.At(cid)); 46 Class& cls = Class::Handle(thread_->zone(), class_table.At(cid));
47 return HasSubclasses(cls); 47 return HasSubclasses(cls);
48 } 48 }
49 49
50 50
51 bool CHA::IsImplemented(const Class& cls) { 51 bool CHA::IsImplemented(const Class& cls) {
52 // Signature classes have different type checking rules. 52 // Signature classes have different type checking rules.
53 ASSERT(!cls.IsSignatureClass()); 53 ASSERT(!cls.IsSignatureClass());
54 // Can't track dependencies for classes on the VM heap since those are 54 // Can't track dependencies for classes on the VM heap since those are
(...skipping 29 matching lines...) Expand all
84 return true; 84 return true;
85 } 85 }
86 if (HasOverride(direct_subclass, function_name)) { 86 if (HasOverride(direct_subclass, function_name)) {
87 return true; 87 return true;
88 } 88 }
89 } 89 }
90 return false; 90 return false;
91 } 91 }
92 92
93 } // namespace dart 93 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/cha.h ('k') | runtime/vm/cha_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698