| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_DBC_H_ |
| 7 #define VM_INSTRUCTIONS_ARM_H_ | 7 #define VM_INSTRUCTIONS_DBC_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_dbc.h directly; use instructions.h instead. |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #include "vm/constants_arm.h" | 13 #include "vm/constants_dbc.h" |
| 14 #include "vm/native_entry.h" | 14 #include "vm/native_entry.h" |
| 15 #include "vm/object.h" | 15 #include "vm/object.h" |
| 16 | 16 |
| 17 namespace dart { | 17 namespace dart { |
| 18 | 18 |
| 19 class InstructionPattern : public AllStatic { | 19 class InstructionPattern : public AllStatic { |
| 20 public: | 20 public: |
| 21 // Decodes a load sequence ending at 'end' (the last instruction of the | 21 // Decodes a load sequence ending at 'end' (the last instruction of the |
| 22 // load sequence is the instruction before the one at end). Returns the | 22 // load sequence is the instruction before the one at end). Returns the |
| 23 // address of the first instruction in the sequence. Returns the register | 23 // address of the first instruction in the sequence. Returns the register |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Instance call that can switch from an IC call to a megamorphic call | 101 // Instance call that can switch from an IC call to a megamorphic call |
| 102 // load ICData load MegamorphicCache | |
| 103 // call ICLookup stub -> call MegamorphicLookup stub | |
| 104 // call target call target | |
| 105 class SwitchableCallPattern : public ValueObject { | 102 class SwitchableCallPattern : public ValueObject { |
| 106 public: | 103 public: |
| 107 SwitchableCallPattern(uword pc, const Code& code); | 104 SwitchableCallPattern(uword pc, const Code& code); |
| 108 | 105 |
| 109 RawObject* cache() const; | 106 RawObject* cache() const; |
| 110 void SetCache(const MegamorphicCache& cache) const; | 107 void SetCache(const MegamorphicCache& cache) const; |
| 111 void SetLookupStub(const Code& stub) const; | 108 void SetLookupStub(const Code& stub) const; |
| 112 | 109 |
| 113 private: | 110 private: |
| 114 const ObjectPool& object_pool_; | 111 const ObjectPool& object_pool_; |
| 115 intptr_t cache_pool_index_; | 112 intptr_t cache_pool_index_; |
| 116 intptr_t stub_pool_index_; | 113 intptr_t stub_pool_index_; |
| 117 | 114 |
| 118 DISALLOW_COPY_AND_ASSIGN(SwitchableCallPattern); | 115 DISALLOW_COPY_AND_ASSIGN(SwitchableCallPattern); |
| 119 }; | 116 }; |
| 120 | 117 |
| 121 | 118 |
| 122 class ReturnPattern : public ValueObject { | 119 class ReturnPattern : public ValueObject { |
| 123 public: | 120 public: |
| 124 explicit ReturnPattern(uword pc); | 121 explicit ReturnPattern(uword pc); |
| 125 | 122 |
| 126 // bx_lr = 1. | 123 static const int kLengthInBytes = 0; |
| 127 static const int kLengthInBytes = 1 * Instr::kInstrSize; | |
| 128 | 124 |
| 129 int pattern_length_in_bytes() const { | 125 int pattern_length_in_bytes() const { |
| 126 UNIMPLEMENTED(); |
| 130 return kLengthInBytes; | 127 return kLengthInBytes; |
| 131 } | 128 } |
| 132 | 129 |
| 133 bool IsValid() const; | 130 bool IsValid() const; |
| 134 | 131 |
| 135 private: | 132 private: |
| 136 const uword pc_; | 133 const uword pc_; |
| 137 }; | 134 }; |
| 138 | 135 |
| 139 } // namespace dart | 136 } // namespace dart |
| 140 | 137 |
| 141 #endif // VM_INSTRUCTIONS_ARM_H_ | 138 #endif // VM_INSTRUCTIONS_DBC_H_ |
| OLD | NEW |