From d2caf50772201a5aee852589e8985e1431e8d01c Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Sun, 24 Feb 2013 16:03:19 -0700 Subject: [PATCH] fix debug build --- src/codegen/target/arm/fixup.cpp | 2 ++ src/codegen/target/arm/multimethod.cpp | 2 ++ src/codegen/target/powerpc/fixup.cpp | 1 + src/codegen/target/powerpc/multimethod.cpp | 32 ++++++++++++++++++++++ src/codegen/target/powerpc/multimethod.h | 30 +++++--------------- src/codegen/target/x86/fixup.cpp | 2 ++ src/codegen/target/x86/multimethod.cpp | 2 ++ 7 files changed, 48 insertions(+), 23 deletions(-) diff --git a/src/codegen/target/arm/fixup.cpp b/src/codegen/target/arm/fixup.cpp index 2cf0b01216..88b5789f5a 100644 --- a/src/codegen/target/arm/fixup.cpp +++ b/src/codegen/target/arm/fixup.cpp @@ -16,6 +16,8 @@ namespace avian { namespace codegen { namespace arm { +using namespace util; + unsigned padding(MyBlock*, unsigned); OffsetPromise::OffsetPromise(Context* con, MyBlock* block, unsigned offset, bool forTrace): diff --git a/src/codegen/target/arm/multimethod.cpp b/src/codegen/target/arm/multimethod.cpp index 76c681a60f..4e789cc18c 100644 --- a/src/codegen/target/arm/multimethod.cpp +++ b/src/codegen/target/arm/multimethod.cpp @@ -16,6 +16,8 @@ namespace avian { namespace codegen { namespace arm { +using namespace util; + unsigned index(ArchitectureContext*, lir::UnaryOperation operation, lir::OperandType operand) { return operation + (lir::UnaryOperationCount * operand); diff --git a/src/codegen/target/powerpc/fixup.cpp b/src/codegen/target/powerpc/fixup.cpp index 06075c00e6..6de1698fe2 100644 --- a/src/codegen/target/powerpc/fixup.cpp +++ b/src/codegen/target/powerpc/fixup.cpp @@ -18,6 +18,7 @@ namespace codegen { namespace powerpc { using namespace isa; +using namespace util; unsigned padding(MyBlock*, unsigned); diff --git a/src/codegen/target/powerpc/multimethod.cpp b/src/codegen/target/powerpc/multimethod.cpp index 79b5f9bf7b..d8ffba5008 100644 --- a/src/codegen/target/powerpc/multimethod.cpp +++ b/src/codegen/target/powerpc/multimethod.cpp @@ -19,6 +19,38 @@ namespace avian { namespace codegen { namespace powerpc { +using namespace util; + +unsigned index(ArchitectureContext*, lir::UnaryOperation operation, lir::OperandType operand) +{ + return operation + (lir::UnaryOperationCount * operand); +} + +unsigned index(ArchitectureContext*, + lir::BinaryOperation operation, + lir::OperandType operand1, + lir::OperandType operand2) +{ + return operation + + (lir::BinaryOperationCount * operand1) + + (lir::BinaryOperationCount * lir::OperandTypeCount * operand2); +} + +unsigned index(ArchitectureContext* c UNUSED, + lir::TernaryOperation operation, + lir::OperandType operand1) +{ + assert(c, not isBranch(operation)); + + return operation + (lir::NonBranchTernaryOperationCount * operand1); +} + +unsigned branchIndex(ArchitectureContext* c UNUSED, lir::OperandType operand1, + lir::OperandType operand2) +{ + return operand1 + (lir::OperandTypeCount * operand2); +} + void populateTables(ArchitectureContext* c) { const lir::OperandType C = lir::ConstantOperand; const lir::OperandType A = lir::AddressOperand; diff --git a/src/codegen/target/powerpc/multimethod.h b/src/codegen/target/powerpc/multimethod.h index b2fe6f206d..06b881e97a 100644 --- a/src/codegen/target/powerpc/multimethod.h +++ b/src/codegen/target/powerpc/multimethod.h @@ -21,35 +21,19 @@ namespace codegen { namespace powerpc { -inline unsigned index(ArchitectureContext*, lir::UnaryOperation operation, lir::OperandType operand) -{ - return operation + (lir::UnaryOperationCount * operand); -} +unsigned index(ArchitectureContext*, lir::UnaryOperation operation, lir::OperandType operand); -inline unsigned index(ArchitectureContext*, +unsigned index(ArchitectureContext*, lir::BinaryOperation operation, lir::OperandType operand1, - lir::OperandType operand2) -{ - return operation - + (lir::BinaryOperationCount * operand1) - + (lir::BinaryOperationCount * lir::OperandTypeCount * operand2); -} + lir::OperandType operand2); -inline unsigned index(ArchitectureContext* c UNUSED, +unsigned index(ArchitectureContext* c UNUSED, lir::TernaryOperation operation, - lir::OperandType operand1) -{ - assert(c, not isBranch(operation)); + lir::OperandType operand1); - return operation + (lir::NonBranchTernaryOperationCount * operand1); -} - -inline unsigned branchIndex(ArchitectureContext* c UNUSED, lir::OperandType operand1, - lir::OperandType operand2) -{ - return operand1 + (lir::OperandTypeCount * operand2); -} +unsigned branchIndex(ArchitectureContext* c UNUSED, lir::OperandType operand1, + lir::OperandType operand2); void populateTables(ArchitectureContext* c); diff --git a/src/codegen/target/x86/fixup.cpp b/src/codegen/target/x86/fixup.cpp index 5e85d7c062..ba0a06f906 100644 --- a/src/codegen/target/x86/fixup.cpp +++ b/src/codegen/target/x86/fixup.cpp @@ -27,6 +27,8 @@ namespace avian { namespace codegen { namespace x86 { +using namespace util; + ResolvedPromise* resolvedPromise(Context* c, int64_t value) { return new(c->zone) ResolvedPromise(value); } diff --git a/src/codegen/target/x86/multimethod.cpp b/src/codegen/target/x86/multimethod.cpp index f0ad4621b2..9146c9d9cb 100644 --- a/src/codegen/target/x86/multimethod.cpp +++ b/src/codegen/target/x86/multimethod.cpp @@ -22,6 +22,8 @@ namespace avian { namespace codegen { namespace x86 { +using namespace util; + unsigned index(ArchitectureContext*, lir::UnaryOperation operation, lir::OperandType operand) { return operation + (lir::UnaryOperationCount * operand);