hotspot/src/share/vm/opto/compile.cpp
changeset 24018 77b156916bab
parent 24002 4e6a72032a99
child 24342 34e1384b02db
equal deleted inserted replaced
24016:2927072ed5fb 24018:77b156916bab
   438   int words = _frame_slots >> shift;
   438   int words = _frame_slots >> shift;
   439   assert( words << shift == _frame_slots, "frame size must be properly aligned in LP64" );
   439   assert( words << shift == _frame_slots, "frame size must be properly aligned in LP64" );
   440   return words;
   440   return words;
   441 }
   441 }
   442 
   442 
       
   443 // To bang the stack of this compiled method we use the stack size
       
   444 // that the interpreter would need in case of a deoptimization. This
       
   445 // removes the need to bang the stack in the deoptimization blob which
       
   446 // in turn simplifies stack overflow handling.
       
   447 int Compile::bang_size_in_bytes() const {
       
   448   return MAX2(_interpreter_frame_size, frame_size_in_bytes());
       
   449 }
       
   450 
   443 // ============================================================================
   451 // ============================================================================
   444 //------------------------------CompileWrapper---------------------------------
   452 //------------------------------CompileWrapper---------------------------------
   445 class CompileWrapper : public StackObj {
   453 class CompileWrapper : public StackObj {
   446   Compile *const _compile;
   454   Compile *const _compile;
   447  public:
   455  public:
   662                   _inlining_progress(false),
   670                   _inlining_progress(false),
   663                   _inlining_incrementally(false),
   671                   _inlining_incrementally(false),
   664                   _print_inlining_list(NULL),
   672                   _print_inlining_list(NULL),
   665                   _print_inlining_stream(NULL),
   673                   _print_inlining_stream(NULL),
   666                   _print_inlining_idx(0),
   674                   _print_inlining_idx(0),
   667                   _preserve_jvm_state(0) {
   675                   _preserve_jvm_state(0),
       
   676                   _interpreter_frame_size(0) {
   668   C = this;
   677   C = this;
   669 
   678 
   670   CompileWrapper cw(this);
   679   CompileWrapper cw(this);
   671 #ifndef PRODUCT
   680 #ifndef PRODUCT
   672   if (TimeCompiler2) {
   681   if (TimeCompiler2) {
   967     _inlining_incrementally(false),
   976     _inlining_incrementally(false),
   968     _print_inlining_list(NULL),
   977     _print_inlining_list(NULL),
   969     _print_inlining_stream(NULL),
   978     _print_inlining_stream(NULL),
   970     _print_inlining_idx(0),
   979     _print_inlining_idx(0),
   971     _preserve_jvm_state(0),
   980     _preserve_jvm_state(0),
   972     _allowed_reasons(0) {
   981     _allowed_reasons(0),
       
   982     _interpreter_frame_size(0) {
   973   C = this;
   983   C = this;
   974 
   984 
   975 #ifndef PRODUCT
   985 #ifndef PRODUCT
   976   TraceTime t1(NULL, &_t_totalCompilation, TimeCompiler, false);
   986   TraceTime t1(NULL, &_t_totalCompilation, TimeCompiler, false);
   977   TraceTime t2(NULL, &_t_stubCompilation, TimeCompiler, false);
   987   TraceTime t2(NULL, &_t_stubCompilation, TimeCompiler, false);
  3076     if (i < cnt) {
  3086     if (i < cnt) {
  3077       // Place all non-visited non-null inputs onto stack
  3087       // Place all non-visited non-null inputs onto stack
  3078       Node* m = n->in(i);
  3088       Node* m = n->in(i);
  3079       ++i;
  3089       ++i;
  3080       if (m != NULL && !frc._visited.test_set(m->_idx)) {
  3090       if (m != NULL && !frc._visited.test_set(m->_idx)) {
  3081         if (m->is_SafePoint() && m->as_SafePoint()->jvms() != NULL)
  3091         if (m->is_SafePoint() && m->as_SafePoint()->jvms() != NULL) {
       
  3092           // compute worst case interpreter size in case of a deoptimization
       
  3093           update_interpreter_frame_size(m->as_SafePoint()->jvms()->interpreter_frame_size());
       
  3094 
  3082           sfpt.push(m);
  3095           sfpt.push(m);
       
  3096         }
  3083         cnt = m->req();
  3097         cnt = m->req();
  3084         nstack.push(n, i); // put on stack parent and next input's index
  3098         nstack.push(n, i); // put on stack parent and next input's index
  3085         n = m;
  3099         n = m;
  3086         i = 0;
  3100         i = 0;
  3087       }
  3101       }