OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // Classes that describe assembly patterns as used by inline caches. | 4 // Classes that describe assembly patterns as used by inline caches. |
5 | 5 |
6 #ifndef VM_INSTRUCTIONS_ARM_H_ | 6 #ifndef VM_INSTRUCTIONS_ARM_H_ |
7 #define VM_INSTRUCTIONS_ARM_H_ | 7 #define VM_INSTRUCTIONS_ARM_H_ |
8 | 8 |
9 #ifndef VM_INSTRUCTIONS_H_ | 9 #ifndef VM_INSTRUCTIONS_H_ |
10 #error Do not include instructions_arm.h directly; use instructions.h instead. | 10 #error Do not include instructions_arm.h directly; use instructions.h instead. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 const ObjectPool& object_pool_; | 91 const ObjectPool& object_pool_; |
92 | 92 |
93 uword end_; | 93 uword end_; |
94 intptr_t native_function_pool_index_; | 94 intptr_t native_function_pool_index_; |
95 intptr_t target_code_pool_index_; | 95 intptr_t target_code_pool_index_; |
96 | 96 |
97 DISALLOW_COPY_AND_ASSIGN(NativeCallPattern); | 97 DISALLOW_COPY_AND_ASSIGN(NativeCallPattern); |
98 }; | 98 }; |
99 | 99 |
100 | 100 |
| 101 class SwitchableCallPattern : public ValueObject { |
| 102 public: |
| 103 SwitchableCallPattern(uword pc, const Code& code); |
| 104 |
| 105 RawObject* cache() const; |
| 106 void SetCache(const MegamorphicCache& cache) const; |
| 107 void SetLookupStub(const Code& stub) const; |
| 108 |
| 109 private: |
| 110 const ObjectPool& object_pool_; |
| 111 intptr_t cache_pool_index_; |
| 112 intptr_t stub_pool_index_; |
| 113 |
| 114 DISALLOW_COPY_AND_ASSIGN(SwitchableCallPattern); |
| 115 }; |
| 116 |
| 117 |
101 class ReturnPattern : public ValueObject { | 118 class ReturnPattern : public ValueObject { |
102 public: | 119 public: |
103 explicit ReturnPattern(uword pc); | 120 explicit ReturnPattern(uword pc); |
104 | 121 |
105 // bx_lr = 1. | 122 // bx_lr = 1. |
106 static const int kLengthInBytes = 1 * Instr::kInstrSize; | 123 static const int kLengthInBytes = 1 * Instr::kInstrSize; |
107 | 124 |
108 int pattern_length_in_bytes() const { | 125 int pattern_length_in_bytes() const { |
109 return kLengthInBytes; | 126 return kLengthInBytes; |
110 } | 127 } |
111 | 128 |
112 bool IsValid() const; | 129 bool IsValid() const; |
113 | 130 |
114 private: | 131 private: |
115 const uword pc_; | 132 const uword pc_; |
116 }; | 133 }; |
117 | 134 |
118 } // namespace dart | 135 } // namespace dart |
119 | 136 |
120 #endif // VM_INSTRUCTIONS_ARM_H_ | 137 #endif // VM_INSTRUCTIONS_ARM_H_ |
OLD | NEW |