| 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_IA32_H_ | 6 #ifndef VM_INSTRUCTIONS_IA32_H_ |
| 7 #define VM_INSTRUCTIONS_IA32_H_ | 7 #define VM_INSTRUCTIONS_IA32_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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 return kCallPattern; | 97 return kCallPattern; |
| 98 } | 98 } |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 static const int kLengthInBytes = 5; | 101 static const int kLengthInBytes = 5; |
| 102 | 102 |
| 103 DISALLOW_COPY_AND_ASSIGN(CallPattern); | 103 DISALLOW_COPY_AND_ASSIGN(CallPattern); |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 | 106 |
| 107 class JumpPattern : public CallOrJumpPattern<JumpPattern> { | |
| 108 public: | |
| 109 JumpPattern(uword pc, const Code& code) : CallOrJumpPattern(pc) {} | |
| 110 | |
| 111 static int pattern_length_in_bytes() { return kLengthInBytes; } | |
| 112 static const int* pattern() { | |
| 113 static const int kJumpPattern[kLengthInBytes] = {0xE9, -1, -1, -1, -1}; | |
| 114 return kJumpPattern; | |
| 115 } | |
| 116 | |
| 117 private: | |
| 118 static const int kLengthInBytes = 5; | |
| 119 | |
| 120 DISALLOW_COPY_AND_ASSIGN(JumpPattern); | |
| 121 }; | |
| 122 | |
| 123 | |
| 124 class ReturnPattern : public InstructionPattern<ReturnPattern> { | 107 class ReturnPattern : public InstructionPattern<ReturnPattern> { |
| 125 public: | 108 public: |
| 126 explicit ReturnPattern(uword pc) : InstructionPattern(pc) {} | 109 explicit ReturnPattern(uword pc) : InstructionPattern(pc) {} |
| 127 | 110 |
| 128 static const int* pattern() { | 111 static const int* pattern() { |
| 129 static const int kReturnPattern[kLengthInBytes] = { 0xC3 }; | 112 static const int kReturnPattern[kLengthInBytes] = { 0xC3 }; |
| 130 return kReturnPattern; | 113 return kReturnPattern; |
| 131 } | 114 } |
| 132 static int pattern_length_in_bytes() { return kLengthInBytes; } | 115 static int pattern_length_in_bytes() { return kLengthInBytes; } |
| 133 | 116 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 150 |
| 168 static int pattern_length_in_bytes() { return kLengthInBytes; } | 151 static int pattern_length_in_bytes() { return kLengthInBytes; } |
| 169 | 152 |
| 170 private: | 153 private: |
| 171 static const int kLengthInBytes = 2; | 154 static const int kLengthInBytes = 2; |
| 172 }; | 155 }; |
| 173 | 156 |
| 174 } // namespace dart | 157 } // namespace dart |
| 175 | 158 |
| 176 #endif // VM_INSTRUCTIONS_IA32_H_ | 159 #endif // VM_INSTRUCTIONS_IA32_H_ |
| OLD | NEW |