hotspot/src/share/vm/opto/graphKit.cpp
changeset 27921 4b932655e504
parent 27637 cf68c0af6882
child 28913 252f7d579300
child 28837 fda2ab610119
child 29181 89beae49867c
--- a/hotspot/src/share/vm/opto/graphKit.cpp	Tue Dec 02 12:24:31 2014 -0800
+++ b/hotspot/src/share/vm/opto/graphKit.cpp	Mon Dec 01 11:59:56 2014 +0100
@@ -2809,7 +2809,8 @@
  */
 Node* GraphKit::maybe_cast_profiled_obj(Node* obj,
                                         ciKlass* type,
-                                        bool not_null) {
+                                        bool not_null,
+                                        SafePointNode* sfpt) {
   // type == NULL if profiling tells us this object is always null
   if (type != NULL) {
     Deoptimization::DeoptReason class_reason = Deoptimization::Reason_speculate_class_check;
@@ -2831,7 +2832,13 @@
       ciKlass* exact_kls = type;
       Node* slow_ctl  = type_check_receiver(exact_obj, exact_kls, 1.0,
                                             &exact_obj);
-      {
+      if (sfpt != NULL) {
+        GraphKit kit(sfpt->jvms());
+        PreserveJVMState pjvms(&kit);
+        kit.set_control(slow_ctl);
+        kit.uncommon_trap(class_reason,
+                          Deoptimization::Action_maybe_recompile);
+      } else {
         PreserveJVMState pjvms(this);
         set_control(slow_ctl);
         uncommon_trap(class_reason,