Chromium Code Reviews| 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 #ifndef VM_CHA_H_ | 5 #ifndef VM_CHA_H_ |
| 6 #define VM_CHA_H_ | 6 #define VM_CHA_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
| 10 #include "vm/thread.h" | 10 #include "vm/thread.h" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 previous_(thread->cha()) { | 25 previous_(thread->cha()) { |
| 26 thread->set_cha(this); | 26 thread->set_cha(this); |
| 27 } | 27 } |
| 28 | 28 |
| 29 ~CHA() { | 29 ~CHA() { |
| 30 ASSERT(thread_->cha() == this); | 30 ASSERT(thread_->cha() == this); |
| 31 thread_->set_cha(previous_); | 31 thread_->set_cha(previous_); |
| 32 } | 32 } |
| 33 | 33 |
| 34 // Returns true if the class has subclasses. | 34 // Returns true if the class has subclasses. |
| 35 // Updates set of leaf classes that we register optimized code with for lazy | 35 // Updates set of leaf classes that we register optimized code with for lazy |
|
rmacnak
2015/05/28 23:16:52
No longer true.
srdjan
2015/05/28 23:28:57
Removed.
| |
| 36 // deoptimization. | 36 // deoptimization. |
| 37 bool HasSubclasses(const Class& cls); | 37 bool HasSubclasses(const Class& cls); |
| 38 bool HasSubclasses(intptr_t cid); | 38 bool HasSubclasses(intptr_t cid); |
| 39 | 39 |
| 40 // Return true if the class is implemented by some other class. | 40 // Return true if the class is implemented by some other class. |
| 41 // Updates set of leaf classes that we register optimized code with for lazy | 41 // Updates set of leaf classes that we register optimized code with for lazy |
|
rmacnak
2015/05/28 23:16:52
No longer true.
srdjan
2015/05/28 23:28:57
Removed.
| |
| 42 // deoptimization. | 42 // deoptimization. |
| 43 bool IsImplemented(const Class& cls); | 43 bool IsImplemented(const Class& cls); |
| 44 | 44 |
| 45 // Returns true if any subclass of 'cls' contains the function. | 45 // Returns true if any subclass of 'cls' contains the function. |
| 46 // Updates set of leaf classes that we register optimized code with for lazy | 46 // Updates set of leaf classes that we register optimized code with for lazy |
|
rmacnak
2015/05/28 23:16:52
No longer true.
srdjan
2015/05/28 23:28:57
Removed.
| |
| 47 // deoptimization. | 47 // deoptimization. |
| 48 bool HasOverride(const Class& cls, const String& function_name); | 48 bool HasOverride(const Class& cls, const String& function_name); |
| 49 | 49 |
| 50 const GrowableArray<Class*>& leaf_classes() const { | 50 const GrowableArray<Class*>& leaf_classes() const { |
| 51 return leaf_classes_; | 51 return leaf_classes_; |
| 52 } | 52 } |
| 53 | 53 |
| 54 private: | 54 // Adds class 'cls' to the list of leaf classes, deoptimization occurs |
| 55 // if any of the leaf classes gets subclassed through later loaded/finalized | |
| 56 // libraries. | |
| 55 void AddToLeafClasses(const Class& cls); | 57 void AddToLeafClasses(const Class& cls); |
|
rmacnak
2015/05/28 23:16:52
Add a note that this does not include all leaf cla
srdjan
2015/05/28 23:28:56
Done.
| |
| 56 | 58 |
| 59 private: | |
| 57 Thread* thread_; | 60 Thread* thread_; |
| 58 GrowableArray<Class*> leaf_classes_; | 61 GrowableArray<Class*> leaf_classes_; |
| 59 CHA* previous_; | 62 CHA* previous_; |
| 60 }; | 63 }; |
| 61 | 64 |
| 62 } // namespace dart | 65 } // namespace dart |
| 63 | 66 |
| 64 #endif // VM_CHA_H_ | 67 #endif // VM_CHA_H_ |
| OLD | NEW |