changeset 13155:1dd9aa5a9ee5

Deoptimization reason for failed aliasing assumptions.
author Roland Schatz <roland.schatz@oracle.com>
date Mon, 25 Nov 2013 17:23:56 +0100
parents 1e22792abdbc
children 2e76d94f8383 787357a6de3e 5df9c590f401
files graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/DeoptimizationReason.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaAccessProvider.java src/share/vm/runtime/deoptimization.hpp src/share/vm/runtime/vmStructs.cpp
diffstat 5 files changed, 21 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/DeoptimizationReason.java	Mon Nov 25 17:19:29 2013 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/DeoptimizationReason.java	Mon Nov 25 17:23:56 2013 +0100
@@ -40,4 +40,5 @@
     ArithmeticException,
     RuntimeConstraint,
     LoopLimitCheck,
+    Aliasing,
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java	Mon Nov 25 17:19:29 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java	Mon Nov 25 17:23:56 2013 +0100
@@ -1129,6 +1129,7 @@
     @HotSpotVMConstant(name = "Deoptimization::Reason_div0_check") @Stable public int deoptReasonDiv0Check;
     @HotSpotVMConstant(name = "Deoptimization::Reason_constraint") @Stable public int deoptReasonConstraint;
     @HotSpotVMConstant(name = "Deoptimization::Reason_loop_limit_check") @Stable public int deoptReasonLoopLimitCheck;
+    @HotSpotVMConstant(name = "Deoptimization::Reason_aliasing") @Stable public int deoptReasonAliasing;
 
     @HotSpotVMConstant(name = "Deoptimization::Action_none") @Stable public int deoptActionNone;
     @HotSpotVMConstant(name = "Deoptimization::Action_maybe_recompile") @Stable public int deoptActionMaybeRecompile;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaAccessProvider.java	Mon Nov 25 17:19:29 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaAccessProvider.java	Mon Nov 25 17:23:56 2013 +0100
@@ -187,6 +187,8 @@
                 return runtime.getConfig().deoptReasonConstraint;
             case LoopLimitCheck:
                 return runtime.getConfig().deoptReasonLoopLimitCheck;
+            case Aliasing:
+                return runtime.getConfig().deoptReasonAliasing;
             default:
                 throw GraalInternalError.shouldNotReachHere();
         }
@@ -221,6 +223,8 @@
             return DeoptimizationReason.RuntimeConstraint;
         } else if (reason == runtime.getConfig().deoptReasonLoopLimitCheck) {
             return DeoptimizationReason.LoopLimitCheck;
+        } else if (reason == runtime.getConfig().deoptReasonAliasing) {
+            return DeoptimizationReason.Aliasing;
         } else {
             throw GraalInternalError.shouldNotReachHere(Integer.toHexString(reason));
         }
--- a/src/share/vm/runtime/deoptimization.hpp	Mon Nov 25 17:19:29 2013 +0100
+++ b/src/share/vm/runtime/deoptimization.hpp	Mon Nov 25 17:23:56 2013 +0100
@@ -72,6 +72,9 @@
     Reason_age,                   // nmethod too old; tier threshold reached
     Reason_predicate,             // compiler generated predicate failed
     Reason_loop_limit_check,      // compiler generated loop limits check failed
+#ifdef GRAAL
+    Reason_aliasing,              // optimistic assumption about aliasing failed
+#endif
     Reason_LIMIT,
 
 #ifdef GRAAL
--- a/src/share/vm/runtime/vmStructs.cpp	Mon Nov 25 17:19:29 2013 +0100
+++ b/src/share/vm/runtime/vmStructs.cpp	Mon Nov 25 17:23:56 2013 +0100
@@ -2196,7 +2196,8 @@
                          declare_preprocessor_constant,                   \
                          declare_c1_constant,                             \
                          declare_c2_constant,                             \
-                         declare_c2_preprocessor_constant)                \
+                         declare_c2_preprocessor_constant,                \
+                         declare_graal_constant)                          \
                                                                           \
   /******************/                                                    \
   /* Useful globals */                                                    \
@@ -2505,6 +2506,7 @@
   declare_constant(Deoptimization::Reason_age)                            \
   declare_constant(Deoptimization::Reason_predicate)                      \
   declare_constant(Deoptimization::Reason_loop_limit_check)               \
+  declare_graal_constant(Deoptimization::Reason_aliasing)                 \
   declare_constant(Deoptimization::Reason_LIMIT)                          \
   declare_constant(Deoptimization::Reason_RECORDED_LIMIT)                 \
                                                                           \
@@ -2867,6 +2869,13 @@
 # define GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY(name, value)
 #endif /* COMPILER1 */
 
+// Generate an int constant for a Graal build
+#ifdef GRAAL
+# define GENERATE_GRAAL_VM_INT_CONSTANT_ENTRY(name)  GENERATE_VM_INT_CONSTANT_ENTRY(name)
+#else
+# define GENERATE_GRAAL_VM_INT_CONSTANT_ENTRY(name)
+#endif
+
 //--------------------------------------------------------------------------------
 // VMLongConstantEntry macros
 //
@@ -3009,7 +3018,8 @@
                    GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY,
                    GENERATE_C1_VM_INT_CONSTANT_ENTRY,
                    GENERATE_C2_VM_INT_CONSTANT_ENTRY,
-                   GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY)
+                   GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY,
+                   GENERATE_GRAAL_VM_INT_CONSTANT_ENTRY)
 
 #if INCLUDE_ALL_GCS
   VM_INT_CONSTANTS_CMS(GENERATE_VM_INT_CONSTANT_ENTRY)