| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64_H_ | 6 #ifndef VM_INSTRUCTIONS_ARM64_H_ |
| 7 #define VM_INSTRUCTIONS_ARM64_H_ | 7 #define VM_INSTRUCTIONS_ARM64_H_ |
| 8 | 8 |
| 9 #ifndef VM_INSTRUCTIONS_H_ | 9 #ifndef VM_INSTRUCTIONS_H_ |
| 10 #error Do not include instructions_arm64.h directly; use instructions.h instead. | 10 #error Do not include instructions_arm64.h directly; use instructions.h instead. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 const ObjectPool& object_pool_; | 99 const ObjectPool& object_pool_; |
| 100 | 100 |
| 101 uword end_; | 101 uword end_; |
| 102 intptr_t native_function_pool_index_; | 102 intptr_t native_function_pool_index_; |
| 103 intptr_t target_code_pool_index_; | 103 intptr_t target_code_pool_index_; |
| 104 | 104 |
| 105 DISALLOW_COPY_AND_ASSIGN(NativeCallPattern); | 105 DISALLOW_COPY_AND_ASSIGN(NativeCallPattern); |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 | 108 |
| 109 // Instance call that can switch from an IC call to a megamorphic call |
| 110 // load ICData load MegamorphicCache |
| 111 // call ICLookup stub -> call MegamorphicLookup stub |
| 112 // call target call target |
| 113 class SwitchableCallPattern : public ValueObject { |
| 114 public: |
| 115 SwitchableCallPattern(uword pc, const Code& code); |
| 116 |
| 117 RawObject* cache() const; |
| 118 void SetCache(const MegamorphicCache& cache) const; |
| 119 void SetLookupStub(const Code& stub) const; |
| 120 |
| 121 private: |
| 122 const ObjectPool& object_pool_; |
| 123 intptr_t cache_pool_index_; |
| 124 intptr_t stub_pool_index_; |
| 125 |
| 126 DISALLOW_COPY_AND_ASSIGN(SwitchableCallPattern); |
| 127 }; |
| 128 |
| 129 |
| 109 class ReturnPattern : public ValueObject { | 130 class ReturnPattern : public ValueObject { |
| 110 public: | 131 public: |
| 111 explicit ReturnPattern(uword pc); | 132 explicit ReturnPattern(uword pc); |
| 112 | 133 |
| 113 // bx_lr = 1. | 134 // bx_lr = 1. |
| 114 static const int kLengthInBytes = 1 * Instr::kInstrSize; | 135 static const int kLengthInBytes = 1 * Instr::kInstrSize; |
| 115 | 136 |
| 116 int pattern_length_in_bytes() const { | 137 int pattern_length_in_bytes() const { |
| 117 return kLengthInBytes; | 138 return kLengthInBytes; |
| 118 } | 139 } |
| 119 | 140 |
| 120 bool IsValid() const; | 141 bool IsValid() const; |
| 121 | 142 |
| 122 private: | 143 private: |
| 123 const uword pc_; | 144 const uword pc_; |
| 124 }; | 145 }; |
| 125 | 146 |
| 126 } // namespace dart | 147 } // namespace dart |
| 127 | 148 |
| 128 #endif // VM_INSTRUCTIONS_ARM64_H_ | 149 #endif // VM_INSTRUCTIONS_ARM64_H_ |
| OLD | NEW |