Removing vestigial ContextInfo.
This commit is contained in:
parent
5e6c1f5a50
commit
9273359cdd
|
@ -277,8 +277,7 @@ void X64Emitter::MarkSourceOffset(const Instr* i) {
|
||||||
|
|
||||||
void X64Emitter::EmitGetCurrentThreadId() {
|
void X64Emitter::EmitGetCurrentThreadId() {
|
||||||
// rcx must point to context. We could fetch from the stack if needed.
|
// rcx must point to context. We could fetch from the stack if needed.
|
||||||
mov(ax,
|
mov(ax, word[rcx + offsetof(frontend::PPCContext, thread_id)]);
|
||||||
word[rcx + processor_->frontend()->context_info()->thread_id_offset()]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void X64Emitter::EmitTraceUserCallReturn() {}
|
void X64Emitter::EmitTraceUserCallReturn() {}
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include "xenia/base/profiling.h"
|
#include "xenia/base/profiling.h"
|
||||||
#include "xenia/cpu/compiler/compiler.h"
|
#include "xenia/cpu/compiler/compiler.h"
|
||||||
|
#include "xenia/cpu/frontend/ppc_context.h"
|
||||||
#include "xenia/cpu/processor.h"
|
#include "xenia/cpu/processor.h"
|
||||||
|
|
||||||
DECLARE_bool(debug);
|
DECLARE_bool(debug);
|
||||||
|
@ -28,7 +29,6 @@ namespace passes {
|
||||||
// TODO(benvanik): remove when enums redefined.
|
// TODO(benvanik): remove when enums redefined.
|
||||||
using namespace xe::cpu::hir;
|
using namespace xe::cpu::hir;
|
||||||
|
|
||||||
using xe::cpu::frontend::ContextInfo;
|
|
||||||
using xe::cpu::hir::Block;
|
using xe::cpu::hir::Block;
|
||||||
using xe::cpu::hir::HIRBuilder;
|
using xe::cpu::hir::HIRBuilder;
|
||||||
using xe::cpu::hir::Instr;
|
using xe::cpu::hir::Instr;
|
||||||
|
@ -44,9 +44,8 @@ bool ContextPromotionPass::Initialize(Compiler* compiler) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a terrible implementation.
|
// This is a terrible implementation.
|
||||||
ContextInfo* context_info = processor_->frontend()->context_info();
|
context_values_.resize(sizeof(frontend::PPCContext));
|
||||||
context_values_.resize(context_info->size());
|
context_validity_.resize(static_cast<uint32_t>(sizeof(frontend::PPCContext)));
|
||||||
context_validity_.resize(static_cast<uint32_t>(context_info->size()));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
* Xenia : Xbox 360 Emulator Research Project *
|
|
||||||
******************************************************************************
|
|
||||||
* Copyright 2013 Ben Vanik. All rights reserved. *
|
|
||||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
|
||||||
******************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "xenia/cpu/frontend/context_info.h"
|
|
||||||
|
|
||||||
namespace xe {
|
|
||||||
namespace cpu {
|
|
||||||
namespace frontend {
|
|
||||||
|
|
||||||
ContextInfo::ContextInfo(size_t size, uintptr_t thread_state_offset,
|
|
||||||
uintptr_t thread_id_offset)
|
|
||||||
: size_(size),
|
|
||||||
thread_state_offset_(thread_state_offset),
|
|
||||||
thread_id_offset_(thread_id_offset) {}
|
|
||||||
|
|
||||||
ContextInfo::~ContextInfo() {}
|
|
||||||
|
|
||||||
} // namespace frontend
|
|
||||||
} // namespace cpu
|
|
||||||
} // namespace xe
|
|
|
@ -1,41 +0,0 @@
|
||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
* Xenia : Xbox 360 Emulator Research Project *
|
|
||||||
******************************************************************************
|
|
||||||
* Copyright 2013 Ben Vanik. All rights reserved. *
|
|
||||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
|
||||||
******************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef XENIA_CPU_FRONTEND_CONTEXT_INFO_H_
|
|
||||||
#define XENIA_CPU_FRONTEND_CONTEXT_INFO_H_
|
|
||||||
|
|
||||||
#include <cstddef>
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
namespace xe {
|
|
||||||
namespace cpu {
|
|
||||||
namespace frontend {
|
|
||||||
|
|
||||||
class ContextInfo {
|
|
||||||
public:
|
|
||||||
ContextInfo(size_t size, uintptr_t thread_state_offset,
|
|
||||||
uintptr_t thread_id_offset);
|
|
||||||
~ContextInfo();
|
|
||||||
|
|
||||||
size_t size() const { return size_; }
|
|
||||||
|
|
||||||
uintptr_t thread_state_offset() const { return thread_state_offset_; }
|
|
||||||
uintptr_t thread_id_offset() const { return thread_id_offset_; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
size_t size_;
|
|
||||||
uintptr_t thread_state_offset_;
|
|
||||||
uintptr_t thread_id_offset_;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace frontend
|
|
||||||
} // namespace cpu
|
|
||||||
} // namespace xe
|
|
||||||
|
|
||||||
#endif // XENIA_CPU_FRONTEND_CONTEXT_INFO_H_
|
|
|
@ -43,12 +43,6 @@ void CleanupOnShutdown() {}
|
||||||
|
|
||||||
PPCFrontend::PPCFrontend(Processor* processor) : processor_(processor) {
|
PPCFrontend::PPCFrontend(Processor* processor) : processor_(processor) {
|
||||||
InitializeIfNeeded();
|
InitializeIfNeeded();
|
||||||
|
|
||||||
std::unique_ptr<ContextInfo> context_info(
|
|
||||||
new ContextInfo(sizeof(PPCContext), offsetof(PPCContext, thread_state),
|
|
||||||
offsetof(PPCContext, thread_id)));
|
|
||||||
// Add fields/etc.
|
|
||||||
context_info_ = std::move(context_info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PPCFrontend::~PPCFrontend() {
|
PPCFrontend::~PPCFrontend() {
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "xenia/base/type_pool.h"
|
#include "xenia/base/type_pool.h"
|
||||||
#include "xenia/cpu/frontend/context_info.h"
|
|
||||||
#include "xenia/cpu/function.h"
|
#include "xenia/cpu/function.h"
|
||||||
#include "xenia/memory.h"
|
#include "xenia/memory.h"
|
||||||
|
|
||||||
|
@ -45,7 +44,6 @@ class PPCFrontend {
|
||||||
|
|
||||||
Processor* processor() const { return processor_; }
|
Processor* processor() const { return processor_; }
|
||||||
Memory* memory() const;
|
Memory* memory() const;
|
||||||
ContextInfo* context_info() const { return context_info_.get(); }
|
|
||||||
PPCBuiltins* builtins() { return &builtins_; }
|
PPCBuiltins* builtins() { return &builtins_; }
|
||||||
|
|
||||||
bool DeclareFunction(GuestFunction* function);
|
bool DeclareFunction(GuestFunction* function);
|
||||||
|
@ -53,7 +51,6 @@ class PPCFrontend {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Processor* processor_;
|
Processor* processor_;
|
||||||
std::unique_ptr<ContextInfo> context_info_;
|
|
||||||
PPCBuiltins builtins_ = {0};
|
PPCBuiltins builtins_ = {0};
|
||||||
TypePool<PPCTranslator, PPCFrontend*> translator_pool_;
|
TypePool<PPCTranslator, PPCFrontend*> translator_pool_;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue