# HG changeset patch # User Gilles Duboscq # Date 1332920238 -7200 # Node ID 05fb99cbb605944572b76762468d08c917343645 # Parent 6e385457d6fc29c1fb3b32bec24345190e5cd677# Parent 24c77ad284dc721cd4bdcb9bdc4cf9a2ab9dd5b1 Merge diff -r 6e385457d6fc -r 05fb99cbb605 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java Mon Mar 26 15:47:49 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java Wed Mar 28 09:37:18 2012 +0200 @@ -196,6 +196,11 @@ */ public static boolean AllocSSA = false; + /** + * Prints all the available GraalOptions. + */ + public static boolean PrintFlags = false; + static { // turn detailed assertions on when the general assertions are on (misusing the assert keyword for this) assert (DetailedAsserts = true) == true; diff -r 6e385457d6fc -r 05fb99cbb605 graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java --- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java Mon Mar 26 15:47:49 2012 +0200 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java Wed Mar 28 09:37:18 2012 +0200 @@ -55,18 +55,22 @@ return ENABLED && DebugScope.getInstance().isLogEnabled(); } + @SuppressWarnings("unused") public static Runnable decorateDebugRoot(Runnable runnable, String name, DebugConfig config) { return runnable; } + @SuppressWarnings("unused") public static Callable decorateDebugRoot(Callable callable, String name, DebugConfig config) { return callable; } + @SuppressWarnings("unused") public static Runnable decorateScope(Runnable runnable, String name, Object... context) { return runnable; } + @SuppressWarnings("unused") public static Callable decorateScope(Callable callable, String name, Object... context) { return callable; } diff -r 6e385457d6fc -r 05fb99cbb605 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotOptions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotOptions.java Mon Mar 26 15:47:49 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotOptions.java Wed Mar 28 09:37:18 2012 +0200 @@ -24,6 +24,7 @@ package com.oracle.graal.hotspot; import java.lang.reflect.*; +import java.util.*; import com.oracle.graal.compiler.*; import com.oracle.graal.hotspot.logging.*; @@ -35,6 +36,7 @@ GraalOptions.ResolveClassBeforeStaticInvoke = false; } + // Called from VM code public static boolean setOption(String option) { if (option.length() == 0) { return false; @@ -62,28 +64,35 @@ Field f; try { f = GraalOptions.class.getDeclaredField(fieldName); + Class< ? > fType = f.getType(); if (value == null) { - if (f.getType() == Float.TYPE) { + if (fType == Boolean.TYPE) { + Logger.info("Value for boolean option '" + fieldName + "' must use '-G:+" + fieldName + "' or '-G:-" + fieldName + "' format"); + return false; + } + + if (valueString == null) { + Logger.info("Value for option '" + fieldName + "' must use '-G:" + fieldName + "=' format"); + return false; + } + + if (fType == Float.TYPE) { value = Float.parseFloat(valueString); - } else if (f.getType() == Double.TYPE) { + } else if (fType == Double.TYPE) { value = Double.parseDouble(valueString); - } else if (f.getType() == Integer.TYPE) { + } else if (fType == Integer.TYPE) { value = Integer.parseInt(valueString); - } else if (f.getType() == Boolean.TYPE) { - if (valueString == null || valueString.length() == 0) { - value = true; - } else { - value = Boolean.parseBoolean(valueString); - } - } else if (f.getType() == String.class) { - if (valueString == null) { - value = ""; - } else { - value = valueString; - } + } else if (fType == String.class) { + value = valueString; + } + } else { + if (fType != Boolean.TYPE) { + Logger.info("Value for option '" + fieldName + "' must use '-G:" + fieldName + "=' format"); + return false; } } + if (value != null) { f.setAccessible(true); f.set(null, value); @@ -106,6 +115,31 @@ return false; } + if (option.equals("+PrintFlags")) { + printFlags(); + } + return true; } + + private static void printFlags() { + Logger.info("[Graal flags]"); + Field[] flags = GraalOptions.class.getDeclaredFields(); + Arrays.sort(flags, new Comparator() { + public int compare(Field o1, Field o2) { + return o1.getName().compareTo(o2.getName()); + } + }); + for (Field f : flags) { + if (Modifier.isPublic(f.getModifiers()) && Modifier.isStatic(f.getModifiers())) { + f.setAccessible(true); + try { + Object value = f.get(null); + Logger.info(String.format("%9s %-40s = %s", f.getType().getSimpleName(), f.getName(), value)); + } catch (Exception e) { + } + } + } + System.exit(0); + } } diff -r 6e385457d6fc -r 05fb99cbb605 mx/eclipse-settings/org.eclipse.jdt.core.prefs --- a/mx/eclipse-settings/org.eclipse.jdt.core.prefs Mon Mar 26 15:47:49 2012 +0200 +++ b/mx/eclipse-settings/org.eclipse.jdt.core.prefs Wed Mar 28 09:37:18 2012 +0200 @@ -1,4 +1,3 @@ -#Sun Dec 18 01:19:17 CET 2011 eclipse.preferences.version=1 org.eclipse.jdt.core.builder.cleanOutputFolder=clean org.eclipse.jdt.core.builder.duplicateResourceTask=warning @@ -18,6 +17,11 @@ org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve @@ -72,13 +76,17 @@ org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore diff -r 6e385457d6fc -r 05fb99cbb605 mxtool/mx.py --- a/mxtool/mx.py Mon Mar 26 15:47:49 2012 +0200 +++ b/mxtool/mx.py Wed Mar 28 09:37:18 2012 +0200 @@ -124,7 +124,7 @@ Property values can use environment variables with Bash syntax (e.g. ${HOME}). """ -import sys, os, errno, time, subprocess, shlex, types, urllib2, contextlib, StringIO, zipfile, signal +import sys, os, errno, time, subprocess, shlex, types, urllib2, contextlib, StringIO, zipfile, signal, xml.sax.saxutils import shutil, fnmatch, re, xml.dom.minidom from collections import Callable from threading import Thread @@ -1379,6 +1379,9 @@ def println(out, obj): out.write(str(obj) + '\n') + source_locator_memento = '\n' + entities = { '"': """, "'": "'", '\n': ' ' } + for p in projects(): if p.native: continue @@ -1492,7 +1495,6 @@ update_file(join(p.dir, '.project'), out.getvalue()) out.close() - out = StringIO.StringIO() settingsDir = join(p.dir, ".settings") if not exists(settingsDir): os.mkdir(settingsDir) @@ -1506,6 +1508,24 @@ content = f.read() content = content.replace('${javaCompliance}', str(p.javaCompliance)) update_file(join(settingsDir, name), content) + + memento = '\n\n' + source_locator_memento += '\n' + + source_locator_memento += '\n' + launch = r""" + + + + + + + + + + +""".format(xml.sax.saxutils.escape(source_locator_memento, entities)) + update_file(join(suite.dir, 'mx', 'attach-8000.launch'), launch) def netbeansinit(args, suite=None): """(re)generate NetBeans project configurations""" diff -r 6e385457d6fc -r 05fb99cbb605 src/share/vm/graal/graalCompiler.cpp --- a/src/share/vm/graal/graalCompiler.cpp Mon Mar 26 15:47:49 2012 +0200 +++ b/src/share/vm/graal/graalCompiler.cpp Wed Mar 28 09:37:18 2012 +0200 @@ -80,7 +80,7 @@ Handle option = java_lang_String::create_from_str(arg, THREAD); jboolean result = VMToCompiler::setOption(option); if (!result) { - tty->print_cr("Invalid option for graal!"); + tty->print_cr("Invalid option for graal: -G:%s", arg); vm_abort(false); } }