< prev index next >

src/hotspot/share/runtime/vframeArray.cpp

Print this page




  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/vmSymbols.hpp"
  27 #include "code/vmreg.inline.hpp"
  28 #include "interpreter/bytecode.hpp"
  29 #include "interpreter/interpreter.hpp"
  30 #include "memory/allocation.inline.hpp"
  31 #include "memory/resourceArea.hpp"
  32 #include "memory/universe.hpp"
  33 #include "oops/methodData.hpp"
  34 #include "oops/oop.inline.hpp"
  35 #include "prims/jvmtiThreadState.hpp"

  36 #include "runtime/handles.inline.hpp"
  37 #include "runtime/monitorChunk.hpp"
  38 #include "runtime/sharedRuntime.hpp"
  39 #include "runtime/vframe.hpp"
  40 #include "runtime/vframeArray.hpp"
  41 #include "runtime/vframe_hp.hpp"
  42 #include "utilities/events.hpp"
  43 #ifdef COMPILER2
  44 #include "opto/runtime.hpp"
  45 #endif
  46 
  47 int vframeArrayElement:: bci(void) const { return (_bci == SynchronizationEntryBCI ? 0 : _bci); }
  48 
  49 void vframeArrayElement::free_monitors(JavaThread* jt) {
  50   if (_monitors != NULL) {
  51      MonitorChunk* chunk = _monitors;
  52      _monitors = NULL;
  53      jt->remove_monitor_chunk(chunk);
  54      delete chunk;
  55   }


 472 
 473 }
 474 
 475 int vframeArrayElement::on_stack_size(int callee_parameters,
 476                                       int callee_locals,
 477                                       bool is_top_frame,
 478                                       int popframe_extra_stack_expression_els) const {
 479   assert(method()->max_locals() == locals()->size(), "just checking");
 480   int locks = monitors() == NULL ? 0 : monitors()->number_of_monitors();
 481   int temps = expressions()->size();
 482   return Interpreter::size_activation(method()->max_stack(),
 483                                       temps + callee_parameters,
 484                                       popframe_extra_stack_expression_els,
 485                                       locks,
 486                                       callee_parameters,
 487                                       callee_locals,
 488                                       is_top_frame);
 489 }
 490 
 491 



 492 
 493 vframeArray* vframeArray::allocate(JavaThread* thread, int frame_size, GrowableArray<compiledVFrame*>* chunk,
 494                                    RegisterMap *reg_map, frame sender, frame caller, frame self,
 495                                    bool realloc_failures) {
 496 
 497   // Allocate the vframeArray
 498   vframeArray * result = (vframeArray*) AllocateHeap(sizeof(vframeArray) + // fixed part
 499                                                      sizeof(vframeArrayElement) * (chunk->length() - 1), // variable part
 500                                                      mtCompiler);
 501   result->_frames = chunk->length();
 502   result->_owner_thread = thread;
 503   result->_sender = sender;
 504   result->_caller = caller;
 505   result->_original = self;
 506   result->set_unroll_block(NULL); // initialize it
 507   result->fill_in(thread, frame_size, chunk, reg_map, realloc_failures);
 508   return result;
 509 }
 510 
 511 void vframeArray::fill_in(JavaThread* thread,




  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/vmSymbols.hpp"
  27 #include "code/vmreg.inline.hpp"
  28 #include "interpreter/bytecode.hpp"
  29 #include "interpreter/interpreter.hpp"
  30 #include "memory/allocation.inline.hpp"
  31 #include "memory/resourceArea.hpp"
  32 #include "memory/universe.hpp"
  33 #include "oops/methodData.hpp"
  34 #include "oops/oop.inline.hpp"
  35 #include "prims/jvmtiThreadState.hpp"
  36 #include "runtime/frame.inline.hpp"
  37 #include "runtime/handles.inline.hpp"
  38 #include "runtime/monitorChunk.hpp"
  39 #include "runtime/sharedRuntime.hpp"
  40 #include "runtime/vframe.hpp"
  41 #include "runtime/vframeArray.hpp"
  42 #include "runtime/vframe_hp.hpp"
  43 #include "utilities/events.hpp"
  44 #ifdef COMPILER2
  45 #include "opto/runtime.hpp"
  46 #endif
  47 
  48 int vframeArrayElement:: bci(void) const { return (_bci == SynchronizationEntryBCI ? 0 : _bci); }
  49 
  50 void vframeArrayElement::free_monitors(JavaThread* jt) {
  51   if (_monitors != NULL) {
  52      MonitorChunk* chunk = _monitors;
  53      _monitors = NULL;
  54      jt->remove_monitor_chunk(chunk);
  55      delete chunk;
  56   }


 473 
 474 }
 475 
 476 int vframeArrayElement::on_stack_size(int callee_parameters,
 477                                       int callee_locals,
 478                                       bool is_top_frame,
 479                                       int popframe_extra_stack_expression_els) const {
 480   assert(method()->max_locals() == locals()->size(), "just checking");
 481   int locks = monitors() == NULL ? 0 : monitors()->number_of_monitors();
 482   int temps = expressions()->size();
 483   return Interpreter::size_activation(method()->max_stack(),
 484                                       temps + callee_parameters,
 485                                       popframe_extra_stack_expression_els,
 486                                       locks,
 487                                       callee_parameters,
 488                                       callee_locals,
 489                                       is_top_frame);
 490 }
 491 
 492 
 493 intptr_t* vframeArray::unextended_sp() const {
 494   return _original.unextended_sp();
 495 }
 496 
 497 vframeArray* vframeArray::allocate(JavaThread* thread, int frame_size, GrowableArray<compiledVFrame*>* chunk,
 498                                    RegisterMap *reg_map, frame sender, frame caller, frame self,
 499                                    bool realloc_failures) {
 500 
 501   // Allocate the vframeArray
 502   vframeArray * result = (vframeArray*) AllocateHeap(sizeof(vframeArray) + // fixed part
 503                                                      sizeof(vframeArrayElement) * (chunk->length() - 1), // variable part
 504                                                      mtCompiler);
 505   result->_frames = chunk->length();
 506   result->_owner_thread = thread;
 507   result->_sender = sender;
 508   result->_caller = caller;
 509   result->_original = self;
 510   result->set_unroll_block(NULL); // initialize it
 511   result->fill_in(thread, frame_size, chunk, reg_map, realloc_failures);
 512   return result;
 513 }
 514 
 515 void vframeArray::fill_in(JavaThread* thread,


< prev index next >