Sandbox getting close to running.
This commit is contained in:
@@ -128,8 +128,6 @@ int IVMFunction::CallImpl(ThreadState* thread_state, uint64_t return_address) {
|
||||
ics.return_address = return_address;
|
||||
ics.call_return_address = 0;
|
||||
|
||||
volatile int* suspend_flag_address = thread_state->suspend_flag_address();
|
||||
|
||||
// TODO(benvanik): DID_CARRY -- need HIR to set a OPCODE_FLAG_SET_CARRY
|
||||
// or something so the fns can set an ics flag.
|
||||
|
||||
@@ -139,12 +137,6 @@ int IVMFunction::CallImpl(ThreadState* thread_state, uint64_t return_address) {
|
||||
|
||||
uint32_t ia = 0;
|
||||
while (true) {
|
||||
// Check suspend. We could do this only on certain instructions, if we
|
||||
// wanted to speed things up.
|
||||
if (*suspend_flag_address) {
|
||||
thread_state->EnterSuspend();
|
||||
}
|
||||
|
||||
#ifdef TRACE_SOURCE_OFFSET
|
||||
uint64_t source_offset = -1;
|
||||
if (source_index < this->source_map_count_ &&
|
||||
|
||||
@@ -199,7 +199,6 @@ typedef struct XECACHEALIGN64 PPCContext_s {
|
||||
// Runtime-specific data pointer. Used on callbacks to get access to the
|
||||
// current runtime and its data.
|
||||
runtime::Runtime* runtime;
|
||||
volatile int suspend_flag;
|
||||
|
||||
void SetRegFromString(const char* name, const char* value);
|
||||
bool CompareRegWithString(const char* name, const char* value,
|
||||
|
||||
@@ -31,7 +31,7 @@ class Runtime {
|
||||
typedef std::vector<Module*> ModuleList;
|
||||
|
||||
public:
|
||||
Runtime(Memory* memory);
|
||||
explicit Runtime(Memory* memory);
|
||||
virtual ~Runtime();
|
||||
|
||||
Memory* memory() const { return memory_; }
|
||||
|
||||
@@ -32,10 +32,8 @@ class ThreadState {
|
||||
void* backend_data() const { return backend_data_; }
|
||||
void* raw_context() const { return raw_context_; }
|
||||
|
||||
virtual volatile int* suspend_flag_address() const = 0;
|
||||
virtual int Suspend(uint32_t timeout_ms = UINT_MAX) = 0;
|
||||
virtual int Resume(bool force = false) = 0;
|
||||
virtual void EnterSuspend() = 0;
|
||||
virtual int Suspend(uint32_t timeout_ms = UINT_MAX) { return 1; }
|
||||
virtual int Resume(bool force = false) { return 1; }
|
||||
|
||||
static void Bind(ThreadState* thread_state);
|
||||
static ThreadState* Get();
|
||||
|
||||
Reference in New Issue
Block a user