Removing SET_RETURN_ADDRESS - hopefully it'll never be needed again.
This commit is contained in:
@@ -13,8 +13,9 @@ using namespace alloy;
|
||||
using namespace alloy::frontend;
|
||||
|
||||
|
||||
ContextInfo::ContextInfo(size_t size) :
|
||||
size_(size) {
|
||||
ContextInfo::ContextInfo(size_t size, uintptr_t thread_state_offset) :
|
||||
size_(size),
|
||||
thread_state_offset_(thread_state_offset) {
|
||||
}
|
||||
|
||||
ContextInfo::~ContextInfo() {
|
||||
|
||||
@@ -19,13 +19,16 @@ namespace frontend {
|
||||
|
||||
class ContextInfo {
|
||||
public:
|
||||
ContextInfo(size_t size);
|
||||
ContextInfo(size_t size, uintptr_t thread_state_offset);
|
||||
~ContextInfo();
|
||||
|
||||
size_t size() const { return size_; }
|
||||
|
||||
uintptr_t thread_state_offset() const { return thread_state_offset_; }
|
||||
|
||||
private:
|
||||
size_t size_;
|
||||
uintptr_t thread_state_offset_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -64,6 +64,10 @@ typedef union {
|
||||
|
||||
#pragma pack(push, 4)
|
||||
typedef struct XECACHEALIGN64 PPCContext_s {
|
||||
// Must be stored at 0x0 for now.
|
||||
// TODO(benvanik): find a nice way to describe this to the JIT.
|
||||
runtime::ThreadState* thread_state;
|
||||
|
||||
// Most frequently used registers first.
|
||||
uint64_t r[32]; // General purpose registers
|
||||
uint64_t lr; // Link register
|
||||
@@ -194,7 +198,6 @@ typedef struct XECACHEALIGN64 PPCContext_s {
|
||||
// current runtime and its data.
|
||||
uint8_t* membase;
|
||||
runtime::Runtime* runtime;
|
||||
runtime::ThreadState* thread_state;
|
||||
volatile int suspend_flag;
|
||||
|
||||
void SetRegFromString(const char* name, const char* value);
|
||||
|
||||
@@ -35,7 +35,6 @@ int InstrEmit_branch(
|
||||
// be correct for returns.
|
||||
if (lk) {
|
||||
Value* return_address = f.LoadConstant(cia + 4);
|
||||
f.SetReturnAddress(return_address);
|
||||
f.StoreLR(return_address);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,9 @@ PPCFrontend::PPCFrontend(Runtime* runtime) :
|
||||
Frontend(runtime) {
|
||||
InitializeIfNeeded();
|
||||
|
||||
ContextInfo* info = new ContextInfo(sizeof(PPCContext));
|
||||
ContextInfo* info = new ContextInfo(
|
||||
sizeof(PPCContext),
|
||||
offsetof(PPCContext, thread_state));
|
||||
// Add fields/etc.
|
||||
context_info_ = info;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user