diff options
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/Compiler.h | 38 | ||||
-rw-r--r-- | src/compiler/CompilerIR.h | 34 | ||||
-rw-r--r-- | src/compiler/CompilerUtility.h | 14 | ||||
-rw-r--r-- | src/compiler/codegen/GenInvoke.cc | 2 | ||||
-rw-r--r-- | src/compiler/codegen/Optimizer.h | 3 | ||||
-rw-r--r-- | src/compiler/codegen/Ralloc.h | 2 |
6 files changed, 42 insertions, 51 deletions
diff --git a/src/compiler/Compiler.h b/src/compiler/Compiler.h index 6d62f29bcf..db7f2ba28d 100644 --- a/src/compiler/Compiler.h +++ b/src/compiler/Compiler.h @@ -170,34 +170,26 @@ bool oatArchInit(void); bool oatStartup(void); void oatShutdown(void); void oatScanAllClassPointers(void (*callback)(void* ptr)); -void oatInitializeSSAConversion(struct CompilationUnit* cUnit); -int SRegToVReg(const struct CompilationUnit* cUnit, int ssaReg); -int SRegToSubscript(const struct CompilationUnit* cUnit, int ssaReg); -bool oatFindLocalLiveIn(struct CompilationUnit* cUnit, - struct BasicBlock* bb); -bool oatDoSSAConversion(struct CompilationUnit* cUnit, - struct BasicBlock* bb); -bool oatDoConstantPropagation(struct CompilationUnit* cUnit, - struct BasicBlock* bb); -bool oatFindInductionVariables(struct CompilationUnit* cUnit, - struct BasicBlock* bb); +void oatInitializeSSAConversion(CompilationUnit* cUnit); +int SRegToVReg(const CompilationUnit* cUnit, int ssaReg); +int SRegToSubscript(const CompilationUnit* cUnit, int ssaReg); +bool oatFindLocalLiveIn(CompilationUnit* cUnit, BasicBlock* bb); +bool oatDoSSAConversion(CompilationUnit* cUnit, BasicBlock* bb); +bool oatDoConstantPropagation(CompilationUnit* cUnit, BasicBlock* bb); +bool oatFindInductionVariables(CompilationUnit* cUnit, BasicBlock* bb); /* Clear the visited flag for each BB */ -bool oatClearVisitedFlag(struct CompilationUnit* cUnit, - struct BasicBlock* bb); -char* oatGetDalvikDisassembly(CompilationUnit* cUnit, - const DecodedInstruction& insn, +bool oatClearVisitedFlag(CompilationUnit* cUnit, BasicBlock* bb); +char* oatGetDalvikDisassembly(CompilationUnit* cUnit, const DecodedInstruction& insn, const char* note); -char* oatFullDisassembler(struct CompilationUnit* cUnit, - const struct MIR* mir); -char* oatGetSSAString(struct CompilationUnit* cUnit, - struct SSARepresentation* ssaRep); -void oatDataFlowAnalysisDispatcher(struct CompilationUnit* cUnit, - bool (*func)(struct CompilationUnit* , struct BasicBlock*), +char* oatFullDisassembler(CompilationUnit* cUnit, const MIR* mir); +char* oatGetSSAString(CompilationUnit* cUnit, SSARepresentation* ssaRep); +void oatDataFlowAnalysisDispatcher(CompilationUnit* cUnit, + bool (*func)(CompilationUnit* , BasicBlock*), DataFlowAnalysisMode dfaMode, bool isIterative); -void oatMethodSSATransformation(struct CompilationUnit* cUnit); +void oatMethodSSATransformation(CompilationUnit* cUnit); u8 oatGetRegResourceMask(int reg); -void oatDumpCFG(struct CompilationUnit* cUnit, const char* dirPrefix); +void oatDumpCFG(CompilationUnit* cUnit, const char* dirPrefix); void oatProcessSwitchTables(CompilationUnit* cUnit); bool oatIsFpReg(int reg); uint32_t oatFpRegMask(void); diff --git a/src/compiler/CompilerIR.h b/src/compiler/CompilerIR.h index 88593bd09e..67d741a095 100644 --- a/src/compiler/CompilerIR.h +++ b/src/compiler/CompilerIR.h @@ -91,8 +91,8 @@ struct RegisterInfo { bool live; // Is there an associated SSA name? bool dirty; // If live, is it dirty? int sReg; // Name of live value - struct LIR *defStart; // Starting inst in last def sequence - struct LIR *defEnd; // Ending inst in last def sequence + LIR *defStart; // Starting inst in last def sequence + LIR *defEnd; // Ending inst in last def sequence }; struct RegisterPool { @@ -143,9 +143,9 @@ enum BBType { struct LIR { int offset; // Offset of this instruction int dalvikOffset; // Offset of Dalvik opcode - struct LIR* next; - struct LIR* prev; - struct LIR* target; + LIR* next; + LIR* prev; + LIR* target; int opcode; int operands[5]; // [0..4] = [dest, src1, src2, extra, extra2] struct { @@ -213,9 +213,9 @@ struct MIR { DecodedInstruction dalvikInsn; unsigned int width; unsigned int offset; - struct MIR* prev; - struct MIR* next; - struct SSARepresentation* ssaRep; + MIR* prev; + MIR* next; + SSARepresentation* ssaRep; int optimizationFlags; int seqNum; union { @@ -224,7 +224,7 @@ struct MIR { // Used by the inlined invoke to find the class and method pointers CallsiteInfo* callsiteInfo; // Used to quickly locate all Phi opcodes - struct MIR* phiNext; + MIR* phiNext; } meta; }; @@ -253,10 +253,10 @@ struct BasicBlock { bool isFallThroughFromInvoke; // True means the block needs alignment MIR* firstMIRInsn; MIR* lastMIRInsn; - struct BasicBlock* fallThrough; - struct BasicBlock* taken; - struct BasicBlock* iDom; // Immediate dominator - struct BasicBlockDataFlow* dataFlowInfo; + BasicBlock* fallThrough; + BasicBlock* taken; + BasicBlock* iDom; // Immediate dominator + BasicBlockDataFlow* dataFlowInfo; GrowableList* predecessors; ArenaBitVector* dominators; ArenaBitVector* iDominated; // Set nodes being immediately dominated @@ -425,7 +425,7 @@ struct CompilationUnit { bool qdMode; // Compile for code size/compile time bool usesLinkRegister; // For self-verification only bool methodTraceSupport; // For TraceView profiling - struct RegisterPool* regPool; + RegisterPool* regPool; int optRound; // round number to tell an LIR's age InstructionSet instructionSet; /* Number of total regs used in the whole cUnit after SSA transformation */ @@ -529,10 +529,10 @@ struct CompilationUnit { std::string compilerMethodMatch; // Flips sense of compilerMethodMatch - apply flags if doesn't match. bool compilerFlipMatch; - struct ArenaMemBlock* arenaHead; - struct ArenaMemBlock* currentArena; + ArenaMemBlock* arenaHead; + ArenaMemBlock* currentArena; int numArenaBlocks; - struct Memstats* mstats; + Memstats* mstats; int* opcodeCount; // Count Dalvik opcodes for tuning #ifndef NDEBUG /* diff --git a/src/compiler/CompilerUtility.h b/src/compiler/CompilerUtility.h index f7b9b0e7fd..4a15f265e7 100644 --- a/src/compiler/CompilerUtility.h +++ b/src/compiler/CompilerUtility.h @@ -33,7 +33,7 @@ bool oatHeapInit(CompilationUnit* cUnit); struct ArenaMemBlock { size_t blockSize; size_t bytesAllocated; - struct ArenaMemBlock *next; + ArenaMemBlock *next; char ptr[0]; }; @@ -87,9 +87,10 @@ struct ArenaBitVectorIterator { #define BLOCK_NAME_LEN 80 /* Forward declarations */ -struct LIR; struct BasicBlock; struct CompilationUnit; +struct LIR; +struct RegLocation; void oatInitGrowableList(CompilationUnit* cUnit,GrowableList* gList, size_t initLength, oatListKind kind = kListMisc); @@ -124,14 +125,13 @@ bool oatCompareBitVectors(const ArenaBitVector* src1, bool oatTestBitVectors(const ArenaBitVector* src1, const ArenaBitVector* src2); int oatCountSetBits(const ArenaBitVector* pBits); -void oatDumpLIRInsn(CompilationUnit* cUnit, struct LIR* lir, - unsigned char* baseAddr); -void oatDumpResourceMask(struct LIR* lir, u8 mask, const char* prefix); +void oatDumpLIRInsn(CompilationUnit* cUnit, LIR* lir, unsigned char* baseAddr); +void oatDumpResourceMask(LIR* lir, u8 mask, const char* prefix); void oatDumpBlockBitVector(const GrowableList* blocks, char* msg, const ArenaBitVector* bv, int length); -void oatGetBlockName(struct BasicBlock* bb, char* name); +void oatGetBlockName(BasicBlock* bb, char* name); const char* oatGetShortyFromTargetIdx(CompilationUnit*, int); -void oatDumpRegLocTable(struct RegLocation*, int); +void oatDumpRegLocTable(RegLocation*, int); void oatDumpMemStats(CompilationUnit* cUnit); } // namespace art diff --git a/src/compiler/codegen/GenInvoke.cc b/src/compiler/codegen/GenInvoke.cc index a904419138..b986e785b3 100644 --- a/src/compiler/codegen/GenInvoke.cc +++ b/src/compiler/codegen/GenInvoke.cc @@ -884,7 +884,7 @@ bool genIntrinsic(CompilationUnit* cUnit, BasicBlock* bb, MIR* mir, * method. By doing this during basic block construction, we can also * take advantage of/generate new useful dataflow info. */ - std::string tgtMethod = PrettyMethod(mir->dalvikInsn.vB, *cUnit->dex_file); + std::string tgtMethod(PrettyMethod(mir->dalvikInsn.vB, *cUnit->dex_file)); if (tgtMethod.compare("char java.lang.String.charAt(int)") == 0) { return genInlinedCharAt(cUnit, bb, mir, type, isRange); } diff --git a/src/compiler/codegen/Optimizer.h b/src/compiler/codegen/Optimizer.h index 06c77320c6..94b1907ef1 100644 --- a/src/compiler/codegen/Optimizer.h +++ b/src/compiler/codegen/Optimizer.h @@ -25,8 +25,7 @@ namespace art { struct CompilationUnit; struct LIR; -void oatApplyLocalOptimizations(struct CompilationUnit* cUnit, - struct LIR* head, struct LIR* tail); +void oatApplyLocalOptimizations(CompilationUnit* cUnit, LIR* head, LIR* tail); } // namespace art diff --git a/src/compiler/codegen/Ralloc.h b/src/compiler/codegen/Ralloc.h index 21690821a8..671dffed2f 100644 --- a/src/compiler/codegen/Ralloc.h +++ b/src/compiler/codegen/Ralloc.h @@ -95,7 +95,7 @@ extern void oatResetDef(CompilationUnit* cUnit, int reg); extern void oatResetDefLoc(CompilationUnit* cUnit, RegLocation rl); /* Set up temp & preserved register pools specialized by target */ -extern void oatInitPool(struct RegisterInfo* regs, int* regNums, int num); +extern void oatInitPool(RegisterInfo* regs, int* regNums, int num); /* * Mark the beginning and end LIR of a def sequence. Note that |