6#ifndef RUNTIME_VM_INSTRUCTIONS_X64_H_
7#define RUNTIME_VM_INSTRUCTIONS_X64_H_
9#ifndef RUNTIME_VM_INSTRUCTIONS_H_
10#error "Do not include instructions_x64.h directly; use instructions.h instead."
35 return TestBytesWith(P::pattern(), P::pattern_length_in_bytes());
45 bool TestBytesWith(
const int*
data,
int num_bytes)
const {
47 const uint8_t* byte_array =
reinterpret_cast<const uint8_t*
>(start_);
48 for (
int i = 0;
i < num_bytes;
i++) {
50 if ((
data[
i] >= 0) && (byte_array[
i] != (0xFF &
data[
i]))) {
62class ReturnPattern :
public InstructionPattern<ReturnPattern> {
68 return kReturnPattern;
79class ProloguePattern :
public InstructionPattern<ProloguePattern> {
84 static const int kProloguePattern[kLengthInBytes] = {0x55, 0x48, 0x89,
86 return kProloguePattern;
92 static constexpr int kLengthInBytes = 4;
96class SetFramePointerPattern
97 :
public InstructionPattern<SetFramePointerPattern> {
102 static const int kFramePointerPattern[kLengthInBytes] = {0x48, 0x89, 0xe5};
103 return kFramePointerPattern;
109 static constexpr int kLengthInBytes = 3;
113class PcRelativeCallPattern :
public InstructionPattern<PcRelativeCallPattern> {
163class PcRelativeTrampolineJumpPattern :
public ValueObject {
168 : pattern_start_(pattern_start) {}
171 uint8_t* pattern =
reinterpret_cast<uint8_t*
>(pattern_start_);
176 return LoadUnaligned(
reinterpret_cast<int32_t*
>(pattern_start_ + 1)) +
188 uint8_t* pattern =
reinterpret_cast<uint8_t*
>(pattern_start_);
189 return pattern[0] == 0xe9;
193 uword pattern_start_;
196class PcRelativeTailCallPattern :
public PcRelativeTrampolineJumpPattern {
InstructionPattern(uword pc)
static const int * pattern()
PcRelativeCallPattern(uword pc)
void set_distance(int32_t distance)
static constexpr int32_t kLowerCallingRange
static constexpr int kLengthInBytes
static int pattern_length_in_bytes()
static constexpr int32_t kUpperCallingRange
static constexpr int32_t kUpperCallingRange
PcRelativeTailCallPattern(uword pc)
static constexpr int32_t kLowerCallingRange
PcRelativeTrampolineJumpPattern(uword pattern_start)
static constexpr int kLengthInBytes
void set_distance(intptr_t distance)
static const int * pattern()
ProloguePattern(uword pc)
static int pattern_length_in_bytes()
static constexpr int kLengthInBytes
static const int * pattern()
static int pattern_length_in_bytes()
static const int * pattern()
SetFramePointerPattern(uword pc)
static int pattern_length_in_bytes()
static float max(float r, float g, float b)
static float min(float r, float g, float b)
static T LoadUnaligned(const T *ptr)
static void StoreUnaligned(T *ptr, T value)
intptr_t IndexFromPPLoadDisp32(uword start)
static int8_t data[kExtLength]
intptr_t IndexFromPPLoadDisp8(uword start)