810 // Walk the inline list to fill in the correct set of JVMState's |
810 // Walk the inline list to fill in the correct set of JVMState's |
811 // Also fill in the associated edges for each JVMState. |
811 // Also fill in the associated edges for each JVMState. |
812 |
812 |
813 JVMState* youngest_jvms = sync_jvms(); |
813 JVMState* youngest_jvms = sync_jvms(); |
814 |
814 |
815 // Do we need debug info here? If it is a SafePoint and this method |
|
816 // cannot de-opt, then we do NOT need any debug info. |
|
817 bool full_info = (C->deopt_happens() || call->Opcode() != Op_SafePoint); |
|
818 |
|
819 // If we are guaranteed to throw, we can prune everything but the |
815 // If we are guaranteed to throw, we can prune everything but the |
820 // input to the current bytecode. |
816 // input to the current bytecode. |
821 bool can_prune_locals = false; |
817 bool can_prune_locals = false; |
822 uint stack_slots_not_pruned = 0; |
818 uint stack_slots_not_pruned = 0; |
823 int inputs = 0, depth = 0; |
819 int inputs = 0, depth = 0; |
827 can_prune_locals = true; |
823 can_prune_locals = true; |
828 stack_slots_not_pruned = inputs; |
824 stack_slots_not_pruned = inputs; |
829 } |
825 } |
830 } |
826 } |
831 |
827 |
832 if (env()->jvmti_can_examine_or_deopt_anywhere()) { |
828 if (env()->jvmti_can_access_local_variables()) { |
833 // At any safepoint, this method can get breakpointed, which would |
829 // At any safepoint, this method can get breakpointed, which would |
834 // then require an immediate deoptimization. |
830 // then require an immediate deoptimization. |
835 full_info = true; |
|
836 can_prune_locals = false; // do not prune locals |
831 can_prune_locals = false; // do not prune locals |
837 stack_slots_not_pruned = 0; |
832 stack_slots_not_pruned = 0; |
838 } |
833 } |
839 |
834 |
840 // do not scribble on the input jvms |
835 // do not scribble on the input jvms |
888 |
883 |
889 // Add the Locals |
884 // Add the Locals |
890 k = in_jvms->locoff(); |
885 k = in_jvms->locoff(); |
891 l = in_jvms->loc_size(); |
886 l = in_jvms->loc_size(); |
892 out_jvms->set_locoff(p); |
887 out_jvms->set_locoff(p); |
893 if (full_info && !can_prune_locals) { |
888 if (!can_prune_locals) { |
894 for (j = 0; j < l; j++) |
889 for (j = 0; j < l; j++) |
895 call->set_req(p++, in_map->in(k+j)); |
890 call->set_req(p++, in_map->in(k+j)); |
896 } else { |
891 } else { |
897 p += l; // already set to top above by add_req_batch |
892 p += l; // already set to top above by add_req_batch |
898 } |
893 } |
899 |
894 |
900 // Add the Expression Stack |
895 // Add the Expression Stack |
901 k = in_jvms->stkoff(); |
896 k = in_jvms->stkoff(); |
902 l = in_jvms->sp(); |
897 l = in_jvms->sp(); |
903 out_jvms->set_stkoff(p); |
898 out_jvms->set_stkoff(p); |
904 if (full_info && !can_prune_locals) { |
899 if (!can_prune_locals) { |
905 for (j = 0; j < l; j++) |
900 for (j = 0; j < l; j++) |
906 call->set_req(p++, in_map->in(k+j)); |
901 call->set_req(p++, in_map->in(k+j)); |
907 } else if (can_prune_locals && stack_slots_not_pruned != 0) { |
902 } else if (can_prune_locals && stack_slots_not_pruned != 0) { |
908 // Divide stack into {S0,...,S1}, where S0 is set to top. |
903 // Divide stack into {S0,...,S1}, where S0 is set to top. |
909 uint s1 = stack_slots_not_pruned; |
904 uint s1 = stack_slots_not_pruned; |