From: <ls...@us...> - 2010-02-19 07:21:58
|
Revision: 5727 http://jnode.svn.sourceforge.net/jnode/?rev=5727&view=rev Author: lsantha Date: 2010-02-19 07:21:51 +0000 (Fri, 19 Feb 2010) Log Message: ----------- Code style fixes. Modified Paths: -------------- trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeParser.java trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/EntryPoints.java trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java trunk/core/src/core/org/jnode/vm/compiler/InlineBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/VerifyingCompilerBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86Compiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86StackManager.java trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler32.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler64.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/EmitterContext.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerSSE.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FloatItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/InlinedMethodInfo.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/IntItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/Item.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemFactory.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/L1AHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/LongItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/RefItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/VirtualStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/WordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86Level1ACompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86RegisterPool.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86StackFrame.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86Level1BCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/stub/X86StubCompiler.java Modified: trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -69,14 +69,12 @@ import org.jnode.vm.x86.VmX86Processor32; import org.jnode.vm.x86.VmX86Processor64; import org.jnode.vm.x86.X86CpuID; -import org.jnode.vm.x86.compiler.X86CompilerConstants; import org.jnode.vm.x86.compiler.X86JumpTable; /** * @author epr */ -public class BootImageBuilder extends AbstractBootImageBuilder implements - X86CompilerConstants { +public class BootImageBuilder extends AbstractBootImageBuilder { public static final int LOAD_ADDR = 1024 * 1024; Modified: trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeParser.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeParser.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeParser.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -35,6 +35,7 @@ /** * @param bc + * @param cfg * @param handler */ protected CompilerBytecodeParser(VmByteCode bc, ControlFlowGraph cfg, CompilerBytecodeVisitor handler) { Modified: trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeVisitor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeVisitor.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeVisitor.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -32,6 +32,7 @@ /** * The given basic block is about to start. + * @param bb */ public abstract void startBasicBlock(BasicBlock bb); @@ -57,6 +58,7 @@ /** * Push the given VmType on the stack. + * @param value */ public abstract void visit_ldc(VmType<?> value); Modified: trunk/core/src/core/org/jnode/vm/compiler/EntryPoints.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/EntryPoints.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/compiler/EntryPoints.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -127,10 +127,11 @@ /** * Create a new instance * - * @param loader + * @param loader the VmClassLoader instance + * @param heapManager heap manager + * @param magic the compiler magic ID */ - public EntryPoints(VmClassLoader loader, VmHeapManager heapManager, - int magic) { + public EntryPoints(VmClassLoader loader, VmHeapManager heapManager, int magic) { try { this.magic = magic; // VmMember class @@ -174,8 +175,7 @@ writeBarrier = (heapManager != null) ? heapManager .getWriteBarrier() : null; if (writeBarrier != null) { - final VmType wbClass = loader.loadClass(writeBarrier.getClass() - .getName(), true); + final VmType wbClass = loader.loadClass(writeBarrier.getClass().getName(), true); arrayStoreWriteBarrier = testMethod(wbClass.getMethod( "arrayStoreWriteBarrier", "(Ljava/lang/Object;ILjava/lang/Object;)V")); @@ -191,105 +191,79 @@ } // MonitorManager - this.vmMonitorManagerClass = loader.loadClass( - "org.jnode.vm.scheduler.MonitorManager", true); - monitorEnterMethod = testMethod(vmMonitorManagerClass.getMethod( - "monitorEnter", "(Ljava/lang/Object;)V")); - monitorExitMethod = testMethod(vmMonitorManagerClass.getMethod( - "monitorExit", "(Ljava/lang/Object;)V")); + this.vmMonitorManagerClass = loader.loadClass("org.jnode.vm.scheduler.MonitorManager", true); + monitorEnterMethod = testMethod(vmMonitorManagerClass.getMethod("monitorEnter", "(Ljava/lang/Object;)V")); + monitorExitMethod = testMethod(vmMonitorManagerClass.getMethod("monitorExit", "(Ljava/lang/Object;)V")); // MathSupport - final VmType vmClass = loader.loadClass("org.jnode.vm.MathSupport", - true); + final VmType vmClass = loader.loadClass("org.jnode.vm.MathSupport", true); ldivMethod = testMethod(vmClass.getMethod("ldiv", "(JJ)J")); lremMethod = testMethod(vmClass.getMethod("lrem", "(JJ)J")); // VmInstanceField - this.vmInstanceFieldClass = loader.loadClass( - "org.jnode.vm.classmgr.VmInstanceField", true); - vmFieldOffsetField = (VmInstanceField) testField(vmInstanceFieldClass - .getField("offset")); + this.vmInstanceFieldClass = loader.loadClass("org.jnode.vm.classmgr.VmInstanceField", true); + vmFieldOffsetField = (VmInstanceField) testField(vmInstanceFieldClass.getField("offset")); // VmStaticField - this.vmStaticFieldClass = loader.loadClass( - "org.jnode.vm.classmgr.VmStaticField", true); - vmFieldStaticsIndexField = (VmInstanceField) testField(vmStaticFieldClass - .getField("staticsIndex")); + this.vmStaticFieldClass = loader.loadClass("org.jnode.vm.classmgr.VmStaticField", true); + vmFieldStaticsIndexField = (VmInstanceField) testField(vmStaticFieldClass.getField("staticsIndex")); // VmInstanceMethod - this.vmInstanceMethodClass = loader.loadClass( - "org.jnode.vm.classmgr.VmInstanceMethod", true); - vmMethodTibOffsetField = (VmInstanceField) testField(vmInstanceMethodClass - .getField("tibOffset")); + this.vmInstanceMethodClass = loader.loadClass("org.jnode.vm.classmgr.VmInstanceMethod", true); + vmMethodTibOffsetField = (VmInstanceField) testField(vmInstanceMethodClass.getField("tibOffset")); // VmMethodCode - this.vmMethodCodeClass = loader.loadClass( - "org.jnode.vm.classmgr.VmMethodCode", true); - vmMethodSelectorField = (VmInstanceField) testField(vmInstanceMethodClass - .getField("selector")); - vmMethodNativeCodeField = (VmInstanceField) testField(vmInstanceMethodClass - .getField("nativeCode")); + this.vmMethodCodeClass = loader.loadClass("org.jnode.vm.classmgr.VmMethodCode", true); + vmMethodSelectorField = (VmInstanceField) testField(vmInstanceMethodClass.getField("selector")); + vmMethodNativeCodeField = (VmInstanceField) testField(vmInstanceMethodClass.getField("nativeCode")); // VmConstIMethodRef - final VmType cimrClass = loader.loadClass( - "org.jnode.vm.classmgr.VmConstIMethodRef", true); - this.vmConstIMethodRefSelectorField = (VmInstanceField) testField(cimrClass - .getField("selector")); + final VmType cimrClass = loader.loadClass("org.jnode.vm.classmgr.VmConstIMethodRef", true); + this.vmConstIMethodRefSelectorField = (VmInstanceField) testField(cimrClass.getField("selector")); // VmProcessor - final VmType processorClass = loader.loadClass( - "org.jnode.vm.scheduler.VmProcessor", true); + final VmType processorClass = loader.loadClass("org.jnode.vm.scheduler.VmProcessor", true); vmThreadSwitchIndicatorOffset = ((VmInstanceField) testField(processorClass.getField("threadSwitchIndicator"))).getOffset(); vmProcessorMeField = (VmInstanceField) testField(processorClass.getField("me")); - vmProcessorStackEnd = (VmInstanceField) testField(processorClass - .getField("stackEnd")); - vmProcessorSharedStaticsTable = (VmInstanceField) testField(processorClass - .getField("staticsTable")); + vmProcessorStackEnd = (VmInstanceField) testField(processorClass.getField("stackEnd")); + vmProcessorSharedStaticsTable = (VmInstanceField) testField(processorClass.getField("staticsTable")); vmProcessorIsolatedStaticsTable = (VmInstanceField) testField(processorClass .getField("isolatedStaticsTable")); // VmType - final VmType typeClass = loader.loadClass( - "org.jnode.vm.classmgr.VmType", true); - vmTypeInitialize = testMethod(typeClass.getMethod("initialize", - "()V")); - vmTypeModifiers = (VmInstanceField) testField(typeClass - .getField("modifiers")); - vmTypeState = (VmInstanceField) testField(typeClass - .getField("state")); + final VmType typeClass = loader.loadClass("org.jnode.vm.classmgr.VmType", true); + vmTypeInitialize = testMethod(typeClass.getMethod("initialize", "()V")); + vmTypeModifiers = (VmInstanceField) testField(typeClass.getField("modifiers")); + vmTypeState = (VmInstanceField) testField(typeClass.getField("state")); vmTypeCp = (VmInstanceField) testField(typeClass.getField("cp")); // VmCP - final VmType cpClass = loader.loadClass( - "org.jnode.vm.classmgr.VmCP", true); + final VmType cpClass = loader.loadClass("org.jnode.vm.classmgr.VmCP", true); vmCPCp = (VmInstanceField) testField(cpClass.getField("cp")); // VmProcessor // VmThread final VmType vmThreadClass = loader.loadClass("org.jnode.vm.scheduler.VmThread", true); - systemExceptionMethod = testMethod(vmThreadClass.getMethod( - "systemException", "(II)Ljava/lang/Throwable;")); + systemExceptionMethod = testMethod(vmThreadClass.getMethod("systemException", "(II)Ljava/lang/Throwable;")); // VmMethod - final VmType vmMethodClass = loader.loadClass( - "org.jnode.vm.classmgr.VmMethod", true); - recompileMethod = testMethod(vmMethodClass.getDeclaredMethod( - "recompileMethod", "(II)V")); + final VmType vmMethodClass = loader.loadClass("org.jnode.vm.classmgr.VmMethod", true); + recompileMethod = testMethod(vmMethodClass.getDeclaredMethod("recompileMethod", "(II)V")); } catch (ClassNotFoundException ex) { throw new NoClassDefFoundError(ex.getMessage()); } } - private final VmMethod testMethod(VmMethod method) { + private VmMethod testMethod(VmMethod method) { if (method == null) { throw new RuntimeException("Cannot find a method"); } return method; } - private final VmField testField(VmField field) { + private VmField testField(VmField field) { if (field == null) { throw new RuntimeException("Cannot find a field"); } Modified: trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -42,8 +42,10 @@ /** * Compile the given IMT. * + * @param resolver * @param imt * @param imtCollisions + * @return */ public abstract CompiledIMT compile(ObjectResolver resolver, Object[] imt, boolean[] imtCollisions); } Modified: trunk/core/src/core/org/jnode/vm/compiler/InlineBytecodeVisitor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/InlineBytecodeVisitor.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/compiler/InlineBytecodeVisitor.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -52,6 +52,7 @@ /** * Leave the values on the stack and jump to the end of the inlined method. + * @param jvmType */ public abstract void visit_inlinedReturn(int jvmType); } Modified: trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -158,11 +158,11 @@ /** * Initialize this instance. * + * @param entryPoints * @param delegate * @param loader */ - public OptimizingBytecodeVisitor(EntryPoints entryPoints, - InlineBytecodeVisitor delegate, VmClassLoader loader) { + public OptimizingBytecodeVisitor(EntryPoints entryPoints, InlineBytecodeVisitor delegate, VmClassLoader loader) { super(delegate); this.entryPoints = entryPoints; this.loader = loader; Modified: trunk/core/src/core/org/jnode/vm/compiler/VerifyingCompilerBytecodeVisitor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/VerifyingCompilerBytecodeVisitor.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/compiler/VerifyingCompilerBytecodeVisitor.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -55,8 +55,8 @@ } /** - * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor - * #visit_invokeinterface(org.jnode.vm.classmgr.VmConstIMethodRef, int) + * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor#visit_invokeinterface( + * org.jnode.vm.classmgr.VmConstIMethodRef, int) */ @Override public void visit_invokeinterface(VmConstIMethodRef methodRef, int count) { @@ -65,8 +65,8 @@ } /** - * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor - * #visit_invokespecial(org.jnode.vm.classmgr.VmConstMethodRef) + * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor#visit_invokespecial( + * org.jnode.vm.classmgr.VmConstMethodRef) */ @Override public void visit_invokespecial(VmConstMethodRef methodRef) { @@ -75,8 +75,8 @@ } /** - * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor - * #visit_invokestatic(org.jnode.vm.classmgr.VmConstMethodRef) + * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor#visit_invokestatic( + * org.jnode.vm.classmgr.VmConstMethodRef) */ @Override public void visit_invokestatic(VmConstMethodRef methodRef) { @@ -85,8 +85,8 @@ } /** - * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor - * #visit_invokevirtual(org.jnode.vm.classmgr.VmConstMethodRef) + * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor#visit_invokevirtual( + * org.jnode.vm.classmgr.VmConstMethodRef) */ @Override public void visit_invokevirtual(VmConstMethodRef methodRef) { Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86Compiler.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86Compiler.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86Compiler.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -51,8 +51,7 @@ * @author Ewout Prangsma (ep...@us...) */ @MagicPermission -public abstract class AbstractX86Compiler extends NativeCodeCompiler implements - X86CompilerConstants { +public abstract class AbstractX86Compiler extends NativeCodeCompiler { private EntryPoints context; @@ -65,7 +64,7 @@ /** * Initialize this compiler * - * @param loader + * @param loader the VmClassLoader */ public final void initialize(VmClassLoader loader) { if (context == null) { Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86StackManager.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86StackManager.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86StackManager.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -42,8 +42,7 @@ * @param msbReg * @param jvmType the type of the registers contents as a {@link org.jnode.vm.JvmType}. */ - public void writePUSH64(int jvmType, X86Register.GPR lsbReg, - X86Register.GPR msbReg); + public void writePUSH64(int jvmType, X86Register.GPR lsbReg, X86Register.GPR msbReg); /** * Write code to push a 64-bit word on the stack Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -34,6 +34,7 @@ * Convert a method code into an X86 condition code. * * @param mcode + * @return */ protected final int methodToCC(MagicMethod mcode) { switch (mcode) { @@ -67,6 +68,7 @@ * Convert a method code into an X86 condition code. * * @param mcode + * @return */ protected final int methodToShift(MagicMethod mcode) { switch (mcode) { @@ -142,7 +144,7 @@ } } - protected static final int methodCodeToOperation(MagicMethod mcode) { + protected static int methodCodeToOperation(MagicMethod mcode) { switch (mcode) { case ATOMICADD: return X86Operation.ADD; Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -45,13 +45,18 @@ import org.jnode.vm.scheduler.VmProcessor; import org.jnode.vm.x86.X86CpuID; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.BITS32; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.BITS64; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.INTSIZE; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.PROCESSOR64; + /** * Helpers class used by the X86 compilers. * * @author epr * @author patrik_reali */ -public class X86CompilerHelper implements X86CompilerConstants { +public class X86CompilerHelper { /** * Address size ax register (EAX/RAX) Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler32.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler32.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler32.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -32,11 +32,12 @@ import org.jnode.vm.compiler.CompiledIMT; import org.jnode.vm.compiler.IMTCompiler; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.BITS32; + /** * @author Ewout Prangsma (ep...@us...) */ -public final class X86IMTCompiler32 extends IMTCompiler implements - X86CompilerConstants { +public final class X86IMTCompiler32 extends IMTCompiler { /** * Register that holds the selector @@ -60,6 +61,7 @@ * destroyed) * * @param os + * @param method */ public static void emitInvokeInterface(X86Assembler os, VmMethod method) { final int selector = method.getSelector(); @@ -95,8 +97,7 @@ * @see org.jnode.vm.compiler.IMTCompiler#compile(ObjectResolver, Object[], * boolean[]) */ - public CompiledIMT compile(ObjectResolver resolver__, Object[] imt, - boolean[] imtCollisions) { + public CompiledIMT compile(ObjectResolver resolver__, Object[] imt, boolean[] imtCollisions) { final int imtLength = imt.length; // Calculate size of code array @@ -186,10 +187,10 @@ * * @param code * @param ofs + * @param staticsIndex * @return the new offset */ - private final int genJmpStaticsCodeOfs(byte[] code, int ofs, - int staticsIndex) { + private int genJmpStaticsCodeOfs(byte[] code, int ofs, int staticsIndex) { final int offset = (staticsIndex + VmArray.DATA_OFFSET) * 4; // JMP [EDI+codeOfs] code[ofs++] = (byte) 0xFF; Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler64.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler64.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler64.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -33,11 +33,12 @@ import org.jnode.vm.compiler.CompiledIMT; import org.jnode.vm.compiler.IMTCompiler; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.BITS64; + /** * @author Ewout Prangsma (ep...@us...) */ -public final class X86IMTCompiler64 extends IMTCompiler implements - X86CompilerConstants { +public final class X86IMTCompiler64 extends IMTCompiler { /** * Size in bytes of an entry in the IMT jump table generated by this method. @@ -55,6 +56,7 @@ * destroyed) RDX is destroyed * * @param os + * @param method */ public static void emitInvokeInterface(X86Assembler os, VmMethod method) { final int selector = method.getSelector(); @@ -166,10 +168,10 @@ * * @param code * @param ofs + * @param staticsIndex * @return the new offset */ - private final int genJmpStaticsCodeOfs(byte[] code, int ofs, - int staticsIndex) { + private int genJmpStaticsCodeOfs(byte[] code, int ofs, int staticsIndex) { final int offset = (staticsIndex * 4) + (VmArray.DATA_OFFSET * 8); // JMP [RDI+codeOfs] code[ofs++] = (byte) 0xFF; Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -28,6 +28,10 @@ import org.jnode.vm.JvmType; import org.jnode.vm.Vm; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.BITS32; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.LSB; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.MSB; + /** * @author Patrik Reali */ @@ -37,14 +41,21 @@ /** * Initialize a blank item. + * + * @param factory the item factory which created this item. */ DoubleItem(ItemFactory factory) { super(factory); } /** + * @param ec * @param kind * @param offsetToFP + * @param lsb + * @param msb + * @param reg + * @param xmm * @param value */ final void initialize(EmitterContext ec, byte kind, short offsetToFP, X86Register.GPR lsb, @@ -55,7 +66,7 @@ } /** - * @see org.jnode.vm.x86.compiler.l1a.DoubleWordItem#cloneConstant() + * @see DoubleWordItem#cloneConstant(EmitterContext) */ protected DoubleWordItem cloneConstant(EmitterContext ec) { return factory.createDConst(ec, getValue()); @@ -89,8 +100,7 @@ * @param lsb * @param msb */ - protected final void loadToConstant32(EmitterContext ec, X86Assembler os, - GPR32 lsb, GPR32 msb) { + protected final void loadToConstant32(EmitterContext ec, X86Assembler os, GPR32 lsb, GPR32 msb) { final long lvalue = Double.doubleToLongBits(value); final int lsbv = (int) (lvalue & 0xFFFFFFFFL); final int msbv = (int) ((lvalue >>> 32) & 0xFFFFFFFFL); @@ -105,8 +115,7 @@ * @param os * @param reg */ - protected final void loadToConstant64(EmitterContext ec, X86Assembler os, - GPR64 reg) { + protected final void loadToConstant64(EmitterContext ec, X86Assembler os, GPR64 reg) { final long lvalue = Double.doubleToLongBits(value); os.writeMOV_Const(reg, lvalue); } @@ -144,8 +153,8 @@ /** * Push the given memory location on the FPU stack. * - * @param os - * @param reg + * @param os the assembler + * @param reg the * @param disp */ protected void pushToFPU(X86Assembler os, GPR reg, int disp) { Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -27,13 +27,14 @@ import org.jnode.assembler.x86.X86Register.GPR64; import org.jnode.vm.JvmType; import org.jnode.vm.Vm; -import org.jnode.vm.x86.compiler.X86CompilerConstants; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.INTSIZE; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.BITS64; + /** * @author Ewout Prangsma (ep...@us...) */ -public abstract class DoubleWordItem extends Item implements - X86CompilerConstants { +public abstract class DoubleWordItem extends Item { /** * LSB Register in 32-bit mode @@ -52,16 +53,20 @@ /** * Initialize a blank item. + * @param factory */ protected DoubleWordItem(ItemFactory factory) { super(factory); } /** + * @param ec * @param kind * @param offsetToFP * @param lsb * @param msb + * @param reg + * @param xmm */ protected final void initialize(EmitterContext ec, byte kind, short offsetToFP, X86Register.GPR lsb, X86Register.GPR msb, X86Register.GPR64 reg, @@ -129,6 +134,7 @@ /** * Create a clone of this item, which must be a constant. * + * @param ec * @return the clone */ protected abstract DoubleWordItem cloneConstant(EmitterContext ec); @@ -148,6 +154,7 @@ * Gets the offset from the LSB part of this item to the FramePointer * register. This is only valid if this item has a LOCAL kind. * + * @param ec * @return the offset */ final int getLsbOffsetToFP(EmitterContext ec) { @@ -157,6 +164,7 @@ /** * Gets the register holding the LSB part of this item in 32-bit mode. * + * @param ec * @return the register */ final X86Register.GPR getLsbRegister(EmitterContext ec) { @@ -174,6 +182,7 @@ * Gets the offset from the MSB part of this item to the FramePointer * register. This is only valid if this item has a LOCAL kind. * + * @param ec * @return the offset */ final int getMsbOffsetToFP(EmitterContext ec) { @@ -183,6 +192,7 @@ /** * Gets the register holding the MSB part of this item in 32-bit mode. * + * @param ec * @return the register */ final X86Register.GPR getMsbRegister(EmitterContext ec) { @@ -199,6 +209,7 @@ /** * Gets the register holding this item in 64-bit mode. * + * @param ec * @return the register */ final X86Register.GPR64 getRegister(EmitterContext ec) { @@ -437,6 +448,7 @@ /** * Load my constant to the given os in 32-bit mode. * + * @param ec * @param os * @param lsb * @param msb @@ -447,6 +459,7 @@ /** * Load my constant to the given os in 64-bit mode. * + * @param ec * @param os * @param reg */ @@ -591,6 +604,7 @@ /** * Push my constant on the stack using the given os. * + * @param ec * @param os */ protected abstract void pushConstant(EmitterContext ec, X86Assembler os); @@ -680,9 +694,10 @@ } /** + * @param ec * @see org.jnode.vm.x86.compiler.l1a.Item#release(EmitterContext) */ - private final void cleanup(EmitterContext ec) { + private void cleanup(EmitterContext ec) { // assertCondition(!ec.getVStack().contains(this), "Cannot release while // on vstack"); final X86RegisterPool pool = ec.getGPRPool(); @@ -721,7 +736,7 @@ setKind((byte) 0); } - private final X86Register request(EmitterContext ec, X86RegisterPool pool) { + private X86Register request(EmitterContext ec, X86RegisterPool pool) { final X86Assembler os = ec.getStream(); final X86Register r; if (os.isCode32()) { Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/EmitterContext.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/EmitterContext.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/EmitterContext.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -68,6 +68,13 @@ /** * Create a new context + * @param os + * @param helper + * @param vstack + * @param gprPool + * @param xmmPool + * @param ifac + * @param context */ EmitterContext(X86Assembler os, X86CompilerHelper helper, VirtualStack vstack, X86RegisterPool gprPool, Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompiler.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompiler.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompiler.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -88,8 +88,6 @@ /** * fadd / dadd * - * @param ec - * @param vstack * @param type */ abstract void add(int type); @@ -97,9 +95,6 @@ /** * fcmpg, fcmpl, dcmpg, dcmpl * - * @param os - * @param ec - * @param vstack * @param gt * @param type * @param curInstrLabel @@ -109,16 +104,14 @@ /** * f2x / d2x * - * @param ec - * @param vstack + * @param fromType + * @param toType */ abstract void convert(int fromType, int toType); /** * fdiv / ddiv * - * @param ec - * @param vstack * @param type */ abstract void div(int type); @@ -126,8 +119,6 @@ /** * fmul / dmul * - * @param ec - * @param vstack * @param type */ abstract void mul(int type); @@ -135,8 +126,6 @@ /** * fneg / dneg * - * @param ec - * @param vstack * @param type */ abstract void neg(int type); @@ -144,8 +133,6 @@ /** * frem / drem * - * @param ec - * @param vstack * @param type */ abstract void rem(int type); @@ -153,8 +140,6 @@ /** * fsub / dsub * - * @param ec - * @param vstack * @param type */ abstract void sub(int type); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -38,9 +38,11 @@ final class FPCompilerFPU extends FPCompiler { /** + * @param bcv * @param os * @param ec * @param vstack + * @param arrayDataOffset */ public FPCompilerFPU(X86BytecodeVisitor bcv, X86Assembler os, EmitterContext ec, VirtualStack vstack, int arrayDataOffset) { @@ -50,8 +52,6 @@ /** * fadd / dadd * - * @param ec - * @param vstack * @param type */ final void add(int type) { @@ -83,9 +83,6 @@ /** * fcmpg, fcmpl, dcmpg, dcmpl * - * @param os - * @param ec - * @param vstack * @param gt * @param type * @param curInstrLabel @@ -166,8 +163,6 @@ /** * f2x / d2x * - * @param ec - * @param vstack */ final void convert(int fromType, int toType) { final ItemFactory ifac = ec.getItemFactory(); @@ -191,8 +186,6 @@ /** * fdiv / ddiv * - * @param ec - * @param vstack * @param type */ final void div(int type) { @@ -230,7 +223,7 @@ * @param vstack * @param items */ - static final void ensureStackCapacity(X86Assembler os, EmitterContext ec, + static void ensureStackCapacity(X86Assembler os, EmitterContext ec, VirtualStack vstack, int items) { final FPUStack fpuStack = vstack.fpuStack; if (!fpuStack.hasCapacity(items)) { @@ -249,7 +242,7 @@ * @param fpuStack * @param fpuReg */ - private static final void fxchST1(X86Assembler os, FPUStack fpuStack, + private static void fxchST1(X86Assembler os, FPUStack fpuStack, FPU fpuReg) { // We need reg to be ST1, if not swap if (fpuReg != X86Register.ST1) { @@ -263,8 +256,6 @@ /** * fmul / dmul * - * @param ec - * @param vstack * @param type */ final void mul(int type) { @@ -296,8 +287,6 @@ /** * fneg / dneg * - * @param ec - * @param vstack * @param type */ final void neg(int type) { @@ -322,6 +311,11 @@ /** * Make sure that the given operand is on the top on the FPU stack. + * @param os + * @param ec + * @param vstack + * @param fpuStack + * @param left */ private static void prepareForOperation(X86Assembler os, EmitterContext ec, VirtualStack vstack, FPUStack fpuStack, @@ -355,8 +349,14 @@ * <p/> * The item at ST0 is popped of the given fpuStack stack. * + * @param os + * @param ec + * @param vstack + * @param fpuStack * @param left * @param right + * @param commutative + * @return */ private static FPU prepareForOperation(X86Assembler os, EmitterContext ec, VirtualStack vstack, FPUStack fpuStack, @@ -424,8 +424,6 @@ /** * frem / drem * - * @param ec - * @param vstack * @param type */ final void rem(int type) { @@ -462,8 +460,6 @@ /** * fsub / dsub * - * @param ec - * @param vstack * @param type */ final void sub(int type) { Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerSSE.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerSSE.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerSSE.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -91,7 +91,7 @@ * @param operation * @param commutative */ - private final void arithOperation(int type, int operation, boolean commutative) { + private void arithOperation(int type, int operation, boolean commutative) { final ItemFactory ifac = ec.getItemFactory(); Item v2 = vstack.pop(type); Item v1 = vstack.pop(type); @@ -138,7 +138,7 @@ * @return True if the operand must be swapped. when not commutative, false * is always returned. */ - private final boolean prepareForOperation(Item destAndSource, Item source, + private boolean prepareForOperation(Item destAndSource, Item source, boolean commutative) { // WARNING: source was on top of the virtual stack (thus higher than // destAndSource) Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUHelper.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUHelper.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -24,12 +24,11 @@ import org.jnode.assembler.x86.X86Register; import org.jnode.assembler.x86.X86Register.FPU; import org.jnode.vm.bytecode.StackException; -import org.jnode.vm.x86.compiler.X86CompilerConstants; /** * @author Ewout Prangsma (ep...@us...) */ -final class FPUHelper implements X86CompilerConstants { +final class FPUHelper { /** * Swap ST0 and the given item. Action is emitted to code & performed on @@ -39,7 +38,7 @@ * @param fpuStack * @param item */ - static final void fxch(X86Assembler os, FPUStack fpuStack, Item item) { + static void fxch(X86Assembler os, FPUStack fpuStack, Item item) { if (!fpuStack.isTos(item)) { final FPU fpuReg = fpuStack.getRegister(item); fxch(os, fpuStack, fpuReg); @@ -53,7 +52,7 @@ * @param fpuStack * @param fpuReg */ - static final void fxch(X86Assembler os, FPUStack fpuStack, + static void fxch(X86Assembler os, FPUStack fpuStack, FPU fpuReg) { if (fpuReg == X86Register.ST0) { throw new StackException("Cannot fxch ST0"); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUStack.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUStack.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUStack.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -58,6 +58,8 @@ /** * Gets the item that is contained in the given register. + * @param fpuReg + * @return */ final Item getItem(FPU fpuReg) { final int idx = tos - (fpuReg.getNr() + 1); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FloatItem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FloatItem.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FloatItem.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -52,7 +52,7 @@ } /** - * @see org.jnode.vm.x86.compiler.l1a.WordItem#cloneConstant() + * @see org.jnode.vm.x86.compiler.l1a.WordItem#cloneConstant(EmitterContext) */ protected WordItem cloneConstant(EmitterContext ec) { return factory.createFConst(ec, getValue()); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/InlinedMethodInfo.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/InlinedMethodInfo.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/InlinedMethodInfo.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -45,7 +45,10 @@ /** * Initialize this instance. * + * @param previous * @param inlinedMethod + * @param endOfInlineLabel + * @param previousLabelPrefix */ public InlinedMethodInfo(InlinedMethodInfo previous, VmMethod inlinedMethod, Label endOfInlineLabel, String previousLabelPrefix) { @@ -69,6 +72,7 @@ /** * Push the stack elements of the outer method stack. * + * @param ifac * @param vstack */ final void pushOuterMethodStack(ItemFactory ifac, VirtualStack vstack) { @@ -78,6 +82,7 @@ /** * Push the stack elements of the outer method stack and the exit stack. * + * @param ifac * @param vstack * @param eContext */ Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/IntItem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/IntItem.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/IntItem.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -25,7 +25,6 @@ import org.jnode.assembler.x86.X86Register.GPR; import org.jnode.vm.JvmType; import org.jnode.vm.Vm; -import org.jnode.vm.x86.compiler.X86CompilerConstants; /** * @author Patrik Reali @@ -33,7 +32,7 @@ * IntItems are items with type INT */ -final class IntItem extends WordItem implements X86CompilerConstants { +final class IntItem extends WordItem { private int value; @@ -47,7 +46,7 @@ } /** - * @see org.jnode.vm.x86.compiler.l1a.WordItem#cloneConstant() + * @see org.jnode.vm.x86.compiler.l1a.WordItem#cloneConstant(EmitterContext) */ protected WordItem cloneConstant(EmitterContext ec) { return factory.createIConst(ec, getValue()); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/Item.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/Item.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/Item.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -75,7 +75,7 @@ */ static final byte LOCAL = 0x20; - public static final String toString(int kind) { + public static String toString(int kind) { switch (kind) { case STACK: return "STACK"; @@ -117,6 +117,7 @@ /** * Initialize a blank item. + * @param factory */ protected Item(ItemFactory factory) { this.factory = factory; @@ -185,6 +186,7 @@ /** * Is this item on the stack + * @return */ final boolean isStack() { return (kind == Kind.STACK); @@ -192,6 +194,7 @@ /** * Is this item in a general purpose register + * @return */ final boolean isGPR() { return (kind == Kind.GPR); @@ -199,6 +202,7 @@ /** * Is this item in a SSE register + * @return */ final boolean isXMM() { return (kind == Kind.XMM); @@ -206,6 +210,7 @@ /** * Is this item on the FPU stack + * @return */ final boolean isFPUStack() { return (kind == Kind.FPUSTACK); @@ -213,6 +218,7 @@ /** * Is this item a local variable + * @return */ final boolean isLocal() { return (kind == Kind.LOCAL); @@ -220,6 +226,7 @@ /** * Is this item a constant + * @return */ final boolean isConstant() { return (kind == Kind.CONSTANT); @@ -240,6 +247,7 @@ * Gets the offset from this item to the FramePointer register. This is only * valid if this item has a LOCAL kind. * + * @param ec * @return */ short getOffsetToFP(EmitterContext ec) { @@ -265,6 +273,7 @@ /** * Is this item located at the given FP offset. * + * @param offset * @return */ boolean isAtOffset(int offset) { @@ -297,6 +306,8 @@ /** * Load item into a register / two registers / an FPU register depending on * its type, if its kind matches the mask + * @param eContext + * @param mask */ final void loadIf(EmitterContext eContext, int mask) { if ((kind & mask) > 0) { @@ -306,6 +317,8 @@ /** * Load item into an XMM register if its kind matches the mask + * @param eContext + * @param mask */ final void loadToXMMIf(EmitterContext eContext, int mask) { if ((kind & mask) > 0) { @@ -331,6 +344,7 @@ /** * Push the value of this item on the FPU stack. The item itself is not * changed in any way. + * @param ec */ abstract void pushToFPU(EmitterContext ec); @@ -364,6 +378,8 @@ /** * Spill this item if it uses the given register. + * @param ec + * @param reg */ final void spillIfUsing(EmitterContext ec, X86Register reg) { if (uses(reg)) { @@ -382,7 +398,7 @@ /** * enquire whether the item uses a volatile register * - * @param reg + * @param pool * @return true, when this item uses a volatile register. */ abstract boolean usesVolatileRegister(X86RegisterPool pool); @@ -390,6 +406,7 @@ /** * Verify the consistency of the state of this item. * Throw an exception is the state is inconsistent. + * @param ec */ protected abstract void verifyState(EmitterContext ec); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemFactory.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemFactory.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemFactory.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -52,7 +52,9 @@ /** * Create a constant item * + * @param ec * @param val + * @return */ final IntItem createIConst(EmitterContext ec, int val) { final IntItem item = (IntItem) getOrCreate(JvmType.INT); @@ -63,7 +65,9 @@ /** * Create a constant item * + * @param ec * @param val + * @return */ final FloatItem createFConst(EmitterContext ec, float val) { final FloatItem item = (FloatItem) getOrCreate(JvmType.FLOAT); @@ -74,7 +78,9 @@ /** * Create a constant item * + * @param ec * @param val + * @return */ final RefItem createAConst(EmitterContext ec, VmConstString val) { final RefItem item = (RefItem) getOrCreate(JvmType.REFERENCE); @@ -85,7 +91,9 @@ /** * Create a constant item * + * @param ec * @param val + * @return */ final LongItem createLConst(EmitterContext ec, long val) { final LongItem item = (LongItem) getOrCreate(JvmType.LONG); @@ -96,7 +104,9 @@ /** * Create a constant item * + * @param ec * @param val + * @return */ final DoubleItem createDConst(EmitterContext ec, double val) { final DoubleItem item = (DoubleItem) getOrCreate(JvmType.DOUBLE); @@ -108,6 +118,7 @@ * Create a stack item. * * @param jvmType + * @return */ public Item createStack(int jvmType) { final Item item = getOrCreate(jvmType); @@ -119,6 +130,7 @@ * Create an FPU stack item. * * @param jvmType + * @return */ public Item createFPUStack(int jvmType) { final Item item = getOrCreate(jvmType); @@ -130,6 +142,8 @@ * Create an LOCAL item. * * @param jvmType + * @param ebpOffset + * @return */ public Item createLocal(int jvmType, short ebpOffset) { final Item item = getOrCreate(jvmType); @@ -141,6 +155,8 @@ * Create an XMM item. * * @param jvmType + * @param xmm + * @return */ public Item createLocal(int jvmType, X86Register.XMM xmm) { final Item item = getOrCreate(jvmType); @@ -151,8 +167,10 @@ /** * Create a word register item. * + * @param ec * @param jvmType * @param reg + * @return */ public WordItem createReg(EmitterContext ec, int jvmType, X86Register reg) { final WordItem item = (WordItem) getOrCreate(jvmType); @@ -163,9 +181,11 @@ /** * Create a doubleword register item. * + * @param ec * @param jvmType * @param lsb * @param msb + * @return */ public DoubleWordItem createReg(EmitterContext ec, int jvmType, X86Register.GPR lsb, X86Register.GPR msb) { if (!ec.getStream().isCode32()) { @@ -179,9 +199,10 @@ /** * Create a doubleword register item. * + * @param ec * @param jvmType - * @param lsb - * @param msb + * @param reg + * @return */ public DoubleWordItem createReg(EmitterContext ec, int jvmType, X86Register.GPR64 reg) { final DoubleWordItem item = (DoubleWordItem) getOrCreate(jvmType); @@ -216,8 +237,9 @@ * Get an item out of the cache or if not present, create a new one. * * @param jvmType + * @return */ - private final Item getOrCreate(int jvmType) { + private Item getOrCreate(int jvmType) { final ArrayList<? extends Item> list = getList(jvmType); final Item item; if (list.isEmpty()) { @@ -234,8 +256,9 @@ * Gets the cache array for a given type. * * @param jvmType + * @return */ - private final ArrayList<? extends Item> getList(int jvmType) { + private ArrayList<? extends Item> getList(int jvmType) { switch (jvmType) { case JvmType.INT: return intItems; @@ -256,8 +279,9 @@ * Create a new item of a given type. * * @param jvmType + * @return */ - private final Item createNew(int jvmType) { + private Item createNew(int jvmType) { createCount++; switch (jvmType) { case JvmType.INT: @@ -283,8 +307,9 @@ /** * Gets the item factory. This item factory is singleton per thread. + * @return */ - static final ItemFactory getFactory() { + static ItemFactory getFactory() { ItemFactory fac = (ItemFactory) itemFactory.get(); if (fac == null) { fac = new ItemFactory(); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -51,6 +51,8 @@ /** * Constructor; create and initialize stack with default size + * @param expectedKind + * @param maxSize */ ItemStack(int expectedKind, int maxSize) { this.expectedKind = expectedKind; @@ -78,7 +80,7 @@ /** * Grow the stack capacity. */ - private final void grow() { + private void grow() { if (stack.length == maxSize) { throw new StackException("Stack full"); } else { @@ -165,6 +167,7 @@ /** * Reset this stack. The stack will be empty afterwards. + * @param ec */ final void reset(EmitterContext ec) { while (tos != 0) { Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/L1AHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/L1AHelper.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/L1AHelper.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -32,12 +32,12 @@ */ final class L1AHelper { - static final void assertCondition(boolean cond, String message) { + static void assertCondition(boolean cond, String message) { if (!cond) throw new Error("assert failed: " + message); } - static final void assertCondition(boolean cond, String message, Object param) { + static void assertCondition(boolean cond, String message, Object param) { if (!cond) { throw new Error("assert failed: " + message + param); } @@ -46,27 +46,32 @@ /** * Gets the 64-bit equivalent of the given 32-bit register. * + * @param eContext * @param src * @return the 64-bit register. */ - static final GPR64 get64BitReg(EmitterContext eContext, GPR src) { + static GPR64 get64BitReg(EmitterContext eContext, GPR src) { return (GPR64) eContext.getGPRPool().getRegisterInSameGroup(src, JvmType.LONG); } /** * Release a register. * + * @param eContext * @param reg */ - static final void releaseRegister(EmitterContext eContext, X86Register reg) { + static void releaseRegister(EmitterContext eContext, X86Register reg) { final X86RegisterPool pool = eContext.getGPRPool(); pool.release(reg); } /** * Request two register for a 8-byte item. + * @param eContext + * @param jvmType + * @return */ - static final DoubleWordItem requestDoubleWordRegisters( + static DoubleWordItem requestDoubleWordRegisters( EmitterContext eContext, int jvmType) { final X86RegisterPool pool = eContext.getGPRPool(); final X86Assembler os = eContext.getStream(); @@ -89,8 +94,13 @@ /** * Request two register for a 8-byte item. + * @param eContext + * @param jvmType + * @param lsb + * @param msb + * @return */ - static final DoubleWordItem requestDoubleWordRegisters( + static DoubleWordItem requestDoubleWordRegisters( EmitterContext eContext, int jvmType, X86Register.GPR lsb, X86Register.GPR msb) { if (!eContext.getStream().isCode32()) { throw new IllegalModeException("Only support in 32-bit mode"); @@ -108,8 +118,12 @@ /** * Request a 64-bit register for a 8-byte item. + * @param eContext + * @param jvmType + * @param reg + * @return */ - static final DoubleWordItem requestDoubleWordRegister( + static DoubleWordItem requestDoubleWordRegister( EmitterContext eContext, int jvmType, GPR64 reg) { if (!eContext.getStream().isCode64()) { throw new IllegalModeException("Only support in 64-bit mode"); @@ -126,9 +140,10 @@ * Request a register for calcuation, not tied to an item. Make sure to * release the register afterwards. * + * @param eContext * @param reg */ - static final void requestRegister(EmitterContext eContext, X86Register reg) { + static void requestRegister(EmitterContext eContext, X86Register reg) { final X86RegisterPool pool = eContext.getGPRPool(); if (!pool.isFree(reg)) { final Item i = (Item) pool.getOwner(reg); @@ -142,8 +157,12 @@ /** * Request a register of a given type, not tied to an item. Make sure to * release the register afterwards. + * @param eContext + * @param type + * @param supportsBits8 + * @return */ - static final X86Register requestRegister(EmitterContext eContext, int type, + static X86Register requestRegister(EmitterContext eContext, int type, boolean supportsBits8) { final X86RegisterPool pool = eContext.getGPRPool(); X86Register r = pool.request(type, supportsBits8); @@ -159,10 +178,11 @@ * reserve a register for an item. The item is not loaded with the register. * The register is spilled if another item holds it. * + * @param eContext * @param reg the register to reserve * @param it the item requiring the register */ - static final void requestRegister(EmitterContext eContext, X86Register reg, + static void requestRegister(EmitterContext eContext, X86Register reg, Item it) { final X86RegisterPool pool = eContext.getGPRPool(); @@ -182,8 +202,12 @@ /** * Request one register for a single word item. + * @param eContext + * @param jvmType + * @param supportsBits8 + * @return */ - static final WordItem requestWordRegister(EmitterContext eContext, + static WordItem requestWordRegister(EmitterContext eContext, int jvmType, boolean supportsBits8) { final X86RegisterPool pool = eContext.getGPRPool(); final ItemFactory ifac = eContext.getItemFactory(); @@ -196,8 +220,12 @@ /** * Request specific one register for a single word item. + * @param eContext + * @param jvmType + * @param reg + * @return */ - static final WordItem requestWordRegister(EmitterContext eContext, + static WordItem requestWordRegister(EmitterContext eContext, int jvmType, X86Register reg) { final X86RegisterPool pool = eContext.getGPRPool(); final ItemFactory ifac = eContext.getItemFactory(); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/LongItem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/LongItem.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/LongIt... [truncated message content] |