| 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 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 static const int kLengthInBytes = 3 * Instr::kInstrSize; | 104 static const int kLengthInBytes = 3 * Instr::kInstrSize; |
| 83 | 105 |
| 84 static int pattern_length_in_bytes(); | 106 static int pattern_length_in_bytes(); |
| 85 | 107 |
| 86 bool IsValid() const; | 108 bool IsValid() const; |
| 87 uword TargetAddress() const; | 109 uword TargetAddress() const; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 107 | 129 |
| 108 bool IsValid() const; | 130 bool IsValid() const; |
| 109 | 131 |
| 110 private: | 132 private: |
| 111 const uword pc_; | 133 const uword pc_; |
| 112 }; | 134 }; |
| 113 | 135 |
| 114 } // namespace dart | 136 } // namespace dart |
| 115 | 137 |
| 116 #endif // VM_INSTRUCTIONS_ARM_H_ | 138 #endif // VM_INSTRUCTIONS_ARM_H_ |
| OLD | NEW |