| 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_COMPILER_H_ | 5 #ifndef VM_COMPILER_H_ |
| 6 #define VM_COMPILER_H_ | 6 #define VM_COMPILER_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/runtime_entry.h" | 10 #include "vm/runtime_entry.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 void set_result_code(const Code& value) { result_code_ = value.raw(); } | 38 void set_result_code(const Code& value) { result_code_ = value.raw(); } |
| 39 const Code& result_code() const { return result_code_; } | 39 const Code& result_code() const { return result_code_; } |
| 40 | 40 |
| 41 uint32_t cha_invalidation_gen() const { return cha_invalidation_gen_; } | 41 uint32_t cha_invalidation_gen() const { return cha_invalidation_gen_; } |
| 42 uint32_t field_invalidation_gen() const { return field_invalidation_gen_; } | 42 uint32_t field_invalidation_gen() const { return field_invalidation_gen_; } |
| 43 uint32_t prefix_invalidation_gen() const { return prefix_invalidation_gen_; } | 43 uint32_t prefix_invalidation_gen() const { return prefix_invalidation_gen_; } |
| 44 | 44 |
| 45 void SetFromQElement(QueueElement* value); | 45 void SetFromQElement(QueueElement* value); |
| 46 | 46 |
| 47 void SetLeafClasses(const GrowableArray<Class*>& leaf_classes); |
| 48 void SetGuardedFields(const ZoneGrowableArray<const Field*>& guarded_fields); |
| 49 void SetDeoptimizeDependentFields(const GrowableArray<const Field*>& fields); |
| 50 |
| 51 const Array& leaf_classes() const { return leaf_classes_; } |
| 52 const Array& guarded_fields() const { return guarded_fields_; } |
| 53 const Array& deoptimize_dependent_fields() const { |
| 54 return deoptimize_dependent_fields_; |
| 55 } |
| 56 |
| 47 // Returns true if all relevant gen-counts are current and code is valid. | 57 // Returns true if all relevant gen-counts are current and code is valid. |
| 48 bool IsValid() const; | 58 bool IsValid() const; |
| 49 | 59 |
| 50 // Remove gen-counts from validation check. | 60 // Remove gen-counts from validation check. |
| 51 void ClearCHAInvalidationGen() { | 61 void ClearCHAInvalidationGen() { |
| 52 cha_invalidation_gen_ = Isolate::kInvalidGen; | 62 cha_invalidation_gen_ = Isolate::kInvalidGen; |
| 53 } | 63 } |
| 54 void ClearFieldInvalidationGen() { | 64 void ClearFieldInvalidationGen() { |
| 55 field_invalidation_gen_ = Isolate::kInvalidGen; | 65 field_invalidation_gen_ = Isolate::kInvalidGen; |
| 56 } | 66 } |
| 57 void ClearPrefixInvalidationGen() { | 67 void ClearPrefixInvalidationGen() { |
| 58 prefix_invalidation_gen_ = Isolate::kInvalidGen; | 68 prefix_invalidation_gen_ = Isolate::kInvalidGen; |
| 59 } | 69 } |
| 60 | 70 |
| 61 void PrintValidity() const; | 71 void PrintValidity() const; |
| 62 | 72 |
| 63 private: | 73 private: |
| 64 Code& result_code_; | 74 Code& result_code_; |
| 75 Array& leaf_classes_; |
| 76 Array& guarded_fields_; |
| 77 Array& deoptimize_dependent_fields_; |
| 65 uint32_t cha_invalidation_gen_; | 78 uint32_t cha_invalidation_gen_; |
| 66 uint32_t field_invalidation_gen_; | 79 uint32_t field_invalidation_gen_; |
| 67 uint32_t prefix_invalidation_gen_; | 80 uint32_t prefix_invalidation_gen_; |
| 68 }; | 81 }; |
| 69 | 82 |
| 70 | 83 |
| 71 class Compiler : public AllStatic { | 84 class Compiler : public AllStatic { |
| 72 public: | 85 public: |
| 73 static const intptr_t kNoOSRDeoptId = Thread::kNoDeoptId; | 86 static const intptr_t kNoOSRDeoptId = Thread::kNoDeoptId; |
| 74 | 87 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 206 |
| 194 BackgroundCompilationQueue* function_queue_; | 207 BackgroundCompilationQueue* function_queue_; |
| 195 BackgroundCompilationQueue* result_queue_; | 208 BackgroundCompilationQueue* result_queue_; |
| 196 | 209 |
| 197 DISALLOW_IMPLICIT_CONSTRUCTORS(BackgroundCompiler); | 210 DISALLOW_IMPLICIT_CONSTRUCTORS(BackgroundCompiler); |
| 198 }; | 211 }; |
| 199 | 212 |
| 200 } // namespace dart | 213 } // namespace dart |
| 201 | 214 |
| 202 #endif // VM_COMPILER_H_ | 215 #endif // VM_COMPILER_H_ |
| OLD | NEW |