diff src/cpu/x86/vm/sharedRuntime_x86_64.cpp @ 9112:6c33b2076d7c

minor HotSpot deoptimization cleanups
author Christian Haeubl <haeubl@ssw.jku.at>
date Mon, 08 Apr 2013 17:48:46 +0200
parents b9a918201d47
children 01958088b87d
line wrap: on
line diff
--- a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Mon Apr 08 09:26:06 2013 +0200
+++ b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Mon Apr 08 17:48:46 2013 +0200
@@ -3330,6 +3330,10 @@
   __ jmp(cont);
 
   int reexecute_offset = __ pc() - start;
+#ifdef GRAALVM
+  // Graal does not use this kind of deoptimization
+  __ should_not_reach_here();
+#endif
 
   // Reexecute case
   // return address is the pc describes what bci to do re-execute at
@@ -3340,6 +3344,32 @@
   __ movl(r14, Deoptimization::Unpack_reexecute); // callee-saved
   __ jmp(cont);
 
+#ifdef GRAAL
+  int implicit_exception_uncommon_trap_offset = __ pc() - start;
+  // pc where the exception happened is in ScratchA
+  __ pushptr(Address(r15_thread, in_bytes(JavaThread::ScratchA_offset())));
+
+  int uncommon_trap_offset = __ pc() - start;
+
+  // Save everything in sight.
+  RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words);
+  // fetch_unroll_info needs to call last_java_frame()
+  __ set_last_Java_frame(noreg, noreg, NULL);
+
+  __ movl(c_rarg1, Address(r15_thread, in_bytes(ThreadShadow::pending_deoptimization_offset())));
+  __ movl(Address(r15_thread, in_bytes(ThreadShadow::pending_deoptimization_offset())), -1);
+
+  __ movl(r14, (int32_t)Deoptimization::Unpack_reexecute);
+  __ mov(c_rarg0, r15_thread);
+  __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap)));
+  oop_maps->add_gc_map( __ pc()-start, map->deep_copy());
+
+  __ reset_last_Java_frame(false, false);
+
+  Label after_fetch_unroll_info_call;
+  __ jmp(after_fetch_unroll_info_call);
+#endif // GRAAL
+
   int exception_offset = __ pc() - start;
 
   // Prolog for exception case
@@ -3396,34 +3426,6 @@
   __ bind(no_pending_exception);
 #endif
 
-#ifdef GRAAL
-  __ jmp(cont);
-
-  int implicit_exception_uncommon_trap_offset = __ pc() - start;
-  // pc where the exception happened is in ScratchA
-  __ pushptr(Address(r15_thread, in_bytes(JavaThread::ScratchA_offset())));
-
-  int uncommon_trap_offset = __ pc() - start;
-
-  // Save everything in sight.
-  RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words);
-  // fetch_unroll_info needs to call last_java_frame()
-  __ set_last_Java_frame(noreg, noreg, NULL);
-
-  __ movl(c_rarg1, Address(r15_thread, in_bytes(ThreadShadow::pending_deoptimization_offset())));
-  __ movl(Address(r15_thread, in_bytes(ThreadShadow::pending_deoptimization_offset())), -1);
-
-  __ movl(r14, (int32_t)Deoptimization::Unpack_reexecute);
-  __ mov(c_rarg0, r15_thread);
-  __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap)));
-  oop_maps->add_gc_map( __ pc()-start, map->deep_copy());
-
-  __ reset_last_Java_frame(false, false);
-
-  Label after_fetch_unroll_info_call;
-  __ jmp(after_fetch_unroll_info_call);
-#endif // GRAAL
-
   __ bind(cont);
 
   // Call C code.  Need thread and this frame, but NOT official VM entry