Converting addresses in xe::cpu to 32bit.
This commit is contained in:
@@ -229,7 +229,7 @@ int X64Emitter::Emit(HIRBuilder* builder, size_t& out_stack_size) {
|
||||
|
||||
void X64Emitter::MarkSourceOffset(const Instr* i) {
|
||||
auto entry = source_map_arena_.Alloc<SourceMapEntry>();
|
||||
entry->source_offset = i->src1.offset;
|
||||
entry->source_offset = static_cast<uint32_t>(i->src1.offset);
|
||||
entry->hir_offset = uint32_t(i->block->ordinal << 16) | i->ordinal;
|
||||
entry->code_offset = getSize();
|
||||
source_map_count_++;
|
||||
@@ -477,12 +477,11 @@ const int kICSlotCount = 4;
|
||||
const int kICSlotSize = 23;
|
||||
const uint64_t kICSlotInvalidTargetAddress = 0x0F0F0F0F0F0F0F0F;
|
||||
|
||||
uint64_t ResolveFunctionAddress(void* raw_context, uint64_t target_address) {
|
||||
uint64_t ResolveFunctionAddress(void* raw_context, uint32_t target_address) {
|
||||
// TODO(benvanik): generate this thunk at runtime? or a shim?
|
||||
auto thread_state = *reinterpret_cast<ThreadState**>(raw_context);
|
||||
|
||||
// TODO(benvanik): required?
|
||||
target_address &= 0xFFFFFFFF;
|
||||
assert_not_zero(target_address);
|
||||
|
||||
Function* fn = NULL;
|
||||
|
||||
@@ -34,10 +34,11 @@ int X64Function::AddBreakpointImpl(Breakpoint* breakpoint) { return 0; }
|
||||
|
||||
int X64Function::RemoveBreakpointImpl(Breakpoint* breakpoint) { return 0; }
|
||||
|
||||
int X64Function::CallImpl(ThreadState* thread_state, uint64_t return_address) {
|
||||
int X64Function::CallImpl(ThreadState* thread_state, uint32_t return_address) {
|
||||
auto backend = (X64Backend*)thread_state->runtime()->backend();
|
||||
auto thunk = backend->host_to_guest_thunk();
|
||||
thunk(machine_code_, thread_state->raw_context(), (void*)return_address);
|
||||
thunk(machine_code_, thread_state->raw_context(),
|
||||
reinterpret_cast<void*>(uintptr_t(return_address)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class X64Function : public Function {
|
||||
protected:
|
||||
virtual int AddBreakpointImpl(Breakpoint* breakpoint);
|
||||
virtual int RemoveBreakpointImpl(Breakpoint* breakpoint);
|
||||
virtual int CallImpl(ThreadState* thread_state, uint64_t return_address);
|
||||
virtual int CallImpl(ThreadState* thread_state, uint32_t return_address);
|
||||
|
||||
private:
|
||||
void* machine_code_;
|
||||
|
||||
Reference in New Issue
Block a user