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_MIPS_H_ | 6 #ifndef VM_INSTRUCTIONS_MIPS_H_ |
7 #define VM_INSTRUCTIONS_MIPS_H_ | 7 #define VM_INSTRUCTIONS_MIPS_H_ |
8 | 8 |
9 #ifndef VM_INSTRUCTIONS_H_ | 9 #ifndef VM_INSTRUCTIONS_H_ |
10 #error Do not include instructions_mips.h directly; use instructions.h instead. | 10 #error Do not include instructions_mips.h directly; use instructions.h instead. |
11 #endif | 11 #endif |
12 | 12 |
13 #include "vm/constants_mips.h" | 13 #include "vm/constants_mips.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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 uword end_; | 69 uword end_; |
69 uword ic_data_load_end_; | 70 uword ic_data_load_end_; |
70 | 71 |
71 intptr_t target_address_pool_index_; | 72 intptr_t target_address_pool_index_; |
72 ICData& ic_data_; | 73 ICData& ic_data_; |
73 | 74 |
74 DISALLOW_COPY_AND_ASSIGN(CallPattern); | 75 DISALLOW_COPY_AND_ASSIGN(CallPattern); |
75 }; | 76 }; |
76 | 77 |
77 | 78 |
| 79 class NativeCallPattern : public ValueObject { |
| 80 public: |
| 81 NativeCallPattern(uword pc, const Code& code); |
| 82 |
| 83 uword target() const; |
| 84 void set_target(uword target_address) const; |
| 85 |
| 86 NativeFunction native_function() const; |
| 87 void set_native_function(NativeFunction target) const; |
| 88 |
| 89 private: |
| 90 const ObjectPool& object_pool_; |
| 91 |
| 92 uword end_; |
| 93 intptr_t native_function_pool_index_; |
| 94 intptr_t target_address_pool_index_; |
| 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(NativeCallPattern); |
| 97 }; |
| 98 |
| 99 |
78 class JumpPattern : public ValueObject { | 100 class JumpPattern : public ValueObject { |
79 public: | 101 public: |
80 JumpPattern(uword pc, const Code& code); | 102 JumpPattern(uword pc, const Code& code); |
81 | 103 |
82 // lui; ori; jr; nop (in delay slot) = 4. | 104 // lui; ori; jr; nop (in delay slot) = 4. |
83 static const int kLengthInBytes = 4*Instr::kInstrSize; | 105 static const int kLengthInBytes = 4*Instr::kInstrSize; |
84 | 106 |
85 int pattern_length_in_bytes() const { | 107 int pattern_length_in_bytes() const { |
86 return kLengthInBytes; | 108 return kLengthInBytes; |
87 } | 109 } |
(...skipping 22 matching lines...) Expand all Loading... |
110 | 132 |
111 bool IsValid() const; | 133 bool IsValid() const; |
112 | 134 |
113 private: | 135 private: |
114 const uword pc_; | 136 const uword pc_; |
115 }; | 137 }; |
116 | 138 |
117 } // namespace dart | 139 } // namespace dart |
118 | 140 |
119 #endif // VM_INSTRUCTIONS_MIPS_H_ | 141 #endif // VM_INSTRUCTIONS_MIPS_H_ |
OLD | NEW |