< prev index next >

src/hotspot/share/runtime/deoptimization.cpp

Print this page




  39 #include "oops/method.hpp"
  40 #include "oops/objArrayOop.inline.hpp"
  41 #include "oops/oop.inline.hpp"
  42 #include "oops/fieldStreams.hpp"
  43 #include "oops/typeArrayOop.inline.hpp"
  44 #include "oops/verifyOopClosure.hpp"
  45 #include "prims/jvmtiThreadState.hpp"
  46 #include "runtime/biasedLocking.hpp"
  47 #include "runtime/compilationPolicy.hpp"
  48 #include "runtime/deoptimization.hpp"
  49 #include "runtime/interfaceSupport.hpp"
  50 #include "runtime/sharedRuntime.hpp"
  51 #include "runtime/signature.hpp"
  52 #include "runtime/stubRoutines.hpp"
  53 #include "runtime/thread.hpp"
  54 #include "runtime/threadSMR.hpp"
  55 #include "runtime/vframe.hpp"
  56 #include "runtime/vframeArray.hpp"
  57 #include "runtime/vframe_hp.hpp"
  58 #include "utilities/events.hpp"

  59 #include "utilities/xmlstream.hpp"
  60 
  61 #if INCLUDE_JVMCI
  62 #include "jvmci/jvmciRuntime.hpp"
  63 #include "jvmci/jvmciJavaClasses.hpp"
  64 #endif
  65 
  66 
  67 bool DeoptimizationMarker::_is_active = false;
  68 
  69 Deoptimization::UnrollBlock::UnrollBlock(int  size_of_deoptimized_frame,
  70                                          int  caller_adjustment,
  71                                          int  caller_actual_parameters,
  72                                          int  number_of_frames,
  73                                          intptr_t* frame_sizes,
  74                                          address* frame_pcs,
  75                                          BasicType return_type,
  76                                          int exec_mode) {
  77   _size_of_deoptimized_frame = size_of_deoptimized_frame;
  78   _caller_adjustment         = caller_adjustment;


 631 
 632   UnrollBlock* info = array->unroll_block();
 633 
 634   // Unpack the interpreter frames and any adapter frame (c2 only) we might create.
 635   array->unpack_to_stack(stub_frame, exec_mode, info->caller_actual_parameters());
 636 
 637   BasicType bt = info->return_type();
 638 
 639   // If we have an exception pending, claim that the return type is an oop
 640   // so the deopt_blob does not overwrite the exception_oop.
 641 
 642   if (exec_mode == Unpack_exception)
 643     bt = T_OBJECT;
 644 
 645   // Cleanup thread deopt data
 646   cleanup_deopt_info(thread, array);
 647 
 648 #ifndef PRODUCT
 649   if (VerifyStack) {
 650     ResourceMark res_mark;


 651 
 652     thread->validate_frame_layout();
 653 
 654     // Verify that the just-unpacked frames match the interpreter's
 655     // notions of expression stack and locals
 656     vframeArray* cur_array = thread->vframe_array_last();
 657     RegisterMap rm(thread, false);
 658     rm.set_include_argument_oops(false);
 659     bool is_top_frame = true;
 660     int callee_size_of_parameters = 0;
 661     int callee_max_locals = 0;
 662     for (int i = 0; i < cur_array->frames(); i++) {
 663       vframeArrayElement* el = cur_array->element(i);
 664       frame* iframe = el->iframe();
 665       guarantee(iframe->is_interpreted_frame(), "Wrong frame type");
 666 
 667       // Get the oop map for this bci
 668       InterpreterOopMap mask;
 669       int cur_invoke_parameter_size = 0;
 670       bool try_next_mask = false;




  39 #include "oops/method.hpp"
  40 #include "oops/objArrayOop.inline.hpp"
  41 #include "oops/oop.inline.hpp"
  42 #include "oops/fieldStreams.hpp"
  43 #include "oops/typeArrayOop.inline.hpp"
  44 #include "oops/verifyOopClosure.hpp"
  45 #include "prims/jvmtiThreadState.hpp"
  46 #include "runtime/biasedLocking.hpp"
  47 #include "runtime/compilationPolicy.hpp"
  48 #include "runtime/deoptimization.hpp"
  49 #include "runtime/interfaceSupport.hpp"
  50 #include "runtime/sharedRuntime.hpp"
  51 #include "runtime/signature.hpp"
  52 #include "runtime/stubRoutines.hpp"
  53 #include "runtime/thread.hpp"
  54 #include "runtime/threadSMR.hpp"
  55 #include "runtime/vframe.hpp"
  56 #include "runtime/vframeArray.hpp"
  57 #include "runtime/vframe_hp.hpp"
  58 #include "utilities/events.hpp"
  59 #include "utilities/preserveException.hpp"
  60 #include "utilities/xmlstream.hpp"
  61 
  62 #if INCLUDE_JVMCI
  63 #include "jvmci/jvmciRuntime.hpp"
  64 #include "jvmci/jvmciJavaClasses.hpp"
  65 #endif
  66 
  67 
  68 bool DeoptimizationMarker::_is_active = false;
  69 
  70 Deoptimization::UnrollBlock::UnrollBlock(int  size_of_deoptimized_frame,
  71                                          int  caller_adjustment,
  72                                          int  caller_actual_parameters,
  73                                          int  number_of_frames,
  74                                          intptr_t* frame_sizes,
  75                                          address* frame_pcs,
  76                                          BasicType return_type,
  77                                          int exec_mode) {
  78   _size_of_deoptimized_frame = size_of_deoptimized_frame;
  79   _caller_adjustment         = caller_adjustment;


 632 
 633   UnrollBlock* info = array->unroll_block();
 634 
 635   // Unpack the interpreter frames and any adapter frame (c2 only) we might create.
 636   array->unpack_to_stack(stub_frame, exec_mode, info->caller_actual_parameters());
 637 
 638   BasicType bt = info->return_type();
 639 
 640   // If we have an exception pending, claim that the return type is an oop
 641   // so the deopt_blob does not overwrite the exception_oop.
 642 
 643   if (exec_mode == Unpack_exception)
 644     bt = T_OBJECT;
 645 
 646   // Cleanup thread deopt data
 647   cleanup_deopt_info(thread, array);
 648 
 649 #ifndef PRODUCT
 650   if (VerifyStack) {
 651     ResourceMark res_mark;
 652     // Clear pending exception to not break verification code (restored afterwards)
 653     PRESERVE_EXCEPTION_MARK;
 654 
 655     thread->validate_frame_layout();
 656 
 657     // Verify that the just-unpacked frames match the interpreter's
 658     // notions of expression stack and locals
 659     vframeArray* cur_array = thread->vframe_array_last();
 660     RegisterMap rm(thread, false);
 661     rm.set_include_argument_oops(false);
 662     bool is_top_frame = true;
 663     int callee_size_of_parameters = 0;
 664     int callee_max_locals = 0;
 665     for (int i = 0; i < cur_array->frames(); i++) {
 666       vframeArrayElement* el = cur_array->element(i);
 667       frame* iframe = el->iframe();
 668       guarantee(iframe->is_interpreted_frame(), "Wrong frame type");
 669 
 670       // Get the oop map for this bci
 671       InterpreterOopMap mask;
 672       int cur_invoke_parameter_size = 0;
 673       bool try_next_mask = false;


< prev index next >