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. |
11 #endif | 11 #endif |
12 | 12 |
13 #include "vm/constants_arm64.h" | 13 #include "vm/constants_arm64.h" |
| 14 #include "vm/native_entry.h" |
14 #include "vm/object.h" | 15 #include "vm/object.h" |
15 | 16 |
16 namespace dart { | 17 namespace dart { |
17 | 18 |
18 class InstructionPattern : public AllStatic { | 19 class InstructionPattern : public AllStatic { |
19 public: | 20 public: |
20 // 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 |
21 // 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 |
22 // address of the first instruction in the sequence. Returns the register | 23 // address of the first instruction in the sequence. Returns the register |
23 // being loaded and the loaded object in the output parameters 'reg' and | 24 // being loaded and the loaded object in the output parameters 'reg' and |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 uword ic_data_load_end_; | 79 uword ic_data_load_end_; |
79 | 80 |
80 intptr_t target_address_pool_index_; | 81 intptr_t target_address_pool_index_; |
81 Array& args_desc_; | 82 Array& args_desc_; |
82 ICData& ic_data_; | 83 ICData& ic_data_; |
83 | 84 |
84 DISALLOW_COPY_AND_ASSIGN(CallPattern); | 85 DISALLOW_COPY_AND_ASSIGN(CallPattern); |
85 }; | 86 }; |
86 | 87 |
87 | 88 |
| 89 class NativeCallPattern : public ValueObject { |
| 90 public: |
| 91 NativeCallPattern(uword pc, const Code& code); |
| 92 |
| 93 uword target() const; |
| 94 void set_target(uword target_address) const; |
| 95 |
| 96 NativeFunction native_function() const; |
| 97 void set_native_function(NativeFunction target) const; |
| 98 |
| 99 private: |
| 100 const ObjectPool& object_pool_; |
| 101 |
| 102 uword end_; |
| 103 intptr_t native_function_pool_index_; |
| 104 intptr_t target_address_pool_index_; |
| 105 |
| 106 DISALLOW_COPY_AND_ASSIGN(NativeCallPattern); |
| 107 }; |
| 108 |
| 109 |
88 class JumpPattern : public ValueObject { | 110 class JumpPattern : public ValueObject { |
89 public: | 111 public: |
90 JumpPattern(uword pc, const Code& code); | 112 JumpPattern(uword pc, const Code& code); |
91 | 113 |
92 static const int kLengthInBytes = 5 * Instr::kInstrSize; | 114 static const int kLengthInBytes = 5 * Instr::kInstrSize; |
93 | 115 |
94 int pattern_length_in_bytes() const { | 116 int pattern_length_in_bytes() const { |
95 return kLengthInBytes; | 117 return kLengthInBytes; |
96 } | 118 } |
97 | 119 |
(...skipping 21 matching lines...) Expand all Loading... |
119 | 141 |
120 bool IsValid() const; | 142 bool IsValid() const; |
121 | 143 |
122 private: | 144 private: |
123 const uword pc_; | 145 const uword pc_; |
124 }; | 146 }; |
125 | 147 |
126 } // namespace dart | 148 } // namespace dart |
127 | 149 |
128 #endif // VM_INSTRUCTIONS_ARM64_H_ | 150 #endif // VM_INSTRUCTIONS_ARM64_H_ |
OLD | NEW |