From: <cr...@us...> - 2008-04-06 06:26:56
|
Revision: 3940 http://jnode.svn.sourceforge.net/jnode/?rev=3940&view=rev Author: crawley Date: 2008-04-05 23:26:51 -0700 (Sat, 05 Apr 2008) Log Message: ----------- Enabled code to find out what the max --level should be (hacky). Fixed a couple of syntax issues. Modified Paths: -------------- trunk/shell/descriptors/org.jnode.shell.command.xml trunk/shell/src/shell/org/jnode/shell/command/CompileCommand.java Modified: trunk/shell/descriptors/org.jnode.shell.command.xml =================================================================== --- trunk/shell/descriptors/org.jnode.shell.command.xml 2008-04-06 06:25:22 UTC (rev 3939) +++ trunk/shell/descriptors/org.jnode.shell.command.xml 2008-04-06 06:26:51 UTC (rev 3940) @@ -65,7 +65,7 @@ <option argLabel="clear" longName="clear" description="remove all URLs from the classpath"/> <option argLabel="refresh" longName="refresh" description="refresh the loaded classes on next use"/> </syntax> - <syntax alias="classpath"> + <syntax alias="compile"> <sequence description="print the current classpath"> <optionSet> <option argLabel="test" longName="test"/> Modified: trunk/shell/src/shell/org/jnode/shell/command/CompileCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/CompileCommand.java 2008-04-06 06:25:22 UTC (rev 3939) +++ trunk/shell/src/shell/org/jnode/shell/command/CompileCommand.java 2008-04-06 06:26:51 UTC (rev 3940) @@ -39,23 +39,16 @@ * @author cr...@jn... */ public class CompileCommand extends AbstractCommand { - // FIXME ... it would be good if something exposed the current maximum - // compiler optimization level via(s) a getter method. -// private final VmArchitecture arch = VmMagic.currentProcessor().getArchitecture(); -// private final Object[] compilers = arch.getCompilers(); -// private final Object[] testCompilers = arch.getTestCompilers(); -// private final int maxLevel = Math.max( -// compilers.length, (testCompilers == null) ? 0 : testCompilers.length) - 1; + // FIXME ... something should exposed the maximum compiler optimization levels + // via getter methods. The code below gives "MagicPermission is not granted ..." + private final VmArchitecture arch = VmMagic.currentProcessor().getArchitecture(); + private final Object[] compilers = arch.getCompilers(); + private final Object[] testCompilers = arch.getTestCompilers(); + private final int maxLevel = Math.max( + compilers.length, (testCompilers == null) ? 0 : testCompilers.length) - 1; - // FIXME ... temporary hack until I work out what is causing the System.out stream - // to be toasted in the compiler thread. (The commented out code causes the compiler - // to try to print "MagicPermission is not granted ..." to System.out, and a NPE is - // being thrown because (I think) the proclet context thinks that the global output - // stream is null.) - private final int maxLevel = 3; - private final ClassNameArgument ARG_CLASS = - new ClassNameArgument("className", Argument.MANDATORY, "the class file to compile"); + new ClassNameArgument("classname", Argument.MANDATORY, "the class file to compile"); private final IntegerArgument ARG_LEVEL = new IntegerArgument("level", Argument.OPTIONAL, 0, maxLevel, "the optimization level"); private final FlagArgument ARG_TEST = This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |