changeset 10074:e8fbc5fd3440

aot: add/fix some javadoc
author Bernhard Urban <bernhard.urban@jku.at>
date Mon, 17 Jun 2013 17:50:09 +0200
parents 1397c3e1f642
children c0e9ae41ed17
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerifcationPhase.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/BoxingSnippets.java
diffstat 4 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java	Mon Jun 17 17:07:49 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java	Mon Jun 17 17:50:09 2013 +0200
@@ -81,7 +81,7 @@
     }
 
     /**
-     * if the compiler is configured for AOT mode, {@link #readConstantValue(Constant)} should be
+     * If the compiler is configured for AOT mode, {@link #readConstantValue(Constant)} should be
      * only called for snippets or replacements.
      */
     private static boolean isCalledForSnippets() {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerifcationPhase.java	Mon Jun 17 17:07:49 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerifcationPhase.java	Mon Jun 17 17:50:09 2013 +0200
@@ -26,12 +26,18 @@
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.phases.*;
 
+/**
+ * Checking for embedded oops in the graph. (Interned) Strings are an exception as they live in CDS
+ * space.
+ * 
+ * @see LoadJavaMirrorWithKlassPhase
+ */
 public class AheadOfTimeVerifcationPhase extends VerifyPhase {
 
     @Override
     protected boolean verify(StructuredGraph graph) {
         for (ConstantNode node : graph.getNodes().filter(ConstantNode.class)) {
-            assert !isOop(node) || isNullReference(node) || isString(node) : "embedded oop: " + node + ". toString: " + node.asConstant().asObject();
+            assert !isOop(node) || isNullReference(node) || isString(node) : "embedded oop: " + node;
         }
         return true;
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java	Mon Jun 17 17:07:49 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java	Mon Jun 17 17:50:09 2013 +0200
@@ -32,6 +32,15 @@
 import com.oracle.graal.phases.*;
 import com.oracle.graal.phases.tiers.*;
 
+/**
+ * For AOT compilation we aren't allowed to use a class reference (javaMirror) directly. Instead the
+ * class reference should be obtained from the klass object. The reason for this is, that in CDS a
+ * klass object is mapped to a fixed address in memory, but the javaMirror is not (which lives in
+ * the java heap).
+ * 
+ * Lowering can introduce new ConstantNodes containing a class reference, thus this phase must be
+ * applied after lowering.
+ */
 public class LoadJavaMirrorWithKlassPhase extends BasePhase<PhaseContext> {
 
     @Override
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/BoxingSnippets.java	Mon Jun 17 17:07:49 2013 +0200
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/BoxingSnippets.java	Mon Jun 17 17:50:09 2013 +0200
@@ -215,6 +215,7 @@
 
         public void lower(BoxNode box) {
             FloatingNode canonical = canonicalizeBoxing(box, runtime);
+            // if in AOT mode, we don't want to embed boxed constants.
             if (!AOTCompilation.getValue() && canonical != null) {
                 box.graph().replaceFixedWithFloating(box, canonical);
             } else {