| 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. |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #include "vm/constants_arm.h" | 13 #include "vm/constants_arm.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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 uword ic_data_load_end_; | 72 uword ic_data_load_end_; |
| 72 | 73 |
| 73 intptr_t target_address_pool_index_; | 74 intptr_t target_address_pool_index_; |
| 74 Array& args_desc_; | 75 Array& args_desc_; |
| 75 ICData& ic_data_; | 76 ICData& ic_data_; |
| 76 | 77 |
| 77 DISALLOW_COPY_AND_ASSIGN(CallPattern); | 78 DISALLOW_COPY_AND_ASSIGN(CallPattern); |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 | 81 |
| 82 class NativeCallPattern : public ValueObject { |
| 83 public: |
| 84 NativeCallPattern(uword pc, const Code& code); |
| 85 |
| 86 uword target() const; |
| 87 void set_target(uword target_address) const; |
| 88 |
| 89 NativeFunction native_function() const; |
| 90 void set_native_function(NativeFunction target) const; |
| 91 |
| 92 private: |
| 93 const ObjectPool& object_pool_; |
| 94 |
| 95 uword end_; |
| 96 intptr_t native_function_pool_index_; |
| 97 intptr_t target_address_pool_index_; |
| 98 |
| 99 DISALLOW_COPY_AND_ASSIGN(NativeCallPattern); |
| 100 }; |
| 101 |
| 102 |
| 81 class JumpPattern : public ValueObject { | 103 class JumpPattern : public ValueObject { |
| 82 public: | 104 public: |
| 83 JumpPattern(uword pc, const Code& code); | 105 JumpPattern(uword pc, const Code& code); |
| 84 | 106 |
| 85 static const int kLengthInBytes = 3 * Instr::kInstrSize; | 107 static const int kLengthInBytes = 3 * Instr::kInstrSize; |
| 86 | 108 |
| 87 static int pattern_length_in_bytes(); | 109 static int pattern_length_in_bytes(); |
| 88 | 110 |
| 89 bool IsValid() const; | 111 bool IsValid() const; |
| 90 uword TargetAddress() const; | 112 uword TargetAddress() const; |
| (...skipping 19 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_ARM_H_ | 141 #endif // VM_INSTRUCTIONS_ARM_H_ |
| OLD | NEW |