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
|
From: <ls...@us...> - 2006-12-30 17:55:28
|
Revision: 2969 http://jnode.svn.sourceforge.net/jnode/?rev=2969&view=rev Author: lsantha Date: 2006-12-30 09:55:27 -0800 (Sat, 30 Dec 2006) Log Message: ----------- moved Added Paths: ----------- trunk/core/src/test/org/jnode/test/IRTest.java Copied: trunk/core/src/test/org/jnode/test/IRTest.java (from rev 2956, trunk/core/src/core/org/jnode/vm/compiler/ir/IRTest.java) =================================================================== --- trunk/core/src/test/org/jnode/test/IRTest.java (rev 0) +++ trunk/core/src/test/org/jnode/test/IRTest.java 2006-12-30 17:55:27 UTC (rev 2969) @@ -0,0 +1,277 @@ +/* + * $Id$ + * + * JNode.org + * Copyright (C) 2003-2006 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.test; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.net.MalformedURLException; +import java.util.Collection; +import java.util.Map; + +import org.jnode.assembler.x86.X86Assembler; +import org.jnode.assembler.x86.X86BinaryAssembler; +import org.jnode.assembler.x86.X86Constants; +import org.jnode.assembler.x86.X86Register; +import org.jnode.assembler.x86.X86TextAssembler; +import org.jnode.util.BootableHashMap; +import org.jnode.vm.VmSystemClassLoader; +import org.jnode.vm.bytecode.BytecodeParser; +import org.jnode.vm.classmgr.VmByteCode; +import org.jnode.vm.classmgr.VmMethod; +import org.jnode.vm.classmgr.VmType; +import org.jnode.vm.compiler.ir.quad.Quad; +import org.jnode.vm.compiler.ir.*; +import org.jnode.vm.x86.VmX86Architecture32; +import org.jnode.vm.x86.X86CpuID; +import org.jnode.vm.x86.compiler.l2.GenericX86CodeGenerator; +import org.jnode.vm.x86.compiler.l2.X86CodeGenerator; + +/** + * @author Madhu Siddalingaiah + * @author Levente S\u00e1ntha + */ +public class IRTest { + public static void main(String args[]) throws SecurityException, IOException, ClassNotFoundException { +// System.in.read(); + X86CpuID cpuId = X86CpuID.createID("p5"); + boolean binary = false; + + String className = "org.jnode.vm.compiler.ir.PrimitiveTest"; + if (args.length > 0) { + String arg0 = args[0]; + if("-b".equals(arg0)){ + binary = true; + if(args.length > 1){ + className = args[1]; + } + }else{ + className = arg0; + } + } + + if(binary){ + X86BinaryAssembler os = new X86BinaryAssembler(cpuId, X86Constants.Mode.CODE32, 0); + generateCode(os, className); + FileOutputStream fos = new FileOutputStream("test.bin"); + os.writeTo(fos); + fos.close(); + }else{ + X86TextAssembler tos = new X86TextAssembler(new OutputStreamWriter(System.out), cpuId, X86Constants.Mode.CODE32); + generateCode(tos, className); + tos.flush(); + } + + + +/* + BytecodeViewer bv = new BytecodeViewer(); + BytecodeParser.parse(code, bv); + + // System.out.println(cfg.toString()); + // System.out.println(); + + boolean printDeadCode = false; + boolean printDetail = false; + IRBasicBlock currentBlock = null; + for (int i=0; i<n; i+=1) { + Quad quad = (Quad) quads.get(i); + if (currentBlock != quad.getBasicBlock()) { + currentBlock = quad.getBasicBlock(); + System.out.println(); + System.out.println(currentBlock); + } + if (printDeadCode && quad.isDeadCode()) { + if (printDetail) { + printQuadDetail(quad); + } + System.out.println(quad); + } + if (!quad.isDeadCode()) { + if (printDetail) { + printQuadDetail(quad); + } + System.out.println(quad); + } + } + + System.out.println(); + System.out.println("Live ranges:"); + n = lv.size(); + for (int i=0; i<n; i+=1) { + System.out.println(liveRanges[i]); + } +*/ + } + + private static void generateCode(X86Assembler os, String className) throws MalformedURLException, ClassNotFoundException { + //VmByteCode code = loadByteCode(className, "discriminant"); + //VmByteCode code = loadByteCode(className, "arithOptIntx"); + //VmByteCode code = loadByteCode(className, "simpleWhile"); + //VmByteCode code = loadByteCode(className, "terniary2"); + VmByteCode code = loadByteCode(className, "trivial"); + //VmByteCode code = loadByteCode(className, "appel"); + + X86CodeGenerator x86cg = new X86CodeGenerator(os, code.getLength()); + + generateCode(os, code, x86cg); + } + + private static <T extends X86Register> void generateCode(X86Assembler os, VmByteCode code, CodeGenerator<T> cg) throws MalformedURLException, ClassNotFoundException { + IRControlFlowGraph<T> cfg = new IRControlFlowGraph<T>(code); + + //BytecodeViewer bv = new BytecodeViewer(); + //BytecodeParser.parse(code, bv); + + //System.out.println(cfg.toString()); + //System.out.println(); + + //System.out.println(cfg); + IRGenerator<T> irg = new IRGenerator<T>(cfg); + BytecodeParser.parse(code, irg); + + cfg.constructSSA(); + cfg.optimize(); + + cfg.deconstrucSSA(); + cfg.fixupAddresses(); + + final Map<Variable, Variable<T>> liveVariables = new BootableHashMap<Variable, Variable<T>>(); + + for (IRBasicBlock<T> b : cfg) { + System.out.println(); + System.out.println(b + ", stackOffset = " + b.getStackOffset()); + for (Quad<T> q : b.getQuads()) { + if (!q.isDeadCode()) { + q.computeLiveness(liveVariables); + System.out.println(q); + } + } + } + System.out.println(); + + System.out.println("Live ranges:"); + Collection<Variable<T>> lv = liveVariables.values(); + LiveRange<T>[] liveRanges = new LiveRange[lv.size()]; + int i = 0; + for (Variable<T> var : lv) { + LiveRange<T> range = new LiveRange<T>(var); + liveRanges[i++] = range; + } + + LinearScanAllocator<T> lsa = new LinearScanAllocator<T>(liveRanges); + lsa.allocate(); + + for (LiveRange range : liveRanges) { + System.out.println(range); + } + + GenericX86CodeGenerator<T> x86cg = (GenericX86CodeGenerator<T>)cg; + x86cg.setArgumentVariables(irg.getVariables(), irg.getNoArgs()); + x86cg.setSpilledVariables(lsa.getSpilledVariables()); + x86cg.emitHeader(); + for (IRBasicBlock<T> b : cfg) { + System.out.println(); + System.out.println(b); + for (Quad<T> q : b.getQuads()) { + if (!q.isDeadCode()) { + q.generateCode(cg); + } + } + } + + // TODO + // 1. Fix method argument location, allocator leaves it null and breaks + // 2. Many necessary operations are not implemented in the code generator + // 3. Do something about unused phi nodes, they just waste space right now + + +// BootableArrayList quads = irg.getQuadList(); +// int n = quads.size(); +// BootableHashMap liveVariables = new BootableHashMap(); +// for (int i=0; i<n; i+=1) { +// Quad quad = (Quad) quads.get(i); +//// System.out.println(quad); +// quad.doPass2(liveVariables); +// System.out.println(quad); +// } + +// Collection lv = liveVariables.values(); +// n = lv.size(); +// LiveRange[] liveRanges = new LiveRange[n]; +// Iterator it = lv.iterator(); +// for (int i=0; i<n; i+=1) { +// Variable v = (Variable) it.next(); +// liveRanges[i] = new LiveRange(v); +// // System.out.println("Live range: " + liveRanges[i]); +// } +// Arrays.sort(liveRanges); +// System.out.println(Arrays.asList(liveRanges)); +// LinearScanAllocator lsa = new LinearScanAllocator(liveRanges); +// lsa.allocate(); +// +// x86cg.setArgumentVariables(irg.getVariables(), irg.getNoArgs()); +// x86cg.setSpilledVariables(lsa.getSpilledVariables()); +// x86cg.emitHeader(); +// +// n = quads.size(); +// for (int i=0; i<n; i+=1) { +// Quad quad = (Quad) quads.get(i); +// if (!quad.isDeadCode()) { +// quad.generateCode(x86cg); +// } +// } + } + + private static VmByteCode loadByteCode(String className, String methodName) + throws MalformedURLException, ClassNotFoundException { + VmSystemClassLoader vmc = new VmSystemClassLoader(new File(".").toURL(), new VmX86Architecture32()); + VmType<?> type = vmc.loadClass(className, true); + VmMethod arithMethod = null; + int nMethods = type.getNoDeclaredMethods(); + for (int i=0; i<nMethods; i+=1) { + VmMethod method = type.getDeclaredMethod(i); + if (methodName.equals(method.getName())) { + arithMethod = method; + break; + } + } + VmByteCode code = arithMethod.getBytecode(); + return code; + } + + public static <T> void printQuadDetail(Quad<T> quad) { + System.out.print(quad.getBasicBlock()); + System.out.print(" "); + Variable[] vars = quad.getBasicBlock().getVariables(); + System.out.print("["); + for (int j=0; j<vars.length; j+=1) { + System.out.print(vars[j]); + System.out.print(","); + } + System.out.print("] "); + if (quad.isDeadCode()) { + System.out.print("(dead) "); + } + } +} Property changes on: trunk/core/src/test/org/jnode/test/IRTest.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2006-12-30 17:46:44
|
Revision: 2968 http://jnode.svn.sourceforge.net/jnode/?rev=2968&view=rev Author: lsantha Date: 2006-12-30 09:46:43 -0800 (Sat, 30 Dec 2006) Log Message: ----------- Added configuration with a minimal shell. Added Paths: ----------- trunk/all/conf/shell-plugin-list.xml Added: trunk/all/conf/shell-plugin-list.xml =================================================================== --- trunk/all/conf/shell-plugin-list.xml (rev 0) +++ trunk/all/conf/shell-plugin-list.xml 2006-12-30 17:46:43 UTC (rev 2968) @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<plugin-list name="shell"> + <manifest> + <attribute key="Main-Class" value="org.jnode.shell.CommandShell"/> + </manifest> + + <plugin id="org.jnode.driver"/> + <plugin id="org.jnode.driver.character"/> + <plugin id="org.jnode.driver.console"/> + <plugin id="org.jnode.driver.console.core"/> + <plugin id="org.jnode.driver.console.textscreen"/> + <plugin id="org.jnode.driver.finder"/> + <plugin id="org.jnode.driver.input"/> + <plugin id="org.jnode.driver.input.l10n"/> + <plugin id="org.jnode.driver.ps2"/> + <plugin id="org.jnode.driver.system.cmos"/> + <plugin id="org.jnode.driver.textscreen"/> + <plugin id="org.jnode.driver.textscreen.core"/> + <plugin id="org.jnode.log4j"/> + <plugin id="org.jnode.shell"/> + <plugin id="org.jnode.shell.command"/> + <plugin id="org.jnode.shell.help"/> + <plugin id="org.jnode.work"/> +</plugin-list> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2006-12-30 17:45:50
|
Revision: 2967 http://jnode.svn.sourceforge.net/jnode/?rev=2967&view=rev Author: lsantha Date: 2006-12-30 09:45:47 -0800 (Sat, 30 Dec 2006) Log Message: ----------- Added configuration with a minimal shell. Modified Paths: -------------- trunk/all/conf/x86/menu-cdrom.lst Modified: trunk/all/conf/x86/menu-cdrom.lst =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2006-12-30 16:08:30
|
Revision: 2966 http://jnode.svn.sourceforge.net/jnode/?rev=2966&view=rev Author: lsantha Date: 2006-12-30 08:08:29 -0800 (Sat, 30 Dec 2006) Log Message: ----------- Moved various packages to separate fragments. Modified Paths: -------------- trunk/core/descriptors/org.classpath.core.xml trunk/core/descriptors/org.classpath.ext.core.xml Modified: trunk/core/descriptors/org.classpath.core.xml =================================================================== --- trunk/core/descriptors/org.classpath.core.xml 2006-12-30 15:19:00 UTC (rev 2965) +++ trunk/core/descriptors/org.classpath.core.xml 2006-12-30 16:08:29 UTC (rev 2966) @@ -11,7 +11,17 @@ <runtime> <library name="jnode-core.jar"> - <export name="gnu.classpath.*"/> + + <export name="gnu.classpath.Configuration"/> + <export name="gnu.classpath.Pointer"/> + <export name="gnu.classpath.SystemProperties"/> + <export name="gnu.classpath.VMSystemProperties"/> + <export name="gnu.classpath.VMStackWalker"/> + <export name="gnu.classpath.NotImplementedException"/> + <export name="gnu.classpath.ServiceFactory"/> + <export name="gnu.classpath.ServiceFactory$ServiceIterator"/> + <export name="gnu.classpath.ServiceProviderLoadingAction"/> + <export name="gnu.classpath.debug.*"/> <export name="gnu.java.io.*"/> @@ -21,8 +31,7 @@ <export name="gnu.java.nio.channels.*"/> <export name="gnu.java.nio.charset.*"/> <export name="gnu.java.nio.charset.iconv.*"/> - <export name="gnu.java.lang.*"/> - <export name="gnu.java.lang.management.*"/> + <export name="gnu.java.lang.*"/> <export name="gnu.java.lang.reflect.*"/> <export name="gnu.java.locale.LocaleHelper"/> @@ -30,12 +39,6 @@ <export name="gnu.java.locale.LocaleInformation_en"/> <export name="gnu.java.locale.LocaleInformation"/> - <export name="gnu.java.rmi.*"/> - <export name="gnu.java.rmi.dgc.*"/> - <export name="gnu.java.rmi.registry.*"/> - <export name="gnu.java.rmi.server.*"/> - <export name="gnu.java.rmi.activation.*"/> - <export name="gnu.java.security.*"/> <export name="gnu.java.security.action.*"/> <export name="gnu.java.security.ber.*"/> @@ -72,7 +75,6 @@ <export name="java.lang.*"/> <export name="java.lang.annotation.*"/> <export name="java.lang.instrument.*"/> - <export name="java.lang.management.*"/> <export name="java.lang.ref.*"/> <export name="java.lang.reflect.*"/> <export name="java.math.*"/> @@ -81,12 +83,7 @@ <export name="java.nio.channels.*"/> <export name="java.nio.channels.spi.*"/> <export name="java.nio.charset.*"/> - <export name="java.nio.charset.spi.*"/> - <export name="java.rmi.*"/> - <export name="java.rmi.activation.*"/> - <export name="java.rmi.dgc.*"/> - <export name="java.rmi.registry.*"/> - <export name="java.rmi.server.*"/> + <export name="java.nio.charset.spi.*"/> <export name="java.security.*"/> <export name="java.security.acl.*"/> <export name="java.security.cert.*"/> @@ -100,10 +97,8 @@ <export name="java.util.prefs.*"/> <export name="java.util.regex.*"/> <export name="java.util.zip.*"/> - - <export name="javax.accessibility.*"/> + <export name="javax.isolate.*"/> - <export name="javax.management.*"/> <export name="javax.naming.Name"/> <export name="javax.naming.InvalidNameException"/> @@ -127,6 +122,4 @@ </library> </runtime> - - </plugin> Modified: trunk/core/descriptors/org.classpath.ext.core.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.core.xml 2006-12-30 15:19:00 UTC (rev 2965) +++ trunk/core/descriptors/org.classpath.ext.core.xml 2006-12-30 16:08:29 UTC (rev 2966) @@ -12,13 +12,9 @@ <runtime> <library name="jnode-core.jar"> - <export name="gnu.java.net.protocol.*"/> - <export name="gnu.java.net.protocol.file.*"/> - <export name="gnu.java.net.protocol.ftp.*"/> - <export name="gnu.java.net.protocol.http.*"/> - <export name="gnu.java.net.protocol.http.event.*"/> - <export name="gnu.java.net.protocol.jar.*"/> + <export name="gnu.classpath.*"/> + <export name="gnu.java.awt.*"/> <export name="gnu.java.awt.color.*"/> <export name="gnu.java.awt.peer.*"/> @@ -29,6 +25,18 @@ <export name="gnu.java.beans.editors.*"/> <export name="gnu.java.beans.encoder.*"/> <export name="gnu.java.beans.encoder.elements.*"/> + <export name="gnu.java.lang.management.*"/> + <export name="gnu.java.net.protocol.*"/> + <export name="gnu.java.net.protocol.file.*"/> + <export name="gnu.java.net.protocol.ftp.*"/> + <export name="gnu.java.net.protocol.http.*"/> + <export name="gnu.java.net.protocol.http.event.*"/> + <export name="gnu.java.net.protocol.jar.*"/> + <export name="gnu.java.rmi.*"/> + <export name="gnu.java.rmi.dgc.*"/> + <export name="gnu.java.rmi.registry.*"/> + <export name="gnu.java.rmi.server.*"/> + <export name="gnu.java.rmi.activation.*"/> <export name="java.applet.*"/> <export name="java.awt.*"/> @@ -47,7 +55,15 @@ <export name="java.awt.print.*"/> <export name="java.beans.*"/> <export name="java.beans.beancontext.*"/> + <export name="java.lang.management.*"/> + <export name="java.rmi.*"/> + <export name="java.rmi.activation.*"/> + <export name="java.rmi.dgc.*"/> + <export name="java.rmi.registry.*"/> + <export name="java.rmi.server.*"/> + <export name="javax.accessibility.*"/> + <export name="javax.management.*"/> <export name="javax.naming.*"/> <export name="javax.naming.directory.*"/> <export name="javax.naming.event.*"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2006-12-30 15:19:01
|
Revision: 2965 http://jnode.svn.sourceforge.net/jnode/?rev=2965&view=rev Author: lsantha Date: 2006-12-30 07:19:00 -0800 (Sat, 30 Dec 2006) Log Message: ----------- Moved various packages to separate fragments. Modified Paths: -------------- trunk/all/conf/default-plugin-list.xml Modified: trunk/all/conf/default-plugin-list.xml =================================================================== --- trunk/all/conf/default-plugin-list.xml 2006-12-30 15:18:21 UTC (rev 2964) +++ trunk/all/conf/default-plugin-list.xml 2006-12-30 15:19:00 UTC (rev 2965) @@ -10,6 +10,8 @@ </manifest> <plugin id="org.classpath.ext"/> + <plugin id="org.classpath.ext.awt"/> + <plugin id="org.classpath.ext.core"/> <plugin id="org.classpath.ext.xml"/> <plugin id="org.classpath.ext.jdwp"/> <plugin id="org.classpath.ext.corba"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2006-12-30 15:18:22
|
Revision: 2964 http://jnode.svn.sourceforge.net/jnode/?rev=2964&view=rev Author: lsantha Date: 2006-12-30 07:18:21 -0800 (Sat, 30 Dec 2006) Log Message: ----------- Moved various packages to separate fragments. Modified Paths: -------------- trunk/core/descriptors/org.classpath.ext.core.xml Modified: trunk/core/descriptors/org.classpath.ext.core.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.core.xml 2006-12-30 15:17:46 UTC (rev 2963) +++ trunk/core/descriptors/org.classpath.ext.core.xml 2006-12-30 15:18:21 UTC (rev 2964) @@ -19,14 +19,7 @@ <export name="gnu.java.net.protocol.http.event.*"/> <export name="gnu.java.net.protocol.jar.*"/> - - - - - - - - <export name="gnu.java.awt.*"/> + <export name="gnu.java.awt.*"/> <export name="gnu.java.awt.color.*"/> <export name="gnu.java.awt.peer.*"/> <export name="gnu.java.awt.image.*"/> @@ -37,7 +30,6 @@ <export name="gnu.java.beans.encoder.*"/> <export name="gnu.java.beans.encoder.elements.*"/> - <export name="java.applet.*"/> <export name="java.awt.*"/> <export name="java.awt.color.*"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2006-12-30 15:17:47
|
Revision: 2963 http://jnode.svn.sourceforge.net/jnode/?rev=2963&view=rev Author: lsantha Date: 2006-12-30 07:17:46 -0800 (Sat, 30 Dec 2006) Log Message: ----------- Moved various packages to separate fragments. Modified Paths: -------------- trunk/core/descriptors/org.classpath.core.xml Added Paths: ----------- trunk/core/descriptors/org.classpath.ext.awt.xml trunk/core/descriptors/org.classpath.ext.core.xml Modified: trunk/core/descriptors/org.classpath.core.xml =================================================================== --- trunk/core/descriptors/org.classpath.core.xml 2006-12-30 15:16:12 UTC (rev 2962) +++ trunk/core/descriptors/org.classpath.core.xml 2006-12-30 15:17:46 UTC (rev 2963) @@ -13,26 +13,10 @@ <library name="jnode-core.jar"> <export name="gnu.classpath.*"/> <export name="gnu.classpath.debug.*"/> - - <export name="gnu.java.awt.*"/> - <export name="gnu.java.awt.color.*"/> - <export name="gnu.java.awt.peer.*"/> - <export name="gnu.java.awt.image.*"/> - <export name="gnu.java.awt.java2d.*"/> - <export name="gnu.java.beans.*"/> - <export name="gnu.java.beans.decoder.*"/> - <export name="gnu.java.beans.editors.*"/> - <export name="gnu.java.beans.encoder.*"/> - <export name="gnu.java.beans.encoder.elements.*"/> + <export name="gnu.java.io.*"/> <export name="gnu.java.math.*"/> - <export name="gnu.java.net.*"/> - <export name="gnu.java.net.protocol.*"/> - <export name="gnu.java.net.protocol.file.*"/> - <export name="gnu.java.net.protocol.ftp.*"/> - <export name="gnu.java.net.protocol.http.*"/> - <export name="gnu.java.net.protocol.http.event.*"/> - <export name="gnu.java.net.protocol.jar.*"/> + <export name="gnu.java.net.*"/> <export name="gnu.java.nio.*"/> <export name="gnu.java.nio.channels.*"/> <export name="gnu.java.nio.charset.*"/> @@ -40,15 +24,18 @@ <export name="gnu.java.lang.*"/> <export name="gnu.java.lang.management.*"/> <export name="gnu.java.lang.reflect.*"/> + <export name="gnu.java.locale.LocaleHelper"/> <export name="gnu.java.locale.LocaleData"/> <export name="gnu.java.locale.LocaleInformation_en"/> <export name="gnu.java.locale.LocaleInformation"/> + <export name="gnu.java.rmi.*"/> <export name="gnu.java.rmi.dgc.*"/> <export name="gnu.java.rmi.registry.*"/> <export name="gnu.java.rmi.server.*"/> <export name="gnu.java.rmi.activation.*"/> + <export name="gnu.java.security.*"/> <export name="gnu.java.security.action.*"/> <export name="gnu.java.security.ber.*"/> @@ -60,9 +47,10 @@ <export name="gnu.java.security.pkcs.*"/> <export name="gnu.java.security.prng.*"/> <export name="gnu.java.security.provider.*"/> - <export name="gnu.java.security.util.*"/> + <export name="gnu.java.security.util.*"/> <export name="gnu.java.security.x509.*"/> <export name="gnu.java.security.x509.ext.*"/> + <export name="gnu.java.text.*"/> <export name="gnu.java.util.*"/> <export name="gnu.java.util.prefs.*"/> @@ -73,23 +61,13 @@ <export name="gnu.javax.net.ssl.provider.*"/> <export name="gnu.xml.stream.*"/> - <export name="java.applet.*"/> - <export name="java.awt.*"/> - <export name="java.awt.color.*"/> - <export name="java.awt.datatransfer.*"/> - <export name="java.awt.dnd.*"/> - <export name="java.awt.dnd.peer.*"/> - <export name="java.awt.event.*"/> - <export name="java.awt.font.*"/> - <export name="java.awt.geom.*"/> - <export name="java.awt.im.*"/> - <export name="java.awt.im.spi.*"/> - <export name="java.awt.image.*"/> - <export name="java.awt.image.renderable.*"/> - <export name="java.awt.peer.*"/> - <export name="java.awt.print.*"/> - <export name="java.beans.*"/> - <export name="java.beans.beancontext.*"/> + <export name="java.applet.Applet"/> + <export name="java.awt.AWTPermission"/> + <export name="java.beans.PropertyChangeListener" /> + <export name="java.beans.PropertyChangeListenerProxy" /> + <export name="java.beans.PropertyChangeSupport" /> + <export name="java.beans.PropertyChangeEvent" /> + <export name="java.io.*"/> <export name="java.lang.*"/> <export name="java.lang.annotation.*"/> @@ -125,14 +103,14 @@ <export name="javax.accessibility.*"/> <export name="javax.isolate.*"/> - <export name="javax.management.*"/> - <export name="javax.naming.*"/> - <export name="javax.naming.directory.*"/> - <export name="javax.naming.event.*"/> - <export name="javax.naming.ldap.*"/> - <export name="javax.naming.spi.*"/> - <export name="javax.sound.sampled.*"/> - <export name="javax.sound.sampled.spi.*"/> + <export name="javax.management.*"/> + + <export name="javax.naming.Name"/> + <export name="javax.naming.InvalidNameException"/> + <export name="javax.naming.NameAlreadyBoundException"/> + <export name="javax.naming.NamingException"/> + <export name="javax.naming.NameNotFoundException"/> + <export name="javax.xml.stream.*"/> <export name="javax.xml.stream.events.*"/> <export name="javax.xml.stream.util.*"/> Added: trunk/core/descriptors/org.classpath.ext.awt.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.awt.xml (rev 0) +++ trunk/core/descriptors/org.classpath.ext.awt.xml 2006-12-30 15:17:46 UTC (rev 2963) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plugin SYSTEM "jnode.dtd"> + +<fragment id="org.classpath.ext.awt" + name="Classpath AWT classes" + version="@VERSION@" + plugin-id="org.classpath.core" + plugin-version="@VERSION@" + provider-name="Classpath" + provider-url="http://classpath.org" + license-name="classpath"> + + <runtime> + <library name="jnode-core.jar"> + <export name="gnu.java.awt.peer.headless.*"/> + <export name="gnu.java.awt.peer.swing.*"/> + <export name="gnu.java.awt.font.*"/> + </library> + </runtime> + +</fragment> Added: trunk/core/descriptors/org.classpath.ext.core.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.core.xml (rev 0) +++ trunk/core/descriptors/org.classpath.ext.core.xml 2006-12-30 15:17:46 UTC (rev 2963) @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plugin SYSTEM "jnode.dtd"> + +<fragment id="org.classpath.ext.core" + name="Classpath core classes" + version="@VERSION@" + plugin-id="org.classpath.core" + plugin-version="@VERSION@" + provider-name="Classpath" + provider-url="http://classpath.org" + license-name="classpath"> + + <runtime> + <library name="jnode-core.jar"> + <export name="gnu.java.net.protocol.*"/> + <export name="gnu.java.net.protocol.file.*"/> + <export name="gnu.java.net.protocol.ftp.*"/> + <export name="gnu.java.net.protocol.http.*"/> + <export name="gnu.java.net.protocol.http.event.*"/> + <export name="gnu.java.net.protocol.jar.*"/> + + + + + + + + + <export name="gnu.java.awt.*"/> + <export name="gnu.java.awt.color.*"/> + <export name="gnu.java.awt.peer.*"/> + <export name="gnu.java.awt.image.*"/> + <export name="gnu.java.awt.java2d.*"/> + <export name="gnu.java.beans.*"/> + <export name="gnu.java.beans.decoder.*"/> + <export name="gnu.java.beans.editors.*"/> + <export name="gnu.java.beans.encoder.*"/> + <export name="gnu.java.beans.encoder.elements.*"/> + + + <export name="java.applet.*"/> + <export name="java.awt.*"/> + <export name="java.awt.color.*"/> + <export name="java.awt.datatransfer.*"/> + <export name="java.awt.dnd.*"/> + <export name="java.awt.dnd.peer.*"/> + <export name="java.awt.event.*"/> + <export name="java.awt.font.*"/> + <export name="java.awt.geom.*"/> + <export name="java.awt.im.*"/> + <export name="java.awt.im.spi.*"/> + <export name="java.awt.image.*"/> + <export name="java.awt.image.renderable.*"/> + <export name="java.awt.peer.*"/> + <export name="java.awt.print.*"/> + <export name="java.beans.*"/> + <export name="java.beans.beancontext.*"/> + + <export name="javax.naming.*"/> + <export name="javax.naming.directory.*"/> + <export name="javax.naming.event.*"/> + <export name="javax.naming.ldap.*"/> + <export name="javax.naming.spi.*"/> + + <export name="javax.sound.sampled.*"/> + <export name="javax.sound.sampled.spi.*"/> + </library> + </runtime> + +</fragment> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2006-12-30 15:16:16
|
Revision: 2962 http://jnode.svn.sourceforge.net/jnode/?rev=2962&view=rev Author: lsantha Date: 2006-12-30 07:16:12 -0800 (Sat, 30 Dec 2006) Log Message: ----------- Reduced the procompiled classes. Modified Paths: -------------- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java Modified: trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2006-12-30 15:11:53 UTC (rev 2961) +++ trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2006-12-30 15:16:12 UTC (rev 2962) @@ -1316,8 +1316,6 @@ addCompileHighOptLevel("org.jnode.vm.compiler"); addCompileHighOptLevel("org.jnode.vm.isolate"); addCompileHighOptLevel("org.jnode.vm.scheduler"); -// addCompileHighOptLevel("org.jnode.vm.compiler.ir"); -// addCompileHighOptLevel("org.jnode.vm.compiler.ir.quad"); for (NativeCodeCompiler compiler : getArchitecture().getCompilers()) { for (String packageName : compiler.getCompilerPackages()) { addCompileHighOptLevel(packageName); @@ -1330,22 +1328,22 @@ addCompileHighOptLevel("org.jnode.vm.memmgr.mmtk.genrc"); addCompileHighOptLevel("org.jnode.vm.memmgr.mmtk.nogc"); addCompileHighOptLevel("org.jnode.vm.memmgr.mmtk.ms"); - - addCompileHighOptLevel("org.mmtk.plan"); - addCompileHighOptLevel("org.mmtk.policy"); - addCompileHighOptLevel("org.mmtk.utility"); - addCompileHighOptLevel("org.mmtk.utility.alloc"); - addCompileHighOptLevel("org.mmtk.utility.deque"); - addCompileHighOptLevel("org.mmtk.utility.gcspy"); - addCompileHighOptLevel("org.mmtk.utility.gcspy.drivers"); - addCompileHighOptLevel("org.mmtk.utility.heap"); - addCompileHighOptLevel("org.mmtk.utility.options"); - addCompileHighOptLevel("org.mmtk.utility.scan"); - addCompileHighOptLevel("org.mmtk.utility.statistics"); - addCompileHighOptLevel("org.mmtk.vm"); - addCompileHighOptLevel("org.mmtk.vm.gcspy"); - if (false) { + if(false){ + addCompileHighOptLevel("org.mmtk.plan"); + addCompileHighOptLevel("org.mmtk.policy"); + addCompileHighOptLevel("org.mmtk.utility"); + addCompileHighOptLevel("org.mmtk.utility.alloc"); + addCompileHighOptLevel("org.mmtk.utility.deque"); + addCompileHighOptLevel("org.mmtk.utility.gcspy"); + addCompileHighOptLevel("org.mmtk.utility.gcspy.drivers"); + addCompileHighOptLevel("org.mmtk.utility.heap"); + addCompileHighOptLevel("org.mmtk.utility.options"); + addCompileHighOptLevel("org.mmtk.utility.scan"); + addCompileHighOptLevel("org.mmtk.utility.statistics"); + addCompileHighOptLevel("org.mmtk.vm"); + addCompileHighOptLevel("org.mmtk.vm.gcspy"); + addCompileHighOptLevel("java.awt"); addCompileHighOptLevel("java.awt.event"); addCompileHighOptLevel("java.awt.peer"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2006-12-30 15:11:55
|
Revision: 2961 http://jnode.svn.sourceforge.net/jnode/?rev=2961&view=rev Author: lsantha Date: 2006-12-30 07:11:53 -0800 (Sat, 30 Dec 2006) Log Message: ----------- Removed unused packages. Modified Paths: -------------- trunk/core/descriptors/org.jnode.vm.core.xml Modified: trunk/core/descriptors/org.jnode.vm.core.xml =================================================================== --- trunk/core/descriptors/org.jnode.vm.core.xml 2006-12-30 15:10:50 UTC (rev 2960) +++ trunk/core/descriptors/org.jnode.vm.core.xml 2006-12-30 15:11:53 UTC (rev 2961) @@ -24,8 +24,6 @@ <export name="org.jnode.vm.bytecode.*"/> <export name="org.jnode.vm.classmgr.*"/> <export name="org.jnode.vm.compiler.*"/> - <export name="org.jnode.vm.compiler.ir.*"/> - <export name="org.jnode.vm.compiler.ir.quad.*"/> <export name="org.jnode.vm.isolate.*"/> <export name="org.jnode.vm.isolate.link.*"/> <export name="org.jnode.vm.memmgr.*"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2006-12-30 15:10:51
|
Revision: 2960 http://jnode.svn.sourceforge.net/jnode/?rev=2960&view=rev Author: lsantha Date: 2006-12-30 07:10:50 -0800 (Sat, 30 Dec 2006) Log Message: ----------- Removed unused packages. Modified Paths: -------------- trunk/core/descriptors/org.jnode.vm_x86.xml Modified: trunk/core/descriptors/org.jnode.vm_x86.xml =================================================================== --- trunk/core/descriptors/org.jnode.vm_x86.xml 2006-12-30 10:32:52 UTC (rev 2959) +++ trunk/core/descriptors/org.jnode.vm_x86.xml 2006-12-30 15:10:50 UTC (rev 2960) @@ -18,10 +18,8 @@ <export name="org.jnode.vm.x86.*"/> <export name="org.jnode.vm.x86.compiler.*"/> <export name="org.jnode.vm.x86.compiler.stub.*"/> - <!-- export name="org.jnode.vm.x86.compiler.l1.*"/ --> <export name="org.jnode.vm.x86.compiler.l1a.*"/> <export name="org.jnode.vm.x86.compiler.l1b.*"/> - <export name="org.jnode.vm.x86.compiler.l2.*"/> <export name="org.jnode.vm.x86.performance.*"/> </library> </runtime> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2006-12-30 10:32:57
|
Revision: 2959 http://jnode.svn.sourceforge.net/jnode/?rev=2959&view=rev Author: lsantha Date: 2006-12-30 02:32:52 -0800 (Sat, 30 Dec 2006) Log Message: ----------- Moved JDWP classes to a fragment. Modified Paths: -------------- trunk/all/conf/default-plugin-list.xml Modified: trunk/all/conf/default-plugin-list.xml =================================================================== --- trunk/all/conf/default-plugin-list.xml 2006-12-30 09:30:15 UTC (rev 2958) +++ trunk/all/conf/default-plugin-list.xml 2006-12-30 10:32:52 UTC (rev 2959) @@ -11,6 +11,7 @@ <plugin id="org.classpath.ext"/> <plugin id="org.classpath.ext.xml"/> + <plugin id="org.classpath.ext.jdwp"/> <plugin id="org.classpath.ext.corba"/> <plugin id="org.classpath.ext.imageio"/> <plugin id="org.classpath.ext.management"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2006-12-30 09:30:21
|
Revision: 2958 http://jnode.svn.sourceforge.net/jnode/?rev=2958&view=rev Author: lsantha Date: 2006-12-30 01:30:15 -0800 (Sat, 30 Dec 2006) Log Message: ----------- Moved JDWP classes to a fragment. Modified Paths: -------------- trunk/core/descriptors/org.classpath.core.xml Added Paths: ----------- trunk/core/descriptors/org.classpath.ext.jdwp.xml Modified: trunk/core/descriptors/org.classpath.core.xml =================================================================== --- trunk/core/descriptors/org.classpath.core.xml 2006-12-30 08:16:04 UTC (rev 2957) +++ trunk/core/descriptors/org.classpath.core.xml 2006-12-30 09:30:15 UTC (rev 2958) @@ -12,15 +12,7 @@ <runtime> <library name="jnode-core.jar"> <export name="gnu.classpath.*"/> - <export name="gnu.classpath.debug.*"/> - <export name="gnu.classpath.jdwp.*"/> - <export name="gnu.classpath.jdwp.event.*"/> - <export name="gnu.classpath.jdwp.event.filters.*"/> - <export name="gnu.classpath.jdwp.exception.*"/> - <export name="gnu.classpath.jdwp.id.*"/> - <export name="gnu.classpath.jdwp.processor.*"/> - <export name="gnu.classpath.jdwp.transport.*"/> - <export name="gnu.classpath.jdwp.util.*"/> + <export name="gnu.classpath.debug.*"/> <export name="gnu.java.awt.*"/> <export name="gnu.java.awt.color.*"/> Added: trunk/core/descriptors/org.classpath.ext.jdwp.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.jdwp.xml (rev 0) +++ trunk/core/descriptors/org.classpath.ext.jdwp.xml 2006-12-30 09:30:15 UTC (rev 2958) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plugin SYSTEM "jnode.dtd"> + +<fragment id="org.classpath.ext.jdwp" + name="Classpath JDWP classes" + version="@VERSION@" + plugin-id="org.classpath.core" + plugin-version="@VERSION@" + provider-name="Classpath" + provider-url="http://classpath.org" + license-name="classpath"> + + <runtime> + <library name="jnode-core.jar"> + <export name="gnu.classpath.jdwp.*"/> + <export name="gnu.classpath.jdwp.event.*"/> + <export name="gnu.classpath.jdwp.event.filters.*"/> + <export name="gnu.classpath.jdwp.exception.*"/> + <export name="gnu.classpath.jdwp.id.*"/> + <export name="gnu.classpath.jdwp.processor.*"/> + <export name="gnu.classpath.jdwp.transport.*"/> + <export name="gnu.classpath.jdwp.util.*"/> + </library> + </runtime> + +</fragment> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2006-12-30 08:16:07
|
Revision: 2957 http://jnode.svn.sourceforge.net/jnode/?rev=2957&view=rev Author: lsantha Date: 2006-12-30 00:16:04 -0800 (Sat, 30 Dec 2006) Log Message: ----------- Fixed package name. Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/x86/compiler/stub/X86StubCompiler.java Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/stub/X86StubCompiler.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/stub/X86StubCompiler.java 2006-12-26 00:28:17 UTC (rev 2956) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/stub/X86StubCompiler.java 2006-12-30 08:16:04 UTC (rev 2957) @@ -146,6 +146,6 @@ */ @Override public String[] getCompilerPackages() { - return new String[] { "org.jnode.vm.x86.compiler", "org.jnode.vm.x86.compiler.stup" }; + return new String[] { "org.jnode.vm.x86.compiler", "org.jnode.vm.x86.compiler.stub" }; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2006-12-26 00:28:22
|
Revision: 2956 http://jnode.svn.sourceforge.net/jnode/?rev=2956&view=rev Author: fduminy Date: 2006-12-25 16:28:17 -0800 (Mon, 25 Dec 2006) Log Message: ----------- declare java.version as 1.5 (that's almost the case) in order that program checking it (like junit) can be happy Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/VmSystem.java Modified: trunk/core/src/core/org/jnode/vm/VmSystem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmSystem.java 2006-12-26 00:22:49 UTC (rev 2955) +++ trunk/core/src/core/org/jnode/vm/VmSystem.java 2006-12-26 00:28:17 UTC (rev 2956) @@ -226,7 +226,7 @@ final VmArchitecture arch = Vm.getArch(); // Java properties - res.put("java.version", "1.1.0"); + res.put("java.version", "1.5"); res.put("java.vendor", "JNode.org"); res.put("java.vendor.url", "http://jnode.org"); res.put("java.home", "/jifs/"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2006-12-26 00:22:52
|
Revision: 2955 http://jnode.svn.sourceforge.net/jnode/?rev=2955&view=rev Author: fduminy Date: 2006-12-25 16:22:49 -0800 (Mon, 25 Dec 2006) Log Message: ----------- patch submited by Andrei DORE : fixed bug in ByteBufferInputStream.available() implementation + added test case Modified Paths: -------------- trunk/core/src/core/org/jnode/util/ByteBufferInputStream.java Added Paths: ----------- trunk/core/src/test/org/jnode/test/bugs/TestByteBufferInputStream.java Modified: trunk/core/src/core/org/jnode/util/ByteBufferInputStream.java =================================================================== --- trunk/core/src/core/org/jnode/util/ByteBufferInputStream.java 2006-12-22 21:17:39 UTC (rev 2954) +++ trunk/core/src/core/org/jnode/util/ByteBufferInputStream.java 2006-12-26 00:22:49 UTC (rev 2955) @@ -33,6 +33,7 @@ } /** + * @Override * @see java.io.InputStream#read() */ public int read() throws IOException { @@ -41,5 +42,14 @@ } else { return -1; } - } + } + + @Override + /** + * @author Andrei DORE + */ + public int available() throws IOException + { + return buf.remaining(); + } } Added: trunk/core/src/test/org/jnode/test/bugs/TestByteBufferInputStream.java =================================================================== --- trunk/core/src/test/org/jnode/test/bugs/TestByteBufferInputStream.java (rev 0) +++ trunk/core/src/test/org/jnode/test/bugs/TestByteBufferInputStream.java 2006-12-26 00:22:49 UTC (rev 2955) @@ -0,0 +1,41 @@ +package org.jnode.test.bugs; + +import java.io.BufferedInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; + +import junit.framework.TestCase; + +import org.jnode.util.ByteBufferInputStream; + +/** + * + * @author Andrei DORE + * + */ +public class TestByteBufferInputStream extends TestCase { + /** + * That test show if the (ByteBuffer)InputStream.available is properly implemented + * or not + * @throws IOException + */ + public void testWrappedByBufferedInputStream() throws IOException{ + final int SIZE = 5000; + + ByteBuffer buffer=ByteBuffer.allocate(SIZE); + for(int i=0;i<SIZE;i++){ + buffer.put((byte)1); + } + + buffer.rewind(); + + ByteBufferInputStream input=new ByteBufferInputStream(buffer); + + BufferedInputStream bufferedInputStream=new BufferedInputStream(input,2048); + + + byte data[]=new byte[SIZE]; + + assertEquals(SIZE, bufferedInputStream.read(data)); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ans...@us...> - 2006-12-22 21:17:41
|
Revision: 2954 http://jnode.svn.sourceforge.net/jnode/?rev=2954&view=rev Author: ansari82 Date: 2006-12-22 13:17:39 -0800 (Fri, 22 Dec 2006) Log Message: ----------- Fixed compilation of 'instanceof' bytecode in jikesopt', partial fix to float values sent/received in physical registers Modified Paths: -------------- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_CallingConvention.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_DynamicTypeCheckExpansion.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/ir/OPT_GenerateJnodeMagic.java branches/jikesRVM/core/src/test/org/jnode/test/core/CompilerTest.java Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java 2006-12-22 09:56:52 UTC (rev 2953) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java 2006-12-22 21:17:39 UTC (rev 2954) @@ -118,26 +118,45 @@ } public static boolean compilableMethod(VmMethod vmMethod) { - if (vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.A") - || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.C") - || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.I") - || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.M") - || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.N") - || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.O") - || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.S") - || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.T") - || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmA") -// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmB") <== bad -// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmCl") -// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmCompiledCode") -// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmCompiledEx") -// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmCon") + if ( +// vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.A") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.C") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.I") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.M") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.N") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.O") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.S") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.T") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmA") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmB") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmClass") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmCom") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmConstC") // +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmConstD") // +// vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmConstMember") // + vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmConstFl") // + && ( + vmMethod.getName().contains("get") + || vmMethod.getName().startsWith("float") + ) +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmConstI") // // || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmCP") // || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmE") // || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmF") -// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmCP") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmIm") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmIns") // +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmInt") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmIso") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmL") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmM") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmN") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmO") // +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmP") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmR") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmSh") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmSp") // || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmSt") - || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmT") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmT") // || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmU") ) Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_CallingConvention.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_CallingConvention.java 2006-12-22 09:56:52 UTC (rev 2953) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_CallingConvention.java 2006-12-22 21:17:39 UTC (rev 2954) @@ -134,14 +134,14 @@ //non-FPU implementing processor OPT_Instruction tmp; if(type.isFloatType()) { - tmp = MIR_Unary.create(IA32_ADD, new OPT_RegisterOperand(phys.getESP(), VM_TypeReference.Int), IC(-BYTES_IN_DOUBLE)); + tmp = MIR_Unary.create(IA32_ADD, new OPT_RegisterOperand(phys.getESP(), VM_TypeReference.Int), IC(-BYTES_IN_FLOAT)); ret.insertBefore(tmp); - tmp = MIR_Move.create(IA32_FMOV, new OPT_RegisterOperand(phys.getESP(), VM_TypeReference.Double), symb1); + tmp = MIR_Move.create(IA32_FSTP, new OPT_RegisterOperand(phys.getESP(), VM_TypeReference.Double), symb1); ret.insertBefore(tmp); tmp = MIR_Nullary.create(IA32_POP, new OPT_RegisterOperand(phys.getEAX(), VM_TypeReference.Int)); ret.insertBefore(tmp); - tmp = MIR_Unary.create(IA32_ADD, new OPT_RegisterOperand(phys.getESP(), VM_TypeReference.Int), IC(BYTES_IN_FLOAT)); - ret.insertBefore(tmp); +// tmp = MIR_Unary.create(IA32_ADD, new OPT_RegisterOperand(phys.getESP(), VM_TypeReference.Int), IC(BYTES_IN_FLOAT)); +// ret.insertBefore(tmp); OPT_Register r = phys.getFirstReturnGPR(); OPT_RegisterOperand rOp= new OPT_RegisterOperand(r, type); MIR_Return.setVal(ret, rOp.copyD2U()); @@ -149,7 +149,7 @@ else { tmp = MIR_Unary.create(IA32_ADD, new OPT_RegisterOperand(phys.getESP(), VM_TypeReference.Int), IC(-BYTES_IN_DOUBLE)); ret.insertBefore(tmp); - tmp = MIR_Move.create(IA32_FMOV, new OPT_RegisterOperand(phys.getESP(), VM_TypeReference.Double), symb1); + tmp = MIR_Move.create(IA32_FSTP, new OPT_RegisterOperand(phys.getESP(), VM_TypeReference.Double), symb1); ret.insertBefore(tmp); if(VM.BuildForJNode) { tmp = MIR_Nullary.create(IA32_POP, new OPT_RegisterOperand(phys.getEAX(), VM_TypeReference.Int)); @@ -245,16 +245,16 @@ OPT_Instruction tmp; if(result1.type.isFloatType()) { OPT_MemoryOperand m = OPT_MemoryOperand.B(new OPT_RegisterOperand(phys.getESP(), VM_TypeReference.Int), - (byte)8, null, null); - tmp = MIR_Move.create(IA32_FMOV, result1, m); + (byte)BYTES_IN_FLOAT, null, null); + tmp = MIR_Move.create(IA32_FLD, result1, m); call.insertAfter(tmp); tmp = MIR_Nullary.create(IA32_PUSH, new OPT_RegisterOperand(phys.getEAX(), VM_TypeReference.Int)); call.insertAfter(tmp); } else { OPT_MemoryOperand m = OPT_MemoryOperand.B(new OPT_RegisterOperand(phys.getESP(), VM_TypeReference.Int), - (byte)8, null, null); - tmp = MIR_Move.create(IA32_FMOV, result1, m); + (byte)BYTES_IN_DOUBLE, null, null); + tmp = MIR_Move.create(IA32_FLD, result1, m); call.insertAfter(tmp); if(VM.BuildForJNode) { tmp = MIR_Nullary.create(IA32_PUSH, new OPT_RegisterOperand(phys.getEAX(), VM_TypeReference.Int)); Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_DynamicTypeCheckExpansion.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_DynamicTypeCheckExpansion.java 2006-12-22 09:56:52 UTC (rev 2953) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_DynamicTypeCheckExpansion.java 2006-12-22 21:17:39 UTC (rev 2954) @@ -427,9 +427,18 @@ InsertUnary(curBlock.lastInstruction(), ir, GET_TYPE_FROM_TIB, VM_TypeReference.VM_Type, lhsElemTIB.copyU2U()); - OPT_RegisterOperand rhsSuperclassIds = + OPT_RegisterOperand rhsSuperclassIds; + if(VM.BuildForJNode) { + rhsSuperclassIds = InsertUnary(curBlock.lastInstruction(), ir, GET_SUPERCLASS_IDS_FROM_TIB, - VM_TypeReference.ShortArray, rhsTIB.copyD2U()); + VM_TypeReference.IntArray, rhsTIB.copyD2U()); + } + else { + rhsSuperclassIds = + InsertUnary(curBlock.lastInstruction(), ir, GET_SUPERCLASS_IDS_FROM_TIB, + VM_TypeReference.ShortArray, rhsTIB.copyD2U()); + + } OPT_RegisterOperand lhsElemDepth = getField(curBlock.lastInstruction(), ir, lhsElemType, VM_Entrypoints.depthField, TG()); OPT_RegisterOperand rhsSuperclassIdsLength = @@ -445,10 +454,26 @@ curBlock.insertOut(trapBlock); curBlock = advanceBlock(s.bcIndex, curBlock, ir); - OPT_RegisterOperand lhsElemId = - getField(curBlock.lastInstruction(), ir, lhsElemType.copyD2U(), VM_Entrypoints.idField, TG()); - OPT_RegisterOperand refCandidate = ir.regpool.makeTemp(VM_TypeReference.Short); - OPT_LocationOperand loc = new OPT_LocationOperand(VM_TypeReference.Short); + OPT_RegisterOperand lhsElemId; + OPT_RegisterOperand refCandidate; + OPT_LocationOperand loc; + if(VM.BuildForJNode) { + lhsElemId = ir.regpool.makeTempInt(); + OPT_RegisterOperand jtoc = ir.regpool.makeTempInt(); + curBlock.appendInstruction(JnodeMagic.create(JNODE_SHARED_STATICS, jtoc)); + Offset clsOffset = lhsElemType.type.peekResolvedType().getTibOffset(); + OPT_MemoryOperand cls = OPT_MemoryOperand.BD(jtoc, + clsOffset, (byte)BYTES_IN_ADDRESS, new OPT_LocationOperand(lhsElemType.type), null); + curBlock.appendInstruction(Move.create(INT_MOVE, lhsElemId, cls)); + refCandidate = ir.regpool.makeTemp(VM_TypeReference.Int); + loc = new OPT_LocationOperand(VM_TypeReference.Int); + } + else { + lhsElemId = + getField(curBlock.lastInstruction(), ir, lhsElemType.copyD2U(), VM_Entrypoints.idField, TG()); + refCandidate = ir.regpool.makeTemp(VM_TypeReference.Short); + loc = new OPT_LocationOperand(VM_TypeReference.Short); + } if (LOWER_ARRAY_ACCESS) { OPT_RegisterOperand lhsDepthOffset = InsertBinary(curBlock.lastInstruction(), ir, INT_SHL, VM_TypeReference.Int, @@ -556,7 +581,7 @@ return continueAt; } else { // A resolved class (cases 5 and 6 in VM_DynamicTypeCheck) - if (LHSclass.isFinal()) { + if (LHSclass.isFinal() && !VM.BuildForJNode) { // For a final class, we can do a PTR compare of // rhsTIB and the TIB of the class OPT_Operand classTIB = getTIB(s, ir, LHSclass); @@ -568,9 +593,18 @@ // Do the full blown case 5 or 6 typecheck. int LHSDepth = LHSclass.getTypeDepth(); int LHSId = LHSclass.getId(); - OPT_RegisterOperand superclassIds = - InsertUnary(s, ir, GET_SUPERCLASS_IDS_FROM_TIB, - VM_TypeReference.ShortArray, RHStib); + OPT_RegisterOperand superclassIds; + if(VM.BuildForJNode) { + superclassIds = + InsertUnary(s, ir, GET_SUPERCLASS_IDS_FROM_TIB, + VM_TypeReference.IntArray, RHStib); + } + else { + superclassIds = + InsertUnary(s, ir, GET_SUPERCLASS_IDS_FROM_TIB, + VM_TypeReference.ShortArray, RHStib); + + } OPT_RegisterOperand refCandidate = null; if(VM.BuildForJNode) { refCandidate = @@ -774,7 +808,7 @@ return continueAt; } else { // A resolved class (cases 5 and 6 in VM_DynamicTypeCheck) - if (LHSclass.isFinal()) { + if (LHSclass.isFinal() && !VM.BuildForJNode) { // For a final class, we can do a PTR compare of // rhsTIB and the TIB of the class OPT_Operand classTIB = getTIB(continueAt, ir, LHSclass); @@ -788,9 +822,17 @@ // Do the full blown case 5 or 6 typecheck. int LHSDepth = LHSclass.getTypeDepth(); int LHSId = LHSclass.getId(); - OPT_RegisterOperand superclassIds = - InsertUnary(continueAt, ir, GET_SUPERCLASS_IDS_FROM_TIB, - VM_TypeReference.ShortArray, RHStib); + OPT_RegisterOperand superclassIds; + if(VM.BuildForJNode) { + superclassIds = + InsertUnary(continueAt, ir, GET_SUPERCLASS_IDS_FROM_TIB, + VM_TypeReference.IntArray, RHStib); + } + else { + superclassIds = + InsertUnary(continueAt, ir, GET_SUPERCLASS_IDS_FROM_TIB, + VM_TypeReference.ShortArray, RHStib); + } if (VM_DynamicTypeCheck.MIN_SUPERCLASS_IDS_SIZE <= LHSDepth) { OPT_RegisterOperand superclassIdsLength = InsertGuardedUnary(continueAt, @@ -808,13 +850,40 @@ oldBlock.splitNodeWithLinksAt(lengthCheck, ir); oldBlock.insertOut(falseBlock); // required due to splitNode! } - OPT_RegisterOperand refCandidate = - InsertLoadOffset(continueAt, ir, USHORT_LOAD, VM_TypeReference.Short, - superclassIds, Offset.fromIntZeroExtend(LHSDepth << 1), - new OPT_LocationOperand(VM_TypeReference.Short), - TG()); + OPT_Operand cmpWith; + OPT_LocationOperand loc; + OPT_RegisterOperand refCandidate; + Offset supOffset; + if(VM.BuildForJNode) { + cmpWith = ir.regpool.makeTempInt(); + OPT_RegisterOperand jtoc = ir.regpool.makeTempInt(); + Offset clsOffset = LHSclass.getTibOffset(); + supOffset = Offset.fromIntZeroExtend(LHSDepth << LOG_BYTES_IN_INT) + .add(VM_ObjectModel.getArrayDataOffset()); + loc = new OPT_LocationOperand(VM_TypeReference.Int); + continueAt.insertBefore(JnodeMagic.create(JNODE_SHARED_STATICS, jtoc)); + OPT_RegisterOperand cls = InsertLoadOffset(continueAt, ir, INT_LOAD, VM_TypeReference.Int, + jtoc, clsOffset, loc, TG()); + continueAt.insertBefore(Move.create(INT_MOVE, cmpWith.asRegister(), cls)); + + refCandidate = + InsertLoadOffset(continueAt, ir, INT_LOAD, VM_TypeReference.Int, + superclassIds, supOffset, + new OPT_LocationOperand(VM_TypeReference.Int), + TG()); + } + else { + cmpWith = IC(LHSId); + supOffset = Offset.fromIntZeroExtend(LHSDepth << LOG_BYTES_IN_SHORT) + .add(VM_ObjectModel.getArrayDataOffset()); + refCandidate = + InsertLoadOffset(continueAt, ir, USHORT_LOAD, VM_TypeReference.Short, + superclassIds, supOffset, + new OPT_LocationOperand(VM_TypeReference.Short), + TG()); + } continueAt.insertBefore(IfCmp.create(INT_IFCMP, oldGuard, - refCandidate, IC(LHSId), + refCandidate, cmpWith, OPT_ConditionOperand.NOT_EQUAL(), falseBlock.makeJumpTarget(), falseProb)); Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/ir/OPT_GenerateJnodeMagic.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/ir/OPT_GenerateJnodeMagic.java 2006-12-22 09:56:52 UTC (rev 2953) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/ir/OPT_GenerateJnodeMagic.java 2006-12-22 21:17:39 UTC (rev 2954) @@ -1,12 +1,726 @@ package com.ibm.JikesRVM.opt.ir; +import org.jnode.vm.classmgr.ObjectFlags; +import org.jnode.vm.classmgr.ObjectLayout; +import org.jnode.vm.classmgr.VmArray; +import org.jnode.vm.compiler.BaseMagicHelper.MagicMethod; +import org.vmmagic.unboxed.Address; + +import com.ibm.JikesRVM.VM; +import com.ibm.JikesRVM.classloader.VM_Atom; import com.ibm.JikesRVM.classloader.VM_MethodReference; +import com.ibm.JikesRVM.classloader.VM_TypeReference; +import com.ibm.JikesRVM.opt.OPT_MagicNotImplementedException; class OPT_GenerateJnodeMagic extends OPT_GenerateMagic { - static boolean generateMagic(OPT_BC2IR bc2ir, - OPT_GenerationContext gc, - VM_MethodReference meth) { - return false; - } + static boolean generateMagic(OPT_BC2IR bc2ir, OPT_GenerationContext gc, + VM_MethodReference meth) throws OPT_MagicNotImplementedException { + + VM_TypeReference [] paramTypes = meth.getParameterTypes(); + VM_TypeReference resultType = meth.getReturnType(); + VM_TypeReference [] types = meth.getParameterTypes(); + VM_TypeReference returnType = meth.getReturnType(); + final VM_Atom methodName = meth.getName(); + final OPT_PhysicalRegisterSet phys = gc.temps.getPhysicalRegisterSet(); + final MagicMethod mcode = MagicMethod.get(meth.getResolvedMember().getJnodeMethod()); + final int slotSize = BYTES_IN_WORD; + + // Test magic permission first -- TODO + //testMagicPermission(mcode, caller); + + switch (mcode) { + case ATOMICADD: + case ADD: { + OPT_Operand o2 = bc2ir.pop(); + OPT_Operand o1 = bc2ir.pop(); + OPT_RegisterOperand op0 = gc.temps.makeTemp(resultType); + if (VM.BuildFor64Addr && o2.isInt()){ + OPT_RegisterOperand op1 = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Unary.create(INT_2ADDRSigExt, op1, o2)); + bc2ir.appendInstruction(Binary.create(REF_ADD, op0, o1, op1.copyD2U())); + } else { + bc2ir.appendInstruction(Binary.create(REF_ADD, op0, o1, o2)); + } + bc2ir.push(op0.copyD2U(), resultType); + } + break; + case ATOMICAND: + case AND: { + OPT_Operand o2 = bc2ir.pop(); + OPT_Operand o1 = bc2ir.pop(); + OPT_RegisterOperand op0 = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Binary.create(REF_AND, op0, o1, o2)); + bc2ir.push(op0.copyD2U(), resultType); + } + break; + case ATOMICOR: + case OR: { + OPT_Operand o2 = bc2ir.pop(); + OPT_Operand o1 = bc2ir.pop(); + OPT_RegisterOperand op0 = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Binary.create(REF_OR, op0, o1, o2)); + bc2ir.push(op0.copyD2U(), resultType); + } + break; + case ATOMICSUB: + case SUB: { + OPT_Operand o2 = bc2ir.pop(); + OPT_Operand o1 = bc2ir.pop(); + OPT_RegisterOperand op0 = gc.temps.makeTemp(resultType); + if (VM.BuildFor64Addr && o2.isInt()){ + OPT_RegisterOperand op1 = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Unary.create(INT_2ADDRSigExt, op1, o2)); + bc2ir.appendInstruction(Binary.create(REF_SUB, op0, o1, op1)); + } else { + bc2ir.appendInstruction(Binary.create(REF_SUB, op0, o1, o2)); + } + bc2ir.push(op0.copyD2U(), resultType); + } + break; + case DIFF: { + OPT_Operand o2 = bc2ir.pop(); + OPT_Operand o1 = bc2ir.pop(); + OPT_RegisterOperand op0 = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Binary.create(REF_SUB, op0, o1, o2)); + bc2ir.push(op0.copyD2U()); + } + break; + case XOR: { + OPT_Operand o2 = bc2ir.pop(); + OPT_Operand o1 = bc2ir.pop(); + OPT_RegisterOperand op0 = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Binary.create(REF_XOR, op0, o1, o2)); + bc2ir.push(op0.copyD2U()); + } + break; + case NOT: { + OPT_Operand o1 = bc2ir.pop(); + OPT_RegisterOperand op0 = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Unary.create(REF_NOT, op0, o1)); + bc2ir.push(op0.copyD2U()); + } + break; + case TOINT: { + OPT_RegisterOperand reg = gc.temps.makeTempInt(); + bc2ir.appendInstruction(Unary.create(ADDR_2INT, reg, bc2ir.popAddress())); + bc2ir.push(reg.copyD2U()); + } + break; + case TOWORD: { + OPT_RegisterOperand reg = gc.temps.makeTemp(VM_TypeReference.Word); + bc2ir.appendInstruction(Move.create(REF_MOVE, reg, bc2ir.popAddress())); + bc2ir.push(reg.copyD2U()); + } + break; + case TOADDRESS: { + OPT_RegisterOperand reg = gc.temps.makeTemp(VM_TypeReference.Address); + bc2ir.appendInstruction(Move.create(REF_MOVE, reg, bc2ir.popRef())); + bc2ir.push(reg.copyD2U()); + } + break; + case TOOFFSET: { + OPT_RegisterOperand reg = gc.temps.makeTemp(VM_TypeReference.Offset); + bc2ir.appendInstruction(Move.create(REF_MOVE, reg, bc2ir.popAddress())); + bc2ir.push(reg.copyD2U()); + } + break; + case TOOBJECT: { + OPT_RegisterOperand reg + = gc.temps.makeTemp(VM_TypeReference.JavaLangObject); + bc2ir.appendInstruction(Move.create(REF_MOVE, reg, bc2ir.popRef())); + bc2ir.push(reg.copyD2U()); + } + break; + case TOOBJECTREFERENCE: { + OPT_RegisterOperand reg + = gc.temps.makeTemp(VM_TypeReference.ObjectReference); + bc2ir.appendInstruction(Move.create(REF_MOVE, reg, bc2ir.popRef())); + bc2ir.push(reg.copyD2U()); + } + break; + case TOEXTENT: { + OPT_RegisterOperand reg = gc.temps.makeTemp(VM_TypeReference.Extent); + bc2ir.appendInstruction(Move.create(REF_MOVE, reg, bc2ir.popAddress())); + bc2ir.push(reg.copyD2U()); + } + break; + case TOLONG: { + OPT_RegisterOperand lreg = gc.temps.makeTempLong(); + bc2ir.appendInstruction(Unary.create(ADDR_2LONG, lreg, bc2ir.popAddress())); + bc2ir.pushDual(lreg.copyD2U()); + } + break; + case MAX: { + OPT_RegisterOperand op0 = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Move.create(REF_MOVE, op0, new OPT_AddressConstantOperand(Address.max()))); + bc2ir.push(op0.copyD2U()); + } + break; + case ONE: { + OPT_RegisterOperand op0 = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Move.create(REF_MOVE, op0, new OPT_AddressConstantOperand(Address.fromIntZeroExtend(1)))); + bc2ir.push(op0.copyD2U()); + } + break; + case ZERO: + case NULLREFERENCE: { + OPT_RegisterOperand op0 = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Move.create(REF_MOVE, op0, new OPT_AddressConstantOperand(Address.zero()))); + bc2ir.push(op0.copyD2U()); + } + break; + case SIZE: { + OPT_RegisterOperand op0 = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Move.create(REF_MOVE, op0, new OPT_AddressConstantOperand(Address.fromIntZeroExtend(BYTES_IN_WORD)))); + bc2ir.push(op0.copyD2U()); + break; + } + case ISMAX: { + OPT_RegisterOperand op0 = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Move.create(REF_MOVE, op0, new OPT_AddressConstantOperand(Address.max()))); + OPT_ConditionOperand cond = OPT_ConditionOperand.EQUAL(); + cmpHelper(bc2ir,gc,cond, op0.copyRO()); + } + break; + case ISZERO: { + OPT_RegisterOperand op0 = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Move.create(REF_MOVE, op0, new OPT_AddressConstantOperand(Address.zero()))); + OPT_ConditionOperand cond = OPT_ConditionOperand.EQUAL(); + cmpHelper(bc2ir,gc,cond, op0.copyRO()); + } + break; + case ISNULL: { + OPT_RegisterOperand op0 = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Move.create(REF_MOVE, op0, new OPT_AddressConstantOperand(Address.zero()))); + OPT_ConditionOperand cond = OPT_ConditionOperand.EQUAL(); + cmpHelper(bc2ir,gc,cond,op0.copyRO()); + } + break; + case EQUALS: + case EQ: { + OPT_ConditionOperand cond = OPT_ConditionOperand.EQUAL(); + cmpHelper(bc2ir,gc,cond,null); + } + break; + case NE: { + OPT_ConditionOperand cond = OPT_ConditionOperand.NOT_EQUAL(); + cmpHelper(bc2ir,gc,cond,null); + } + break; + case LT: { + OPT_ConditionOperand cond = OPT_ConditionOperand.LOWER(); + cmpHelper(bc2ir,gc,cond,null); + } + break; + case LE: { + OPT_ConditionOperand cond = OPT_ConditionOperand.LOWER_EQUAL(); + cmpHelper(bc2ir,gc,cond,null); + } + break; + case GE: { + OPT_ConditionOperand cond = OPT_ConditionOperand.HIGHER_EQUAL(); + cmpHelper(bc2ir,gc,cond,null); + } + break; + case GT: { + OPT_ConditionOperand cond = OPT_ConditionOperand.HIGHER(); + cmpHelper(bc2ir,gc,cond,null); + } + break; + case SLT: { + OPT_ConditionOperand cond = OPT_ConditionOperand.LESS(); + cmpHelper(bc2ir,gc,cond,null); + } + break; + case SLE: { + OPT_ConditionOperand cond = OPT_ConditionOperand.LESS_EQUAL(); + cmpHelper(bc2ir,gc,cond,null); + } + break; + case SGE: { + OPT_ConditionOperand cond = OPT_ConditionOperand.GREATER_EQUAL(); + cmpHelper(bc2ir,gc,cond,null); + } + break; + case SGT: { + OPT_ConditionOperand cond = OPT_ConditionOperand.GREATER(); + cmpHelper(bc2ir,gc,cond,null); + } + break; + case FROMINT: + case FROMINTSIGNEXTEND: { + OPT_RegisterOperand reg = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Unary.create(INT_2ADDRSigExt, reg, bc2ir.popInt())); + bc2ir.push(reg.copyD2U()); + } + break; + case FROMINTZEROEXTEND: { + OPT_RegisterOperand reg = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Unary.create(INT_2ADDRZerExt, reg, bc2ir.popInt())); + bc2ir.push(reg.copyD2U()); + } + break; + case FROMADDRESS: + case FROMOBJECT: { + OPT_RegisterOperand reg + = gc.temps.makeTemp(VM_TypeReference.ObjectReference); + bc2ir.appendInstruction(Move.create(REF_MOVE, reg, bc2ir.popRef())); + bc2ir.push(reg.copyD2U()); + } + break; + case FROMLONG: { + if (VM.BuildFor64Addr) { + OPT_RegisterOperand reg = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Unary.create(LONG_2ADDR, reg, bc2ir.popLong())); + bc2ir.push(reg.copyD2U()); + } else { + OPT_RegisterOperand reg = gc.temps.makeTemp(resultType); + OPT_Operand longVal = bc2ir.popLong(); + bc2ir.appendInstruction(Unary.create(LONG_2INT, reg, longVal)); + bc2ir.appendInstruction(Unary.create(INT_2ADDRZerExt, reg.copyRO(), reg.copy())); + bc2ir.push(reg.copyD2U()); + } + } + break; + case LSH: { + OPT_Operand op2 = bc2ir.popInt(); + OPT_Operand op1 = bc2ir.popAddress(); + OPT_RegisterOperand res = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Binary.create(REF_SHL, res, op1, op2)); + bc2ir.push(res.copyD2U()); + } + break; + case RSHA: { + OPT_Operand op2 = bc2ir.popInt(); + OPT_Operand op1 = bc2ir.popAddress(); + OPT_RegisterOperand res = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Binary.create(REF_SHR, res, op1, op2)); + bc2ir.push(res.copyD2U()); + } + break; + case RSHL: { + OPT_Operand op2 = bc2ir.popInt(); + OPT_Operand op1 = bc2ir.popAddress(); + OPT_RegisterOperand res = gc.temps.makeTemp(resultType); + bc2ir.appendInstruction(Binary.create(REF_USHR, res, op1, op2)); + bc2ir.push(res.copyD2U()); + } + break; + case LOADBYTE_OFS: + case LOADCHAR_OFS: + case LOADSHORT_OFS: + case LOADBYTE: + case LOADCHAR: + case LOADSHORT: { + // LOAD + OPT_Operand offset = (types.length == 0) + ? new OPT_AddressConstantOperand(Address.zero()) + : bc2ir.popAddress(); + OPT_Operand base = bc2ir.popAddress(); + OPT_RegisterOperand result = gc.temps.makeTemp(returnType); + bc2ir.appendInstruction(Load.create(getOperator(returnType, LOAD_OP), + result, base, offset, null)); + bc2ir.push(result.copyD2U(), returnType); + } + break; + case LOADINT_OFS: + case LOADFLOAT_OFS: + case LOADADDRESS_OFS: + case LOADOBJECTREFERENCE_OFS: + case LOADWORD_OFS: + case LOADINT: + case LOADFLOAT: + case LOADADDRESS: + case LOADOBJECTREFERENCE: + case LOADWORD: { + // LOAD: Code same as cases above, as jnode does these differently, see if we need to do differently + OPT_Operand offset = (types.length == 0) + ? new OPT_AddressConstantOperand(Address.zero()) + : bc2ir.popAddress(); + OPT_Operand base = bc2ir.popAddress(); + OPT_RegisterOperand result = gc.temps.makeTemp(returnType); + bc2ir.appendInstruction(Load.create(getOperator(returnType, LOAD_OP), + result, base, offset, null)); + bc2ir.push(result.copyD2U(), returnType); + } + break; + case PREPAREINT_OFS: + case PREPAREADDRESS_OFS: + case PREPAREOBJECTREFERENCE_OFS: + case PREPAREWORD_OFS: + case PREPAREINT: + case PREPAREADDRESS: + case PREPAREOBJECTREFERENCE: + case PREPAREWORD: { + // PREPARE + OPT_Operand offset = (types.length == 0) + ? new OPT_AddressConstantOperand(Address.zero()) + : bc2ir.popAddress(); + OPT_Operand base = bc2ir.popAddress(); + OPT_RegisterOperand result = gc.temps.makeTemp(returnType); + bc2ir.appendInstruction( + Prepare.create(getOperator(returnType, PREPARE_OP), + result, base, offset, null)); + bc2ir.push(result.copyD2U(), returnType); + } + break; + case LOADLONG: + case LOADDOUBLE: + case LOADLONG_OFS: + case LOADDOUBLE_OFS: { + // LOAD: Code same as cases above, as jnode does these differently, see if we need to do differently + OPT_Operand offset = (types.length == 0) + ? new OPT_AddressConstantOperand(Address.zero()) + : bc2ir.popAddress(); + OPT_Operand base = bc2ir.popAddress(); + OPT_RegisterOperand result = gc.temps.makeTemp(returnType); + bc2ir.appendInstruction(Load.create(getOperator(returnType, LOAD_OP), + result, base, offset, null)); + bc2ir.push(result.copyD2U(), returnType); + } + break; + case STOREBYTE_OFS: + case STORECHAR_OFS: + case STORESHORT_OFS: + case STOREBYTE: + case STORECHAR: + case STORESHORT: { + // STORE: Code same as cases above, as jnode does these differently, see if we need to do differently + VM_TypeReference storeType = types[0]; + + OPT_Operand offset = (types.length == 1) + ? new OPT_AddressConstantOperand(Address.zero()) + : bc2ir.popAddress(); + + OPT_Operand val = bc2ir.pop(storeType); + OPT_Operand base = bc2ir.popAddress(); + bc2ir.appendInstruction(Store.create(getOperator(storeType, STORE_OP), + val, base, offset, null)); + } + break; + case STOREINT_OFS: + case STOREFLOAT_OFS: + case STOREADDRESS_OFS: + case STOREOBJECTREFERENCE_OFS: + case STOREWORD_OFS: + case STOREINT: + case STOREFLOAT: + case STOREADDRESS: + case STOREOBJECTREFERENCE: + case STOREWORD: { + // STORE: Code same as cases above, as jnode does these differently, see if we need to do differently + VM_TypeReference storeType = types[0]; + + OPT_Operand offset = (types.length == 1) + ? new OPT_AddressConstantOperand(Address.zero()) + : bc2ir.popAddress(); + + OPT_Operand val = bc2ir.pop(storeType); + OPT_Operand base = bc2ir.popAddress(); + bc2ir.appendInstruction(Store.create(getOperator(storeType, STORE_OP), + val, base, offset, null)); + } + break; + case STORELONG_OFS: + case STOREDOUBLE_OFS: + case STORELONG: + case STOREDOUBLE: { + // STORE: Code same as cases above, as jnode does these differently, see if we need to do differently + VM_TypeReference storeType = types[0]; + + OPT_Operand offset = (types.length == 1) + ? new OPT_AddressConstantOperand(Address.zero()) + : bc2ir.popAddress(); + + OPT_Operand val = bc2ir.pop(storeType); + OPT_Operand base = bc2ir.popAddress(); + bc2ir.appendInstruction(Store.create(getOperator(storeType, STORE_OP), + val, base, offset, null)); + } + break; + case ATTEMPTINT_OFS: + case ATTEMPTADDRESS_OFS: + case ATTEMPTOBJECTREFERENCE_OFS: + case ATTEMPTWORD_OFS: + case ATTEMPTINT: + case ATTEMPTADDRESS: + case ATTEMPTOBJECTREFERENCE: + case ATTEMPTWORD: { + // ATTEMPT + VM_TypeReference attemptType = types[0]; + + OPT_Operand offset = (types.length == 2) + ? new OPT_AddressConstantOperand(Address.zero()) + : bc2ir.popAddress(); + + OPT_Operand newVal = bc2ir.pop(); + OPT_Operand oldVal = bc2ir.pop(); + OPT_Operand base = bc2ir.popAddress(); + OPT_RegisterOperand test = gc.temps.makeTempInt(); + bc2ir.appendInstruction( + Attempt.create(getOperator(attemptType, ATTEMPT_OP), test, + base, offset, oldVal, newVal, null)); + bc2ir.push(test.copyD2U(), returnType); + } + break; + case GETOBJECTTYPE: { + OPT_Operand val = bc2ir.popRef(); + OPT_Operand guard = OPT_BC2IR.getGuard(val); + if (guard == null) { + // it's magic, so assume that it's OK.... + guard = new OPT_TrueGuardOperand(); + } + OPT_RegisterOperand tibPtr = + gc.temps.makeTemp(VM_TypeReference.JavaLangObjectArray); + bc2ir.appendInstruction(GuardedUnary.create(GET_OBJ_TIB, tibPtr, + val, guard)); + OPT_RegisterOperand op0; + VM_TypeReference argType = val.getType(); + if (argType.isArrayType()) { + op0 = gc.temps.makeTemp(VM_TypeReference.VM_Array); + } else { + if (argType == VM_TypeReference.JavaLangObject || + argType == VM_TypeReference.JavaLangCloneable || + argType == VM_TypeReference.JavaIoSerializable) { + // could be an array or a class, so make op0 be a VM_Type + op0 = gc.temps.makeTemp(VM_TypeReference.VM_Type); + } else { + op0 = gc.temps.makeTemp(VM_TypeReference.VM_Class); + } + } + bc2ir.markGuardlessNonNull(op0); + bc2ir.appendInstruction(Unary.create(GET_TYPE_FROM_TIB, op0, + tibPtr.copyD2U())); + bc2ir.push(op0.copyD2U()); + } + break; + case GETTIB: { + OPT_Operand val = bc2ir.popRef(); + OPT_Operand guard = OPT_BC2IR.getGuard(val); + if (guard == null) { + // it's magic, so assume that it's OK.... + guard = new OPT_TrueGuardOperand(); + } + OPT_RegisterOperand tibPtr = + gc.temps.makeTemp(VM_TypeReference.JavaLangObjectArray); + bc2ir.appendInstruction(GuardedUnary.create(GET_OBJ_TIB, tibPtr, + val, guard)); + bc2ir.push(tibPtr.copyD2U(), returnType); + } + break; + case GETOBJECTFLAGS: { + OPT_Operand offset = new OPT_IntConstantOperand(ObjectLayout.FLAGS_SLOT * slotSize); + OPT_Operand base = bc2ir.popRef(); + OPT_RegisterOperand result = gc.temps.makeTemp(returnType); + bc2ir.appendInstruction(Load.create(getOperator(returnType, LOAD_OP), + result, base, offset, null)); + bc2ir.push(result.copyD2U(), returnType); + } + break; + case SETOBJECTFLAGS: { + OPT_Operand offset = new OPT_IntConstantOperand(ObjectLayout.FLAGS_SLOT * slotSize); + VM_TypeReference storeType = types[1]; + OPT_Operand val = bc2ir.pop(storeType); + OPT_Operand base = bc2ir.popRef(); + bc2ir.appendInstruction(Store.create(getOperator(storeType, STORE_OP), + val, base, offset, null)); + } + break; + case GETARRAYDATA: { + OPT_Operand offset = new OPT_IntConstantOperand(VmArray.DATA_OFFSET * slotSize); + OPT_RegisterOperand base = bc2ir.popRef().asRegister(); + OPT_RegisterOperand result = gc.temps.makeTemp(returnType); + bc2ir.appendInstruction(Binary.create(INT_ADD, result, base, offset)); + bc2ir.push(result.copyD2U(), returnType); + } + break; + case GETOBJECTCOLOR: { + OPT_Operand offset = new OPT_IntConstantOperand(ObjectLayout.FLAGS_SLOT * slotSize); + OPT_Operand gcmask = new OPT_IntConstantOperand(ObjectFlags.GC_COLOUR_MASK); + OPT_Operand base = bc2ir.popRef(); + OPT_RegisterOperand result = gc.temps.makeTemp(returnType); + bc2ir.appendInstruction(Load.create(getOperator(returnType, LOAD_OP), + result, base, offset, null)); + bc2ir.appendInstruction(Binary.create(INT_AND, result.copyRO(), result.copy(), gcmask)); + bc2ir.push(result.copy(), returnType); + } + break; + case ISFINALIZED: { + OPT_Operand offset = new OPT_IntConstantOperand(ObjectLayout.FLAGS_SLOT * slotSize); + OPT_Operand fmask = new OPT_IntConstantOperand(ObjectFlags.STATUS_FINALIZED); + OPT_Operand base = bc2ir.popRef(); + OPT_RegisterOperand result = gc.temps.makeTemp(returnType); + bc2ir.appendInstruction(Load.create(INT_LOAD, result, base, offset, null)); + bc2ir.appendInstruction(Binary.create(INT_AND, result.copyRO(), result.copy(), fmask)); + bc2ir.push(result.copy(), returnType); + } + break; + case GETCURRENTFRAME: { + OPT_RegisterOperand result = gc.temps.makeTemp(returnType); + OPT_RegisterOperand ebp = new OPT_RegisterOperand(phys.getEBP(), returnType); + bc2ir.appendInstruction(Move.create(INT_MOVE, result, ebp)); + bc2ir.push(result.copy(), returnType); + } + break; + case GETTIMESTAMP: { + OPT_RegisterOperand result = gc.temps.makeTemp(returnType); + bc2ir.appendInstruction(Call.create0(GET_TIME_BASE, result, null, null, null)); + bc2ir.push(result.copy(), returnType); + } + break; + case INTBITSTOFLOAT: { + OPT_Operand val = bc2ir.popInt(); + OPT_RegisterOperand op0 = gc.temps.makeTempFloat(); + bc2ir.appendInstruction(Unary.create(INT_BITS_AS_FLOAT, op0, val)); + bc2ir.push(op0.copyD2U()); + } + break; + case FLOATTORAWINTBITS: { + OPT_Operand val = bc2ir.popFloat(); + OPT_RegisterOperand op0 = gc.temps.makeTempInt(); + bc2ir.appendInstruction(Unary.create(FLOAT_AS_INT_BITS, op0, val)); + bc2ir.push(op0.copyD2U()); + } + break; + case LONGBITSTODOUBLE: { + OPT_Operand val = bc2ir.popLong(); + OPT_RegisterOperand op0 = gc.temps.makeTempDouble(); + bc2ir.appendInstruction(Unary.create(LONG_BITS_AS_DOUBLE, op0, val)); + bc2ir.pushDual(op0.copyD2U()); + } + break; + case DOUBLETORAWLONGBITS: { + OPT_Operand val = bc2ir.popDouble(); + OPT_RegisterOperand op0 = gc.temps.makeTempLong(); + bc2ir.appendInstruction(Unary.create(DOUBLE_AS_LONG_BITS, op0, val)); + bc2ir.pushDual(op0.copyD2U()); + } + break; +// case BREAKPOINT: { +// //TODO +// if (Vm.VerifyAssertions) +// Vm._assert(isstatic); +// os.writeINT(3); +// } +// break; + case CURRENTPROCESSOR: { + OPT_RegisterOperand result = gc.temps.makeTemp(returnType); + bc2ir.appendInstruction(JnodeMagic.create(JNODE_PROCESSOR, result)); + bc2ir.push(result.copyD2U(), returnType); + } + break; + case GETSHAREDSTATICSFIELDADDRESS: + case GETISOLATEDSTATICSFIELDADDRESS: { + OPT_Operand idx = bc2ir.popInt(); + OPT_RegisterOperand result = gc.temps.makeTemp(returnType); + bc2ir.appendInstruction(BinaryAcc.create(INT_SHL_ACC, idx.asRegister().copyRO(), + new OPT_IntConstantOperand(2))); + bc2ir.appendInstruction(BinaryAcc.create(INT_ADD_ACC, idx.asRegister().copyRO(), + new OPT_IntConstantOperand(VmArray.DATA_OFFSET * slotSize))); + if(mcode == MagicMethod.GETSHAREDSTATICSFIELDADDRESS) + bc2ir.appendInstruction(JnodeMagic.create(JNODE_SHARED_STATICS, result)); + else + bc2ir.appendInstruction(JnodeMagic.create(JNODE_ISOLATED_STATICS, result)); + bc2ir.appendInstruction(Binary.create(INT_ADD, result.copyRO(), result.copy(), idx.copy())); + //bc2ir.appendInstruction(Move.create(INT_MOVE, result.copyRO(), result.copy())); + //, idx.copy(), null, null)); + bc2ir.push(result.copyD2U(), returnType); + } + break; + case ISRUNNINGJNODE: { + OPT_IntConstantOperand val = new OPT_IntConstantOperand(1); + OPT_RegisterOperand result = gc.temps.makeTemp(returnType); + bc2ir.appendInstruction(Move.create(INT_MOVE, result, val)); + bc2ir.push(result.copyD2U(), returnType); + } + break; + // xyzArray classes + case ARR_CREATE: { + OPT_Instruction s = bc2ir.generateAnewarray(meth.getType().getArrayElementType()); + bc2ir.appendInstruction(s); + } + break; + case ARR_GET: { + VM_TypeReference elementType = meth.getType().getArrayElementType(); + OPT_Operand index = bc2ir.popInt(); + OPT_Operand ref = bc2ir.popRef(); + OPT_RegisterOperand offsetI = gc.temps.makeTempInt(); + OPT_RegisterOperand offset = gc.temps.makeTempOffset(); + OPT_RegisterOperand result = null; + if (meth.getType().isCodeArrayType()) { + if (VM.BuildForIA32) { + result = gc.temps.makeTemp(VM_TypeReference.Byte); + bc2ir.appendInstruction(Load.create(BYTE_LOAD, result, ref, index, + new OPT_LocationOperand(elementType), + new OPT_TrueGuardOperand())); + } else if (VM.BuildForPowerPC) { + result = gc.temps.makeTemp(VM_TypeReference.Int); + bc2ir.appendInstruction(Binary.create(INT_SHL, offsetI, index, + new OPT_IntConstantOperand(LOG_BYTES_IN_INT))); + bc2ir.appendInstruction(Unary.create(INT_2ADDRZerExt, offset, offsetI.copy())); + bc2ir.appendInstruction(Load.create(INT_LOAD, result, ref, offset.copy(), + new OPT_LocationOperand(elementType), + new OPT_TrueGuardOperand())); + } + } else { + result = gc.temps.makeTemp(elementType); + bc2ir.appendInstruction(Binary.create(INT_SHL, offsetI, index, + new OPT_IntConstantOperand(LOG_BYTES_IN_ADDRESS))); + bc2ir.appendInstruction(Unary.create(INT_2ADDRZerExt, offset, offsetI.copy())); + bc2ir.appendInstruction(Load.create(REF_LOAD, result, ref, offset.copy(), + new OPT_LocationOperand(elementType), + new OPT_TrueGuardOperand())); + } + bc2ir.push(result.copyD2U()); + } + break; + case ARR_SET: { + VM_TypeReference elementType = meth.getType().getArrayElementType(); + OPT_Operand val = bc2ir.pop(); + OPT_Operand index = bc2ir.popInt(); + OPT_Operand ref = bc2ir.popRef(); + OPT_RegisterOperand offsetI = gc.temps.makeTempInt(); + OPT_RegisterOperand offset = gc.temps.makeTempOffset(); + if (meth.getType().isCodeArrayType()) { + if (VM.BuildForIA32) { + bc2ir.appendInstruction(Store.create(BYTE_STORE, val, ref, index, + new OPT_LocationOperand(elementType), + new OPT_TrueGuardOperand())); + } else if (VM.BuildForPowerPC) { + bc2ir.appendInstruction(Binary.create(INT_SHL, offsetI, index, + new OPT_IntConstantOperand(LOG_BYTES_IN_INT))); + bc2ir.appendInstruction(Unary.create(INT_2ADDRZerExt, offset, offsetI.copy())); + bc2ir.appendInstruction(Store.create(INT_STORE, val, ref, offset.copy(), + new OPT_LocationOperand(elementType), + new OPT_TrueGuardOperand())); + } + } else { + bc2ir.appendInstruction(Binary.create(INT_SHL, offsetI, index, + new OPT_IntConstantOperand(LOG_BYTES_IN_ADDRESS))); + bc2ir.appendInstruction(Unary.create(INT_2ADDRZerExt, offset, offsetI.copy())); + bc2ir.appendInstruction(Store.create(REF_STORE, val, ref, offset.copy(), + new OPT_LocationOperand(elementType), + new OPT_TrueGuardOperand())); + } + } + break; + case ARR_LENGTH: { + OPT_Operand op1 = bc2ir.pop(); + bc2ir.clearCurrentGuard(); + if (bc2ir.do_NullCheck(op1)) + return true; + OPT_RegisterOperand t = gc.temps.makeTempInt(); + OPT_Instruction s = GuardedUnary.create(ARRAYLENGTH, t, op1, bc2ir.getCurrentGuard()); + bc2ir.push(t.copyD2U()); + bc2ir.appendInstruction(s); + } + break; + + default: + //We should never hit this point + VM._assert(false); + } + return true; + } } Modified: branches/jikesRVM/core/src/test/org/jnode/test/core/CompilerTest.java =================================================================== --- branches/jikesRVM/core/src/test/org/jnode/test/core/CompilerTest.java 2006-12-22 09:56:52 UTC (rev 2953) +++ branches/jikesRVM/core/src/test/org/jnode/test/core/CompilerTest.java 2006-12-22 21:17:39 UTC (rev 2954) @@ -104,7 +104,7 @@ // "org.jnode.vm.bytecode.BytecodeParser", // "com.ibm.JikesRVM.VM_Runtime", // "org.jnode.test.JikesTest", - "org.jnode.vm.classmgr.ClassDecoder$PragmaAnnotation" + "org.jnode.vm.classmgr.VmConstFloat" }; public static void main(String[] args) throws Exception { @@ -148,7 +148,7 @@ for (int i = 0; i < cnt; i++) { final VmMethod method = type.getDeclaredMethod(i); counts[ci]++; - if(method.getName().contains("init")) +// if(method.getName().contains("is")) compile(method, arch, cs[ci], cpuId, ci + 1); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hag...@us...> - 2006-12-22 09:56:54
|
Revision: 2953 http://jnode.svn.sourceforge.net/jnode/?rev=2953&view=rev Author: hagar-wize Date: 2006-12-22 01:56:52 -0800 (Fri, 22 Dec 2006) Log Message: ----------- Moved the printing of the dns servers to the command. Also using the out PrintStream to send output instead of System.out. Modified Paths: -------------- trunk/net/src/net/org/jnode/net/command/ResolverCommand.java trunk/net/src/net/org/jnode/net/ipv4/util/ResolverImpl.java Modified: trunk/net/src/net/org/jnode/net/command/ResolverCommand.java =================================================================== --- trunk/net/src/net/org/jnode/net/command/ResolverCommand.java 2006-12-22 07:43:57 UTC (rev 2952) +++ trunk/net/src/net/org/jnode/net/command/ResolverCommand.java 2006-12-22 09:56:52 UTC (rev 2953) @@ -23,6 +23,7 @@ import java.io.InputStream; import java.io.PrintStream; +import java.util.Collection; import org.jnode.net.help.argument.HostArgument; import org.jnode.net.ipv4.IPv4Address; @@ -75,9 +76,16 @@ if (cmdLine.size() == 0) { - System.out.println("DNS servers"); - ResolverImpl.printDnsServers(); + Collection<String> resolvers = ResolverImpl.getDnsServers(); + if( resolvers == null ) + out.println("No DNS servers found."); + else { + out.println("DNS servers"); + for (String dnsServer : resolvers) { + out.println(dnsServer); } + } + } else { String func = ARG_FUNCTION.getValue(cmdLine); @@ -93,7 +101,6 @@ } } - System.out.println(); - + out.println(); } } Modified: trunk/net/src/net/org/jnode/net/ipv4/util/ResolverImpl.java =================================================================== --- trunk/net/src/net/org/jnode/net/ipv4/util/ResolverImpl.java 2006-12-22 07:43:57 UTC (rev 2952) +++ trunk/net/src/net/org/jnode/net/ipv4/util/ResolverImpl.java 2006-12-22 09:56:52 UTC (rev 2953) @@ -28,6 +28,7 @@ import java.security.PrivilegedExceptionAction; import java.util.HashMap; import java.util.Map; +import java.util.Collection; import org.jnode.driver.net.NetworkException; import org.jnode.net.ProtocolAddress; @@ -88,17 +89,10 @@ } /** - * List all the dns servers + * Get list all the dns servers */ - - public static void printDnsServers() { - if (resolvers == null) { - return; - } - - for (String dnsServer : resolvers.keySet()) { - System.out.println(dnsServer); - } + public static Collection getDnsServers() { + return resolvers.keySet(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2006-12-22 07:44:00
|
Revision: 2952 http://jnode.svn.sourceforge.net/jnode/?rev=2952&view=rev Author: lsantha Date: 2006-12-21 23:43:57 -0800 (Thu, 21 Dec 2006) Log Message: ----------- Method execute() reverted to previous state for fixing build failure. Modified Paths: -------------- trunk/net/src/net/org/jnode/net/command/ResolverCommand.java Modified: trunk/net/src/net/org/jnode/net/command/ResolverCommand.java =================================================================== --- trunk/net/src/net/org/jnode/net/command/ResolverCommand.java 2006-12-22 02:01:10 UTC (rev 2951) +++ trunk/net/src/net/org/jnode/net/command/ResolverCommand.java 2006-12-22 07:43:57 UTC (rev 2952) @@ -23,7 +23,6 @@ import java.io.InputStream; import java.io.PrintStream; -import java.util.Collection; import org.jnode.net.help.argument.HostArgument; import org.jnode.net.ipv4.IPv4Address; @@ -76,16 +75,9 @@ if (cmdLine.size() == 0) { - Collection<String> resolvers = ResolverImpl.getDnsServers(); - if( resolvers == null ) - System.out.println("No DNS servers found."); - else { System.out.println("DNS servers"); - for (String dnsServer : resolvers) { - System.out.println(dnsServer); + ResolverImpl.printDnsServers(); } - } - } else { String func = ARG_FUNCTION.getValue(cmdLine); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ans...@us...> - 2006-12-22 02:01:11
|
Revision: 2951 http://jnode.svn.sourceforge.net/jnode/?rev=2951&view=rev Author: ansari82 Date: 2006-12-21 18:01:10 -0800 (Thu, 21 Dec 2006) Log Message: ----------- Debug: going thru classes that jikes can build, uploading current list Modified Paths: -------------- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java 2006-12-22 00:45:50 UTC (rev 2950) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java 2006-12-22 02:01:10 UTC (rev 2951) @@ -124,6 +124,21 @@ || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.M") || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.N") || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.O") + || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.S") + || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.T") + || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmA") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmB") <== bad +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmCl") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmCompiledCode") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmCompiledEx") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmCon") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmCP") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmE") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmF") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmCP") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmSt") + || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmT") +// || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.VmU") ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ans...@us...> - 2006-12-22 00:45:52
|
Revision: 2950 http://jnode.svn.sourceforge.net/jnode/?rev=2950&view=rev Author: ansari82 Date: 2006-12-21 16:45:50 -0800 (Thu, 21 Dec 2006) Log Message: ----------- Fixed invokeinterface, removed classcast checking as opt needs more info than is available right now, added an opt-required feature to Jnode that marks a VmType as inBootImage, and tidied up various Jikes files Modified Paths: -------------- branches/jikesRVM/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/VM.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/VM_Magic.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Array.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Class.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Field.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_MemberReference.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Method.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_NormalMethod.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Primitive.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Type.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_Debug.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_Helpers.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_MemOp_Helpers.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_STATE.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_TreeNode.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_ComplexLIR2MIRExpansion.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_ConvertToLowLevelIR.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_DynamicTypeCheckExpansion.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_Options.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_SimpleEscape.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_Simplifier.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_StackManager.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/VM_OptExceptionDeliverer.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/VM_OptGCMapIterator.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/VM_OptSaveVolatile.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/ir/JnodeMagic.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/ir/OPT_AddressConstantOperand.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/ir/OPT_GenerateJnodeMagic.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/ir/OPT_Operator.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/ir/OPT_OperatorNames.java branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/ir/OPT_Operators.java branches/jikesRVM/core/src/core/org/jnode/vm/classmgr/VmArrayClass.java branches/jikesRVM/core/src/core/org/jnode/vm/classmgr/VmInterfaceClass.java branches/jikesRVM/core/src/core/org/jnode/vm/classmgr/VmNormalClass.java branches/jikesRVM/core/src/core/org/jnode/vm/classmgr/VmType.java branches/jikesRVM/core/src/test/org/jnode/test/core/CompilerTest.java branches/jikesRVM/core/src/vmmagic/org/vmmagic/unboxed/WordArray.java Modified: branches/jikesRVM/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java =================================================================== --- branches/jikesRVM/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -213,6 +213,8 @@ do { again = false; oldCount = clsMgr.getLoadedClassCount(); + for (VmType< ? > vmClass : clsMgr.getLoadedClasses()) + vmClass.setInBootImage(true); for (VmType< ? > vmClass : clsMgr.getLoadedClasses()) { vmClass.link(); final boolean compHigh = isCompileHighOptLevel(vmClass); Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/JikesRVMOptCompiler.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -118,21 +118,14 @@ } public static boolean compilableMethod(VmMethod vmMethod) { - if (vmMethod.getDeclaringClass().getName().contains("org.jnode.vm.classmgr.VmType") - && ( - vmMethod.getName().contains("compare") - || vmMethod.getName().contains("equals") - || vmMethod.getName().contains("BootClass") - || vmMethod.getName().contains("i") - || vmMethod.getName().contains("linkAndInitialize") - || vmMethod.getName().contains("link") - || vmMethod.getName().startsWith("do") - || vmMethod.getName().startsWith("is") - || vmMethod.getName().startsWith("getA") - || vmMethod.getName().startsWith("getObjectClass") - || vmMethod.getName().startsWith("getP") - ) - ) + if (vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.A") + || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.C") + || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.I") + || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.M") + || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.N") + || vmMethod.getDeclaringClass().getName().startsWith("org.jnode.vm.classmgr.O") + + ) { return true; } Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/VM.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/VM.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/VM.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -43,6 +43,8 @@ public static final boolean BuildForITableInterfaceInvocation = false; + public static boolean BuildForIMTInterfaceInvocation = false; + public static final boolean BuildForIndirectIMT = false; public static boolean runningVM = true; @@ -61,8 +63,6 @@ public static boolean MeasureCompilation = false; - public static boolean BuildForIMTInterfaceInvocation = false; - public static boolean fullyBooted; public static boolean ExplicitlyGuardLowMemory; Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/VM_Magic.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/VM_Magic.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/VM_Magic.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -29,9 +29,7 @@ **************************************************************/ public static VM_Field getCurrentVmProcField() { - return VM_Field.buildFromJnodeField( - VM_Class.buildFromJnodeClass(context.getVmProcessorMeField().getDeclaringClass()), - context.getVmProcessorMeField()); + return VM_Field.buildFromJnodeField(context.getVmProcessorMeField()); } public static VM_Method getClassForVmTypeMethod() { @@ -140,7 +138,6 @@ public static void setIntAtOffset(VM_CodeArray code, Offset offset, int patch) { - // TODO try {throw new Exception("VM_Magic.setIntAtOffset() not implemented");} catch (Exception e) {e.printStackTrace();} //Address addr = objectAsAddress(code); @@ -148,12 +145,45 @@ } public static void restoreHardwareExceptionState(VM_Registers registers) { - // TODO try {throw new Exception("VM_Magic.restoreHardwareEx... not implemented");} catch (Exception e) {e.printStackTrace();} } public static void isync() {/*Nothing required on Intel*/} + + + public static VM_Method getClassCastFailedMethod() { + return VM_Method.buildFromJnodeMethod(context + .getClassCastFailedMethod()); + } + + + public static Object getFramePointer() { + try {throw new Exception("VM_Magic.getFramePointer() not implemented");} + catch (Exception e) {e.printStackTrace();} + return null; + } + + + public static int getCompiledMethodID(Address fp) { + try {throw new Exception("VM_Magic.getCompiledMethodID() not implemented");} + catch (Exception e) {e.printStackTrace();} + return 0; + } + + + public static Address getReturnAddress(Object framePointer) { + try {throw new Exception("VM_Magic.getReturnAddress() not implemented");} + catch (Exception e) {e.printStackTrace();} + return null; + } + + + public static Address getCallerFramePointer(Object framePointer) { + try {throw new Exception("VM_Magic.getCallerFramePointer() not implemented");} + catch (Exception e) {e.printStackTrace();} + return null; + } } Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Array.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Array.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Array.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -14,8 +14,6 @@ public static int LENGTH_OFFSET = VmArray.LENGTH_OFFSET; public static int DATA_OFFSET = VmArray.DATA_OFFSET; - - final VmArrayClass<?> jnodeArray; /* * We hold on to a number of commonly used arrays for easy access. */ @@ -55,7 +53,6 @@ */ VM_Array(VM_TypeReference typeRef, VM_Type elementType, VmArrayClass<?> array) { super(typeRef, array); - jnodeArray = array; depth = 1; this.elementType = elementType; if (elementType.isArrayType() && @@ -145,8 +142,8 @@ @Override public void resolve() { - // TODO Auto-generated method stub - + jnodeType.prepare(); + jnodeType.prepareForInstantiation(); } /** @@ -176,6 +173,6 @@ } public VmArrayClass<?> getJnodeArray() { - return jnodeArray; + return (VmArrayClass<?>)jnodeType; } } Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Class.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Class.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Class.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -71,7 +71,7 @@ VmConstFieldRef jnodeField = jnodeType.getCP().getConstFieldRef(i); if (!jnodeField.isResolved()) jnodeField.resolve(this.jnodeType.getLoader()); - VM_Field jikesField = VM_Field.buildFromJnodeField(this, jnodeField.getResolvedVmField()); + VM_Field jikesField = VM_Field.buildFromJnodeField(jnodeField.getResolvedVmField()); return (VM_FieldReference)jikesField.memRef; } @@ -182,11 +182,8 @@ return null; } - public boolean hasClassInitializerMethod() { - if (jnodeType.getInitializerMethod() == null) { - return false; - } - return true; + public VM_Method getClassInitializerMethod() { + return VM_Method.buildFromJnodeMethod(jnodeType.getInitializerMethod()); } public String getSourceName() { @@ -194,10 +191,8 @@ } public void resolve() { - // This should call Jnode stuff because VM_Class is only an adapter to the Jnode class - jnodeType.link(); -// jnodeType.resolveCpRefs(); -// jnodeType.prepareForInstantiation(); + jnodeType.prepare(); + jnodeType.prepareForInstantiation(); } /** @@ -207,7 +202,7 @@ * @return description (null --> not found) */ public final VM_Field findDeclaredField(VM_Atom fieldName, VM_Atom fieldDescriptor) { - return VM_Field.buildFromJnodeField(this, jnodeType.getDeclaredField(fieldName.toString(), + return VM_Field.buildFromJnodeField(jnodeType.getDeclaredField(fieldName.toString(), fieldDescriptor.toString())); } @@ -303,7 +298,7 @@ jnodeFields[i] = jnodeType.getDeclaredField(i); VM_Field[] jikesFields = new VM_Field[jnodeFields.length]; for (int i = 0; i < jnodeFields.length; i++) { - jikesFields[i] = VM_Field.buildFromJnodeField(this, jnodeFields[i]); + jikesFields[i] = VM_Field.buildFromJnodeField(jnodeFields[i]); } return jikesFields; } Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Field.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Field.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Field.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -4,8 +4,6 @@ import org.vmmagic.pragma.UninterruptiblePragma; public final class VM_Field extends VM_Member{ - - final VmField jnodeField; /** * NOTE: Only {@link VM_Class} is allowed to create an instance of a VM_Field. @@ -17,7 +15,6 @@ */ public VM_Field(VM_Class declaringClass, VM_MemberReference memRef, int modifiers, VmField field) { super(declaringClass, memRef, modifiers & APPLICABLE_TO_FIELDS, field); - this.jnodeField = field; memRef.asFieldReference().setResolvedMember(this); } @@ -29,7 +26,7 @@ } public boolean isStatic() { - return jnodeField.isStatic(); + return jnodeMember.isStatic(); } public boolean isVolatile() { @@ -38,24 +35,23 @@ } public boolean isFinal() { - return jnodeField.isFinal(); + return jnodeMember.isFinal(); } - public static VM_Field buildFromJnodeField(VM_Class callingClass, VmField jnodeField) { - //The assumption is that the calling class is a Jikes VM_Class, which - // is actually a "copy" of a JNode VmClass. - if(jnodeField == null) return null; + public static VM_Field buildFromJnodeField(VmField jnodeField) { + if(jnodeField==null) return null; + VM_Class declaringClass = VM_Class.buildFromJnodeClass(jnodeField.getDeclaringClass()); VM_Atom methodName = VM_Atom.findOrCreateAsciiAtom(jnodeField.getName()); VM_Atom methodDescriptor = VM_Atom.findOrCreateAsciiAtom(jnodeField.getSignature()); - VM_MemberReference memRef = VM_MemberReference.findOrCreate(callingClass.getTypeRef(), methodName, methodDescriptor); + VM_MemberReference memRef = VM_MemberReference.findOrCreate(declaringClass.getTypeRef(), methodName, methodDescriptor); if(memRef.asFieldReference().isResolved()) return memRef.asFieldReference().getResolvedMember(); - VM_Field jikesField = new VM_Field(callingClass, memRef, jnodeField.getModifiers(), jnodeField); + VM_Field jikesField = new VM_Field(declaringClass, memRef, jnodeField.getModifiers(), jnodeField); return jikesField; } public VmField getJnodeField() { - return jnodeField; + return (VmField)jnodeMember; } Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_MemberReference.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_MemberReference.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_MemberReference.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -272,7 +272,7 @@ } if (isFieldReference() && thisClass.isResolved() && - thisClass.hasClassInitializerMethod()) { + thisClass.getClassInitializerMethod()==null) { // No dynamic linking code is required to access this field // because its size and offset is known and its class has no static // initializer, therefore its value need not be specially initialized @@ -292,9 +292,9 @@ // This member needs size and offset to be computed, or its class's static // initializer needs to be run when the member is first "touched", so // dynamic linking code is required to access the member. - this.resolveMember(); - return false; - //return true; +// this.resolveMember(); +// return false; + return true; } public final int hashCode() { Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Method.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Method.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Method.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -24,12 +24,9 @@ VM_CompiledMethod currentCompiledMethod; - final VmMethod jnodeMethod; - protected VM_Method(VM_Class declaringClass, VM_MemberReference memRef, int modifiers, VM_TypeReference[] exceptionTypes, VmMethod method) { super(declaringClass, memRef, modifiers & APPLICABLE_TO_METHODS, method); - jnodeMethod = method; memRef.asMethodReference().setResolvedMember(this); this.exceptionTypes = exceptionTypes; } @@ -44,16 +41,16 @@ } public final boolean hasNoInlinePragma() { - return jnodeMethod.hasNoInlinePragma(); + return ((VmMethod)jnodeMember).hasNoInlinePragma(); } public final boolean isSynchronized(){ - return jnodeMethod.isSynchronized(); + return ((VmMethod)jnodeMember).isSynchronized(); } public final boolean isStatic() { - return jnodeMethod.isStatic(); + return jnodeMember.isStatic(); } public void invalidateCompiledMethod(VM_CompiledMethod cm) { @@ -64,15 +61,15 @@ } public boolean isObjectInitializer() { - return jnodeMethod.isConstructor(); + return ((VmMethod)jnodeMember).isConstructor(); } public boolean isNative() { - return jnodeMethod.isNative(); + return ((VmMethod)jnodeMember).isNative(); } public boolean isAbstract() { - return jnodeMethod.isAbstract(); + return ((VmMethod)jnodeMember).isAbstract(); } public boolean mayWrite(VM_Field f) { @@ -80,19 +77,19 @@ } public boolean isInterruptible() { - return !jnodeMethod.isUninterruptible(); + return !((VmMethod)jnodeMember).isUninterruptible(); } public boolean isFinal() { - return jnodeMethod.isFinal(); + return jnodeMember.isFinal(); } public boolean hasInlinePragma() { - return jnodeMethod.hasInlinePragma(); + return ((VmMethod)jnodeMember).hasInlinePragma(); } public boolean isClassInitializer() { - return jnodeMethod.isInitializer(); + return ((VmMethod)jnodeMember).isInitializer(); } public boolean isCompiled() { @@ -152,15 +149,15 @@ } public VmMethod getJnodeMethod() { - return jnodeMethod; + return ((VmMethod)jnodeMember); } public int getSelector() { - return jnodeMethod.getSelector(); + return ((VmMethod)jnodeMember).getSelector(); } public Offset getTibOffset() { - return Offset.fromIntZeroExtend(((VmInstanceMethod)jnodeMethod).getTibOffset()); + return Offset.fromIntZeroExtend(((VmInstanceMethod)jnodeMember).getTibOffset()); } Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_NormalMethod.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_NormalMethod.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_NormalMethod.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -169,7 +169,8 @@ */ @Uninterruptible public final int getLocalWords() { - return jnodeMethod.getArgSlotCount() + jnodeMethod.getBytecode().getNoLocals(); + return ((VmMethod)jnodeMember).getArgSlotCount() + + ((VmMethod)jnodeMember).getBytecode().getNoLocals(); } /** @@ -177,7 +178,7 @@ */ public final int getOperandWords() throws UninterruptiblePragma { //return jnodeMethod.getBytecode().getNoLocals(); - return jnodeMethod.getBytecode().getMaxStack(); + return ((VmMethod)jnodeMember).getBytecode().getMaxStack(); } /** Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Primitive.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Primitive.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Primitive.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -36,8 +36,6 @@ public final class VM_Primitive extends VM_Type implements VM_Constants, VM_ClassLoaderConstants { - final VmPrimitiveClass<?> jnodePrimitive; - private static final boolean NOT_REACHED = false; /** @@ -101,7 +99,6 @@ */ VM_Primitive(VM_TypeReference tr, VmPrimitiveClass<?> primitive) { super(tr, primitive); - this.jnodePrimitive = primitive; depth = 0; acyclic = true; // All primitives are inherently acyclic byte code = getDescriptor().parseForTypeCode(); @@ -168,7 +165,10 @@ } @Override - public void resolve() {} + public void resolve() { + jnodeType.prepare(); + jnodeType.prepareForInstantiation(); + } @Override public void instantiate() {} Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Type.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Type.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/classloader/VM_Type.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -52,9 +52,6 @@ final protected VmType<?> jnodeType; protected Offset thinLockOffset;// = VM_ObjectModel.defaultThinLockOffset(); - - private boolean inBootImage = false; - public static VM_Type JavaLangObjectType; public static VM_Array JavaLangObjectArrayType; public static VM_Type JavaLangThrowableType; @@ -201,7 +198,7 @@ * Is this class part of the virtual machine's boot image? */ public final boolean isInBootImage() throws UninterruptiblePragma { - return inBootImage; + return jnodeType.isInBootImage(); } public final Class getClassForType() { @@ -271,7 +268,7 @@ * Primitives are always treated as "resolved". */ public final boolean isResolved() { - return jnodeType.isCpRefsResolved(); + return jnodeType.isPrepared(); } public final boolean isJavaLangObjectType() { return this==JavaLangObjectType; } public final int getId() { return id; } Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_Debug.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_Debug.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_Debug.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -599,45 +599,46 @@ "r: DOUBLE_CMPL(r,r)", // 595 "r: DOUBLE_CMPG(r,r)", // 596 "stm: GOTO", // 597 - "r: JNODE_ISOLATED_STATICS", // 598 - "r: JNODE_SHARED_STATICS", // 599 - "r: JNODE_PROCESSOR", // 600 - "stm: RETURN(NULL)", // 601 - "stm: RETURN(INT_CONSTANT)", // 602 - "stm: RETURN(r)", // 603 - "stm: RETURN(LONG_CONSTANT)", // 604 - "stm: RETURN(fp0)", // 605 - "stm: RETURN(pfp0)", // 606 - "r: CALL(r,any)", // 607 - "r: CALL(BRANCH_TARGET,any)", // 608 - "r: CALL(INT_LOAD(riv,riv),any)", // 609 - "r: SYSCALL(r,any)", // 610 - "r: SYSCALL(INT_LOAD(riv,riv),any)", // 611 - "r: GET_CAUGHT_EXCEPTION", // 612 - "stm: SET_CAUGHT_EXCEPTION(r)", // 613 - "stm: ROUND_TO_ZERO", // 614 - "stm: CLEAR_FLOATING_POINT_STATE", // 615 - "r: GET_TIME_BASE", // 616 - "stm: YIELDPOINT_OSR(any,any)", // 617 - "load32: INT_OR_ACC(INT_MOVE(INT_OR_ACC(INT_OR_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT)),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))", // 618 - "r: INT_OR_ACC(INT_MOVE(INT_OR_ACC(INT_OR_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT)),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))", // 619 - "load32: INT_OR_ACC(INT_MOVE(INT_OR_ACC(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))),INT_SHL_ACC(INT_MOVE(INT_OR_ACC(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))),INT_CONSTANT))", // 620 - "r: INT_OR_ACC(INT_MOVE(INT_OR_ACC(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))),INT_SHL_ACC(INT_MOVE(INT_OR_ACC(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))),INT_CONSTANT))", // 621 - "r: INT_OR_ACC(INT_MOVE(INT_OR_ACC(INT_OR_ACC(INT_MOVE(INT_SHL_ACC(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT),INT_CONSTANT)),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT)),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))),INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT))", // 622 - "r: INT_OR_ACC(INT_MOVE(INT_SHL_ACC(INT_OR_ACC(INT_MOVE(INT_SHL_ACC(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT),INT_CONSTANT)),INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT)),INT_OR_ACC(INT_MOVE(INT_SHL_ACC(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT),INT_CONSTANT)),INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)))", // 623 - "r: INT_OR_ACC(INT_MOVE(INT_OR_ACC(INT_OR_ACC(INT_MOVE(INT_SHL_ACC(INT_AND_ACC(r,INT_CONSTANT),INT_CONSTANT)),INT_SHL_ACC(INT_AND_ACC(r,INT_CONSTANT),INT_CONSTANT)),INT_SHR_ACC(INT_AND_ACC(r,INT_CONSTANT),INT_CONSTANT))),INT_USHR_ACC(r,INT_CONSTANT))", // 624 - "r: BOOLEAN_CMP_INT(INT_AND_ACC(r,INT_SHL_ACC(INT_MOVE(INT_CONSTANT),riv)),INT_CONSTANT)", // 625 - "boolcmp: BOOLEAN_CMP_INT(INT_AND_ACC(r,INT_SHL_ACC(INT_MOVE(INT_CONSTANT),riv)),INT_CONSTANT)", // 626 - "r: BOOLEAN_CMP_INT(INT_AND_ACC(INT_SHL_ACC(INT_MOVE(INT_CONSTANT),riv),r),INT_CONSTANT)", // 627 - "boolcmp: BOOLEAN_CMP_INT(INT_AND_ACC(INT_SHL_ACC(INT_MOVE(INT_CONSTANT),riv),r),INT_CONSTANT)", // 628 - "r: BOOLEAN_CMP_INT(INT_AND_ACC(INT_SHR_ACC(r,riv),INT_CONSTANT),INT_CONSTANT)", // 629 - "boolcmp: BOOLEAN_CMP_INT(INT_AND_ACC(INT_MOVE(INT_SHR_ACC(r,riv)),INT_CONSTANT),INT_CONSTANT)", // 630 - "r: BOOLEAN_CMP_INT(INT_AND_ACC(INT_SHR_ACC(r,riv),INT_CONSTANT),INT_CONSTANT)", // 631 - "boolcmp: BOOLEAN_CMP_INT(INT_AND_ACC(INT_MOVE(INT_SHR_ACC(r,riv)),INT_CONSTANT),INT_CONSTANT)", // 632 - "r: BOOLEAN_CMP_INT(INT_AND_ACC(INT_USHR_ACC(r,riv),INT_CONSTANT),INT_CONSTANT)", // 633 - "boolcmp: BOOLEAN_CMP_INT(INT_AND_ACC(INT_USHR_ACC(r,riv),INT_CONSTANT),INT_CONSTANT)", // 634 - "r: BOOLEAN_CMP_INT(INT_AND_ACC(INT_USHR_ACC(r,riv),INT_CONSTANT),INT_CONSTANT)", // 635 - "boolcmp: BOOLEAN_CMP_INT(INT_AND_ACC(INT_USHR_ACC(r,riv),INT_CONSTANT),INT_CONSTANT)", // 636 + "r: JNODE_IMT_SELECTOR", // 598 + "r: JNODE_ISOLATED_STATICS", // 599 + "r: JNODE_SHARED_STATICS", // 600 + "r: JNODE_PROCESSOR", // 601 + "stm: RETURN(NULL)", // 602 + "stm: RETURN(INT_CONSTANT)", // 603 + "stm: RETURN(r)", // 604 + "stm: RETURN(LONG_CONSTANT)", // 605 + "stm: RETURN(fp0)", // 606 + "stm: RETURN(pfp0)", // 607 + "r: CALL(r,any)", // 608 + "r: CALL(BRANCH_TARGET,any)", // 609 + "r: CALL(INT_LOAD(riv,riv),any)", // 610 + "r: SYSCALL(r,any)", // 611 + "r: SYSCALL(INT_LOAD(riv,riv),any)", // 612 + "r: GET_CAUGHT_EXCEPTION", // 613 + "stm: SET_CAUGHT_EXCEPTION(r)", // 614 + "stm: ROUND_TO_ZERO", // 615 + "stm: CLEAR_FLOATING_POINT_STATE", // 616 + "r: GET_TIME_BASE", // 617 + "stm: YIELDPOINT_OSR(any,any)", // 618 + "load32: INT_OR_ACC(INT_MOVE(INT_OR_ACC(INT_OR_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT)),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))", // 619 + "r: INT_OR_ACC(INT_MOVE(INT_OR_ACC(INT_OR_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT)),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))", // 620 + "load32: INT_OR_ACC(INT_MOVE(INT_OR_ACC(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))),INT_SHL_ACC(INT_MOVE(INT_OR_ACC(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))),INT_CONSTANT))", // 621 + "r: INT_OR_ACC(INT_MOVE(INT_OR_ACC(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))),INT_SHL_ACC(INT_MOVE(INT_OR_ACC(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))),INT_CONSTANT))", // 622 + "r: INT_OR_ACC(INT_MOVE(INT_OR_ACC(INT_OR_ACC(INT_MOVE(INT_SHL_ACC(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT),INT_CONSTANT)),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT)),INT_SHL_ACC(INT_MOVE(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT))),INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT))", // 623 + "r: INT_OR_ACC(INT_MOVE(INT_SHL_ACC(INT_OR_ACC(INT_MOVE(INT_SHL_ACC(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT),INT_CONSTANT)),INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)),INT_CONSTANT)),INT_OR_ACC(INT_MOVE(INT_SHL_ACC(INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT),INT_CONSTANT)),INT_AND_ACC(BYTE_ALOAD(r,INT_CONSTANT),INT_CONSTANT)))", // 624 + "r: INT_OR_ACC(INT_MOVE(INT_OR_ACC(INT_OR_ACC(INT_MOVE(INT_SHL_ACC(INT_AND_ACC(r,INT_CONSTANT),INT_CONSTANT)),INT_SHL_ACC(INT_AND_ACC(r,INT_CONSTANT),INT_CONSTANT)),INT_SHR_ACC(INT_AND_ACC(r,INT_CONSTANT),INT_CONSTANT))),INT_USHR_ACC(r,INT_CONSTANT))", // 625 + "r: BOOLEAN_CMP_INT(INT_AND_ACC(r,INT_SHL_ACC(INT_MOVE(INT_CONSTANT),riv)),INT_CONSTANT)", // 626 + "boolcmp: BOOLEAN_CMP_INT(INT_AND_ACC(r,INT_SHL_ACC(INT_MOVE(INT_CONSTANT),riv)),INT_CONSTANT)", // 627 + "r: BOOLEAN_CMP_INT(INT_AND_ACC(INT_SHL_ACC(INT_MOVE(INT_CONSTANT),riv),r),INT_CONSTANT)", // 628 + "boolcmp: BOOLEAN_CMP_INT(INT_AND_ACC(INT_SHL_ACC(INT_MOVE(INT_CONSTANT),riv),r),INT_CONSTANT)", // 629 + "r: BOOLEAN_CMP_INT(INT_AND_ACC(INT_SHR_ACC(r,riv),INT_CONSTANT),INT_CONSTANT)", // 630 + "boolcmp: BOOLEAN_CMP_INT(INT_AND_ACC(INT_MOVE(INT_SHR_ACC(r,riv)),INT_CONSTANT),INT_CONSTANT)", // 631 + "r: BOOLEAN_CMP_INT(INT_AND_ACC(INT_SHR_ACC(r,riv),INT_CONSTANT),INT_CONSTANT)", // 632 + "boolcmp: BOOLEAN_CMP_INT(INT_AND_ACC(INT_MOVE(INT_SHR_ACC(r,riv)),INT_CONSTANT),INT_CONSTANT)", // 633 + "r: BOOLEAN_CMP_INT(INT_AND_ACC(INT_USHR_ACC(r,riv),INT_CONSTANT),INT_CONSTANT)", // 634 + "boolcmp: BOOLEAN_CMP_INT(INT_AND_ACC(INT_USHR_ACC(r,riv),INT_CONSTANT),INT_CONSTANT)", // 635 + "r: BOOLEAN_CMP_INT(INT_AND_ACC(INT_USHR_ACC(r,riv),INT_CONSTANT),INT_CONSTANT)", // 636 + "boolcmp: BOOLEAN_CMP_INT(INT_AND_ACC(INT_USHR_ACC(r,riv),INT_CONSTANT),INT_CONSTANT)", // 637 }; } Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_Helpers.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_Helpers.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_Helpers.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -222,16 +222,16 @@ if(s.getOperand(1) instanceof OPT_IntConstantOperand) { OPT_RegisterOperand physEDX = new OPT_RegisterOperand(getIR().regpool.getPhysicalRegisterSet().getEDX(), VM_TypeReference.Int); EMIT(MIR_Unary.mutate(s, IA32_MOV, physEDX, s.getOperand(1))); - OPT_Operand prev = s.prevInstructionInCodeOrder().getOperand(0); - OPT_Operand loc; - if(!prev.isRegister()) { - loc = burs.ir.regpool.makeTempInt(); - MIR_Move.create(IA32_MOV, loc, prev); - } - else { - loc = prev; - } - MIR_Call.setParam(s.nextInstructionInCodeOrder(), 0, loc); + // OPT_Operand prev = s.prevInstructionInCodeOrder().getOperand(0); + // OPT_Operand loc; + // if(!prev.isRegister()) { + // loc = burs.ir.regpool.makeTempInt(); + // MIR_Move.create(IA32_MOV, loc, prev); + // } + // else { + // loc = prev; + // } + // MIR_Call.setParam(s.nextInstructionInCodeOrder(), 0, loc); return; } } @@ -1842,15 +1842,14 @@ VM_Class decl = null; //pusha - EMIT(Nullary.create(IA32_PUSH, new OPT_RegisterOperand(getEAX(), VM_TypeReference.Int))); - EMIT(Nullary.create(IA32_PUSH, new OPT_RegisterOperand(getEBX(), VM_TypeReference.Int))); - EMIT(Nullary.create(IA32_PUSH, new OPT_RegisterOperand(getECX(), VM_TypeReference.Int))); - EMIT(Nullary.create(IA32_PUSH, new OPT_RegisterOperand(getEDX(), VM_TypeReference.Int))); - EMIT(Nullary.create(IA32_PUSH, new OPT_RegisterOperand(getEDI(), VM_TypeReference.Int))); - EMIT(Nullary.create(IA32_PUSH, new OPT_RegisterOperand(getESI(), VM_TypeReference.Int))); - EMIT(Nullary.create(IA32_PUSH, new OPT_RegisterOperand(getEBP(), VM_TypeReference.Int))); - EMIT(Nullary.create(IA32_PUSH, new OPT_RegisterOperand(getESP(), VM_TypeReference.Int))); - + EMIT(MIR_UnaryNoRes.create(IA32_PUSH, new OPT_RegisterOperand(getEAX(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_PUSH, new OPT_RegisterOperand(getEBX(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_PUSH, new OPT_RegisterOperand(getECX(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_PUSH, new OPT_RegisterOperand(getEDX(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_PUSH, new OPT_RegisterOperand(getEDI(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_PUSH, new OPT_RegisterOperand(getESI(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_PUSH, new OPT_RegisterOperand(getEBP(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_PUSH, new OPT_RegisterOperand(getESP(), VM_TypeReference.Int))); //Make JTOC register jtoc = regpool.makeTempInt(); EMIT(JnodeMagic.create(JNODE_SHARED_STATICS, jtoc.asRegister())); @@ -1872,20 +1871,20 @@ //Call class resolver jtoc = regpool.makeTempInt(); - EMIT(JnodeMagic.create(JNODE_SHARED_STATICS, (OPT_RegisterOperand)jtoc)); - OPT_Operand target = OPT_MemoryOperand.BD((OPT_RegisterOperand)jtoc, + EMIT(JnodeMagic.create(JNODE_SHARED_STATICS, jtoc.asRegister().copyRO())); + OPT_Operand target = OPT_MemoryOperand.BD(jtoc.asRegister().copyRO(), VM_Magic.getVmTypeInitialize().getOffset(), (byte)BYTES_IN_ADDRESS, null, null); EMIT(MIR_Call.mutate1(s, IA32_CALL, null, null, target, classr.copy())); //popa - EMIT(Nullary.create(IA32_POP, new OPT_RegisterOperand(getEAX(), VM_TypeReference.Int))); - EMIT(Nullary.create(IA32_POP, new OPT_RegisterOperand(getEBX(), VM_TypeReference.Int))); - EMIT(Nullary.create(IA32_POP, new OPT_RegisterOperand(getECX(), VM_TypeReference.Int))); - EMIT(Nullary.create(IA32_POP, new OPT_RegisterOperand(getEDX(), VM_TypeReference.Int))); - EMIT(Nullary.create(IA32_POP, new OPT_RegisterOperand(getEDI(), VM_TypeReference.Int))); - EMIT(Nullary.create(IA32_POP, new OPT_RegisterOperand(getESI(), VM_TypeReference.Int))); - EMIT(Nullary.create(IA32_POP, new OPT_RegisterOperand(getEBP(), VM_TypeReference.Int))); - EMIT(Nullary.create(IA32_POP, new OPT_RegisterOperand(getESP(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_POP, new OPT_RegisterOperand(getESP(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_POP, new OPT_RegisterOperand(getEBP(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_POP, new OPT_RegisterOperand(getESI(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_POP, new OPT_RegisterOperand(getEDI(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_POP, new OPT_RegisterOperand(getEDX(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_POP, new OPT_RegisterOperand(getECX(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_POP, new OPT_RegisterOperand(getEBX(), VM_TypeReference.Int))); + EMIT(MIR_UnaryNoRes.create(IA32_POP, new OPT_RegisterOperand(getEAX(), VM_TypeReference.Int))); } else Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_MemOp_Helpers.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_MemOp_Helpers.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_MemOp_Helpers.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -6,8 +6,6 @@ import com.ibm.JikesRVM.*; import com.ibm.JikesRVM.opt.ir.*; - -import org.jnode.vm.annotation.MagicPermission; import org.vmmagic.unboxed.*; /** * Contains common BURS helper functions for platforms with memory operands. @@ -15,7 +13,6 @@ * @author Dave Grove * @author Stephen Fink */ -@MagicPermission abstract class OPT_BURS_MemOp_Helpers extends OPT_BURS_Common_Helpers { // word size for memory operands static final byte B = 0x01; // byte (8 bits) Modified: branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_STATE.java =================================================================== --- branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_STATE.java 2006-12-21 21:26:04 UTC (rev 2949) +++ branches/jikesRVM/core/src/core/com/ibm/JikesRVM/opt/OPT_BURS_STATE.java 2006-12-22 00:45:50 UTC (rev 2950) @@ -835,33 +835,33 @@ nts_1, // 600 nts_1, // 601 nts_1, // 602 - nts_0, // 603 - nts_1, // 604 - nts_61, // 605 - nts_62, // 606 - nts_33, // 607 - nts_96, // 608 - nts_97, // 609 - nts_33, // 610 - nts_97, // 611 - nts_1, // 612 - nts_0, // 613 - nts_1, // 614 + nts_1, // 603 + nts_0, // 604 + nts_1, // 605 + nts_61, // 606 + nts_62, // 607 + nts_33, // 608 + nts_96, // 609 + nts_97, // 610 + nts_33, // 611 + nts_97, // 612 + nts_1, // 613 + nts_0, // 614 nts_1, // 615 nts_1, // 616 - nts_5, // 617 - nts_98, // 618 + nts_1, // 617 + nts_5, // 618 nts_98, // 619 nts_98, // 620 nts_98, // 621 nts_98, // 622 nts_98, // 623 nts_98, // 624 - nts_7, // 625 + nts_98, // 625 nts_7, // 626 - nts_20, // 627 + nts_7, // 627 nts_20, // 628 - nts_7, // 629 + nts_20, // 629 nts_7, // 630 nts_7, // 631 nts_7, // 632 @@ -869,6 +869,7 @@ nts_7, // 634 nts_7, // 635 nts_7, // 636 + nts_7, // 637 }; /*static final byte arity[] = { @@ -1078,173 +1079,174 @@ -1, // 203=GET_DOES_IMPLEMENT_FROM_TIB -1, // 204=GET_ARRAY_ELEMENT_TIB_FROM_TIB 1, // 205=LOWTABLESWITCH - 0, // 206=JNODE_ISOLATED_STATICS - 0, // 207=JNODE_SHARED_STATICS - 0, // 208=JNODE_PROCESSOR - 0, // 209=ADDRESS_CONSTANT - 0, // 210=INT_CONSTANT - 0, // 211=LONG_CONSTANT - 0, // 212=REGISTER - 2, // 213=OTHER_OPERAND - 0, // 214=NULL - 0, // 215=BRANCH_TARGET - 2, // 216=INT_ADD_ACC - 2, // 217=LONG_ADD_ACC - 2, // 218=INT_SUB_ACC - 2, // 219=LONG_SUB_ACC - 2, // 220=INT_MUL_ACC - 2, // 221=LONG_MUL_ACC - 1, // 222=INT_NEG_ACC - 1, // 223=LONG_NEG_ACC - 2, // 224=INT_SHL_ACC - 2, // 225=LONG_SHL_ACC - 2, // 226=INT_SHR_ACC - 2, // 227=LONG_SHR_ACC - 2, // 228=INT_USHR_ACC - 2, // 229=LONG_USHR_ACC - 2, // 230=INT_AND_ACC - 2, // 231=LONG_AND_ACC - 2, // 232=INT_OR_ACC - 2, // 233=LONG_OR_ACC - 2, // 234=INT_XOR_ACC - 1, // 235=INT_NOT_ACC - 1, // 236=LONG_NOT_ACC - 2, // 237=LONG_XOR_ACC - 1, // 238=BOOLEAN_NOT_ACC - 1, // 239=MATERIALIZE_FP_CONSTANT - 1, // 240=GET_JTOC - 0, // 241=GET_CURRENT_PROCESSOR - 0, // 242=ROUND_TO_ZERO - 0, // 243=CLEAR_FLOATING_POINT_STATE - 2, // 244=FP_ADD - 2, // 245=FP_SUB - 2, // 246=FP_MUL - 2, // 247=FP_DIV - 1, // 248=FP_NEG - 2, // 249=FP_REM - 1, // 250=INT_2FP - 1, // 251=LONG_2FP - 2, // 252=CMP_CMOV - 2, // 253=FCMP_CMOV - 2, // 254=LCMP_CMOV - 2, // 255=CMP_FCMOV - 2, // 256=FCMP_FCMOV - -1, // 257=CALL_SAVE_VOLATILE - -1, // 258=MIR_START - -1, // 259=REQUIRE_ESP - -1, // 260=ADVISE_ESP - -1, // 261=MIR_LOWTABLESWITCH - -1, // 262=IA32_FCLEAR - -1, // 263=DUMMY_DEF - -1, // 264=DUMMY_USE - -1, // 265=IA32_FMOV_ENDING_LIVE_RANGE - -1, // 266=IA32_FMOV - -1, // 267=IA32_TRAPIF - -1, // 268=IA32_OFFSET - -1, // 269=IA32_LOCK_CMPXCHG - -1, // 270=IA32_ADC - -1, // 271=IA32_ADD - -1, // 272=IA32_AND - -1, // 273=IA32_BSWAP - -1, // 274=IA32_BT - -1, // 275=IA32_BTC - -1, // 276=IA32_BTR - -1, // 277=IA32_BTS - -1, // 278=IA32_SYSCALL - -1, // 279=IA32_CALL - -1, // 280=IA32_CDQ - -1, // 281=IA32_CMOV - -1, // 282=IA32_CMP - -1, // 283=IA32_CMPXCHG - -1, // 284=IA32_DEC - -1, // 285=IA32_DIV - -1, // 286=IA32_FADD - -1, // 287=IA32_FADDP - -1, // 288=IA32_FCHS - -1, // 289=IA32_FCMOV - -1, // 290=IA32_FCOMI - -1, // 291=IA32_FCOMIP - -1, // 292=IA32_FDIV - -1, // 293=IA32_FDIVP - -1, // 294=IA32_FDIVR - -1, // 295=IA32_FDIVRP - -1, // 296=IA32_FEXAM - -1, // 297=IA32_FXCH - -1, // 298=IA32_FFREE - -1, // 299=IA32_FIADD - -1, // 300=IA32_FIDIV - -1, // 301=IA32_FIDIVR - -1, // 302=IA32_FILD - -1, // 303=IA32_FIMUL - -1, // 304=IA32_FINIT - -1, // 305=IA32_FIST - -1, // 306=IA32_FISTP - -1, // 307=IA32_FISUB - -1, // 308=IA32_FISUBR - -1, // 309=IA32_FLD - -1, // 310=IA32_FLDCW - -1, // 311=IA32_FLD1 - -1, // 312=IA32_FLDL2T - -1, // 313=IA32_FLDL2E - -1, // 314=IA32_FLDPI - -1, // 315=IA32_FLDLG2 - -1, // 316=IA32_FLDLN2 - -1, // 317=IA32_FLDZ - -1, // 318=IA32_FMUL - -1, // 319=IA32_FMULP - -1, // 320=IA32_FNSTCW - -1, // 321=IA32_FNINIT - -1, // 322=IA32_FNSAVE - -1, // 323=IA32_FPREM - -1, // 324=IA32_FRSTOR - -1, // 325=IA32_FST - -1, // 326=IA32_FSTCW - -1, // 327=IA32_FSTP - -1, // 328=IA32_FSUB - -1, // 329=IA32_FSUBP - -1, // 330=IA32_FSUBR - -1, // 331=IA32_FSUBRP - -1, // 332=IA32_FUCOMI - -1, // 333=IA32_FUCOMIP - -1, // 334=IA32_IDIV - -1, // 335=IA32_IMUL1 - -1, // 336=IA32_IMUL2 - -1, // 337=IA32_INC - -1, // 338=IA32_INT - -1, // 339=IA32_JCC - -1, // 340=IA32_JCC2 - -1, // 341=IA32_JMP - -1, // 342=IA32_LEA - -1, // 343=IA32_LOCK - -1, // 344=IA32_MOV - -1, // 345=IA32_MOVZX__B - -1, // 346=IA32_MOVSX__B - -1, // 347=IA32_MOVZX__W - -1, // 348=IA32_MOVSX__W - -1, // 349=IA32_MUL - -1, // 350=IA32_NEG - -1, // 351=IA32_NOT - -1, // 352=IA32_OR - -1, // 353=IA32_POP - -1, // 354=IA32_PUSH - -1, // 355=IA32_RCL - -1, // 356=IA32_RCR - -1, // 357=IA32_ROL - -1, // 358=IA32_ROR - -1, // 359=IA32_RET - -1, // 360=IA32_SAL - -1, // 361=IA32_SAR - -1, // 362=IA32_SHL - -1, // 363=IA32_SHR - -1, // 364=IA32_SBB - -1, // 365=IA32_SET__B - -1, // 366=IA32_SHLD - -1, // 367=IA32_SHRD - -1, // 368=IA32_SUB - -1, // 369=IA32_TEST - -1, // 370=IA32_XOR - -1, // 371=IA32_RDTSC - -1, // 372=MIR_END + 0, // 206=JNODE_IMT_SELECTOR + 0, // 207=JNODE_ISOLATED_STATICS + 0, // 208=JNODE_SHARED_STATICS + 0, // 209=JNODE_PROCESSOR + 0, // 210=ADDRESS_CONSTANT + 0, // 211=INT_CONSTANT + 0, // 212=LONG_CONSTANT + 0, // 213=REGISTER + 2, // 214=OTHER_OPERAND + 0, // 215=NULL + 0, // 216=BRANCH_TARGET + 2, // 217=INT_ADD_ACC + 2, // 218=LONG_ADD_ACC + 2, // 219=INT_SUB_ACC + 2, // 220=LONG_SUB_ACC + 2, // 221=INT_MUL_ACC + 2, // 222=LONG_MUL_ACC + 1, // 223=INT_NEG_ACC + 1, // 224=LONG_NEG_ACC + 2, // 225=INT_SHL_ACC + 2, // 226=LONG_SHL_ACC + 2, // 227=INT_SHR_ACC + 2, // 228=LONG_SHR_ACC + 2, // 229=INT_USHR_ACC + 2, // 230=LONG_USHR_ACC + 2, // 231=INT_AND_ACC + 2, // 232=LONG_AND_ACC + 2, // 233=INT_OR_ACC + 2, // 234=LONG_OR_ACC + 2, // 235=INT_XOR_ACC + 1, // 236=INT_NOT_ACC + 1, // 237=LONG_NOT_ACC + 2, // 238=LONG_XOR_ACC + 1, // 239=BOOLEAN_NOT_ACC + 1, // 240=MATERIALIZE_FP_CONSTANT + 1, // 241=GET_JTOC + 0, // 242=GET_CURRENT_PROCESSOR + 0, // 243=ROUND_TO_ZERO + 0, // 244=CLEAR_FLOATING_POINT_STATE + 2, // 245=FP_ADD + 2, // 246=FP_SUB + 2, // 247=FP_MUL + 2, // 248=FP_DIV + 1, // 249=FP_NEG + 2, // 250=FP_REM + 1, // 251=INT_2FP + 1, // 252=LONG_2FP + 2, // 253=CMP_CMOV + 2, // 254=FCMP_CMOV + 2, // 255=LCMP_CMOV + 2, // 256=CMP_FCMOV + 2, // 257=FCMP_FCMOV + -1, // 258=CALL_SAVE_VOLATILE + -1, // 259=MIR_START + -1, // 260=REQUIRE_ESP + -1, // 261=ADVISE_ESP + -1, // 262=MIR_LOWTABLESWITCH + -1, // 263=IA32_FCLEAR + -1, // 264=DUMMY_DEF + -1, // 265=DUMMY_USE + -1, // 266=IA32_FMOV_ENDING_LIVE_RANGE + -1, // 267=IA32_FMOV + -1, // 268=IA32_TRAPIF + -1, // 269=IA32_OFFSET + -1, // 270=IA32_LOCK_CMPXCHG + -1, // 271=IA32_ADC + -1, // 272=IA32_ADD + -1, // 273=IA32_AND + -1, // 274=IA32_BSWAP + -1, // 275=IA32_BT + -1, // 276=IA32_BTC + -1, // 277=IA32_BTR + -1, // 278=IA32_BTS + -1, // 279=IA32_SYSCALL + -1, // 280=IA32_CALL + -1, // 281=IA32_CDQ + -1, // 282=IA32_CMOV + -1, // 283=IA32_CMP + -1, // 284=IA32_CMPXCHG + -1, // 285=IA32_DEC + -1, // 286=IA32_DIV + -1, // 287=IA32_FADD + -1, // 288=IA32_FADDP + -1, // 289=IA32_FCHS + -1, // 290=IA32_FCMOV + -1, // 291=IA32_FCOMI + -1, // 292=IA32_FCOMIP + -1, // 293=IA32_FDIV + -1, // 294=IA32_FDIVP + -1, // 295=IA32_FDIVR + -1, // 296=IA32_FDIVRP + -1, // 297=IA32_FEXAM + -1, // 298=IA32_FXCH + -1, // 299=IA32_FFREE + -1, // 300=IA32_FIADD + -1, // 301=IA32_FIDIV + -1, // 302=IA32_FIDIVR + -1, // 303=IA32_FILD + -1, // 304=IA32_FIMUL + -1, // 305=IA32_FINIT + -1, // 306=IA32_FIST + -1, // 307=IA32_FISTP + -1, // 308=IA32_FISUB + -1, // 309=IA32_FISUBR + -1, // 310=IA32_FLD + -1, // 311=IA32_FLDCW + -1, // 312=IA32_FLD1 + -1, // 313=IA32_FLDL2T + -1, // 314=IA32_FLDL2E + -1, // 315=IA32_FLDPI + -1, // 316=IA32_FLDLG2 + -1, // 317=IA32_FLDLN2 + -1, // 318=IA32_FLDZ + -1, // 319=IA32_FMUL + -1, // 320=IA32_FMULP + -1, // 321=IA32_FNSTCW + -1, // 322=IA32_FNINIT + -1, // 323=IA32_FNSAVE + -1, // 324=IA32_FPREM + -1, // 325=IA32_FRSTOR + -1, // 326=IA32_FST + -1, // 327=IA32_FSTCW + -1, // 328=IA32_FSTP + -1, // 329=IA32_FSUB + -1, // 330=IA32_FSUBP + -1, // 331=IA32_FSUBR + -1, // 332=IA32_FSUBRP + -1, // 333=IA32_FUCOMI + -1, // 334=IA32_FUCOMIP + -1, // 335=IA32_IDIV + -1, // 336=IA32_IMUL1 + -1, // 337=IA32_IMUL2 + -1, // 338=IA32_INC + -1, // 339=IA32_INT + -1, // 340=IA32_JCC + -1, // 341=IA32_JCC2 + -1, // 342=IA32_JMP + -1, // 343=IA32_LEA + -1, // 344=IA32_LOCK + -1, // 345=IA32_MOV + -1, // 346=IA32_MOVZX__B + -1, // 347=IA32_MOVSX__B + -1, // 348=IA32_MOVZX__W + -1, // 349=IA32_MOVSX__W + -1, // 350=IA32_MUL + -1, // 351=IA32_NEG + -1, // 352=IA32_NOT + -1, // 353=IA32_OR + -1, // 354=IA32_POP + -1, // 355=IA32_PUSH + -1, // 356=IA32_RCL + -1, // 357=IA32_RCR + -1, // 358=IA32_ROL + -1, // 359=IA32_ROR + -1, // 360=IA32_RET + -1, // 361=IA32_SAL + -1, // 362=IA32_SAR + -1, // 363=IA32_SHL + -1, // 364=IA32_SHR + -1, // 365=IA32_SBB + -1, // 366=IA32_SET__B + -1, // 367=IA32_SHLD + -1, // 368=IA32_SHRD + -1, // 369=IA32_SUB + -1, // 370=IA32_TEST + -1, // 371=IA32_XOR + -1, // 372=IA32_RDTSC + -1, // 373=MIR_END };*/ static final char decode[][] = {null, @@ -1396,16 +1398,16 @@ 590, 591, 597, - 601, 602, 603, 604, 605, 606, - 613, + 607, 614, 615, - 617, + 616, + 618, }, {// r_NT 0, @@ -1647,24 +1649,25 @@ 598, 599, 600, - 607, + 601, 608, 609, 610, 611, 612, - 616, - 619, - 621, + 613, + 617, + 620, 622, 623, 624, 625, - 627, - 629, - 631, - 633, - 635, + 626, + 628, + 630, + 632, + 634, + 636, }, {// czr_NT 0, @@ -1766,8 +1769,8 @@ 28, 29, 441, - 618, - 620, + 619, + 621, }, {// load64_NT 0, @@ -1949,12 +1952,12 @@ 118, 120, 122, - 626, - 628, - 630, - 632, - 634, - 636, + 627, + 629, + 631, + 633, + 635, + 637, }, }; @@ -2064,7 +2067,7 @@ // r: GET_CAUGHT_EXCEPTION if (15 < p.cost_r) { p.cost_r = (char)(15); - p.word0 = (p.word0 & 0xFF007FFF) | 0x7A0000; // p.r = 244 + p.word0 = (p.word0 & 0xFF007FFF) | 0x7A8000; // p.r = 245 closure_r(p, 15); } } @@ -4312,7 +4315,7 @@ c = STATE(lchild.child1).cost_r + STATE(lchild.child2.child2).cost_riv + ((VR(p) == 0) && (VLRLL(p) == 1) && EQ_NE(BooleanCmp.getCond(P(p)))? 39:INFINITE); if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x7D8000; // p.r = 251 + p.word0 = (p.word0 & 0xFF007FFF) | 0x7E0000; // p.r = 252 closure_r(p, c); } } @@ -4339,7 +4342,7 @@ c = STATE(lchild.child1.child2).cost_riv + STATE(lchild.child2).cost_r + ((VR(p) == 0) && (VLLLL(p) == 1) && EQ_NE(BooleanCmp.getCond(P(p)))? 39:INFINITE); if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x7E0000; // p.r = 252 + p.word0 = (p.word0 & 0xFF007FFF) | 0x7E8000; // p.r = 253 closure_r(p, c); } } @@ -4365,7 +4368,7 @@ c = STATE(lchild.child1.child1).cost_r + STATE(lchild.child1.child2).cost_riv + ((VR(p) == 0) && (VLR(p) == 1) && EQ_NE(BooleanCmp.getCond(P(p)))? 39:INFINITE); if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x7E8000; // p.r = 253 + p.word0 = (p.word0 & 0xFF007FFF) | 0x7F0000; // p.r = 254 closure_r(p, c); } } @@ -4391,7 +4394,7 @@ c = STATE(lchild.child1.child1).cost_r + STATE(lchild.child1.child2).cost_riv + ((VR(p) == 1) && (VLR(p) == 1) && EQ_NE(BooleanCmp.getCond(P(p)))? 39:INFINITE); if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x7F0000; // p.r = 254 + p.word0 = (p.word0 & 0xFF007FFF) | 0x7F8000; // p.r = 255 closure_r(p, c); } } @@ -4417,7 +4420,7 @@ c = STATE(lchild.child1.child1).cost_r + STATE(lchild.child1.child2).cost_riv + ((VR(p) == 0) && (VLR(p) == 1) && EQ_NE(BooleanCmp.getCond(P(p)))? 39:INFINITE); if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x7F8000; // p.r = 255 + p.word0 = (p.word0 & 0xFF007FFF) | 0x800000; // p.r = 256 closure_r(p, c); } } @@ -4442,7 +4445,7 @@ c = STATE(lchild.child1.child1).cost_r + STATE(lchild.child1.child2).cost_riv + ((VR(p) == 1) && (VLR(p) == 1) && EQ_NE(BooleanCmp.getCond(P(p)))? 39:INFINITE); if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x800000; // p.r = 256 + p.word0 = (p.word0 & 0xFF007FFF) | 0x808000; // p.r = 257 closure_r(p, c); } } @@ -5473,7 +5476,7 @@ c = STATE(lchild).cost_r + STATE(rchild).cost_any + 13; if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x778000; // p.r = 239 + p.word0 = (p.word0 & 0xFF007FFF) | 0x780000; // p.r = 240 closure_r(p, c); } if ( // r: CALL(BRANCH_TARGET,any) @@ -5482,7 +5485,7 @@ c = STATE(rchild).cost_any + 13; if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x780000; // p.r = 240 + p.word0 = (p.word0 & 0xFF007FFF) | 0x788000; // p.r = 241 closure_r(p, c); } } @@ -5492,7 +5495,7 @@ c = STATE(lchild.child1).cost_riv + STATE(lchild.child2).cost_riv + STATE(rchild).cost_any + 11; if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x788000; // p.r = 241 + p.word0 = (p.word0 & 0xFF007FFF) | 0x790000; // p.r = 242 closure_r(p, c); } } @@ -5511,7 +5514,7 @@ c = STATE(lchild).cost_r + STATE(rchild).cost_any + 13; if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x790000; // p.r = 242 + p.word0 = (p.word0 & 0xFF007FFF) | 0x798000; // p.r = 243 closure_r(p, c); } if ( // r: SYSCALL(INT_LOAD(riv,riv),any) @@ -5520,7 +5523,7 @@ c = STATE(lchild.child1).cost_riv + STATE(lchild.child2).cost_riv + STATE(rchild).cost_any + 11; if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x798000; // p.r = 243 + p.word0 = (p.word0 & 0xFF007FFF) | 0x7A0000; // p.r = 244 closure_r(p, c); } } @@ -5623,7 +5626,7 @@ // r: GET_TIME_BASE if (15 < p.cost_r) { p.cost_r = (char)(15); - p.word0 = (p.word0 & 0xFF007FFF) | 0x7A8000; // p.r = 245 + p.word0 = (p.word0 & 0xFF007FFF) | 0x7B0000; // p.r = 246 closure_r(p, 15); } } @@ -5809,6 +5812,21 @@ } } +private void label_JNODE_IMT_SELECTOR(OPT_BURS_TreeNode p) { + int c; + p.word0 = 0; + p.initCost(); + OPT_BURS_TreeNode lchild, rchild; + lchild = p.child1; + rchild = p.child2; + // r: JNODE_IMT_SELECTOR + if (10 < p.cost_r) { + p.cost_r = (char)(10); + p.word0 = (p.word0 & 0xFF007FFF) | 0x760000; // p.r = 236 + closure_r(p, 10); + } +} + private void label_JNODE_ISOLATED_STATICS(OPT_BURS_TreeNode p) { int c; p.word0 = 0; @@ -5819,7 +5837,7 @@ // r: JNODE_ISOLATED_STATICS if (10 < p.cost_r) { p.cost_r = (char)(10); - p.word0 = (p.word0 & 0xFF007FFF) | 0x760000; // p.r = 236 + p.word0 = (p.word0 & 0xFF007FFF) | 0x768000; // p.r = 237 closure_r(p, 10); } } @@ -5834,7 +5852,7 @@ // r: JNODE_SHARED_STATICS if (10 < p.cost_r) { p.cost_r = (char)(10); - p.word0 = (p.word0 & 0xFF007FFF) | 0x768000; // p.r = 237 + p.word0 = (p.word0 & 0xFF007FFF) | 0x770000; // p.r = 238 closure_r(p, 10); } } @@ -5849,7 +5867,7 @@ // r: JNODE_PROCESSOR if (10 < p.cost_r) { p.cost_r = (char)(10); - p.word0 = (p.word0 & 0xFF007FFF) | 0x770000; // p.r = 238 + p.word0 = (p.word0 & 0xFF007FFF) | 0x778000; // p.r = 239 closure_r(p, 10); } } @@ -6677,7 +6695,7 @@ c = STATE(lchild.child1.child1.child1.child1.child1.child1).cost_r + STATE(lchild.child1.child1.child2.child1.child1.child1.child1).cost_r + STATE(lchild.child1.child2.child1.child1.child1.child1).cost_r + STATE(rchild.child1.child1.child1.child1).cost_r + ((VLLLLLR(p) == 255) && (VLLLRLLR(p) == 255) && (VLLRLLR(p) == 255) && (VLLRLLR(p) == 255) && (VRR(p) == 24) && (VLLRR(p) == 16) && (VLLLRR(p) == 8) && (VLLLLLLR(p)+1 == VLLLRLLLR(p)) && (VLLLRLLLR(p)+1 == VLLRLLLR(p)) && (VLLRLLLR(p)+1 == VRLLLR(p)) && ALoad.getArray(PLLLLLL(p)).similar(ALoad.getArray(PLLLRLLL(p))) && ALoad.getArray(PLLLRLLL(p)).similar(ALoad.getArray(PLLRLLL(p))) && ALoad.getArray(PLLRLLL(p)).similar(ALoad.getArray(PRLLL(p))) ? 15:INFINITE); if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x7B0000; // p.r = 246 + p.word0 = (p.word0 & 0xFF007FFF) | 0x7B8000; // p.r = 247 closure_r(p, c); } } @@ -6750,7 +6768,7 @@ c = STATE(lchild.child1.child1.child1.child1).cost_r + STATE(lchild.child1.child2.child1.child1.child1.child1).cost_r + STATE(rchild.child1.child1.child1.child1.child1).cost_r + STATE(rchild.child1.child1.child2.child1.child1.child1.child1).cost_r + ((VLLLR(p) == 255) && (VLLRLLR(p) == 255) && (VRLLLR(p) == 255) && (VRLLRLLR(p) == 255) && (VLLRR(p) == 8) && (VRLLRR(p) == 8) && (VRR(p) == 16) && (VLLLLR(p)+1 == VLLRLLLR(p)) && (VLLRLLLR(p)+1 == VRLLLLR(p)) && (VRLLLLR(p)+1 == VRLLRLLLR(p)) && ALoad.getArray(PLLLL(p)).similar(ALoad.getArray(PLLRLLL(p))) && ALoad.getArray(PLLRLLL(p)).similar(ALoad.getArray(PRLLLL(p))) && ALoad.getArray(PRLLLL(p)).similar(ALoad.getArray(PRLLRLLL(p))) ? 28:INFINITE); if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x7B8000; // p.r = 247 + p.word0 = (p.word0 & 0xFF007FFF) | 0x7C0000; // p.r = 248 closure_r(p, c); } } @@ -6787,7 +6805,7 @@ c = STATE(lchild.child1.child1.child1.child1.child1.child1.child1).cost_r + STATE(lchild.child1.child1.child2.child1.child1.child1.child1).cost_r + STATE(lchild.child1.child2.child1.child1.child1.child1).cost_r + STATE(rchild.child1.child1).cost_r + ((VLLLLLLR(p) == 255) && (VLLLRLLR(p) == 255) && (VLLRLLR(p) == 255) && (VRR(p) == 255) && (VLLLLLR(p) == 24) && (VLLLRR(p) == 16) && (VLLRR(p) == 8) && (VLLLLLLLR(p)+1 == VLLLRLLLR(p)) && (VLLLRLLLR(p)+1 == VLLRLLLR(p)) && (VLLRLLLR(p)+1 == VRLR(p)) && ALoad.getArray(PLLLLLLL(p)).similar(ALoad.getArray(PLLLRLLL(p))) && ALoad.getArray(PLLLRLLL(p)).similar(ALoad.getArray(PLLRLLL(p))) && ALoad.getArray(PLLRLLL(p)).similar(ALoad.getArray(PRL(p))) ? 28:INFINITE); if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x7C0000; // p.r = 248 + p.word0 = (p.word0 & 0xFF007FFF) | 0x7C8000; // p.r = 249 closure_r(p, c); } } @@ -6823,7 +6841,7 @@ c = STATE(lchild.child1.child1.child1.child1.child1.child1.child1).cost_r + STATE(lchild.child1.child1.child2.child1.child1).cost_r + STATE(rchild.child1.child1.child1.child1.child1).cost_r + STATE(rchild.child2.child1.child1).cost_r + ((VLLLLLLR(p) == 255) && (VLLLRR(p) == 255) && (VRLLLR(p) == 255) && (VRRR(p) == 255) && (VLLLLLR(p) == 8) && (VLLR(p) == 16) && (VRLLR(p) == 8) && (VLLLLLLLR(p)+1 == VLLLRLR(p)) && (VLLLRLR(p)+1 == VRLLLLR(p)) && (VRLLLLR(p)+1 == VRRLR(p)) && ALoad.getArray(PLLLLLLL(p)).similar(ALoad.getArray(PLLLRL(p))) && ALoad.getArray(PLLLRL(p)).similar(ALoad.getArray(PRLLLL(p))) && ALoad.getArray(PRLLLL(p)).similar(ALoad.getArray(PRRL(p))) ? 28:INFINITE); if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x7C8000; // p.r = 249 + p.word0 = (p.word0 & 0xFF007FFF) | 0x7D0000; // p.r = 250 closure_r(p, c); } } @@ -6850,7 +6868,7 @@ c = STATE(lchild.child1.child1.child1.child1.child1.child1).cost_r + STATE(lchild.child1.child1.child2.child1.child1).cost_r + STATE(lchild.child1.child2.child1.child1).cost_r + STATE(rchild.child1).cost_r + ((VLLLLLLR(p) == 0xFF) && (VLLLRLR(p) == 0xFF00) && (VLLRLR(p) == 0xFF0000) && (VLLLLLR(p) == 24) && (VLLLRR(p) == 8) && (VLLRR(p) == 8) && (VRR(p) == 24) && follow(BinaryAcc.getResult(PLLLLLL(p))).similar(follow(BinaryAcc.getResult(PLLLRL(p)))) && follow(BinaryAcc.getResult(PLLLLLL(p))).similar(follow(BinaryAcc.getResult(PLLRL(p)))) && follow(BinaryAcc.getResult(PLLLLLL(p))).similar(follow(BinaryAcc.getResult(PR(p)))) ? 26:INFINITE); if (c < p.cost_r) { p.cost_r = (char)(c); - p.word0 = (p.word0 & 0xFF007FFF) | 0x7D0000; // p.r = 250 + p.word0 = (p.word0 & 0xFF007FFF) | 0x7D8000; // p.r = 251 closure_r(p, c); } } @@ -8653,6 +8671,7 @@ case DOUBLE_AS_LONG_BITS_opcode: label_DOUBLE_AS_LONG_BITS(p); break; case LONG_BITS_AS_DOUBLE_opcode: label_LONG_BITS_AS_DOUBLE(p); break; case LOWTABLESWITCH_opcode: label_LOWTABLESWITCH(p); break; + case JNODE_IMT_SELECTOR_opcode: label_JNODE_IMT_SELECTOR(p); break; case JNODE_ISOLATED_STATICS_opcode: label_JNODE_ISOLATED_STATICS(p); break; case JNODE_SHARED_STATICS_opcode: label_JNODE_SHARED_STATICS(p); break; case JNODE_PROCESSOR_opcode: label_JNODE_PROCESSOR(p); break; @@ -8727,16 +8746,17 @@ case 1: // stm: r if (kidnumber == 0) return p; break; - case 616: // r: GET_TIME_BASE - case 615: // stm: CLEAR_FLOATING_POINT_STATE - case 614: // stm: ROUND_TO_ZERO - case 612: // r: GET_CAUGHT_EXCEPTION - case 604: // stm: RETURN(LONG_CONSTANT) - case 602: // stm: RETURN(INT_CONSTANT) - case 601: // stm: RETURN(NULL) - case 600: // r: JNODE_PROCESSOR - case 599: // r: JNODE_SHARED_STATICS - case 598: // r: JNODE_ISOLATED_STATICS + case 617: // r: GET_TIME_BASE + case 616: // stm: CLEAR_FLOATING_POINT_STATE + case 615: // stm: ROUND_TO_ZERO + case 613: // r: GET_CAUGHT_EXCEPTION + case 605: // stm: RETURN(LONG_CONSTANT) + case 603: // stm: RETURN(INT_CONSTANT) + case 602: // stm: RETURN(NULL) + case 601: // r: JNODE_PROCESSOR + case 600: // r: JNODE_SHARED_STATICS + case 599: // r: JNODE_ISOLATED_STATICS + case 598: // r: JNODE_IMT_SELECTOR case 597: // stm: GOTO case 461: // r: GET_CURRENT_PROCESSOR case 460: // r: LONG_MOVE(LONG_CONSTANT) @@ -8766,9 +8786,9 @@ case 8: // riv: INT_CONSTANT case 2: // r: REGISTER break; - case 617: // stm: YIELD... [truncated message content] |
From: <ls...@us...> - 2006-12-21 21:26:06
|
Revision: 2949 http://jnode.svn.sourceforge.net/jnode/?rev=2949&view=rev Author: lsantha Date: 2006-12-21 13:26:04 -0800 (Thu, 21 Dec 2006) Log Message: ----------- Added support for: push [fs:disp] . Modified Paths: -------------- trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java Modified: trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java 2006-12-21 21:25:19 UTC (rev 2948) +++ trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java 2006-12-21 21:26:04 UTC (rev 2949) @@ -2091,7 +2091,17 @@ */ public abstract int writePUSH(GPR srcReg, int srcDisp); - /** + /** + * Create a push dword [sr:disp] + * + * @param sr + * @param srcDisp + * @return The ofset of the start of the instruction. + */ + public abstract int writePUSH(SR sr, int srcDisp); + + + /** * Create a push dword <imm32> * * @param imm32 Modified: trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java 2006-12-21 21:25:19 UTC (rev 2948) +++ trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java 2006-12-21 21:26:04 UTC (rev 2949) @@ -4135,7 +4135,26 @@ return rc; } - /** + /** + * Create a push d/qword [srcReg+srcDisp] + * + * @param sr + * @param srcDisp + * @return The ofset of the start of the instruction. + */ + public final int writePUSH(SR sr, int srcDisp) { + testOperandSize(4, mode.getSize()); + // PUSH has not encoding for 32-bit in 64-bit mode, so give + // operand size 0 to avoid a REX prefix. + final int rc = m_used; + writeSegPrefix(sr); + write8(0xFF); + write8(0x35); + write32(srcDisp); + return rc; + } + + /** * Create a push d/qword [baseReg+indexReg*scale+disp] * * @param srcBaseReg Modified: trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java 2006-12-21 21:25:19 UTC (rev 2948) +++ trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java 2006-12-21 21:26:04 UTC (rev 2949) @@ -2050,6 +2050,14 @@ } /** + * @see org.jnode.assembler.x86.X86Assembler#writePUSH(GPR, int) + * @return The ofset of the start of the instruction. + */ + public int writePUSH(SR srcReg, int srcDisp) { + return println("\tpush [" + srcReg + ":" + srcDisp + "]"); + } + + /** * @see org.jnode.assembler.x86.X86Assembler#writePUSH(GPR, GPR, int, int) * @return The ofset of the start of the instruction. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2006-12-21 21:25:20
|
Revision: 2948 http://jnode.svn.sourceforge.net/jnode/?rev=2948&view=rev Author: lsantha Date: 2006-12-21 13:25:19 -0800 (Thu, 21 Dec 2006) Log Message: ----------- Added support for: push [fs:disp] . Modified Paths: -------------- trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/X86Core.java Modified: trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/X86Core.java =================================================================== --- trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/X86Core.java 2006-12-21 09:37:36 UTC (rev 2947) +++ trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/X86Core.java 2006-12-21 21:25:19 UTC (rev 2948) @@ -1141,6 +1141,11 @@ Address ind = getAddress(0); stream.writePUSH(getRegister(ind.getImg()), ind.disp); break; + case G_ADDR: + ind = getAddress(0); + r1 = X86Register.getRegister(ind.getImg()); + stream.writePUSH((SR) r1, ind.disp); + break; default: reportAddressingError(PUSH_ISN, addr); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hag...@us...> - 2006-12-21 09:37:37
|
Revision: 2947 http://jnode.svn.sourceforge.net/jnode/?rev=2947&view=rev Author: hagar-wize Date: 2006-12-21 01:37:36 -0800 (Thu, 21 Dec 2006) Log Message: ----------- removed classpath/5.0 folder from build file as it makes the build fail when the folder is "missing" Modified Paths: -------------- trunk/core/build.xml Modified: trunk/core/build.xml =================================================================== --- trunk/core/build.xml 2006-12-20 12:01:58 UTC (rev 2946) +++ trunk/core/build.xml 2006-12-21 09:37:36 UTC (rev 2947) @@ -23,7 +23,6 @@ <pathelement location="${my-src.dir}/classpath/java"/> <pathelement location="${my-src.dir}/classpath/javax"/> <pathelement location="${my-src.dir}/classpath/org"/> - <pathelement location="${my-src.dir}/classpath/5.0"/> <pathelement location="${my-src.dir}/classpath/ext"/> <pathelement location="${my-src.dir}/classpath/vm"/> <pathelement location="${my-src.dir}/classpath/tools"/> @@ -115,7 +114,6 @@ <fileset dir="${my-src.dir}/classpath/java" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/classpath/javax" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/classpath/org" excludes="${my-non-resources}"/> - <fileset dir="${my-src.dir}/classpath/5.0" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/classpath/ext" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/classpath/vm" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/classpath/tools" excludes="${my-non-resources}"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hag...@us...> - 2006-12-20 12:02:06
|
Revision: 2946 http://jnode.svn.sourceforge.net/jnode/?rev=2946&view=rev Author: hagar-wize Date: 2006-12-20 04:01:58 -0800 (Wed, 20 Dec 2006) Log Message: ----------- Classpath patches - with a stub class that needs to be worked on - recommit, but note these are not currently used Added Paths: ----------- trunk/core/src/classpath/vm/gnu/java/nio/VMChannel.java trunk/core/src/core/org/jnode/vm/VmChannel.java Added: trunk/core/src/classpath/vm/gnu/java/nio/VMChannel.java =================================================================== --- trunk/core/src/classpath/vm/gnu/java/nio/VMChannel.java (rev 0) +++ trunk/core/src/classpath/vm/gnu/java/nio/VMChannel.java 2006-12-20 12:01:58 UTC (rev 2946) @@ -0,0 +1,686 @@ +/* VMChannel.java -- Native interface suppling channel operations. + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.nio; + +import gnu.classpath.Configuration; + +import java.io.IOException; +import java.net.Inet4Address; +import java.net.Inet6Address; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.net.SocketException; +import java.nio.ByteBuffer; +import java.nio.MappedByteBuffer; + +import org.jnode.vm.VmChannel; + +/** + * Native interface to support configuring of channel to run in a non-blocking + * manner and support scatter/gather io operations. + * + * @author Michael Barker <mi...@mi...> + * + */ +public final class VMChannel +{ + /** + * Our reference implementation uses an integer to store the native + * file descriptor. Implementations without such support + */ + private final State nfd; + + private Kind kind; + + public VMChannel() + { + // XXX consider adding security check here, so only Classpath + // code may create instances. + this.nfd = new State(); + kind = Kind.OTHER; + } + + /** + * This constructor is used by the POSIX reference implementation; + * other virtual machines need not support it. + * + * <strong>Important:</strong> do not call this in library code that is + * not specific to Classpath's reference implementation. + * + * @param native_fd The native file descriptor integer. + * @throws IOException + */ + VMChannel(final int native_fd) throws IOException + { + this(); + this.nfd.setNativeFD(native_fd); + } + + public State getState() + { + return nfd; + } + + static + { + // load the shared library needed for native methods. + if (Configuration.INIT_LOAD_LIBRARY) + { + System.loadLibrary ("javanio"); + } + try + { + // so fare this will throw an IOException + VmChannel.initIDs(); + } + catch (IOException e) + { + } + } + + public static VMChannel getStdin() throws IOException + { + return new VMChannel(VmChannel.stdin_fd()); + } + + public static VMChannel getStdout() throws IOException + { + return new VMChannel(VmChannel.stdout_fd()); + } + + public static VMChannel getStderr() throws IOException + { + return new VMChannel(VmChannel.stderr_fd()); + } + + + /** + * Set the file descriptor to have the required blocking + * setting. + * + * @param blocking The blocking flag to set. + */ + public void setBlocking(boolean blocking) throws IOException + { + VmChannel.setBlocking(nfd.getNativeFD(), blocking); + } + + + public int available() throws IOException + { + return VmChannel.available(nfd.getNativeFD()); + } + + + /** + * Reads a byte buffer directly using the supplied file descriptor. + * + * @param dst Direct Byte Buffer to read to. + * @return Number of bytes read. + * @throws IOException If an error occurs or dst is not a direct buffers. + */ + public int read(ByteBuffer dst) + throws IOException + { + return VmChannel.read(nfd.getNativeFD(), dst); + } + + /** + * Read a single byte. + * + * @return The byte read, or -1 on end of file. + * @throws IOException + */ + public int read() throws IOException + { + return VmChannel.read(nfd.getNativeFD()); + } + + + /** + * Reads into byte buffers directly using the supplied file descriptor. + * Assumes that the buffer list contains DirectBuffers. Will perform a + * scattering read. + * + * @param dsts An array direct byte buffers. + * @param offset Index of the first buffer to read to. + * @param length The number of buffers to read to. + * @return Number of bytes read. + * @throws IOException If an error occurs or the dsts are not direct buffers. + */ + public long readScattering(ByteBuffer[] dsts, int offset, int length) + throws IOException + { + if (offset + length > dsts.length) + throw new IndexOutOfBoundsException("offset + length > dsts.length"); + + return VmChannel.readScattering(nfd.getNativeFD(), dsts, offset, length); + } + + + /** + * Receive a datagram on this channel, returning the host address + * that sent the datagram. + * + * @param dst Where to store the datagram. + * @return The host address that sent the datagram. + * @throws IOException + */ + public SocketAddress receive(ByteBuffer dst) throws IOException + { + if (kind != Kind.SOCK_DGRAM) + throw new SocketException("not a datagram socket"); + ByteBuffer hostPort = ByteBuffer.allocateDirect(18); + int hostlen = VmChannel.receive(nfd.getNativeFD(), dst, hostPort); + if (hostlen == 0) + return null; + if (hostlen == 4) // IPv4 + { + byte[] addr = new byte[4]; + hostPort.get(addr); + int port = hostPort.getShort() & 0xFFFF; + return new InetSocketAddress(Inet4Address.getByAddress(addr), port); + } + if (hostlen == 16) // IPv6 + { + byte[] addr = new byte[16]; + hostPort.get(addr); + int port = hostPort.getShort() & 0xFFFF; + return new InetSocketAddress(Inet6Address.getByAddress(addr), port); + } + + throw new SocketException("host address received with invalid length: " + + hostlen); + } + + /** + * Writes from a direct byte bufer using the supplied file descriptor. + * Assumes the buffer is a DirectBuffer. + * + * @param src The source buffer. + * @return Number of bytes written. + * @throws IOException + */ + public int write(ByteBuffer src) throws IOException + { + return VmChannel.write(nfd.getNativeFD(), src); + } + + + /** + * Writes from byte buffers directly using the supplied file descriptor. + * Assumes the that buffer list constains DirectBuffers. Will perform + * as gathering write. + * + * @param fd + * @param srcs + * @param offset + * @param length + * @return Number of bytes written. + * @throws IOException + */ + public long writeGathering(ByteBuffer[] srcs, int offset, int length) + throws IOException + { + if (offset + length > srcs.length) + throw new IndexOutOfBoundsException("offset + length > srcs.length"); + + // A gathering write is limited to 16 buffers; when writing, ensure + // that we have at least one buffer with something in it in the 16 + // buffer window starting at offset. + while (!srcs[offset].hasRemaining() && offset < srcs.length) + offset++; + + // There are no buffers with anything to write. + if (offset == srcs.length) + return 0; + + // If we advanced `offset' so far that we don't have `length' + // buffers left, reset length to only the remaining buffers. + if (length > srcs.length - offset) + length = srcs.length - offset; + + return VmChannel.writeGathering(nfd.getNativeFD(), srcs, offset, length); + } + + + /** + * Send a datagram to the given address. + * + * @param src The source buffer. + * @param dst The destination address. + * @return The number of bytes written. + * @throws IOException + */ + public int send(ByteBuffer src, InetSocketAddress dst) + throws IOException + { + InetAddress addr = dst.getAddress(); + if (addr == null) + throw new NullPointerException(); + if (addr instanceof Inet4Address) + return VmChannel.send(nfd.getNativeFD(), src, addr.getAddress(), dst.getPort()); + else if (addr instanceof Inet6Address) + return VmChannel.send6(nfd.getNativeFD(), src, addr.getAddress(), dst.getPort()); + else + throw new SocketException("unrecognized inet address type"); + } + + /** + * Write a single byte. + * + * @param b The byte to write. + * @throws IOException + */ + public void write(int b) throws IOException + { + VmChannel.write(nfd.getNativeFD(), b); + } + + + // Network (socket) specific methods. + + /** + * Create a new socket. This method will initialize the native file + * descriptor state of this instance. + * + * @param stream Whether or not to create a streaming socket, or a datagram + * socket. + * @throws IOException If creating a new socket fails, or if this + * channel already has its native descriptor initialized. + */ + public void initSocket(boolean stream) throws IOException + { + if (nfd.isValid()) + throw new IOException("native FD already initialized"); + if (stream) + kind = Kind.SOCK_STREAM; + else + kind = Kind.SOCK_DGRAM; + nfd.setNativeFD(VmChannel.socket(stream)); + } + + + /** + * Connect the underlying socket file descriptor to the remote host. + * + * @param saddr The address to connect to. + * @param timeout The connect timeout to use for blocking connects. + * @return True if the connection succeeded; false if the file descriptor + * is in non-blocking mode and the connection did not immediately + * succeed. + * @throws IOException If an error occurs while connecting. + */ + public boolean connect(InetSocketAddress saddr, int timeout) + throws SocketException + { + int fd; + + InetAddress addr = saddr.getAddress(); + + // Translates an IOException into a SocketException to conform + // to the throws clause. + try + { + fd = nfd.getNativeFD(); + } + catch (IOException ioe) + { + throw new SocketException(ioe.getMessage()); + } + + if (addr instanceof Inet4Address) + return VmChannel.connect(fd, addr.getAddress(), saddr.getPort(), + timeout); + if (addr instanceof Inet6Address) + return VmChannel.connect6(fd, addr.getAddress(), saddr.getPort(), + timeout); + throw new SocketException("unsupported internet address"); + } + + /** + * Disconnect this channel, if it is a datagram socket. Disconnecting + * a datagram channel will disassociate it from any address, so the + * socket will remain open, but can send and receive datagrams from + * any address. + * + * @throws IOException If disconnecting this channel fails, or if this + * channel is not a datagram channel. + */ + public void disconnect() throws IOException + { + if (kind != Kind.SOCK_DGRAM) + throw new IOException("can only disconnect datagram channels"); + VmChannel.disconnect(nfd.getNativeFD()); + } + + + public InetSocketAddress getLocalAddress() throws IOException + { + if (!nfd.isValid()) + return null; + ByteBuffer name = ByteBuffer.allocateDirect(18); + int namelen = VmChannel.getsockname(nfd.getNativeFD(), name); + if (namelen == 0) // not bound + return null; // XXX return some wildcard? + if (namelen == 4) + { + byte[] addr = new byte[4]; + name.get(addr); + int port = name.getShort() & 0xFFFF; + return new InetSocketAddress(Inet4Address.getByAddress(addr), port); + } + if (namelen == 16) + { + byte[] addr = new byte[16]; + name.get(addr); + int port = name.getShort() & 0xFFFF; + return new InetSocketAddress(Inet6Address.getByAddress(addr), port); + } + throw new SocketException("invalid address length"); + } + + /** + * Returns the socket address of the remote peer this channel is connected + * to, or null if this channel is not yet connected. + * + * @return The peer address. + * @throws IOException + */ + public InetSocketAddress getPeerAddress() throws IOException + { + if (!nfd.isValid()) + return null; + ByteBuffer name = ByteBuffer.allocateDirect(18); + int namelen = VmChannel.getpeername (nfd.getNativeFD(), name); + if (namelen == 0) // not connected yet + return null; + if (namelen == 4) // IPv4 + { + byte[] addr = new byte[4]; + name.get(addr); + int port = name.getShort() & 0xFFFF; + return new InetSocketAddress(Inet4Address.getByAddress(addr), port); + } + else if (namelen == 16) // IPv6 + { + byte[] addr = new byte[16]; + name.get(addr); + int port = name.getShort() & 0xFFFF; + return new InetSocketAddress(Inet6Address.getByAddress(addr), port); + } + throw new SocketException("invalid address length"); + } + + + /** + * Accept an incoming connection, returning a new VMChannel, or null + * if the channel is nonblocking and no connection is pending. + * + * @return The accepted connection, or null. + * @throws IOException If an IO error occurs. + */ + public VMChannel accept() throws IOException + { + int new_fd = VmChannel.accept(nfd.getNativeFD()); + if (new_fd == -1) // non-blocking accept had no pending connection + return null; + return new VMChannel(new_fd); + } + + // File-specific methods. + + /** + * Open a file at PATH, initializing the native state to operate on + * that open file. + * + * @param path The absolute file path. + * @throws IOException If the file cannot be opened, or if this + * channel was previously initialized. + */ + public void openFile(String path, int mode) throws IOException + { + if (nfd.isValid() || nfd.isClosed()) + throw new IOException("can't reinitialize this channel"); + int fd = VmChannel.open(path, mode); + nfd.setNativeFD(fd); + kind = Kind.FILE; + } + + + public long position() throws IOException + { + if (kind != Kind.FILE) + throw new IOException("not a file"); + return VmChannel.position(nfd.getNativeFD()); + } + + + public void seek(long pos) throws IOException + { + if (kind != Kind.FILE) + throw new IOException("not a file"); + VmChannel.seek(nfd.getNativeFD(), pos); + } + + + public void truncate(long length) throws IOException + { + if (kind != Kind.FILE) + throw new IOException("not a file"); + VmChannel.truncate(nfd.getNativeFD(), length); + } + + + public boolean lock(long pos, long len, boolean shared, boolean wait) + throws IOException + { + if (kind != Kind.FILE) + throw new IOException("not a file"); + return VmChannel.lock(nfd.getNativeFD(), pos, len, shared, wait); + } + + + public void unlock(long pos, long len) throws IOException + { + if (kind != Kind.FILE) + throw new IOException("not a file"); + VmChannel.unlock(nfd.getNativeFD(), pos, len); + } + + + public long size() throws IOException + { + if (kind != Kind.FILE) + throw new IOException("not a file"); + return VmChannel.size(nfd.getNativeFD()); + } + + public MappedByteBuffer map(char mode, long position, int size) + throws IOException + { + if (kind != Kind.FILE) + throw new IOException("not a file"); + return VmChannel.map(nfd.getNativeFD(), mode, position, size); + } + + + public boolean flush(boolean metadata) throws IOException + { + if (kind != Kind.FILE) + throw new IOException("not a file"); + return VmChannel.flush(nfd.getNativeFD(), metadata); + } + + // Close. + + /** + * Close this socket. The socket is also automatically closed when this + * object is finalized. + * + * @throws IOException If closing the socket fails, or if this object has + * no open socket. + */ + public void close() throws IOException + { + nfd.close(); + } + + + /** + * <p>Provides a simple mean for the JNI code to find out whether the + * current thread was interrupted by a call to Thread.interrupt().</p> + * + * @return + */ + static boolean isThreadInterrupted() + { + return Thread.currentThread().isInterrupted(); + } + + // Inner classes. + + /** + * A wrapper for a native file descriptor integer. This tracks the state + * of an open file descriptor, and ensures that + * + * This class need not be fully supported by virtual machines; if a + * virtual machine does not use integer file descriptors, or does and + * wishes to hide that, then the methods of this class may be stubbed out. + * + * System-specific classes that depend on access to native file descriptor + * integers SHOULD declare this fact. + */ + public final class State + { + private int native_fd; + private boolean valid; + private boolean closed; + + State() + { + native_fd = -1; + valid = false; + closed = false; + } + + public boolean isValid() + { + return valid; + } + + public boolean isClosed() + { + return closed; + } + + public int getNativeFD() throws IOException + { + if (!valid) + throw new IOException("invalid file descriptor"); + return native_fd; + } + + void setNativeFD(final int native_fd) throws IOException + { + if (valid) + throw new IOException("file descriptor already initialized"); + this.native_fd = native_fd; + valid = true; + } + + public void close() throws IOException + { + if (!valid) + throw new IOException("invalid file descriptor"); + try + { + VmChannel.close(native_fd); + } + finally + { + valid = false; + closed = true; + } + } + + public String toString() + { + if (closed) + return "<<closed>>"; + if (!valid) + return "<<invalid>>"; + return String.valueOf(native_fd); + } + + protected void finalize() throws Throwable + { + try + { + if (valid) + close(); + } + finally + { + super.finalize(); + } + } + } + + /** + * An enumeration of possible kinds of channel. + */ + static class Kind // XXX enum + { + /** A streaming (TCP) socket. */ + static final Kind SOCK_STREAM = new Kind(); + + /** A datagram (UDP) socket. */ + static final Kind SOCK_DGRAM = new Kind(); + + /** A file. */ + static final Kind FILE = new Kind(); + + /** Something else; not a socket or file. */ + static final Kind OTHER = new Kind(); + + private Kind() { } + } +} Added: trunk/core/src/core/org/jnode/vm/VmChannel.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmChannel.java (rev 0) +++ trunk/core/src/core/org/jnode/vm/VmChannel.java 2006-12-20 12:01:58 UTC (rev 2946) @@ -0,0 +1,224 @@ +/* + * $Id: VmChannel.java $ + * + * JNode.org + * Copyright (C) 2003-2006 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; + +import java.io.IOException; +import java.net.SocketException; +import java.nio.ByteBuffer; +import java.nio.MappedByteBuffer; + +/** + * Native interface to support configuring of channel to run in a non-blocking + * manner and support scatter/gather io operations. + * + * + * This has to give the functionality of the classpath/native/jni/java-nio/gnu_java_nio_VMChannel.c + * + * @author + */ +public final class VmChannel +{ + + public static int stdin_fd() throws IOException + { + // shouldn't throw IOException + throw new IOException("Not implemented"); + } + + public static int stdout_fd() throws IOException + { + // shouldn't throw IOException + throw new IOException("Not implemented"); + } + + public static int stderr_fd() throws IOException + { + // shouldn't throw IOException + throw new IOException("Not implemented"); + } + + public static void setBlocking(int fd, boolean blocking) throws IOException + { + throw new IOException("Not implemented"); + } + + public static int available(int native_fd) throws IOException + { + throw new IOException("Not implemented"); + } + + public static int read(int fd, ByteBuffer dst) throws IOException + { + throw new IOException("Not implemented"); + } + + + public static int read(int fd) throws IOException + { + throw new IOException("Not implemented"); + } + + public static long readScattering(int fd, ByteBuffer[] dsts, int offset, int length) throws IOException + { + throw new IOException("Not implemented"); + } + + + public static int receive(int fd, ByteBuffer dst, ByteBuffer address) throws IOException + { + throw new IOException("Not implemented"); + } + + public static int write(int fd, ByteBuffer src) throws IOException + { + throw new IOException("Not implemented"); + } + + public static long writeGathering(int fd, ByteBuffer[] srcs, int offset, int length) throws IOException + { + throw new IOException("Not implemented"); + } + + // Send to an IPv4 address. + public static int send(int fd, ByteBuffer src, byte[] addr, int port) throws IOException + { + throw new IOException("Not implemented"); + } + + // Send to an IPv6 address. + public static int send6(int fd, ByteBuffer src, byte[] addr, int port) throws IOException + { + throw new IOException("Not implemented"); + } + + public static void write(int fd, int b) throws IOException + { + throw new IOException("Not implemented"); + } + + public static void initIDs() throws IOException + { + // shouldn't throw IOException + throw new IOException("Not implemented"); + } + + // Network (socket) specific methods. + + /** + * Create a new socket, returning the native file descriptor. + * + * @param stream Set to true for streaming sockets{} false for datagrams. + * @return The native file descriptor. + * @throws java.io.IOException If creating the socket fails. + */ + public static int socket(boolean stream) throws IOException + { + throw new IOException("Not implemented"); + } + + + public static boolean connect(int fd, byte[] addr, int port, int timeout) throws SocketException + { + throw new SocketException("Not implemented"); + } + + public static boolean connect6(int fd, byte[] addr, int port, int timeout) throws SocketException + { + throw new SocketException("Not implemented"); + } + + public static void disconnect(int fd) throws IOException + { + throw new IOException("Not implemented"); + } + + public static int getsockname(int fd, ByteBuffer name) throws IOException + { + throw new IOException("Not implemented"); + } + + /* + * The format here is the peer address, followed by the port number. + * The returned value is the length of the peer address{} thus, there + * will be LEN + 2 valid bytes put into NAME. + */ + public static int getpeername(int fd, ByteBuffer name) throws IOException + { + throw new IOException("Not implemented"); + } + + public static int accept(int native_fd) throws IOException + { + throw new IOException("Not implemented"); + } + + + public static int open(String path, int mode) throws IOException + { + throw new IOException("Not implemented"); + } + + public static long position(int fd) throws IOException + { + throw new IOException("Not implemented"); + } + + public static void seek(int fd, long pos) throws IOException + { + throw new IOException("Not implemented"); + } + + public static void truncate(int fd, long len) throws IOException + { + throw new IOException("Not implemented"); + } + + public static boolean lock(int fd, long pos, long len, boolean shared, boolean wait) throws IOException + { + throw new IOException("Not implemented"); + } + + public static void unlock(int fd, long pos, long len) throws IOException + { + throw new IOException("Not implemented"); + } + + public static long size(int fd) throws IOException + { + throw new IOException("Not implemented"); + } + + public static MappedByteBuffer map(int fd, char mode, long position, int size) throws IOException + { + throw new IOException("Not implemented"); + } + + public static boolean flush(int fd, boolean metadata) throws IOException + { + throw new IOException("Not implemented"); + } + + public static void close(int native_fd) throws IOException + { + throw new IOException("Not implemented"); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qa...@us...> - 2006-12-20 08:51:19
|
Revision: 2945 http://jnode.svn.sourceforge.net/jnode/?rev=2945&view=rev Author: qades Date: 2006-12-20 00:51:17 -0800 (Wed, 20 Dec 2006) Log Message: ----------- consolidated arguments added optinal API constraint to DeviceArgument Modified Paths: -------------- trunk/distr/src/apps/org/jnode/apps/edit/EditCommand.java trunk/distr/src/apps/org/jnode/apps/editor/LeedCommand.java trunk/fs/src/driver/org/jnode/driver/block/ramdisk/command/RamDiskCommand.java trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java trunk/fs/src/fs/org/jnode/fs/command/CdCommand.java trunk/fs/src/fs/org/jnode/fs/command/CpCommand.java trunk/fs/src/fs/org/jnode/fs/command/DeleteCommand.java trunk/fs/src/fs/org/jnode/fs/command/DirCommand.java trunk/fs/src/fs/org/jnode/fs/command/EjectCommand.java trunk/fs/src/fs/org/jnode/fs/command/FormatCommand.java trunk/fs/src/fs/org/jnode/fs/command/HexdumpCommand.java trunk/fs/src/fs/org/jnode/fs/command/MkdirCommand.java trunk/fs/src/fs/org/jnode/fs/command/MountCommand.java trunk/fs/src/fs/org/jnode/fs/command/TouchCommand.java trunk/fs/src/fs/org/jnode/fs/ftpfs/command/FTPMountCommand.java trunk/fs/src/fs/org/jnode/fs/jifs/command/createJIFS.java trunk/fs/src/fs/org/jnode/fs/smbfs/command/SMBMountCommand.java trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java trunk/gui/src/awt/org/jnode/awt/JNodeCursors.java trunk/gui/src/driver/org/jnode/driver/video/HardwareCursorImage.java trunk/gui/src/test/org/jnode/test/gui/FBTest.java trunk/net/descriptors/org.jnode.net.command.xml trunk/net/src/net/org/jnode/net/command/BootpCommand.java trunk/net/src/net/org/jnode/net/command/DhcpCommand.java trunk/net/src/net/org/jnode/net/command/IfconfigCommand.java trunk/net/src/net/org/jnode/net/command/NetCommand.java trunk/net/src/net/org/jnode/net/command/PingCommand.java trunk/net/src/net/org/jnode/net/command/ResolverCommand.java trunk/net/src/net/org/jnode/net/command/RouteCommand.java trunk/net/src/net/org/jnode/net/command/TftpCommand.java trunk/net/src/net/org/jnode/net/command/WLanCtlCommand.java trunk/net/src/net/org/jnode/net/ipv4/dhcp/DHCPClient.java trunk/shell/.classpath trunk/shell/descriptors/org.jnode.shell.xml trunk/shell/src/shell/org/jnode/shell/CommandShell.java trunk/shell/src/shell/org/jnode/shell/command/AliasCommand.java trunk/shell/src/shell/org/jnode/shell/command/ClassCommand.java trunk/shell/src/shell/org/jnode/shell/command/ClasspathCommand.java trunk/shell/src/shell/org/jnode/shell/command/CompileCommand.java trunk/shell/src/shell/org/jnode/shell/command/DisassembleCommand.java trunk/shell/src/shell/org/jnode/shell/command/EchoCommand.java trunk/shell/src/shell/org/jnode/shell/command/ExecCommand.java trunk/shell/src/shell/org/jnode/shell/command/GrepCommand.java trunk/shell/src/shell/org/jnode/shell/command/HelpCommand.java trunk/shell/src/shell/org/jnode/shell/command/HistoryCommand.java trunk/shell/src/shell/org/jnode/shell/command/JavaCommand.java trunk/shell/src/shell/org/jnode/shell/command/KillCommand.java trunk/shell/src/shell/org/jnode/shell/command/LoadkeysCommand.java trunk/shell/src/shell/org/jnode/shell/command/LocaleCommand.java trunk/shell/src/shell/org/jnode/shell/command/OnHeapCommand.java trunk/shell/src/shell/org/jnode/shell/command/RunCommand.java trunk/shell/src/shell/org/jnode/shell/command/SetCommand.java trunk/shell/src/shell/org/jnode/shell/command/ThreadCommand.java trunk/shell/src/shell/org/jnode/shell/command/debug/UDPOutputCommand.java trunk/shell/src/shell/org/jnode/shell/command/driver/DeviceCommand.java trunk/shell/src/shell/org/jnode/shell/command/driver/system/acpi/AcpiCommand.java trunk/shell/src/shell/org/jnode/shell/command/log4j/Log4jCommand.java trunk/shell/src/shell/org/jnode/shell/command/plugin/PluginCommand.java trunk/shell/src/shell/org/jnode/shell/command/system/KdbCommand.java trunk/shell/src/shell/org/jnode/shell/command/test/SuiteCommand.java trunk/shell/src/shell/org/jnode/shell/command/test/TestCommand.java trunk/shell/src/shell/org/jnode/shell/help/Argument.java Added Paths: ----------- trunk/net/src/net/org/jnode/net/help/ trunk/net/src/net/org/jnode/net/help/argument/ trunk/net/src/net/org/jnode/net/help/argument/HostArgument.java trunk/net/src/net/org/jnode/net/help/argument/NetworkArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/ trunk/shell/src/shell/org/jnode/shell/help/argument/AliasArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/ClassNameArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/CountryArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/DeviceArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/FileArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/HostNameArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/InetAddressArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/IntegerArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/LanguageArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/LongArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/OptionArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/PluginArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/PropertyNameArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/StringArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/StringListArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/ThreadNameArgument.java trunk/shell/src/shell/org/jnode/shell/help/argument/URLArgument.java Removed Paths: ------------- trunk/net/src/net/org/jnode/net/command/HostArgument.java trunk/net/src/net/org/jnode/net/command/HostNameArgument.java trunk/net/src/net/org/jnode/net/command/NetworkArgument.java trunk/shell/src/shell/org/jnode/shell/help/AliasArgument.java trunk/shell/src/shell/org/jnode/shell/help/ClassNameArgument.java trunk/shell/src/shell/org/jnode/shell/help/CountryArgument.java trunk/shell/src/shell/org/jnode/shell/help/DeviceArgument.java trunk/shell/src/shell/org/jnode/shell/help/FileArgument.java trunk/shell/src/shell/org/jnode/shell/help/InetAddressArgument.java trunk/shell/src/shell/org/jnode/shell/help/IntegerArgument.java trunk/shell/src/shell/org/jnode/shell/help/LanguageArgument.java trunk/shell/src/shell/org/jnode/shell/help/LongArgument.java trunk/shell/src/shell/org/jnode/shell/help/OptionArgument.java trunk/shell/src/shell/org/jnode/shell/help/PluginArgument.java trunk/shell/src/shell/org/jnode/shell/help/PropertyNameArgument.java trunk/shell/src/shell/org/jnode/shell/help/StringArgument.java trunk/shell/src/shell/org/jnode/shell/help/StringListArgument.java trunk/shell/src/shell/org/jnode/shell/help/ThreadNameArgument.java trunk/shell/src/shell/org/jnode/shell/help/URLArgument.java Modified: trunk/distr/src/apps/org/jnode/apps/edit/EditCommand.java =================================================================== --- trunk/distr/src/apps/org/jnode/apps/edit/EditCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/distr/src/apps/org/jnode/apps/edit/EditCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -21,10 +21,10 @@ package org.jnode.apps.edit; -import org.jnode.shell.help.FileArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.argument.FileArgument; import java.io.File; Modified: trunk/distr/src/apps/org/jnode/apps/editor/LeedCommand.java =================================================================== --- trunk/distr/src/apps/org/jnode/apps/editor/LeedCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/distr/src/apps/org/jnode/apps/editor/LeedCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -1,9 +1,9 @@ package org.jnode.apps.editor; -import org.jnode.shell.help.FileArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.argument.FileArgument; import java.io.File; Modified: trunk/fs/src/driver/org/jnode/driver/block/ramdisk/command/RamDiskCommand.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/ramdisk/command/RamDiskCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/driver/org/jnode/driver/block/ramdisk/command/RamDiskCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -25,13 +25,13 @@ import org.jnode.driver.block.ramdisk.RamDiskDevice; import org.jnode.driver.block.ramdisk.RamDiskDriver; import org.jnode.naming.InitialNaming; -import org.jnode.shell.help.DeviceArgument; import org.jnode.shell.help.Help; -import org.jnode.shell.help.IntegerArgument; -import org.jnode.shell.help.OptionArgument; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; import org.jnode.shell.help.Syntax; +import org.jnode.shell.help.argument.DeviceArgument; +import org.jnode.shell.help.argument.IntegerArgument; +import org.jnode.shell.help.argument.OptionArgument; /** * @author Ewout Prangsma (ep...@us...) Modified: trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -33,7 +33,7 @@ import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; -import org.jnode.shell.help.FileArgument; +import org.jnode.shell.help.argument.FileArgument; /** * @author epr Modified: trunk/fs/src/fs/org/jnode/fs/command/CdCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/command/CdCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/fs/command/CdCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -27,10 +27,10 @@ import org.jnode.shell.Command; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.FileArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.argument.FileArgument; /** * @author Ewout Prangsma (ep...@us...) Modified: trunk/fs/src/fs/org/jnode/fs/command/CpCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/command/CpCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/fs/command/CpCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -32,11 +32,11 @@ import java.net.MalformedURLException; import java.net.URL; -import org.jnode.shell.help.FileArgument; import org.jnode.shell.help.Help; -import org.jnode.shell.help.OptionArgument; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.Syntax; +import org.jnode.shell.help.argument.FileArgument; +import org.jnode.shell.help.argument.OptionArgument; /** * Modified: trunk/fs/src/fs/org/jnode/fs/command/DeleteCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/command/DeleteCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/fs/command/DeleteCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -29,10 +29,10 @@ import org.jnode.naming.InitialNaming; import org.jnode.shell.Command; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.FileArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.argument.FileArgument; import javax.naming.NameNotFoundException; Modified: trunk/fs/src/fs/org/jnode/fs/command/DirCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/command/DirCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/fs/command/DirCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -23,10 +23,10 @@ import org.jnode.shell.Command; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.FileArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.argument.FileArgument; import org.jnode.util.NumberUtils; import java.io.File; Modified: trunk/fs/src/fs/org/jnode/fs/command/EjectCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/command/EjectCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/fs/command/EjectCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -28,10 +28,10 @@ import org.jnode.driver.RemovableDeviceAPI; import org.jnode.shell.Command; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.DeviceArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.argument.DeviceArgument; /** Modified: trunk/fs/src/fs/org/jnode/fs/command/FormatCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/command/FormatCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/fs/command/FormatCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -40,12 +40,12 @@ import org.jnode.naming.InitialNaming; import org.jnode.shell.Command; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.DeviceArgument; import org.jnode.shell.help.Help; -import org.jnode.shell.help.OptionArgument; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; import org.jnode.shell.help.Syntax; +import org.jnode.shell.help.argument.DeviceArgument; +import org.jnode.shell.help.argument.OptionArgument; /** * @author gbin Modified: trunk/fs/src/fs/org/jnode/fs/command/HexdumpCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/command/HexdumpCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/fs/command/HexdumpCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -7,10 +7,10 @@ import org.jnode.shell.Command; import org.jnode.shell.CommandLine; import org.jnode.shell.help.Argument; -import org.jnode.shell.help.FileArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.argument.FileArgument; import org.jnode.util.NumberUtils; import java.io.File; Modified: trunk/fs/src/fs/org/jnode/fs/command/MkdirCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/command/MkdirCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/fs/command/MkdirCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -27,10 +27,10 @@ import org.jnode.shell.Command; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.FileArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.argument.FileArgument; /** * @author Guillaume BINET (gb...@us...) Modified: trunk/fs/src/fs/org/jnode/fs/command/MountCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/command/MountCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/fs/command/MountCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -30,11 +30,11 @@ import org.jnode.naming.InitialNaming; import org.jnode.shell.Command; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.DeviceArgument; -import org.jnode.shell.help.FileArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.argument.DeviceArgument; +import org.jnode.shell.help.argument.FileArgument; /** * @author Ewout Prangsma (ep...@us...) Modified: trunk/fs/src/fs/org/jnode/fs/command/TouchCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/command/TouchCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/fs/command/TouchCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -27,10 +27,10 @@ import org.jnode.shell.Command; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.FileArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.argument.FileArgument; /** * Touch a file Modified: trunk/fs/src/fs/org/jnode/fs/ftpfs/command/FTPMountCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ftpfs/command/FTPMountCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/fs/ftpfs/command/FTPMountCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -33,10 +33,10 @@ import org.jnode.shell.CommandLine; import org.jnode.shell.Command; import org.jnode.shell.help.Argument; -import org.jnode.shell.help.FileArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.argument.FileArgument; import java.io.InputStream; import java.io.PrintStream; Modified: trunk/fs/src/fs/org/jnode/fs/jifs/command/createJIFS.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jifs/command/createJIFS.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/fs/jifs/command/createJIFS.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -33,10 +33,10 @@ import org.jnode.shell.Command; import org.jnode.shell.CommandLine; import org.jnode.shell.help.Help; -import org.jnode.shell.help.OptionArgument; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; import org.jnode.shell.help.Syntax; +import org.jnode.shell.help.argument.OptionArgument; /** * Just mounts initial JIFS on /Jifs Modified: trunk/fs/src/fs/org/jnode/fs/smbfs/command/SMBMountCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/smbfs/command/SMBMountCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/fs/smbfs/command/SMBMountCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -21,11 +21,11 @@ package org.jnode.fs.smbfs.command; -import org.jnode.shell.help.FileArgument; import org.jnode.shell.help.Argument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.argument.FileArgument; import org.jnode.shell.CommandLine; import org.jnode.fs.service.FileSystemService; import org.jnode.fs.FileSystemType; Modified: trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -45,14 +45,14 @@ import org.jnode.partitions.ibm.IBMPartitionTableEntry; import org.jnode.partitions.ibm.IBMPartitionTableType; import org.jnode.partitions.ibm.IBMPartitionTypes; -import org.jnode.shell.help.DeviceArgument; import org.jnode.shell.help.Help; -import org.jnode.shell.help.OptionArgument; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; -import org.jnode.shell.help.StringArgument; import org.jnode.shell.help.Syntax; import org.jnode.shell.help.SyntaxErrorException; +import org.jnode.shell.help.argument.DeviceArgument; +import org.jnode.shell.help.argument.OptionArgument; +import org.jnode.shell.help.argument.StringArgument; /** * @author gbin * @author Trickkiste Modified: trunk/gui/src/awt/org/jnode/awt/JNodeCursors.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/JNodeCursors.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/gui/src/awt/org/jnode/awt/JNodeCursors.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -29,140 +29,186 @@ */ public class JNodeCursors { - /** White */ - private static final int W = 0xFFFFFFFF; - /** Black */ - private static final int B = 0xFF000000; - /** Transparent */ - private static final int T = 0x00000000; - private static final int[] ARROW_IMAGE_16x16 = { - B, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, B, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, B, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, - T, B, W, W, B, T, T, T, T, T, T, T, T, T, T, T, - T, B, W, W, B, T, T, T, T, T, T, T, T, T, T, T, - T, T, B, W, B, T, T, T, T, T, T, T, T, T, T, T, - T, T, B, B, T, T, T, T, T, T, T, T, T, T, T, T, + private static final String ARROW_IMAGE_16x16 = + "BBTTTTTTTTTTTTTT" + + "BWBTTTTTTTTTTTTT" + + "BWWBTTTTTTTTTTTT" + + "BWWWBTTTTTTTTTTT" + + "BWWWWBTTTTTTTTTT" + + "BWWWWWBTTTTTTTTT" + + "BWWWWWWBTTTTTTTT" + + "BWWWWWWWBTTTTTTT" + + "BWWWWWWWWBTTTTTT" + + "BWWWWWWWWWBTTTTT" + + "BWWBWWWBBBBBTTTT" + + "BWBTBWWBTTTTTTTT" + + "BBTTTBWWBTTTTTTT" + + "TTTTTTBWWBTTTTTT" + + "TTTTTTTBWWBTTTTT" + + "TTTTTTTTBBBTTTTT"; + + private static final String ARROW_IMAGE_32x32 = + "BTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "BBTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "BWBTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "BWWBTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "BWWWBTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "BWWWWBTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "BWWWWWBTTTTTTTTTTTTTTTTTTTTTTTTT" + + "BWWWWWWBTTTTTTTTTTTTTTTTTTTTTTTT" + + "BWWWWWWWBTTTTTTTTTTTTTTTTTTTTTTT" + + "BWWWWWWWWBTTTTTTTTTTTTTTTTTTTTTT" + + "BWWWWWWWWWBTTTTTTTTTTTTTTTTTTTTT" + + "BWWWWWWWWWWBTTTTTTTTTTTTTTTTTTTT" + + "BWWWWWWWWWWWBTTTTTTTTTTTTTTTTTTT" + + "BWWWWWWWWWWWWBTTTTTTTTTTTTTTTTTT" + + "BWWWWWWWWWWWWWBTTTTTTTTTTTTTTTTT" + + "BWWWWWWWWWWWWWWBTTTTTTTTTTTTTTTT" + + "BWWWWWWWWWWWWWWWBTTTTTTTTTTTTTTT" + + "BWWWWWWWWWWWWWWWWBTTTTTTTTTTTTTT" + + "BWWWWWWWWWWWWWWWWWBTTTTTTTTTTTTT" + + "BWWWWWWWWWWWWWWWWWWBTTTTTTTTTTTT" + + "BWWWWWWWWWWWWWWWWWWWBTTTTTTTTTTT" + + "BWWWWWWWWWWWWWWWWWWWWBTTTTTTTTTT" + + "BWWWWWWWWWWWWWWWWWWWWWBTTTTTTTTT" + + "BWWWWWWBWWWWWWBBBBBBBBBBTTTTTTTT" + + "BWWWWWBTBWWWWWWBTTTTTTTTTTTTTTTT" + + "BWWWWBTTTBWWWWWWBTTTTTTTTTTTTTTT" + + "BWWWBTTTTTBWWWWWWBTTTTTTTTTTTTTT" + + "BWWBTTTTTTTBWWWWWWBTTTTTTTTTTTTT" + + "BWBTTTTTTTTTBWWWWWWBTTTTTTTTTTTT" + + "BBTTTTTTTTTTTBWWWWWWBTTTTTTTTTTT" + + "BTTTTTTTTTTTTTBWWWWWWBTTTTTTTTTT" + + "TTTTTTTTTTTTTTTBBBBBBBBTTTTTTTTT"; +/* + private static final String ARROW_IMAGE_16x16 = { + BBTTTTTTTTTTTTTT, + BWBTTTTTTTTTTTTT, + BWBTTTTTTTTTTTTT, + BWWBTTTTTTTTTTTT, + BWWBTTTTTTTTTTTT, + BWWWBTTTTTTTTTTT, + BWWWBTTTTTTTTTTT, + BWWWWBTTTTTTTTTT, + BWWWWBTTTTTTTTTT, + BWWWBTTTTTTTTTTT, + BWWBTTTTTTTTTTTT, + BWWBTTTTTTTTTTTT, + TBWWBTTTTTTTTTTT, + TBWWBTTTTTTTTTTT, + TTBWBTTTTTTTTTTT, + TTBBTTTTTTTTTTTT, }; private static final int[] ARROW_IMAGE_32x32 = { - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, W, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, W, W, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, W, W, W, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, W, W, W, W, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, W, W, W, W, W, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, W, W, W, W, W, W, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, W, W, W, W, W, W, W, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, W, W, W, W, B, B, B, B, B, B, B, B, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, W, B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, W, B, T, B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, W, B, T, T, B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, W, B, T, T, T, T, B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, B, T, T, T, T, T, B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - B, T, T, T, T, T, T, T, B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, B, W, W, W, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, B, B, B, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, + TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT, + BTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT, + BBTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT, + BWBTTTTTTTTTTTTTTTTTTTTTTTTTTTTT, + BWWBTTTTTTTTTTTTTTTTTTTTTTTTTTTT, + BWWWBTTTTTTTTTTTTTTTTTTTTTTTTTTT, + BWWWWBTTTTTTTTTTTTTTTTTTTTTTTTTT, + BWWWWWBTTTTTTTTTTTTTTTTTTTTTTTTT, + BWWWWWWBTTTTTTTTTTTTTTTTTTTTTTTT, + BWWWWWWWBTTTTTTTTTTTTTTTTTTTTTTT, + BWWWWWWWWBTTTTTTTTTTTTTTTTTTTTTT, + BWWWWWWWWWBTTTTTTTTTTTTTTTTTTTTT, + BWWWWWWWWWWBTTTTTTTTTTTTTTTTTTTT, + BWWWWWWWWWWWBTTTTTTTTTTTTTTTTTTT, + BWWWWWWWWWWWWBTTTTTTTTTTTTTTTTTT, + BWWWWWWWWWWWWWBTTTTTTTTTTTTTTTTT, + BWWWWWWWWWWWWWWBTTTTTTTTTTTTTTTT, + BWWWWWWWWWWWWWWWBTTTTTTTTTTTTTTT, + BWWWWWWWWBBBBBBBBBTTTTTTTTTTTTTT, + BWWWWBWWWBTTTTTTTTTTTTTTTTTTTTTT, + BWWWBTBWWWBTTTTTTTTTTTTTTTTTTTTT, + BWWBTTBWWWBTTTTTTTTTTTTTTTTTTTTT, + BWBTTTTBWWWBTTTTTTTTTTTTTTTTTTTT, + BBTTTTTBWWWBTTTTTTTTTTTTTTTTTTTT, + BTTTTTTTBWWWBTTTTTTTTTTTTTTTTTTT, + TTTTTTTTBWWWBTTTTTTTTTTTTTTTTTTT, + TTTTTTTTTBWWWBTTTTTTTTTTTTTTTTTT, + TTTTTTTTTBWWWBTTTTTTTTTTTTTTTTTT, + TTTTTTTTTTBWWWBTTTTTTTTTTTTTTTTT, + TTTTTTTTTTBWWWBTTTTTTTTTTTTTTTTT, + TTTTTTTTTTTBBBTTTTTTTTTTTTTTTTTT, + TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT, }; +*/ + private static final String RESIZE_VERTICAL_IMAGE_16x16 = + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTBTTTTTTTTBTTT" + + "TTBTTTTTTTTTTBTT" + + "TBTTTTTTTTTTTTBT" + + "BBBBBBBBBBBBBBBB" + + "TBTTTTTTTTTTTTBT" + + "TTBTTTTTTTTTTBTT" + + "TTTBTTTTTTTTBTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + ; -// private static final int[] ARROW_IMAGE_32x32 = { -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, -// }; + + // --- Templates --- + + private static final String EMPTY_IMAGE_16x16 = + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTT"; - // to be used for feature cursors - /* - private static final int[] EMPTY_IMAGE_16x16 = { - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - };*/ - private static final int[] RESIZE_VERTICAL_IMAGE_16x16 = { - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, B, T, T, T, T, T, T, T, T, B, T, T, T, - T, T, B, T, T, T, T, T, T, T, T, T, T, B, T, T, - T, B, T, T, T, T, T, T, T, T, T, T, T, T, B, T, - B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, - T, B, T, T, T, T, T, T, T, T, T, T, T, T, B, T, - T, T, B, T, T, T, T, T, T, T, T, T, T, B, T, T, - T, T, T, B, T, T, T, T, T, T, T, T, B, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, - }; + private static final String EMPTY_IMAGE_32x32 = + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" + + "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT"; private static HardwareCursorImage ARROW_16x16 = new HardwareCursorImage(16, 16, ARROW_IMAGE_16x16, 0, 0); private static HardwareCursorImage ARROW_32x32 = new HardwareCursorImage(32, 32, ARROW_IMAGE_32x32, 0, 0); Modified: trunk/gui/src/driver/org/jnode/driver/video/HardwareCursorImage.java =================================================================== --- trunk/gui/src/driver/org/jnode/driver/video/HardwareCursorImage.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/gui/src/driver/org/jnode/driver/video/HardwareCursorImage.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -25,7 +25,14 @@ * @author Ewout Prangsma (ep...@us...) */ public class HardwareCursorImage { - + + /** White */ + private static final int W = 0xFFFFFFFF; + /** Black */ + private static final int B = 0xFF000000; + /** Transparent */ + private static final int T = 0x00000000; + private final int width; private final int height; private final int[] image; @@ -52,6 +59,46 @@ } /** + * Initialize this instance by parsing the pixels from a given String. + * @param width + * @param height + * @param image + * @param hotSpotX + * @param hotSpotY + */ + public HardwareCursorImage(int width, int height, String image, int hotSpotX, int hotSpotY) { + if (image.length() != width * height) { + throw new IllegalArgumentException("Invalid image length"); + } + this.width = width; + this.height = height; + this.image = parse(image); + this.hotSpotX = hotSpotX; + this.hotSpotY = hotSpotY; + } + + private int[] parse(String image) { + int[] res = new int[image.length()]; + int i = 0; + for( char c : image.toCharArray() ) { + switch( c ) { + case 'T': + res[i++] = T; + break; + case 'B': + res[i++] = B; + break; + case 'W': + res[i++] = W; + break; + default: + throw new IllegalArgumentException("Unknown pixel color indicator '" + c + "'"); + } + } + return res; + } + + /** * Gets the argb image. * @return int[] */ Modified: trunk/gui/src/test/org/jnode/test/gui/FBTest.java =================================================================== --- trunk/gui/src/test/org/jnode/test/gui/FBTest.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/gui/src/test/org/jnode/test/gui/FBTest.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -39,9 +39,9 @@ import org.jnode.driver.video.Surface; import org.jnode.naming.InitialNaming; import org.jnode.shell.help.Argument; -import org.jnode.shell.help.DeviceArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; +import org.jnode.shell.help.argument.DeviceArgument; /** * @author epr Modified: trunk/net/descriptors/org.jnode.net.command.xml =================================================================== --- trunk/net/descriptors/org.jnode.net.command.xml 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/net/descriptors/org.jnode.net.command.xml 2006-12-20 08:51:17 UTC (rev 2945) @@ -30,6 +30,7 @@ <alias name="ping" class="org.jnode.net.command.PingCommand"/> <alias name="route" class="org.jnode.net.command.RouteCommand"/> <alias name="resolver" class="org.jnode.net.command.ResolverCommand"/> + <alias name="resolve" class="org.jnode.net.command.ResolveCommand"/> <alias name="tftp" class="org.jnode.net.command.TftpCommand"/> <alias name="wlanctl" class="org.jnode.net.command.WLanCtlCommand"/> <alias name="net" class="org.jnode.net.command.NetCommand"/> Modified: trunk/net/src/net/org/jnode/net/command/BootpCommand.java =================================================================== --- trunk/net/src/net/org/jnode/net/command/BootpCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/net/src/net/org/jnode/net/command/BootpCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -25,21 +25,22 @@ import java.io.PrintStream; import org.jnode.driver.Device; +import org.jnode.driver.net.NetDeviceAPI; import org.jnode.naming.InitialNaming; import org.jnode.net.ipv4.config.IPv4ConfigurationService; import org.jnode.shell.Command; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.DeviceArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.argument.DeviceArgument; /** * @author epr */ public class BootpCommand implements Command { - static final DeviceArgument ARG_DEVICE = new DeviceArgument("device", "the device to boot from"); + static final DeviceArgument ARG_DEVICE = new DeviceArgument("device", "the device to boot from", NetDeviceAPI.class); public static Help.Info HELP_INFO = new Help.Info( "bootp", Modified: trunk/net/src/net/org/jnode/net/command/DhcpCommand.java =================================================================== --- trunk/net/src/net/org/jnode/net/command/DhcpCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/net/src/net/org/jnode/net/command/DhcpCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -25,21 +25,22 @@ import java.io.PrintStream; import org.jnode.driver.Device; +import org.jnode.driver.net.NetDeviceAPI; import org.jnode.naming.InitialNaming; import org.jnode.net.ipv4.config.IPv4ConfigurationService; import org.jnode.shell.Command; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.DeviceArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.argument.DeviceArgument; /** * @author markhale */ public class DhcpCommand implements Command { - static final DeviceArgument ARG_DEVICE = new DeviceArgument("device", "the device to boot from"); + static final DeviceArgument ARG_DEVICE = new DeviceArgument("device", "the device to boot from", NetDeviceAPI.class); public static Help.Info HELP_INFO = new Help.Info( "dhcp", Deleted: trunk/net/src/net/org/jnode/net/command/HostArgument.java =================================================================== --- trunk/net/src/net/org/jnode/net/command/HostArgument.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/net/src/net/org/jnode/net/command/HostArgument.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -1,49 +0,0 @@ -/* - * $Id$ - * - * JNode.org - * Copyright (C) 2003-2006 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.net.command; - -import org.jnode.net.ipv4.IPv4Address; -import org.jnode.shell.help.Argument; -import org.jnode.shell.help.ParsedArguments; - -/** - * @author qades - */ -public class HostArgument extends Argument { - - public HostArgument(String name, String description, boolean multi) { - super(name, description, multi); - } - - public HostArgument(String name, String description) { - super(name, description); - } - - // here the specific command line completion would be implemented - - public IPv4Address getAddress(ParsedArguments args) { - String value = getValue(args); - if( value == null ) - return null; - return new IPv4Address(value); - } -} Deleted: trunk/net/src/net/org/jnode/net/command/HostNameArgument.java =================================================================== --- trunk/net/src/net/org/jnode/net/command/HostNameArgument.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/net/src/net/org/jnode/net/command/HostNameArgument.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -1,57 +0,0 @@ -/* - * $Id$ - * - * JNode.org - * Copyright (C) 2003-2006 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.net.command; - -import org.jnode.shell.help.Argument; -import org.jnode.shell.help.ParsedArguments; - -import java.net.InetAddress; -import java.net.UnknownHostException; - -/** - * @author Martin Hartvig - */ - -public class HostNameArgument extends Argument -{ - - public HostNameArgument(String _name, String _description, boolean _multi) - { - super(_name, _description, _multi); - } - - public HostNameArgument(String _name, String _description) - { - super(_name, _description); - } - - - public InetAddress getAddress(ParsedArguments _parsedArguments) throws UnknownHostException - { - String value = getValue(_parsedArguments); - - if (value == null) - return null; - - return InetAddress.getByName(value); - } -} Modified: trunk/net/src/net/org/jnode/net/command/IfconfigCommand.java =================================================================== --- trunk/net/src/net/org/jnode/net/command/IfconfigCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/net/src/net/org/jnode/net/command/IfconfigCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -29,22 +29,23 @@ import org.jnode.driver.net.NetDeviceAPI; import org.jnode.naming.InitialNaming; import org.jnode.net.ethernet.EthernetConstants; +import org.jnode.net.help.argument.HostArgument; import org.jnode.net.ipv4.IPv4Address; import org.jnode.net.ipv4.config.IPv4ConfigurationService; import org.jnode.shell.Command; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.DeviceArgument; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; import org.jnode.shell.help.Syntax; +import org.jnode.shell.help.argument.DeviceArgument; /** * @author epr */ public class IfconfigCommand implements Command { - static final DeviceArgument ARG_DEVICE = new DeviceArgument("device", "the device"); + static final DeviceArgument ARG_DEVICE = new DeviceArgument("device", "the device", NetDeviceAPI.class); static final HostArgument ARG_IP_ADDRESS = new HostArgument("ip-address", "the IP address to bind the device to"); static final HostArgument ARG_SUBNET_MASK = new HostArgument("subnet-mask", "if given, specifies the range of reachable subnets"); Modified: trunk/net/src/net/org/jnode/net/command/NetCommand.java =================================================================== --- trunk/net/src/net/org/jnode/net/command/NetCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/net/src/net/org/jnode/net/command/NetCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -13,11 +13,11 @@ import org.jnode.shell.CommandLine; import org.jnode.shell.help.Help; -import org.jnode.shell.help.InetAddressArgument; -import org.jnode.shell.help.IntegerArgument; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; import org.jnode.shell.help.Syntax; +import org.jnode.shell.help.argument.InetAddressArgument; +import org.jnode.shell.help.argument.IntegerArgument; public class NetCommand { Deleted: trunk/net/src/net/org/jnode/net/command/NetworkArgument.java =================================================================== --- trunk/net/src/net/org/jnode/net/command/NetworkArgument.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/net/src/net/org/jnode/net/command/NetworkArgument.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -1,49 +0,0 @@ -/* - * $Id$ - * - * JNode.org - * Copyright (C) 2003-2006 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.net.command; - -import org.jnode.net.ipv4.IPv4Address; -import org.jnode.shell.help.Argument; -import org.jnode.shell.help.ParsedArguments; - -/** - * @author qades - */ -public class NetworkArgument extends Argument { - - public NetworkArgument(String name, String description, boolean multi) { - super(name, description, multi); - } - - public NetworkArgument(String name, String description) { - super(name, description); - } - - // here the specific command line completion would be implemented - - public IPv4Address getAddress(ParsedArguments args) { - String value = getValue(args); - if( "default".equals(value) ) - value = "0.0.0.0"; - return new IPv4Address(value); - } -} Modified: trunk/net/src/net/org/jnode/net/command/PingCommand.java =================================================================== --- trunk/net/src/net/org/jnode/net/command/PingCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/net/src/net/org/jnode/net/command/PingCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -42,6 +42,7 @@ import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; import org.jnode.shell.help.Syntax; +import org.jnode.shell.help.argument.HostNameArgument; /** * @author JPG Modified: trunk/net/src/net/org/jnode/net/command/ResolverCommand.java =================================================================== --- trunk/net/src/net/org/jnode/net/command/ResolverCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/net/src/net/org/jnode/net/command/ResolverCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -23,12 +23,18 @@ import java.io.InputStream; import java.io.PrintStream; +import java.util.Collection; +import org.jnode.net.help.argument.HostArgument; import org.jnode.net.ipv4.IPv4Address; import org.jnode.net.ipv4.util.ResolverImpl; import org.jnode.shell.Command; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.*; +import org.jnode.shell.help.Help; +import org.jnode.shell.help.Parameter; +import org.jnode.shell.help.ParsedArguments; +import org.jnode.shell.help.Syntax; +import org.jnode.shell.help.argument.OptionArgument; public class ResolverCommand implements Command @@ -70,8 +76,15 @@ if (cmdLine.size() == 0) { - System.out.println("DNS servers"); - ResolverImpl.printDnsServers(); + Collection<String> resolvers = ResolverImpl.getDnsServers(); + if( resolvers == null ) + System.out.println("No DNS servers found."); + else { + System.out.println("DNS servers"); + for (String dnsServer : resolvers) { + System.out.println(dnsServer); + } + } } else { Modified: trunk/net/src/net/org/jnode/net/command/RouteCommand.java =================================================================== --- trunk/net/src/net/org/jnode/net/command/RouteCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/net/src/net/org/jnode/net/command/RouteCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -27,18 +27,20 @@ import org.jnode.driver.Device; import org.jnode.naming.InitialNaming; import org.jnode.net.ethernet.EthernetConstants; +import org.jnode.net.help.argument.HostArgument; +import org.jnode.net.help.argument.NetworkArgument; import org.jnode.net.ipv4.IPv4Address; import org.jnode.net.ipv4.config.IPv4ConfigurationService; import org.jnode.net.ipv4.layer.IPv4NetworkLayer; import org.jnode.net.util.NetUtils; import org.jnode.shell.Command; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.DeviceArgument; import org.jnode.shell.help.Help; -import org.jnode.shell.help.OptionArgument; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; import org.jnode.shell.help.Syntax; +import org.jnode.shell.help.argument.DeviceArgument; +import org.jnode.shell.help.argument.OptionArgument; /** * @author epr Modified: trunk/net/src/net/org/jnode/net/command/TftpCommand.java =================================================================== --- trunk/net/src/net/org/jnode/net/command/TftpCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/net/src/net/org/jnode/net/command/TftpCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -24,14 +24,15 @@ import java.io.InputStream; import java.io.PrintStream; +import org.jnode.net.help.argument.HostArgument; import org.jnode.net.ipv4.tftp.TFTPClient; import org.jnode.shell.Command; import org.jnode.shell.CommandLine; import org.jnode.shell.help.Argument; import org.jnode.shell.help.Help; -import org.jnode.shell.help.OptionArgument; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.Syntax; +import org.jnode.shell.help.argument.OptionArgument; /** * @author markhale Modified: trunk/net/src/net/org/jnode/net/command/WLanCtlCommand.java =================================================================== --- trunk/net/src/net/org/jnode/net/command/WLanCtlCommand.java 2006-12-20 03:33:57 UTC (rev 2944) +++ trunk/net/src/net/org/jnode/net/command/WLanCtlCommand.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -32,12 +32,12 @@ import org.jnode.shell.Command; import org.jnode.shell.CommandLine; import org.jnode.shell.help.Argument; -import org.jnode.shell.help.DeviceArgument; import org.jnode.shell.help.Help; -import org.jnode.shell.help.OptionArgument; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.ParsedArguments; import org.jnode.shell.help.SyntaxErrorException; +import org.jnode.shell.help.argument.DeviceArgument; +import org.jnode.shell.help.argument.OptionArgument; /** * @author Ewout Prangsma (ep...@us...) @@ -52,7 +52,7 @@ FUNC_SETESSID, "Set the ESSID"), }); private static final DeviceArgument ARG_DEVICE = new DeviceArgument( - "device", "the device to control"); + "device", "the device to control", WirelessNetDeviceAPI.class); private static final Argument ARG_VALUE = new Argument("value", "Value of the function"); Added: trunk/net/src/net/org/jnode/net/help/argument/HostArgument.java =================================================================== --- trunk/net/src/net/org/jnode/net/help/argument/HostArgument.java (rev 0) +++ trunk/net/src/net/org/jnode/net/help/argument/HostArgument.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -0,0 +1,49 @@ +/* + * $Id: HostArgument.java 2224 2006-01-01 12:49:03Z epr $ + * + * JNode.org + * Copyright (C) 2003-2006 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.net.help.argument; + +import org.jnode.net.ipv4.IPv4Address; +import org.jnode.shell.help.Argument; +import org.jnode.shell.help.ParsedArguments; + +/** + * @author qades + */ +public class HostArgument extends Argument { + + public HostArgument(String name, String description, boolean multi) { + super(name, description, multi); + } + + public HostArgument(String name, String description) { + super(name, description); + } + + // here the specific command line completion would be implemented + + public IPv4Address getAddress(ParsedArguments args) { + String value = getValue(args); + if( value == null ) + return null; + return new IPv4Address(value); + } +} Added: trunk/net/src/net/org/jnode/net/help/argument/NetworkArgument.java =================================================================== --- trunk/net/src/net/org/jnode/net/help/argument/NetworkArgument.java (rev 0) +++ trunk/net/src/net/org/jnode/net/help/argument/NetworkArgument.java 2006-12-20 08:51:17 UTC (rev 2945) @@ -0,0 +1,49 @@ +/* + * $Id: NetworkArgument.java 2224 2006-01-01 12:49:03Z epr $ + * + * JNode.org + * Copyright (C) 2003-2006 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.net.help.argument; + +import org.jnode.net.ipv4.IPv4Address; +import org.jnode.shell.help.Argument; +import org.jnode.shell.help.ParsedArguments; + +/** + * @author qades + */ +public class NetworkArgument extends Argument { + + public NetworkArgument(String name, String description, boolean multi) { + super(name, description, multi); + } + + public NetworkArgument(String name, String description) { + super(name, description); + } + + // here the specific command line completion would be implemented + + public IPv4Address getAddress(ParsedArguments args) { + String value = getValue(args); + if( "default".equals(value) ) + value = "0.0.0.0"; + return new IPv4Address(value); + } +} Modified: trunk/net/src/net/org/jnode/net/ipv4/dhcp/DHCPClient.java ==============================... [truncated message content] |