Basic ContextPromotionPass and some opcode info rearranging.

This commit is contained in:
Ben Vanik
2013-12-07 04:39:48 -08:00
parent 51d0be0f0a
commit 329b554c7a
25 changed files with 907 additions and 617 deletions

View File

@@ -10,6 +10,7 @@
#include <alloy/frontend/ppc/ppc_frontend.h>
#include <alloy/frontend/tracing.h>
#include <alloy/frontend/ppc/ppc_context.h>
#include <alloy/frontend/ppc/ppc_disasm.h>
#include <alloy/frontend/ppc/ppc_emit.h>
#include <alloy/frontend/ppc/ppc_translator.h>
@@ -54,6 +55,10 @@ namespace {
PPCFrontend::PPCFrontend(Runtime* runtime) :
Frontend(runtime) {
InitializeIfNeeded();
ContextInfo* info = new ContextInfo(sizeof(PPCContext));
// Add fields/etc.
context_info_ = info;
}
PPCFrontend::~PPCFrontend() {

View File

@@ -30,9 +30,9 @@ PPCTranslator::PPCTranslator(PPCFrontend* frontend) :
scanner_ = new PPCScanner(frontend);
builder_ = new PPCFunctionBuilder(frontend);
compiler_ = new Compiler();
compiler_ = new Compiler(frontend->runtime());
//compiler_->AddPass(new passes::ContextPromotionPass());
compiler_->AddPass(new passes::ContextPromotionPass());
//compiler_->AddPass(new passes::ConstantPropagationPass());
//compiler_->AddPass(new passes::TypePropagationPass());
//compiler_->AddPass(new passes::ByteSwapEliminationPass());