changeset 3486:a5b02018b843

merge
author Lukas Stadler <lukas.stadler@jku.at>
date Thu, 04 Aug 2011 11:54:05 +0200
parents 1e5500ecd6bd (current diff) d6e8ca089e4b (diff)
children b9ed7199f6fb
files graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScan.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/IsNonNull.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/Phase.java
diffstat 10 files changed, 33 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScan.java	Thu Aug 04 11:10:07 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScan.java	Thu Aug 04 11:54:05 2011 +0200
@@ -1334,7 +1334,7 @@
 
     }
 
-    boolean isSorted(Interval[] intervals) {
+    private boolean isSorted(Interval[] intervals) {
         int from = -1;
         for (Interval interval : intervals) {
             assert interval != null;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java	Thu Aug 04 11:10:07 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java	Thu Aug 04 11:54:05 2011 +0200
@@ -120,8 +120,6 @@
         super(inline ? "BuildInlineGraph" : "BuildGraph");
         this.compilation = compilation;
 
-        setDetailedName(getName() + " " + method.holder().name() + "." + method.name() + method.signature().asString());
-
         this.runtime = compilation.runtime;
         this.method = method;
         this.stats = compilation.stats;
@@ -140,6 +138,11 @@
         build();
     }
 
+    @Override
+    protected String getDetailedName() {
+        return getName() + " " + method.holder().name() + "." + method.name() + method.signature().asString();
+    }
+
     /**
      * Builds the graph for a the specified {@code IRScope}.
      *
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/Phase.java	Thu Aug 04 11:10:07 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/Phase.java	Thu Aug 04 11:54:05 2011 +0200
@@ -30,14 +30,12 @@
 public abstract class Phase {
 
     private final String name;
-    private String detailedName;
     private static final ThreadLocal<Phase> currentPhase = new ThreadLocal<Phase>();
     private final boolean shouldVerify;
 
     protected Phase() {
         this.name = this.getClass().getSimpleName();
         this.shouldVerify = GraalOptions.Verify;
-        this.detailedName = name;
     }
 
     protected Phase(String name) {
@@ -47,11 +45,10 @@
     protected Phase(String name, boolean shouldVerify) {
         this.name = name;
         this.shouldVerify = shouldVerify;
-        this.detailedName = name;
     }
 
-    protected void setDetailedName(String detailedName) {
-        this.detailedName = detailedName;
+    protected String getDetailedName() {
+        return getName();
     }
 
     public final void apply(Graph graph) {
@@ -78,13 +75,13 @@
         } catch (AssertionError t) {
             GraalCompilation compilation = GraalCompilation.compilation();
             if (compilation.compiler.isObserved() && plotOnError) {
-                compilation.compiler.fireCompilationEvent(new CompilationEvent(compilation, "AssertionError in " + detailedName, graph, true, false, true));
+                compilation.compiler.fireCompilationEvent(new CompilationEvent(compilation, "AssertionError in " + getDetailedName(), graph, true, false, true));
             }
             throw t;
         } catch (RuntimeException t) {
             GraalCompilation compilation = GraalCompilation.compilation();
             if (compilation.compiler.isObserved() && plotOnError) {
-                compilation.compiler.fireCompilationEvent(new CompilationEvent(compilation, "RuntimeException in " + detailedName, graph, true, false, true));
+                compilation.compiler.fireCompilationEvent(new CompilationEvent(compilation, "RuntimeException in " + getDetailedName(), graph, true, false, true));
             }
             throw t;
         }
@@ -104,7 +101,7 @@
         }
         GraalCompilation compilation = GraalCompilation.compilation();
         if (compilation.compiler.isObserved() && this.getClass() != IdentifyBlocksPhase.class && (plot || GraalOptions.PlotVerbose)) {
-            compilation.compiler.fireCompilationEvent(new CompilationEvent(compilation, "After " + detailedName, graph, true, false));
+            compilation.compiler.fireCompilationEvent(new CompilationEvent(compilation, "After " + getDetailedName(), graph, true, false));
         }
 
         assert !shouldVerify || graph.verify();
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRAssembler.java	Thu Aug 04 11:10:07 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRAssembler.java	Thu Aug 04 11:54:05 2011 +0200
@@ -1141,16 +1141,12 @@
 
         Label continuation = new Label();
 
-        if (GraalOptions.GenSpecialDivChecks) {
+        if (GraalOptions.GenSpecialDivChecks && code == LIROpcode.Div) {
             // check for special case of Long.MIN_VALUE / -1
             Label normalCase = new Label();
             masm.movq(AMD64.rdx, java.lang.Long.MIN_VALUE);
             masm.cmpq(AMD64.rax, AMD64.rdx);
             masm.jcc(ConditionFlag.notEqual, normalCase);
-            if (code == LIROpcode.Lrem) {
-                // prepare X86Register.rdx for possible special case (where remainder = 0)
-                masm.xorq(AMD64.rdx, AMD64.rdx);
-            }
             masm.cmpl(rreg, -1);
             masm.jcc(ConditionFlag.equal, continuation);
 
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotTypeUnresolved.java	Thu Aug 04 11:10:07 2011 +0200
+++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotTypeUnresolved.java	Thu Aug 04 11:54:05 2011 +0200
@@ -68,11 +68,11 @@
     }
 
     private String getFullName(String name, int dimensions) {
-        StringBuilder str = new StringBuilder();
+        StringBuilder str = new StringBuilder(name.length() + dimensions + 2);
         for (int i = 0; i < dimensions; i++) {
             str.append('[');
         }
-        str.append('L').append(simpleName).append(';');
+        str.append('L').append(name).append(';');
         return str.toString();
     }
 
--- a/runfop.sh	Thu Aug 04 11:10:07 2011 +0200
+++ b/runfop.sh	Thu Aug 04 11:54:05 2011 +0200
@@ -15,4 +15,4 @@
   echo "DACAPO is not defined. It must point to a Dacapo benchmark directory."
   exit 1;
 fi
-${JDK7}/bin/java -client -d64 -graal -Xms1g -Xmx2g -esa -classpath ${DACAPO}/dacapo-9.12-bach.jar -XX:-GraalBailoutIsFatal $* Harness --preserve -n 20 fop 
+${JDK7}/bin/java -client -d64 -graal -Xms1g -Xmx2g -esa -classpath ${DACAPO}/dacapo-9.12-bach.jar -XX:-GraalBailoutIsFatal $* Harness --preserve -n 100 fop 
--- a/src/cpu/x86/vm/c1_globals_x86.hpp	Thu Aug 04 11:10:07 2011 +0200
+++ b/src/cpu/x86/vm/c1_globals_x86.hpp	Thu Aug 04 11:54:05 2011 +0200
@@ -40,7 +40,7 @@
 define_pd_global(bool, ProfileTraps,                 true );
 define_pd_global(bool, UseOnStackReplacement,        true );
 define_pd_global(bool, TieredCompilation,            false);
-define_pd_global(intx, CompileThreshold,             5000 );   // changed for GRAAL
+define_pd_global(intx, CompileThreshold,             4500 );   // changed for GRAAL
 define_pd_global(intx, BackEdgeThreshold,            100000);
 
 define_pd_global(intx, OnStackReplacePercentage,     933  );
--- a/src/share/vm/classfile/vmSymbols.hpp	Thu Aug 04 11:10:07 2011 +0200
+++ b/src/share/vm/classfile/vmSymbols.hpp	Thu Aug 04 11:54:05 2011 +0200
@@ -413,6 +413,7 @@
   template(bitCount_name,                             "bitCount")                                 \
   template(profile_name,                              "profile")                                  \
   template(equals_name,                               "equals")                                   \
+  template(length_name,                               "length")                                   \
   template(target_name,                               "target")                                   \
   template(toString_name,                             "toString")                                 \
   template(values_name,                               "values")                                   \
--- a/src/share/vm/compiler/compileBroker.cpp	Thu Aug 04 11:10:07 2011 +0200
+++ b/src/share/vm/compiler/compileBroker.cpp	Thu Aug 04 11:54:05 2011 +0200
@@ -642,6 +642,17 @@
   }
 }
 
+void CompileBroker::add_method_to_queue(klassOop k, Symbol* name, Symbol* signature) {
+  Thread* THREAD = Thread::current();
+  instanceKlass* klass = instanceKlass::cast(k);
+  methodOop method = klass->find_method(name, signature);
+  CompileBroker::compile_method(method, -1, 0, method, 0, "initial compile of object initializer", THREAD);
+  if (HAS_PENDING_EXCEPTION) {
+    CLEAR_PENDING_EXCEPTION;
+    fatal("error inserting method into compile queue");
+  }
+}
+
 // Bootstrap the graal compiler. Compiles all methods until compile queue is empty and no compilation is active.
 void CompileBroker::bootstrap_graal() {
   HandleMark hm;
@@ -652,14 +663,10 @@
   if (compiler == NULL) fatal("must use flag -XX:+UseGraal");
 
   jlong start = os::javaTimeMillis();
-
-  instanceKlass* klass = (instanceKlass*)SystemDictionary::Object_klass()->klass_part();
-  methodOop method = klass->find_method(vmSymbols::object_initializer_name(), vmSymbols::void_method_signature());
-  CompileBroker::compile_method(method, -1, 0, method, 0, "initial compile of object initializer", THREAD);
-  if (HAS_PENDING_EXCEPTION) {
-    CLEAR_PENDING_EXCEPTION;
-    fatal("error inserting object initializer into compile queue");
-  }
+  add_method_to_queue(SystemDictionary::Object_klass(), vmSymbols::object_initializer_name(), vmSymbols::void_method_signature());
+  add_method_to_queue(SystemDictionary::Object_klass(), vmSymbols::equals_name(), vmSymbols::object_boolean_signature());
+  add_method_to_queue(SystemDictionary::String_klass(), vmSymbols::length_name(), vmSymbols::void_int_signature());
+  add_method_to_queue(SystemDictionary::String_klass(), vmSymbols::object_initializer_name(), vmSymbols::void_method_signature());
 
   int z = 0;
   while (true) {
--- a/src/share/vm/compiler/compileBroker.hpp	Thu Aug 04 11:10:07 2011 +0200
+++ b/src/share/vm/compiler/compileBroker.hpp	Thu Aug 04 11:54:05 2011 +0200
@@ -403,6 +403,7 @@
   static void print_compiler_threads_on(outputStream* st);
 
   static void bootstrap_graal();
+  static void add_method_to_queue(klassOop k, Symbol* name, Symbol* signature);
 };
 
 #endif // SHARE_VM_COMPILER_COMPILEBROKER_HPP