hotspot/src/share/vm/runtime/vframeArray.cpp
changeset 15943 d830a939d985
parent 15475 73896d91270c
child 20282 7f9cbdf89af2
equal deleted inserted replaced
15924:d01b3a588e24 15943:d830a939d985
   158 void vframeArrayElement::unpack_on_stack(int caller_actual_parameters,
   158 void vframeArrayElement::unpack_on_stack(int caller_actual_parameters,
   159                                          int callee_parameters,
   159                                          int callee_parameters,
   160                                          int callee_locals,
   160                                          int callee_locals,
   161                                          frame* caller,
   161                                          frame* caller,
   162                                          bool is_top_frame,
   162                                          bool is_top_frame,
       
   163                                          bool is_bottom_frame,
   163                                          int exec_mode) {
   164                                          int exec_mode) {
   164   JavaThread* thread = (JavaThread*) Thread::current();
   165   JavaThread* thread = (JavaThread*) Thread::current();
   165 
   166 
   166   // Look at bci and decide on bcp and continuation pc
   167   // Look at bci and decide on bcp and continuation pc
   167   address bcp;
   168   address bcp;
   273                                  caller_actual_parameters,
   274                                  caller_actual_parameters,
   274                                  callee_parameters,
   275                                  callee_parameters,
   275                                  callee_locals,
   276                                  callee_locals,
   276                                  caller,
   277                                  caller,
   277                                  iframe(),
   278                                  iframe(),
   278                                  is_top_frame);
   279                                  is_top_frame,
       
   280                                  is_bottom_frame);
   279 
   281 
   280   // Update the pc in the frame object and overwrite the temporary pc
   282   // Update the pc in the frame object and overwrite the temporary pc
   281   // we placed in the skeletal frame now that we finally know the
   283   // we placed in the skeletal frame now that we finally know the
   282   // exact interpreter address we should use.
   284   // exact interpreter address we should use.
   283 
   285 
   418 
   420 
   419 int vframeArrayElement::on_stack_size(int caller_actual_parameters,
   421 int vframeArrayElement::on_stack_size(int caller_actual_parameters,
   420                                       int callee_parameters,
   422                                       int callee_parameters,
   421                                       int callee_locals,
   423                                       int callee_locals,
   422                                       bool is_top_frame,
   424                                       bool is_top_frame,
       
   425                                       bool is_bottom_frame,
   423                                       int popframe_extra_stack_expression_els) const {
   426                                       int popframe_extra_stack_expression_els) const {
   424   assert(method()->max_locals() == locals()->size(), "just checking");
   427   assert(method()->max_locals() == locals()->size(), "just checking");
   425   int locks = monitors() == NULL ? 0 : monitors()->number_of_monitors();
   428   int locks = monitors() == NULL ? 0 : monitors()->number_of_monitors();
   426   int temps = expressions()->size();
   429   int temps = expressions()->size();
   427   return Interpreter::size_activation(method(),
   430   return Interpreter::size_activation(method(),
   429                                       popframe_extra_stack_expression_els,
   432                                       popframe_extra_stack_expression_els,
   430                                       locks,
   433                                       locks,
   431                                       caller_actual_parameters,
   434                                       caller_actual_parameters,
   432                                       callee_parameters,
   435                                       callee_parameters,
   433                                       callee_locals,
   436                                       callee_locals,
   434                                       is_top_frame);
   437                                       is_top_frame,
       
   438                                       is_bottom_frame);
   435 }
   439 }
   436 
   440 
   437 
   441 
   438 
   442 
   439 vframeArray* vframeArray::allocate(JavaThread* thread, int frame_size, GrowableArray<compiledVFrame*>* chunk,
   443 vframeArray* vframeArray::allocate(JavaThread* thread, int frame_size, GrowableArray<compiledVFrame*>* chunk,
   520     me = me.sender(&map);
   524     me = me.sender(&map);
   521   }
   525   }
   522 
   526 
   523   // Do the unpacking of interpreter frames; the frame at index 0 represents the top activation, so it has no callee
   527   // Do the unpacking of interpreter frames; the frame at index 0 represents the top activation, so it has no callee
   524   // Unpack the frames from the oldest (frames() -1) to the youngest (0)
   528   // Unpack the frames from the oldest (frames() -1) to the youngest (0)
   525   frame caller_frame = me;
   529   frame* caller_frame = &me;
   526   for (index = frames() - 1; index >= 0 ; index--) {
   530   for (index = frames() - 1; index >= 0 ; index--) {
   527     vframeArrayElement* elem = element(index);  // caller
   531     vframeArrayElement* elem = element(index);  // caller
   528     int callee_parameters, callee_locals;
   532     int callee_parameters, callee_locals;
   529     if (index == 0) {
   533     if (index == 0) {
   530       callee_parameters = callee_locals = 0;
   534       callee_parameters = callee_locals = 0;
   540       callee_locals     = callee->max_locals();
   544       callee_locals     = callee->max_locals();
   541     }
   545     }
   542     elem->unpack_on_stack(caller_actual_parameters,
   546     elem->unpack_on_stack(caller_actual_parameters,
   543                           callee_parameters,
   547                           callee_parameters,
   544                           callee_locals,
   548                           callee_locals,
   545                           &caller_frame,
   549                           caller_frame,
   546                           index == 0,
   550                           index == 0,
       
   551                           index == frames() - 1,
   547                           exec_mode);
   552                           exec_mode);
   548     if (index == frames() - 1) {
   553     if (index == frames() - 1) {
   549       Deoptimization::unwind_callee_save_values(elem->iframe(), this);
   554       Deoptimization::unwind_callee_save_values(elem->iframe(), this);
   550     }
   555     }
   551     caller_frame = *elem->iframe();
   556     caller_frame = elem->iframe();
   552     caller_actual_parameters = callee_parameters;
   557     caller_actual_parameters = callee_parameters;
   553   }
   558   }
   554   deallocate_monitor_chunks();
   559   deallocate_monitor_chunks();
   555 }
   560 }
   556 
   561