< prev index next >

src/hotspot/share/runtime/vframeArray.cpp

Print this page
rev 60252 : imported patch 8249192-monitorinfo-naked-oops


  53      _monitors = NULL;
  54      jt->remove_monitor_chunk(chunk);
  55      delete chunk;
  56   }
  57 }
  58 
  59 void vframeArrayElement::fill_in(compiledVFrame* vf, bool realloc_failures) {
  60 
  61 // Copy the information from the compiled vframe to the
  62 // interpreter frame we will be creating to replace vf
  63 
  64   _method = vf->method();
  65   _bci    = vf->raw_bci();
  66   _reexecute = vf->should_reexecute();
  67 #ifdef ASSERT
  68   _removed_monitors = false;
  69 #endif
  70 
  71   int index;
  72 



  73   // Get the monitors off-stack
  74 
  75   GrowableArray<MonitorInfo*>* list = vf->monitors();
  76   if (list->is_empty()) {
  77     _monitors = NULL;
  78   } else {
  79 
  80     // Allocate monitor chunk
  81     _monitors = new MonitorChunk(list->length());
  82     vf->thread()->add_monitor_chunk(_monitors);
  83 
  84     // Migrate the BasicLocks from the stack to the monitor chunk
  85     for (index = 0; index < list->length(); index++) {
  86       MonitorInfo* monitor = list->at(index);
  87       assert(!monitor->owner_is_scalar_replaced() || realloc_failures, "object should be reallocated already");
  88       BasicObjectLock* dest = _monitors->at(index);
  89       if (monitor->owner_is_scalar_replaced()) {
  90         dest->set_obj(NULL);
  91       } else {
  92         assert(monitor->owner() == NULL || (!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern()), "object must be null or locked, and unbiased");
  93         dest->set_obj(monitor->owner());
  94         monitor->lock()->move_to(monitor->owner(), dest->lock());

  95       }
  96     }
  97   }
  98 
  99   // Convert the vframe locals and expressions to off stack
 100   // values. Because we will not gc all oops can be converted to
 101   // intptr_t (i.e. a stack slot) and we are fine. This is
 102   // good since we are inside a HandleMark and the oops in our
 103   // collection would go away between packing them here and
 104   // unpacking them in unpack_on_stack.
 105 
 106   // First the locals go off-stack
 107 
 108   // FIXME this seems silly it creates a StackValueCollection
 109   // in order to get the size to then copy them and
 110   // convert the types to intptr_t size slots. Seems like it
 111   // could do it in place... Still uses less memory than the
 112   // old way though
 113 
 114   StackValueCollection *locs = vf->locals();




  53      _monitors = NULL;
  54      jt->remove_monitor_chunk(chunk);
  55      delete chunk;
  56   }
  57 }
  58 
  59 void vframeArrayElement::fill_in(compiledVFrame* vf, bool realloc_failures) {
  60 
  61 // Copy the information from the compiled vframe to the
  62 // interpreter frame we will be creating to replace vf
  63 
  64   _method = vf->method();
  65   _bci    = vf->raw_bci();
  66   _reexecute = vf->should_reexecute();
  67 #ifdef ASSERT
  68   _removed_monitors = false;
  69 #endif
  70 
  71   int index;
  72 
  73   {
  74     ResourceMark rm;
  75     HandleMark hm;
  76     // Get the monitors off-stack
  77 
  78     GrowableArray<MonitorInfo*>* list = vf->monitors();
  79     if (list->is_empty()) {
  80       _monitors = NULL;
  81     } else {
  82 
  83       // Allocate monitor chunk
  84       _monitors = new MonitorChunk(list->length());
  85       vf->thread()->add_monitor_chunk(_monitors);
  86 
  87       // Migrate the BasicLocks from the stack to the monitor chunk
  88       for (index = 0; index < list->length(); index++) {
  89         MonitorInfo* monitor = list->at(index);
  90         assert(!monitor->owner_is_scalar_replaced() || realloc_failures, "object should be reallocated already");
  91         BasicObjectLock* dest = _monitors->at(index);
  92         if (monitor->owner_is_scalar_replaced()) {
  93           dest->set_obj(NULL);
  94         } else {
  95           assert(monitor->owner() == NULL || (!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern()), "object must be null or locked, and unbiased");
  96           dest->set_obj(monitor->owner());
  97           monitor->lock()->move_to(monitor->owner(), dest->lock());
  98         }
  99       }
 100     }
 101   }
 102 
 103   // Convert the vframe locals and expressions to off stack
 104   // values. Because we will not gc all oops can be converted to
 105   // intptr_t (i.e. a stack slot) and we are fine. This is
 106   // good since we are inside a HandleMark and the oops in our
 107   // collection would go away between packing them here and
 108   // unpacking them in unpack_on_stack.
 109 
 110   // First the locals go off-stack
 111 
 112   // FIXME this seems silly it creates a StackValueCollection
 113   // in order to get the size to then copy them and
 114   // convert the types to intptr_t size slots. Seems like it
 115   // could do it in place... Still uses less memory than the
 116   // old way though
 117 
 118   StackValueCollection *locs = vf->locals();


< prev index next >