changeset 4852:2d3bd90bfad0

8030070: Test java/io/File/CheckPermission.java fails due to unfinished recursion (java.lang.StackOverflowError) when JIT'ed code (-client,-server) is running Summary: Move null check before klass reference materialization in checkcast Reviewed-by: twisti
author iveresov
date Fri, 20 Dec 2013 13:40:46 -0800
parents ea52633d5d48
children 92083784035a
files src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Thu Dec 19 08:16:57 2013 -0800
+++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Fri Dec 20 13:40:46 2013 -0800
@@ -1686,14 +1686,6 @@
   }
 
   assert_different_registers(obj, k_RInfo, klass_RInfo);
-  if (!k->is_loaded()) {
-    jobject2reg_with_patching(k_RInfo, op->info_for_patch());
-  } else {
-#ifdef _LP64
-    __ movoop(k_RInfo, k->constant_encoding());
-#endif // _LP64
-  }
-  assert(obj != k_RInfo, "must be different");
 
   __ cmpptr(obj, (int32_t)NULL_WORD);
   if (op->should_profile()) {
@@ -1710,6 +1702,14 @@
   } else {
     __ jcc(Assembler::equal, *obj_is_null);
   }
+
+  if (!k->is_loaded()) {
+    jobject2reg_with_patching(k_RInfo, op->info_for_patch());
+  } else {
+#ifdef _LP64
+    __ movoop(k_RInfo, k->constant_encoding());
+#endif // _LP64
+  }
   __ verify_oop(obj);
 
   if (op->fast_check()) {