From: <mic...@us...> - 2007-04-14 09:58:33
|
Revision: 51 http://svn.sourceforge.net/pearcolator/?rev=51&view=rev Author: michael_baer Date: 2007-04-14 02:58:24 -0700 (Sat, 14 Apr 2007) Log Message: ----------- Protected DecoderUtils.numberOfInstructions Introduced usage of generic ArrayList in PPC2IR Modified Paths: -------------- src/org/binarytranslator/arch/ppc/decoder/PPC2IR.java src/org/binarytranslator/arch/ppc/decoder/PPC_InstructionDecoder.java src/org/binarytranslator/generic/decoder/DecoderUtils.java Modified: src/org/binarytranslator/arch/ppc/decoder/PPC2IR.java =================================================================== --- src/org/binarytranslator/arch/ppc/decoder/PPC2IR.java 2007-04-14 09:55:45 UTC (rev 50) +++ src/org/binarytranslator/arch/ppc/decoder/PPC2IR.java 2007-04-14 09:58:24 UTC (rev 51) @@ -962,7 +962,7 @@ * Return an array of unused registers */ protected OPT_Register[] getUnusedRegisters() { - ArrayList unusedRegisterList = new ArrayList(); + ArrayList<OPT_Register> unusedRegisterList = new ArrayList<OPT_Register>(); for (int i = 0; i < 32; i++) { if (intRegInUseMap[i] == false) { unusedRegisterList.add(intRegMap[i]); Modified: src/org/binarytranslator/arch/ppc/decoder/PPC_InstructionDecoder.java =================================================================== --- src/org/binarytranslator/arch/ppc/decoder/PPC_InstructionDecoder.java 2007-04-14 09:55:45 UTC (rev 50) +++ src/org/binarytranslator/arch/ppc/decoder/PPC_InstructionDecoder.java 2007-04-14 09:58:24 UTC (rev 51) @@ -268,7 +268,7 @@ if (DBT_Options.debugInstr) { System.out.println(lazy.makeKey(pc) + PPC_Disassembler.disasm(instr, pc) - + " " + ppc2ir.getCurrentBlock() + " " + ppc2ir.numberOfInstructions); + + " " + ppc2ir.getCurrentBlock() + " " + ppc2ir.getNumInstructions()); } int primaryOpcode = bits(instr, 0, 5); Modified: src/org/binarytranslator/generic/decoder/DecoderUtils.java =================================================================== --- src/org/binarytranslator/generic/decoder/DecoderUtils.java 2007-04-14 09:55:45 UTC (rev 50) +++ src/org/binarytranslator/generic/decoder/DecoderUtils.java 2007-04-14 09:58:24 UTC (rev 51) @@ -29,7 +29,30 @@ import org.jikesrvm.classloader.VM_MethodReference; import org.jikesrvm.classloader.VM_TypeReference; import org.jikesrvm.compilers.opt.OPT_Constants; -import org.jikesrvm.compilers.opt.ir.*; +import org.jikesrvm.compilers.opt.ir.Athrow; +import org.jikesrvm.compilers.opt.ir.BBend; +import org.jikesrvm.compilers.opt.ir.Call; +import org.jikesrvm.compilers.opt.ir.Goto; +import org.jikesrvm.compilers.opt.ir.IfCmp; +import org.jikesrvm.compilers.opt.ir.LookupSwitch; +import org.jikesrvm.compilers.opt.ir.Move; +import org.jikesrvm.compilers.opt.ir.New; +import org.jikesrvm.compilers.opt.ir.OPT_AddressConstantOperand; +import org.jikesrvm.compilers.opt.ir.OPT_BasicBlock; +import org.jikesrvm.compilers.opt.ir.OPT_BranchOperand; +import org.jikesrvm.compilers.opt.ir.OPT_BranchProfileOperand; +import org.jikesrvm.compilers.opt.ir.OPT_ConditionOperand; +import org.jikesrvm.compilers.opt.ir.OPT_GenerationContext; +import org.jikesrvm.compilers.opt.ir.OPT_Instruction; +import org.jikesrvm.compilers.opt.ir.OPT_IntConstantOperand; +import org.jikesrvm.compilers.opt.ir.OPT_MethodOperand; +import org.jikesrvm.compilers.opt.ir.OPT_Operand; +import org.jikesrvm.compilers.opt.ir.OPT_Operator; +import org.jikesrvm.compilers.opt.ir.OPT_Operators; +import org.jikesrvm.compilers.opt.ir.OPT_Register; +import org.jikesrvm.compilers.opt.ir.OPT_RegisterOperand; +import org.jikesrvm.compilers.opt.ir.OPT_TrueGuardOperand; +import org.jikesrvm.compilers.opt.ir.OPT_TypeOperand; /** * A collection of common tools used by decoders. The public entry point for the @@ -107,12 +130,10 @@ .resolveInvokeSpecial(); } - // -oO Global IR Oo- - /** * Number of translated instructions */ - public int numberOfInstructions; + private int numberOfInstructions; /** * The process space object used by the running PPC binary. @@ -237,8 +258,6 @@ */ protected abstract void report(String str); - // -oO Important entry points Oo- - /** * Constructor * @@ -284,6 +303,11 @@ unresolvedLookupSwitchForSwitches_Laziness = new ArrayList<Laziness>(); unresolvedLookupSwitchForSwitches_WasCall = new ArrayList<Boolean>(); } + + /** Returns the number of previously translated instructions within this trace. */ + public int getNumInstructions() { + return numberOfInstructions; + } /** * This is the main loop to generate the HIR. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |