You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(97) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(127) |
Feb
(34) |
Mar
(16) |
Apr
(26) |
May
(55) |
Jun
(107) |
Jul
(36) |
Aug
(72) |
Sep
(90) |
Oct
(41) |
Nov
(27) |
Dec
(13) |
2008 |
Jan
(37) |
Feb
(39) |
Mar
(98) |
Apr
(115) |
May
(134) |
Jun
(120) |
Jul
(86) |
Aug
(149) |
Sep
(68) |
Oct
(66) |
Nov
(104) |
Dec
(49) |
2009 |
Jan
(131) |
Feb
(132) |
Mar
(125) |
Apr
(172) |
May
(161) |
Jun
(43) |
Jul
(47) |
Aug
(38) |
Sep
(18) |
Oct
(6) |
Nov
(1) |
Dec
(15) |
2010 |
Jan
(21) |
Feb
(8) |
Mar
(10) |
Apr
(4) |
May
(9) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(4) |
2011 |
Jan
(23) |
Feb
(10) |
Mar
(13) |
Apr
(3) |
May
|
Jun
(19) |
Jul
(11) |
Aug
(22) |
Sep
|
Oct
(4) |
Nov
(2) |
Dec
(12) |
2012 |
Jan
(3) |
Feb
(4) |
Mar
(7) |
Apr
(3) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(30) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(8) |
2013 |
Jan
(3) |
Feb
(40) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(12) |
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
26
(2) |
27
(2) |
28
(6) |
29
|
30
|
31
|
|
|
|
From: <ls...@us...> - 2010-03-28 19:30:14
|
Revision: 5742 http://jnode.svn.sourceforge.net/jnode/?rev=5742&view=rev Author: lsantha Date: 2010-03-28 19:30:08 +0000 (Sun, 28 Mar 2010) Log Message: ----------- Added javadoc. Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java Modified: trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java 2010-03-28 19:26:38 UTC (rev 5741) +++ trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java 2010-03-28 19:30:08 UTC (rev 5742) @@ -313,11 +313,21 @@ protected abstract CompilerBytecodeVisitor createBytecodeVisitor(VmMethod method, CompiledMethod cm, NativeStream os, int level, boolean isBootstrap); + /** + * Returns an unused or newly created byte code visitor. + * @see #createBytecodeVisitor(org.jnode.vm.classmgr.VmMethod, CompiledMethod, org.jnode.assembler.NativeStream, + * int, boolean) + */ protected CompilerBytecodeVisitor getBytecodeVisitor(VmMethod method, CompiledMethod cm, NativeStream os, int level, boolean isBootstrap) { return createBytecodeVisitor(method, cm, os, level, isBootstrap); } + /** + * Call this method when the specified bytecode visitor finished working. + * + * @param visitor a bytecode visitor + */ protected void releaseBytecodeVisitor(CompilerBytecodeVisitor visitor) { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-03-28 19:26:44
|
Revision: 5741 http://jnode.svn.sourceforge.net/jnode/?rev=5741&view=rev Author: lsantha Date: 2010-03-28 19:26:38 +0000 (Sun, 28 Mar 2010) Log Message: ----------- Added support for releasing the bytecode visitor, other fixes in reusing bytecode visitors. Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86Level1ACompiler.java Modified: trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java 2010-03-28 19:12:41 UTC (rev 5740) +++ trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java 2010-03-28 19:26:38 UTC (rev 5741) @@ -240,38 +240,49 @@ protected CompiledMethod doCompile(VmMethod method, NativeStream os, int level, boolean isBootstrap) { final CompiledMethod cm = new CompiledMethod(level); - if (method.isNative()) { - Object label = new Label(method.getMangledName()); - cm.setCodeStart(os.getObjectRef(label)); - } else { - // Create the visitor - CompilerBytecodeVisitor bcv = createBytecodeVisitor(method, - cm, os, level, isBootstrap); - // Wrap in verifier if needed - if (!(bcv instanceof VerifyingCompilerBytecodeVisitor)) { - bcv = new VerifyingCompilerBytecodeVisitor<CompilerBytecodeVisitor>(bcv); + try { + if (method.isNative()) { + Object label = new Label(method.getMangledName()); + cm.setCodeStart(os.getObjectRef(label)); + } else { + // Create the visitor + CompilerBytecodeVisitor bcv = getBytecodeVisitor(method, cm, os, level, isBootstrap); + + try { + // Wrap in verifier if needed + if (!(bcv instanceof VerifyingCompilerBytecodeVisitor)) { + bcv = new VerifyingCompilerBytecodeVisitor<CompilerBytecodeVisitor>(bcv); + } + // Get the bytecode + final VmByteCode bc = method.getBytecode(); + // Create the control flow graph + ControlFlowGraph cfg = (ControlFlowGraph) bc.getCompilerData(); + if (cfg == null) { + cfg = new ControlFlowGraph(bc); + bc.setCompilerData(cfg); + } + // Compile the code 1 basic block at a time + final CompilerBytecodeParser parser = new CompilerBytecodeParser(bc, cfg, bcv); + bcv.startMethod(method); + for (BasicBlock bb : cfg) { + bcv.startBasicBlock(bb); + parser.parse(bb.getStartPC(), bb.getEndPC(), false); + bcv.endBasicBlock(); + } + bcv.endMethod(); + + //remove the compiler data to save memory, will be regenerated if needed + bc.setCompilerData(null); + } finally { + releaseBytecodeVisitor(bcv); + } } - // Get the bytecode - final VmByteCode bc = method.getBytecode(); - // Create the control flow graph - ControlFlowGraph cfg = (ControlFlowGraph) bc.getCompilerData(); - if (cfg == null) { - cfg = new ControlFlowGraph(bc); - bc.setCompilerData(cfg); - } - // Compile the code 1 basic block at a time - final CompilerBytecodeParser parser = new CompilerBytecodeParser( - bc, cfg, bcv); - bcv.startMethod(method); - for (BasicBlock bb : cfg) { - bcv.startBasicBlock(bb); - parser.parse(bb.getStartPC(), bb.getEndPC(), false); - bcv.endBasicBlock(); - } - bcv.endMethod(); - - //remove the compiler data to save memory, will be regenerated if needed - bc.setCompilerData(null); + } catch (RuntimeException x) { + System.err.println("ERROR in compilation of " + method.getFullName()); + throw x; + } catch (Error x) { + System.err.println("ERROR in compilation of " + method.getFullName()); + throw x; } return cm; @@ -286,8 +297,8 @@ * @param isBootstrap * @return The compiled method */ - protected abstract CompiledMethod doCompileAbstract(VmMethod method, - NativeStream os, int level, boolean isBootstrap); + protected abstract CompiledMethod doCompileAbstract(VmMethod method, NativeStream os, int level, + boolean isBootstrap); /** * Create the visitor that converts bytecodes into native code. @@ -299,10 +310,17 @@ * @param isBootstrap * @return The new bytecode visitor. */ - protected abstract CompilerBytecodeVisitor createBytecodeVisitor( - VmMethod method, CompiledMethod cm, NativeStream os, int level, - boolean isBootstrap); + protected abstract CompilerBytecodeVisitor createBytecodeVisitor(VmMethod method, CompiledMethod cm, + NativeStream os, int level, boolean isBootstrap); + protected CompilerBytecodeVisitor getBytecodeVisitor(VmMethod method, CompiledMethod cm, NativeStream os, + int level, boolean isBootstrap) { + return createBytecodeVisitor(method, cm, os, level, isBootstrap); + } + + protected void releaseBytecodeVisitor(CompilerBytecodeVisitor visitor) { + + } /** * Initialize this compiler * Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86Level1ACompiler.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86Level1ACompiler.java 2010-03-28 19:12:41 UTC (rev 5740) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86Level1ACompiler.java 2010-03-28 19:26:38 UTC (rev 5741) @@ -20,8 +20,6 @@ package org.jnode.vm.x86.compiler.l1a; -import java.util.ArrayList; -import java.util.List; import org.jnode.assembler.NativeStream; import org.jnode.assembler.ObjectResolver; import org.jnode.assembler.x86.X86BinaryAssembler; @@ -96,8 +94,6 @@ private final ThreadLocal<X86BytecodeVisitor> byteCodeVisitorHolder = new ThreadLocal<X86BytecodeVisitor>(); - private final ThreadLocal<List<X86BytecodeVisitor>> byteCodeVisitorListHolder = - new ThreadLocal<List<X86BytecodeVisitor>>(); /** * Create the visitor that converts bytecodes into native code. * @@ -115,37 +111,14 @@ final EntryPoints entryPoints = getEntryPoints(); X86BytecodeVisitor byteCodeVisitor = byteCodeVisitorHolder.get(); if (byteCodeVisitor == null) { - byteCodeVisitor = new X86BytecodeVisitor(os, cm, isBootstrap, entryPoints, - getMagicHelper(), getTypeSizeInfo()); - byteCodeVisitorHolder.set(byteCodeVisitor); + byteCodeVisitor = new X86BytecodeVisitor(os, cm, isBootstrap, entryPoints, getMagicHelper(), + getTypeSizeInfo()); } else { - if (byteCodeVisitor.isWorking()) { - //slow path - List<X86BytecodeVisitor> vlist = byteCodeVisitorListHolder.get(); - if (vlist == null) { - vlist = new ArrayList<X86BytecodeVisitor>(); - byteCodeVisitorListHolder.set(vlist); - } - byteCodeVisitor = null; - for (X86BytecodeVisitor bv : vlist) { - if (!bv.isWorking()) { - byteCodeVisitor = bv; - break; - } - } - if (byteCodeVisitor == null) { - byteCodeVisitor = new X86BytecodeVisitor(os, cm, isBootstrap, entryPoints, - getMagicHelper(), getTypeSizeInfo()); - vlist.add(byteCodeVisitor); - } else { - byteCodeVisitor.reset(os, cm, isBootstrap, entryPoints, getMagicHelper(), getTypeSizeInfo()); - } - } else { - byteCodeVisitor.reset(os, cm, isBootstrap, entryPoints, getMagicHelper(), getTypeSizeInfo()); - } + byteCodeVisitorHolder.remove(); + byteCodeVisitor.reset(os, cm, isBootstrap, entryPoints, getMagicHelper(), getTypeSizeInfo()); } cbv = byteCodeVisitor; - if (inlineMethods /*&& ((X86Assembler)os).isCode32()*/) { + if (inlineMethods) { final VmClassLoader loader = method.getDeclaringClass().getLoader(); return new OptimizingBytecodeVisitor(entryPoints, cbv, loader); } else { @@ -153,7 +126,18 @@ } } - private final MagicHelper getMagicHelper() { + @Override + protected synchronized void releaseBytecodeVisitor(CompilerBytecodeVisitor visitor) { + X86BytecodeVisitor bv; + if (inlineMethods) { + bv = (X86BytecodeVisitor) ((OptimizingBytecodeVisitor) visitor).getDelegate(); + } else { + bv = (X86BytecodeVisitor) visitor; + } + byteCodeVisitorHolder.set(bv); + } + + private MagicHelper getMagicHelper() { final MagicHelper helper = magicHelperHolder.get(); if (helper != null) { return helper; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-03-28 19:12:47
|
Revision: 5740 http://jnode.svn.sourceforge.net/jnode/?rev=5740&view=rev Author: lsantha Date: 2010-03-28 19:12:41 +0000 (Sun, 28 Mar 2010) Log Message: ----------- Fixed a bug where expected item was not at the top of the item stack. Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/WordItem.java 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-03-28 19:03:38 UTC (rev 5739) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java 2010-03-28 19:12:41 UTC (rev 5740) @@ -26,6 +26,7 @@ /** * @author Ewout Prangsma (ep...@us...) + * @author Levente S\u00e1ntha */ class ItemStack { @@ -129,6 +130,36 @@ return (stack[tos - 1] == item); } + /** + * Finds the position of the specified item on the stack starting from the top. + * + * @param item the item to find + * @return the position of the item or -1 if not found + */ + final int stackLocation(Item item) { + int ret = -1; + + int i = tos - 1; + while ((i >= 0) && (stack[i] != item)) + i--; + + if (i >= 0) + ret = tos - 1 - i; + + return ret; + } + + /** + * Exchanges the item at the specified position with the top item. + * + * @param pos the position of the item + */ + final void makeTop(int pos) { + Item tmp = stack[tos - 1]; + stack[tos - 1] = stack[tos - 1 - pos]; + stack[tos - 1 - pos] = tmp; + } + final void pop(EmitterContext ec) { if (tos <= 0) { throw new Error("Stack is empty"); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/WordItem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/WordItem.java 2010-03-28 19:03:38 UTC (rev 5739) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/WordItem.java 2010-03-28 19:12:41 UTC (rev 5740) @@ -27,6 +27,7 @@ import org.jnode.assembler.x86.X86Register.GPR64; import org.jnode.vm.JvmType; import org.jnode.vm.Vm; +import org.jnode.vm.bytecode.StackException; import org.jnode.vm.x86.compiler.X86CompilerHelper; /** @@ -186,7 +187,22 @@ break; case Kind.STACK: - // TODO: make sure this is on top os stack + // TODO: make sure 'this' is on top of stack + // TODO: implemen it for 64 bits + if (!stack.operandStack.isTos(this)) { + + int stack_loc = stack.operandStack.stackLocation(this); + if (stack_loc < 0) + throw new StackException("Item not found on stack"); + + stack.operandStack.makeTop(stack_loc); + + //todo test it + os.writeMOV(org.jnode.vm.x86.compiler.X86CompilerConstants.BITS32, reg, helper.SP, helper.SLOTSIZE); + os.writeXCHG(helper.SP, org.jnode.vm.x86.compiler.X86CompilerConstants.BITS32 * stack_loc, reg); + os.writeMOV(org.jnode.vm.x86.compiler.X86CompilerConstants.BITS32, helper.SP, helper.SLOTSIZE, reg); + } + if (VirtualStack.checkOperandStack) { stack.operandStack.pop(this); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-03-28 19:03:44
|
Revision: 5739 http://jnode.svn.sourceforge.net/jnode/?rev=5739&view=rev Author: lsantha Date: 2010-03-28 19:03:38 +0000 (Sun, 28 Mar 2010) Log Message: ----------- Added support for dead code detection. Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/bytecode/BasicBlock.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeFlags.java Added Paths: ----------- trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java Modified: trunk/core/src/core/org/jnode/vm/bytecode/BasicBlock.java =================================================================== --- trunk/core/src/core/org/jnode/vm/bytecode/BasicBlock.java 2010-03-28 16:49:43 UTC (rev 5738) +++ trunk/core/src/core/org/jnode/vm/bytecode/BasicBlock.java 2010-03-28 19:03:38 UTC (rev 5739) @@ -33,12 +33,14 @@ * * @author epr * @author Madhu Siddalingaiah + * @author Levente S\u00e1ntha */ public class BasicBlock extends VmSystemObject { private final int startPC; private int endPC; private boolean startOfExceptionHandler; + private boolean retTarget; private TypeStack startStack; private BootableArrayList<BasicBlock> entryBlocks = new BootableArrayList<BasicBlock>(); @@ -87,6 +89,10 @@ this.startOfExceptionHandler = startOfExceptionHandler; } + public void setRetTarget(boolean retTarget) { + this.retTarget = retTarget; + } + /** * Gets the first bytecode address of this basic block * @@ -190,6 +196,12 @@ if (startPC == 0) return true; + if (startOfExceptionHandler) + return true; + + if (retTarget) + return true; + if (entryBlocks != null) { for (BasicBlock bb : entryBlocks) { if (!checked.contains(bb)) { Modified: trunk/core/src/core/org/jnode/vm/bytecode/BytecodeFlags.java =================================================================== --- trunk/core/src/core/org/jnode/vm/bytecode/BytecodeFlags.java 2010-03-28 16:49:43 UTC (rev 5738) +++ trunk/core/src/core/org/jnode/vm/bytecode/BytecodeFlags.java 2010-03-28 19:03:38 UTC (rev 5739) @@ -31,4 +31,5 @@ public static final byte F_START_OF_EXCEPTIONHANDLER = 0x08; public static final byte F_START_OF_INSTRUCTION = 0x10; public static final byte F_YIELDPOINT = 0x20; + public static final byte F_RET_TARGET = 0x40; } Added: trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java =================================================================== --- trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java (rev 0) +++ trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java 2010-03-28 19:03:38 UTC (rev 5739) @@ -0,0 +1,498 @@ +/* + * $Id: BasicBlockFinder.java 5709 2010-01-03 11:46:38Z lsantha $ + * + * Copyright (C) 2003-2010 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.vm.bytecode; + +import java.util.TreeMap; +import org.jnode.system.BootLog; +import org.jnode.vm.JvmType; +import org.jnode.vm.classmgr.VmByteCode; +import org.jnode.vm.classmgr.VmInterpretedExceptionHandler; +import org.jnode.vm.classmgr.VmMethod; + +/** + * Bytecode visitor, used to determine the start addresses of basic blocks. + * + * @author Levente S\u00e1ntha + */ +public class DeadBlockFinder extends BytecodeVisitorSupport implements BytecodeFlags { + private static final boolean debug = false; + private final TreeMap<Integer, BasicBlock> blocks = new TreeMap<Integer, BasicBlock>(); + private byte[] opcodeFlags; + private boolean nextIsStartOfBB; + private boolean nextFollowsTypeStack; + private boolean nextIsRetTarget; + private int curAddress; + private BasicBlock current; + + /** + * Create all determined basic blocks + * + * @return the basic blocks. + */ + public BasicBlock[] createBasicBlocks() { + // Create the array + final BasicBlock[] list = blocks.values().toArray(new BasicBlock[blocks.size()]); + // Set the EndPC's and flags + final byte[] opcodeFlags = this.opcodeFlags; + final int len = opcodeFlags.length; + int bbIndex = 0; + for (int i = 0; i < len; i++) { + if (isStartOfBB(i)) { + final int start = i; + // Find the end of the BB + i++; + while ((i < len) && (!isStartOfBB(i))) { + i++; + } + // the BB + final BasicBlock bb = list[bbIndex++]; + if (bb.getStartPC() != start) { + throw new AssertionError("bb.getStartPC() != start"); + } + bb.setEndPC(i); + bb.setStartOfExceptionHandler(isStartOfException(start)); + i--; + } + } + if (bbIndex != list.length) { + throw new AssertionError("bbIndex != list.length"); + } + return list; + } + + /** + * Get the per-opcode bytecode flags. + * + * @return byte[] + */ + public final byte[] getOpcodeFlags() { + return opcodeFlags; + } + + /** + * @param method + * @see BytecodeVisitor#startMethod(org.jnode.vm.classmgr.VmMethod) + */ + public void startMethod(VmMethod method) { + final VmByteCode bc = method.getBytecode(); + final int length = bc.getLength(); + opcodeFlags = new byte[length]; + // The first instruction is always the start of a BB. + startBB(0, true); + // The exception handler also start a basic block + final TypeStack ehTStack = new TypeStack(); + ehTStack.push(JvmType.REFERENCE); + for (int i = 0; i < bc.getNoExceptionHandlers(); i++) { + VmInterpretedExceptionHandler eh = bc.getExceptionHandler(i); + startTryBlock(eh.getStartPC()); + startTryBlockEnd(eh.getEndPC()); + startException(eh.getHandlerPC(), ehTStack); + } + } + + /** + * @param address + * @see BytecodeVisitor#startInstruction(int) + */ + public void startInstruction(int address) { + if (debug) { + BootLog.debug("#" + address); + } + curAddress = address; + super.startInstruction(address); + opcodeFlags[address] |= F_START_OF_INSTRUCTION; + boolean next_is_rt = nextIsRetTarget; + if (nextIsRetTarget) { + opcodeFlags[address] |= F_RET_TARGET; + nextIsRetTarget = false; + } + boolean next_is_bb = nextIsStartOfBB; + if (nextIsStartOfBB) { + if (debug) BootLog.debug("\tnextIsStartOfBB\t" + nextFollowsTypeStack); + startBB(address, nextFollowsTypeStack); + nextIsStartOfBB = false; + nextFollowsTypeStack = true; + } + if (isStartOfBB(address)) { + if (!next_is_bb) { + BasicBlock bb = blocks.get(address); + bb.addEntryBlock(current); + current = bb; + } else { + current = blocks.get(address); + } + + if (next_is_rt) { + current.setRetTarget(true); + } + + if (debug) BootLog.debug("\tcurrent\t" + current); + } + if (debug) { + BootLog.debug("#" + address); + } + } + + /** + * Mark the start of a basic block + * + * @param address + */ + private void startBB(int address, boolean setTypeStack) { + if ((opcodeFlags[address] & F_START_OF_BASICBLOCK) == 0) { + opcodeFlags[address] |= F_START_OF_BASICBLOCK; + final BasicBlock bb = new BasicBlock(address); + blocks.put(address, bb); + if (setTypeStack) { + bb.addEntryBlock(current); + } + } else if (setTypeStack) { + final BasicBlock bb = blocks.get(address); + // Add entry block + bb.addEntryBlock(current); + } + } + + /** + * Mark the end of a basic block + */ + private void endBB(boolean nextFollowsTypeStack) { + this.nextIsStartOfBB = true; + this.nextFollowsTypeStack = nextFollowsTypeStack; + } + + /** + * @param address + * @see BytecodeVisitor#visit_ifeq(int) + */ + public void visit_ifeq(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_ifne(int) + */ + public void visit_ifne(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_iflt(int) + */ + public void visit_iflt(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_ifge(int) + */ + public void visit_ifge(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_ifgt(int) + */ + public void visit_ifgt(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_ifle(int) + */ + public void visit_ifle(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_if_icmpeq(int) + */ + public void visit_if_icmpeq(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_if_icmpne(int) + */ + public void visit_if_icmpne(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_if_icmplt(int) + */ + public void visit_if_icmplt(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_if_icmpge(int) + */ + public void visit_if_icmpge(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_if_icmpgt(int) + */ + public void visit_if_icmpgt(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_if_icmple(int) + */ + public void visit_if_icmple(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_if_acmpeq(int) + */ + public void visit_if_acmpeq(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_if_acmpne(int) + */ + public void visit_if_acmpne(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_goto(int) + */ + public void visit_goto(int address) { + // No change + addBranch(address, false); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_jsr(int) + */ + public void visit_jsr(int address) { + addBranch(address, false); + nextIsRetTarget = true; + condYieldPoint(address); + } + + /** + * @param defValue + * @param lowValue + * @param highValue + * @param addresses + * @see BytecodeVisitor#visit_tableswitch(int, int, int, int[]) + */ + public void visit_tableswitch(int defValue, int lowValue, int highValue, int[] addresses) { + for (int i = 0; i < addresses.length; i++) { + addBranch(addresses[i], true); + condYieldPoint(addresses[i]); + } + addBranch(defValue, false); + condYieldPoint(defValue); + } + + /** + * @param defValue + * @param matchValues + * @param addresses + * @see BytecodeVisitor#visit_lookupswitch(int, int[], int[]) + */ + public void visit_lookupswitch(int defValue, int[] matchValues, int[] addresses) { + for (int i = 0; i < addresses.length; i++) { + addBranch(addresses[i], true); + condYieldPoint(addresses[i]); + } + addBranch(defValue, false); + condYieldPoint(defValue); + } + + /** + * @param address + * @see BytecodeVisitor#visit_ifnull(int) + */ + public void visit_ifnull(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @param address + * @see BytecodeVisitor#visit_ifnonnull(int) + */ + public void visit_ifnonnull(int address) { + addBranch(address, true); + condYieldPoint(address); + } + + /** + * @see BytecodeVisitor#visit_athrow() + */ + public void visit_athrow() { + endBB(false); + // Reference is actually pushed on the stack, but that is handled + // by the startException blocks. + } + + /** + * @see BytecodeVisitor#visit_areturn() + */ + public void visit_areturn() { + endBB(false); + } + + /** + * @see BytecodeVisitor#visit_dreturn() + */ + public void visit_dreturn() { + endBB(false); + } + + /** + * @see BytecodeVisitor#visit_freturn() + */ + public void visit_freturn() { + endBB(false); + } + + /** + * @see BytecodeVisitor#visit_ireturn() + */ + public void visit_ireturn() { + if (debug) { + BootLog.debug("ireturn at " + curAddress); + } + endBB(false); + } + + /** + * @see BytecodeVisitor#visit_lreturn() + */ + public void visit_lreturn() { + endBB(false); + } + + /** + * @param index + * @see BytecodeVisitor#visit_ret(int) + */ + public void visit_ret(int index) { + // No change + endBB(false); + } + + /** + * @see BytecodeVisitor#visit_return() + */ + public void visit_return() { + // No change + endBB(false); + } + + /** + * Add branching information (to the given target) to the basic blocks information. + * + * @param target + */ + private void addBranch(int target, boolean conditional) { + startBB(target, true); + endBB(conditional); + } + + private boolean isStartOfBB(int address) { + return ((opcodeFlags[address] & F_START_OF_BASICBLOCK) != 0); + } + + private boolean isStartOfException(int address) { + return ((opcodeFlags[address] & F_START_OF_EXCEPTIONHANDLER) != 0); + } + + /** + * Mark the start of a exception handler + * + * @param address + */ + private void startException(int address, TypeStack tstack) { + opcodeFlags[address] |= F_START_OF_EXCEPTIONHANDLER; + //System.out.println("startException: " + tstack); + startBB(address, true); + } + + /** + * Mark the start of a try-catch block + * + * @param address + */ + private void startTryBlock(int address) { + opcodeFlags[address] |= F_START_OF_TRYBLOCK; + //startBB(address, false, null); + } + + /** + * Mark the end of a try-catch block + * + * @param address + */ + private void startTryBlockEnd(int address) { + opcodeFlags[address] |= F_START_OF_TRYBLOCKEND; + //startBB(address, false, null); + } + + /** + * Mark a conditional yieldpoint. + */ + private void condYieldPoint(int target) { + if (target < curAddress) { + opcodeFlags[curAddress] |= F_YIELDPOINT; + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-03-28 16:49:50
|
Revision: 5738 http://jnode.svn.sourceforge.net/jnode/?rev=5738&view=rev Author: lsantha Date: 2010-03-28 16:49:43 +0000 (Sun, 28 Mar 2010) Log Message: ----------- Removed needless code. Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/classmgr/VmMethod.java Modified: trunk/core/src/core/org/jnode/vm/classmgr/VmMethod.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/VmMethod.java 2010-03-28 16:29:10 UTC (rev 5737) +++ trunk/core/src/core/org/jnode/vm/classmgr/VmMethod.java 2010-03-28 16:49:43 UTC (rev 5738) @@ -499,7 +499,6 @@ code.setNext(this.compiledCode); this.compiledCode = code; this.nativeCode = code.getNativeCode(); - this.compiledCode = code; Vm.getVm().getSharedStatics().setMethodCode( getSharedStaticsIndex(), code.getNativeCode()); this.nativeCodeOptLevel = (short) optLevel; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-03-28 16:29:16
|
Revision: 5737 http://jnode.svn.sourceforge.net/jnode/?rev=5737&view=rev Author: lsantha Date: 2010-03-28 16:29:10 +0000 (Sun, 28 Mar 2010) Log Message: ----------- Simplified VM type to Class conversion. Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java Modified: trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java 2010-03-27 06:08:08 UTC (rev 5736) +++ trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java 2010-03-28 16:29:10 UTC (rev 5737) @@ -978,34 +978,7 @@ Class r_class; VmType vtm = mts.getReturnType(); if (vtm.isPrimitive()) { - switch (vtm.getJvmType()) { - case JvmType.BOOLEAN: - vtm = VmType.fromClass(Boolean.class); - break; - case JvmType.BYTE: - vtm = VmType.fromClass(Byte.class); - break; - case JvmType.SHORT: - vtm = VmType.fromClass(Short.class); - break; - case JvmType.CHAR: - vtm = VmType.fromClass(Character.class); - break; - case JvmType.INT: - vtm = VmType.fromClass(Integer.class); - break; - case JvmType.FLOAT: - vtm = VmType.fromClass(Float.class); - break; - case JvmType.LONG: - vtm = VmType.fromClass(Long.class); - break; - case JvmType.DOUBLE: - vtm = VmType.fromClass(Double.class); - break; - - } - r_class = vtm.asClass(); + r_class = getClassForJvmType(vtm.getJvmType()); } else { try { r_class = Class.forName(vtm.getName(), false, vtm.getLoader().asClassLoader()); @@ -1014,7 +987,7 @@ } } Object defo = AnnotationParser.parseMemberValue(r_class, data, new VmConstantPool(cls), - cls.asClass()); + org.jnode.vm.Vm.isRunningVm() ? cls.asClass() : cls.asClassDuringBootstrap()); mts.setAnnotationDefault(defo); } else { skip(data, length); @@ -1046,6 +1019,31 @@ } } + private static Class getClassForJvmType(int type) { + switch (type) { + case JvmType.BOOLEAN: + return boolean.class; + case JvmType.BYTE: + return byte.class; + case JvmType.SHORT: + return short.class; + case JvmType.CHAR: + return char.class; + case JvmType.INT: + return int.class; + case JvmType.FLOAT: + return float.class; + case JvmType.LONG: + return long.class; + case JvmType.DOUBLE: + return double.class; + case JvmType.VOID: + return void.class; + default: + throw new IllegalArgumentException("Invalid JVM type: " + type); + } + } + /** * Read a runtime parameter annotations attributes. * @@ -1226,34 +1224,7 @@ Class r_class; VmType vtm = mts.getReturnType(); if (vtm.isPrimitive()) { - switch (vtm.getJvmType()) { - case JvmType.BOOLEAN: - vtm = VmType.fromClass(Boolean.class); - break; - case JvmType.BYTE: - vtm = VmType.fromClass(Byte.class); - break; - case JvmType.SHORT: - vtm = VmType.fromClass(Short.class); - break; - case JvmType.CHAR: - vtm = VmType.fromClass(Character.class); - break; - case JvmType.INT: - vtm = VmType.fromClass(Integer.class); - break; - case JvmType.FLOAT: - vtm = VmType.fromClass(Float.class); - break; - case JvmType.LONG: - vtm = VmType.fromClass(Long.class); - break; - case JvmType.DOUBLE: - vtm = VmType.fromClass(Double.class); - break; - - } - r_class = vtm.asClass(); + r_class = getClassForJvmType(vtm.getJvmType()); } else { try { r_class = vtm.getLoader().asClassLoader().loadClass(vtm.getName()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-03-27 06:08:14
|
Revision: 5736 http://jnode.svn.sourceforge.net/jnode/?rev=5736&view=rev Author: lsantha Date: 2010-03-27 06:08:08 +0000 (Sat, 27 Mar 2010) Log Message: ----------- Added support for specifying in jnode.properties the target plugin list of the jar packager. Modified Paths: -------------- trunk/builder/src/builder/org/jnode/build/packager/PackagerTask.java trunk/builder/src/builder/org/jnode/build/packager/PluginListInsertor.java trunk/jnode.properties.dist Modified: trunk/builder/src/builder/org/jnode/build/packager/PackagerTask.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/packager/PackagerTask.java 2010-03-27 05:39:07 UTC (rev 5735) +++ trunk/builder/src/builder/org/jnode/build/packager/PackagerTask.java 2010-03-27 06:08:08 UTC (rev 5736) @@ -58,6 +58,7 @@ // properties names protected static final String USER_PLUGIN_IDS = "user.plugin.ids"; protected static final String PLUGIN_LIST_NAME = "plugin.list.name"; + protected static final String TARGET_PLUGIN_LIST = "target.plugin.list"; protected static final String FORCE_OVERWRITE_SCRIPTS = "force.overwrite.scripts"; /** Modified: trunk/builder/src/builder/org/jnode/build/packager/PluginListInsertor.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/packager/PluginListInsertor.java 2010-03-27 05:39:07 UTC (rev 5735) +++ trunk/builder/src/builder/org/jnode/build/packager/PluginListInsertor.java 2010-03-27 06:08:08 UTC (rev 5736) @@ -63,9 +63,13 @@ */ private List<String> readPluginIds(String pluginListName) { List<String> pluginIds = new ArrayList<String>(); - + final Properties properties = getProperties(); - final String targetName = properties.getProperty(PLUGIN_LIST_NAME, null); + String targetName = getProject().getProperty(TARGET_PLUGIN_LIST); + if (targetName == null || targetName.trim().length() == 0) { + targetName = properties.getProperty(PLUGIN_LIST_NAME, null); + } + if (targetName == null) { log("property " + PLUGIN_LIST_NAME + " not specified in " + getPropertiesFile().getAbsolutePath(), Project.MSG_ERR); Modified: trunk/jnode.properties.dist =================================================================== --- trunk/jnode.properties.dist 2010-03-27 05:39:07 UTC (rev 5735) +++ trunk/jnode.properties.dist 2010-03-27 06:08:08 UTC (rev 5736) @@ -17,6 +17,9 @@ # jar packager (tool to easily create a jnode plugin from a regular jar file) # user.applications.dir = ${root.dir}/local/applications/ +# The jar packager adds the user plugins to the plugin list specified here. +# target.plugin.list=default + # ----------------------------------------------- # Settings for the bootdisk image This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-03-27 05:39:13
|
Revision: 5735 http://jnode.svn.sourceforge.net/jnode/?rev=5735&view=rev Author: lsantha Date: 2010-03-27 05:39:07 +0000 (Sat, 27 Mar 2010) Log Message: ----------- Added plugin insertor to custom initjar assembler. Modified Paths: -------------- trunk/all/build.xml Modified: trunk/all/build.xml =================================================================== --- trunk/all/build.xml 2010-03-26 13:23:34 UTC (rev 5734) +++ trunk/all/build.xml 2010-03-27 05:39:07 UTC (rev 5735) @@ -502,7 +502,7 @@ pluginDir="${plugins.dir}" systemPluginList="${root.dir}/all/conf/system-plugin-list.xml"> <insert userApplicationsDir="${user.applications.dir}"/> - + <fileset dir="${root.dir}/all/conf"> <exclude name="system-plugin-list.xml"/> <include name="*plugin-list.xml"/> @@ -517,6 +517,7 @@ <initjars destdir="${initjars.dir}" pluginDir="${plugins.dir}" systemPluginList="${root.dir}/all/conf/system-plugin-list.xml"> + <insert userApplicationsDir="${user.applications.dir}"/> <fileset dir="${custom.plugin-list.dir}"> <include name="*plugin-list.xml"/> </fileset> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ga...@us...> - 2010-03-26 13:23:40
|
Revision: 5734 http://jnode.svn.sourceforge.net/jnode/?rev=5734&view=rev Author: galatnm Date: 2010-03-26 13:23:34 +0000 (Fri, 26 Mar 2010) Log Message: ----------- Return space on the device. Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660FileSystem.java trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Volume.java trunk/fs/src/fs/org/jnode/fs/iso9660/PrimaryVolumeDescriptor.java trunk/fs/src/fs/org/jnode/fs/iso9660/SupplementaryVolumeDescriptor.java Modified: trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660FileSystem.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660FileSystem.java 2010-03-26 13:23:12 UTC (rev 5733) +++ trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660FileSystem.java 2010-03-26 13:23:34 UTC (rev 5734) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.fs.iso9660; import java.io.IOException; @@ -43,7 +43,7 @@ * @see org.jnode.fs.FileSystem#getDevice() */ public ISO9660FileSystem(Device device, boolean readOnly, ISO9660FileSystemType type) - throws FileSystemException { + throws FileSystemException { super(device, readOnly, type); try { @@ -108,17 +108,14 @@ } public long getFreeSpace() { - // TODO implement me - return -1; + return 0; } public long getTotalSpace() { - // TODO implement me - return -1; + return volume.getSize(); } public long getUsableSpace() { - // TODO implement me - return -1; + return volume.getSize(); } } Modified: trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Volume.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Volume.java 2010-03-26 13:23:12 UTC (rev 5733) +++ trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Volume.java 2010-03-26 13:23:34 UTC (rev 5734) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.fs.iso9660; import java.io.IOException; @@ -119,4 +119,16 @@ return primaryVolumeDescriptor.getRootDirectoryEntry(); } } + + public PrimaryVolumeDescriptor getPrimaryVolumeDescriptor() { + return primaryVolumeDescriptor; + } + + public SupplementaryVolumeDescriptor getSupplementaryVolumeDescriptor() { + return supplementaryVolumeDescriptor; + } + + public long getSize() { + return primaryVolumeDescriptor.getSize(); + } } Modified: trunk/fs/src/fs/org/jnode/fs/iso9660/PrimaryVolumeDescriptor.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/iso9660/PrimaryVolumeDescriptor.java 2010-03-26 13:23:12 UTC (rev 5733) +++ trunk/fs/src/fs/org/jnode/fs/iso9660/PrimaryVolumeDescriptor.java 2010-03-26 13:23:34 UTC (rev 5734) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.fs.iso9660; import java.io.IOException; @@ -105,7 +105,7 @@ this.getRootDirectoryEntry().getLengthOfExtendedAttribute()); out.println("\t\t- Location of the extent: " + this.getRootDirectoryEntry().getLocationOfExtent()); - //out.println(" - Length of the file identifier: " + + // out.println(" - Length of the file identifier: " + // this.getRootDirectoryEntry().getLengthOfFileIdentifier()); out.println("\t\t- is directory: " + this.getRootDirectoryEntry().isDirectory()); out.println("\t\t- File identifier: " + this.getRootDirectoryEntry().getFileIdentifier()); @@ -197,4 +197,8 @@ public String getVolumeIdentifier() { return volumeIdentifier; } + + public long getSize() { + return this.getSpaceSize() * this.getLBSize(); + } } Modified: trunk/fs/src/fs/org/jnode/fs/iso9660/SupplementaryVolumeDescriptor.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/iso9660/SupplementaryVolumeDescriptor.java 2010-03-26 13:23:12 UTC (rev 5733) +++ trunk/fs/src/fs/org/jnode/fs/iso9660/SupplementaryVolumeDescriptor.java 2010-03-26 13:23:34 UTC (rev 5734) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.fs.iso9660; import java.io.PrintStream; @@ -45,7 +45,7 @@ * @param buffer */ public SupplementaryVolumeDescriptor(ISO9660Volume volume, byte[] buffer) - throws UnsupportedEncodingException { + throws UnsupportedEncodingException { super(volume, buffer); this.flags = getUInt8(buffer, 8); this.escapeSequences = getDChars(buffer, 89, 121 - 89); @@ -71,8 +71,8 @@ public void dump(PrintStream out) { out.println("Supplementary Volume Descriptor"); out.println("\tFlags " + flags); - //out.println("\tEscape sequences " + escapeSequences); - //out.println("\tEncoding " + encoding); + // out.println("\tEscape sequences " + escapeSequences); + // out.println("\tEncoding " + encoding); out.println("\tSystemIdentifier " + systemIdentifier); out.println("\tVolumeIdentifier " + volumeIdentifier); out.println("\tVolume Space Size " + spaceSize); @@ -115,6 +115,7 @@ /** * Gets a derived encoding name from the given escape sequences. + * * @param escapeSequences * @return the encoding name */ @@ -136,6 +137,7 @@ /** * Is the used encoding known to this system. + * * @return {@code true} if the encoding known, otherwise {@code false}. */ public final boolean isEncodingKnown() { @@ -155,4 +157,5 @@ public final EntryRecord getRootDirectoryEntry() { return this.rootDirectoryEntry; } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ga...@us...> - 2010-03-26 13:23:18
|
Revision: 5733 http://jnode.svn.sourceforge.net/jnode/?rev=5733&view=rev Author: galatnm Date: 2010-03-26 13:23:12 +0000 (Fri, 26 Mar 2010) Log Message: ----------- Fix dates. Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Entry.java Modified: trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Entry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Entry.java 2010-02-20 20:32:33 UTC (rev 5732) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Entry.java 2010-03-26 13:23:12 UTC (rev 5733) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.fs.ext2; import java.io.IOException; @@ -30,11 +30,12 @@ /** * @author Andras Nagy * - * In case of a directory, the data will be parsed to get the file-list by - * Ext2Directory. In case of a regular file, no more processing is needed. + * In case of a directory, the data will be parsed to get the file-list + * by Ext2Directory. In case of a regular file, no more processing is + * needed. * - * TODO: besides getFile() and getDirectory(), we will need getBlockDevice() - * getCharacterDevice(), etc. + * TODO: besides getFile() and getDirectory(), we will need + * getBlockDevice() getCharacterDevice(), etc. */ public class Ext2Entry extends AbstractFSEntry { @@ -48,32 +49,32 @@ this.type = type; log.setLevel(Level.INFO); - log.debug("Ext2Entry(iNode, name): name=" + name + (isDirectory() ? " is a directory " : "") + - (isFile() ? " is a file " : "")); + log.debug("Ext2Entry(iNode, name): name=" + name + + (isDirectory() ? " is a directory " : "") + (isFile() ? " is a file " : "")); } public long getLastChanged() throws IOException { - return iNode.getCtime(); + return iNode.getCtime() * 1000; } public long getLastModified() throws IOException { - return iNode.getMtime(); + return iNode.getMtime() * 1000; } public long getLastAccessed() throws IOException { - return iNode.getAtime(); + return iNode.getAtime() * 1000; } public void setLastChanged(long lastChanged) throws IOException { - iNode.setCtime(lastChanged); + iNode.setCtime(lastChanged / 1000); } public void setLastModified(long lastModified) throws IOException { - iNode.setMtime(lastModified); + iNode.setMtime(lastModified / 1000); } public void setLastAccessed(long lastAccessed) throws IOException { - iNode.setAtime(lastAccessed); + iNode.setAtime(lastAccessed / 1000); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |