changeset 4229:8074251d1e05

Fix bug in code installer that caused builds with assertions to crash
author Gilles Duboscq <gilles.m.duboscq@gmail.com>
date Thu, 05 Jan 2012 17:25:28 +0100
parents e872562f95f8
children b780ecb920c9
files src/share/vm/classfile/systemDictionary.hpp src/share/vm/classfile/vmSymbols.hpp src/share/vm/graal/graalCodeInstaller.cpp src/share/vm/graal/graalJavaAccess.hpp
diffstat 4 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/systemDictionary.hpp	Thu Jan 05 14:53:37 2012 +0100
+++ b/src/share/vm/classfile/systemDictionary.hpp	Thu Jan 05 17:25:28 2012 +0100
@@ -195,6 +195,7 @@
   template(HotSpotMethodResolved_klass,           com_oracle_max_graal_hotspot_ri_HotSpotMethodResolved,            Opt) \
   template(HotSpotTargetMethod_klass,             com_oracle_max_graal_hotspot_HotSpotTargetMethod,                 Opt) \
   template(HotSpotExceptionHandler_klass,         com_oracle_max_graal_hotspot_HotSpotExceptionHandler,             Opt) \
+  template(HotSpotProxy_klass,                    com_oracle_max_graal_hotspot_HotSpotProxy,                        Opt) \
   template(CiAssumptions_klass,                   com_oracle_max_cri_ci_CiAssumptions,                              Opt) \
   template(CiAssumptions_ConcreteSubtype_klass,   com_oracle_max_cri_ci_CiAssumptions_ConcreteSubtype,              Opt) \
   template(CiAssumptions_ConcreteMethod_klass,    com_oracle_max_cri_ci_CiAssumptions_ConcreteMethod,               Opt) \
@@ -205,7 +206,7 @@
   template(CiTargetMethod_Safepoint_klass,        com_oracle_max_cri_ci_CiTargetMethod_Safepoint,                   Opt) \
   template(CiTargetMethod_ExceptionHandler_klass, com_oracle_max_cri_ci_CiTargetMethod_ExceptionHandler,            Opt) \
   template(CiTargetMethod_Mark_klass,             com_oracle_max_cri_ci_CiTargetMethod_Mark,                        Opt) \
-  template(GraalBitMap_klass,                    com_oracle_max_cri_ci_CiBitMap,                                    Opt) \
+  template(GraalBitMap_klass,                     com_oracle_max_cri_ci_CiBitMap,                                   Opt) \
   template(CiDebugInfo_klass,                     com_oracle_max_cri_ci_CiDebugInfo,                                Opt) \
   template(CiFrame_klass,                         com_oracle_max_cri_ci_CiFrame,                                    Opt) \
   template(CiValue_klass,                         com_oracle_max_cri_ci_CiValue,                                    Opt) \
--- a/src/share/vm/classfile/vmSymbols.hpp	Thu Jan 05 14:53:37 2012 +0100
+++ b/src/share/vm/classfile/vmSymbols.hpp	Thu Jan 05 17:25:28 2012 +0100
@@ -278,6 +278,7 @@
   template(com_oracle_max_graal_hotspot_HotSpotTypeResolved,          "com/oracle/max/graal/hotspot/ri/HotSpotTypeResolvedImpl")          \
   template(com_oracle_max_graal_hotspot_HotSpotType,                  "com/oracle/max/graal/hotspot/ri/HotSpotType")                      \
   template(com_oracle_max_graal_hotspot_HotSpotExceptionHandler,      "com/oracle/max/graal/hotspot/ri/HotSpotExceptionHandler")          \
+  template(com_oracle_max_graal_hotspot_HotSpotProxy,                 "com/oracle/max/graal/hotspot/HotSpotProxy")                        \
   template(com_oracle_max_graal_hotspot_Compiler,                     "com/oracle/max/graal/hotspot/Compiler")                            \
   template(com_oracle_max_graal_hotspot_CompilerImpl,                 "com/oracle/max/graal/hotspot/CompilerImpl")                        \
   template(com_oracle_max_cri_ri_RiMethod,                            "com/oracle/max/cri/ri/RiMethod")                                   \
--- a/src/share/vm/graal/graalCodeInstaller.cpp	Thu Jan 05 14:53:37 2012 +0100
+++ b/src/share/vm/graal/graalCodeInstaller.cpp	Thu Jan 05 17:25:28 2012 +0100
@@ -793,6 +793,9 @@
         TRACE_graal_3("relocating (HotSpotType) at %016x/%016x", instruction, operand);
       } else {
         jobject value = JNIHandles::make_local(obj());
+        if (obj() == HotSpotProxy::DUMMY_CONSTANT_OBJ()) {
+          value = (jobject) Universe::non_oop_word();
+        }
         *((jobject*) operand) = value;
         _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
         TRACE_graal_3("relocating (oop constant) at %016x/%016x", instruction, operand);
--- a/src/share/vm/graal/graalJavaAccess.hpp	Thu Jan 05 14:53:37 2012 +0100
+++ b/src/share/vm/graal/graalJavaAccess.hpp	Thu Jan 05 17:25:28 2012 +0100
@@ -80,6 +80,9 @@
     long_field(HotSpotCompiledMethod, nmethod)                                          \
     oop_field(HotSpotCompiledMethod, method, "Lcom/oracle/max/cri/ri/RiResolvedMethod;") \
   end_class                                                                             \
+  start_class(HotSpotProxy)                                                             \
+    static_oop_field(HotSpotProxy, DUMMY_CONSTANT_OBJ, "Ljava/lang/Long;")              \
+  end_class                                                                             \
   start_class(HotSpotTargetMethod)                                                      \
     oop_field(HotSpotTargetMethod, targetMethod, "Lcom/oracle/max/cri/ci/CiTargetMethod;") \
     oop_field(HotSpotTargetMethod, method, "Lcom/oracle/max/graal/hotspot/ri/HotSpotMethodResolved;") \