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 | 4 |
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/instructions.h" | 8 #include "vm/instructions.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 const int* JumpPattern::pattern() const { | 47 const int* JumpPattern::pattern() const { |
48 // movq $target, TMP | 48 // movq $target, TMP |
49 // jmpq TMP | 49 // jmpq TMP |
50 static const int kJumpPattern[kLengthInBytes] = | 50 static const int kJumpPattern[kLengthInBytes] = |
51 {0x49, 0xBB, -1, -1, -1, -1, -1, -1, -1, -1, 0x41, 0xFF, 0xE3}; | 51 {0x49, 0xBB, -1, -1, -1, -1, -1, -1, -1, -1, 0x41, 0xFF, 0xE3}; |
52 return kJumpPattern; | 52 return kJumpPattern; |
53 } | 53 } |
54 | 54 |
55 | 55 |
| 56 void ShortCallPattern::SetTargetAddress(uword target) const { |
| 57 ASSERT(IsValid()); |
| 58 *reinterpret_cast<uint32_t*>(start() + 1) = target - start() - kLengthInBytes; |
| 59 } |
| 60 |
| 61 |
| 62 const int* ShortCallPattern::pattern() const { |
| 63 static const int kCallPattern[kLengthInBytes] = {0xE8, -1, -1, -1, -1}; |
| 64 return kCallPattern; |
| 65 } |
| 66 |
56 } // namespace dart | 67 } // namespace dart |
57 | 68 |
58 #endif // defined TARGET_ARCH_X64 | 69 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |