Removing SET_RETURN_ADDRESS - hopefully it'll never be needed again.

This commit is contained in:
Ben Vanik
2014-01-26 01:18:59 -08:00
parent 8789fd4134
commit ecf0988ddb
20 changed files with 81 additions and 83 deletions

View File

@@ -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() {

View File

@@ -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_;
};

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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;
}