| 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" |
| 11 | 11 |
| 12 namespace dart { | 12 namespace dart { |
| 13 | 13 |
| 14 class Class; | 14 class Class; |
| 15 class Function; | 15 class Function; |
| 16 template <typename T> class ZoneGrowableArray; | 16 template <typename T> class ZoneGrowableArray; |
| 17 class String; | 17 class String; |
| 18 | 18 |
| 19 class CHA : public StackResource { | 19 class CHA : public StackResource { |
| 20 public: | 20 public: |
| 21 explicit CHA(Thread* thread) | 21 explicit CHA(Thread* thread) |
| 22 : StackResource(thread->isolate()), | 22 : StackResource(thread), |
| 23 thread_(thread), | 23 thread_(thread), |
| 24 leaf_classes_(thread->zone(), 1), | 24 leaf_classes_(thread->zone(), 1), |
| 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 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 Thread* thread_; | 54 Thread* thread_; |
| 55 GrowableArray<Class*> leaf_classes_; | 55 GrowableArray<Class*> leaf_classes_; |
| 56 CHA* previous_; | 56 CHA* previous_; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace dart | 59 } // namespace dart |
| 60 | 60 |
| 61 #endif // VM_CHA_H_ | 61 #endif // VM_CHA_H_ |
| OLD | NEW |