| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_X64_H_ | 6 #ifndef VM_INSTRUCTIONS_X64_H_ |
| 7 #define VM_INSTRUCTIONS_X64_H_ | 7 #define VM_INSTRUCTIONS_X64_H_ |
| 8 | 8 |
| 9 #ifndef VM_INSTRUCTIONS_H_ | 9 #ifndef VM_INSTRUCTIONS_H_ |
| 10 #error Do not include instructions_ia32.h directly; use instructions.h instead. | 10 #error Do not include instructions_ia32.h directly; use instructions.h instead. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 return true; | 60 return true; |
| 61 } | 61 } |
| 62 | 62 |
| 63 const uword start_; | 63 const uword start_; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(InstructionPattern); | 65 DISALLOW_COPY_AND_ASSIGN(InstructionPattern); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 | 68 |
| 69 // 5 byte call instruction. |
| 70 class ShortCallPattern : public InstructionPattern<ShortCallPattern> { |
| 71 public: |
| 72 explicit ShortCallPattern(uword pc) : InstructionPattern(pc) {} |
| 73 |
| 74 void SetTargetAddress(uword new_target) const; |
| 75 |
| 76 static int pattern_length_in_bytes() { return kLengthInBytes; } |
| 77 static const int* pattern() { |
| 78 static const int kCallPattern[kLengthInBytes] = {0xE8, -1, -1, -1, -1}; |
| 79 return kCallPattern; |
| 80 } |
| 81 |
| 82 private: |
| 83 static const int kLengthInBytes = 5; |
| 84 DISALLOW_COPY_AND_ASSIGN(ShortCallPattern); |
| 85 }; |
| 86 |
| 87 |
| 69 class ReturnPattern : public InstructionPattern<ReturnPattern> { | 88 class ReturnPattern : public InstructionPattern<ReturnPattern> { |
| 70 public: | 89 public: |
| 71 explicit ReturnPattern(uword pc) : InstructionPattern(pc) {} | 90 explicit ReturnPattern(uword pc) : InstructionPattern(pc) {} |
| 72 | 91 |
| 73 static const int* pattern() { | 92 static const int* pattern() { |
| 74 static const int kReturnPattern[kLengthInBytes] = { 0xC3 }; | 93 static const int kReturnPattern[kLengthInBytes] = { 0xC3 }; |
| 75 return kReturnPattern; | 94 return kReturnPattern; |
| 76 } | 95 } |
| 77 | 96 |
| 78 static int pattern_length_in_bytes() { return kLengthInBytes; } | 97 static int pattern_length_in_bytes() { return kLengthInBytes; } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 134 |
| 116 static int pattern_length_in_bytes() { return kLengthInBytes; } | 135 static int pattern_length_in_bytes() { return kLengthInBytes; } |
| 117 | 136 |
| 118 private: | 137 private: |
| 119 static const int kLengthInBytes = 3; | 138 static const int kLengthInBytes = 3; |
| 120 }; | 139 }; |
| 121 | 140 |
| 122 } // namespace dart | 141 } // namespace dart |
| 123 | 142 |
| 124 #endif // VM_INSTRUCTIONS_X64_H_ | 143 #endif // VM_INSTRUCTIONS_X64_H_ |
| OLD | NEW |