< prev index next >

src/hotspot/share/runtime/stackValue.cpp

Print this page

230   if (!reg_map->in_cont()) {
231     address value_addr = loc.is_register()
232       // Value was in a callee-save register
233       ? reg_map->location(VMRegImpl::as_VMReg(loc.register_number()), fr->sp())
234       // Else value was directly saved on the stack. The frame's original stack pointer,
235       // before any extension by its callee (due to Compiler1 linkage on SPARC), must be used.
236       : ((address)fr->unextended_sp()) + loc.stack_offset();
237 
238     assert(value_addr == NULL || reg_map->thread() == NULL || reg_map->thread()->is_in_usable_stack(value_addr), INTPTR_FORMAT, p2i(value_addr));
239     return value_addr;
240   }
241 
242   address value_addr = loc.is_register()
243     ? reg_map->as_RegisterMap()->stack_chunk()->reg_to_location(*fr, reg_map->as_RegisterMap(), VMRegImpl::as_VMReg(loc.register_number()))
244     : reg_map->as_RegisterMap()->stack_chunk()->usp_offset_to_location(*fr, loc.stack_offset());
245 
246   assert(value_addr == NULL || Continuation::is_in_usable_stack(value_addr, reg_map->as_RegisterMap()) || (reg_map->thread() != NULL && reg_map->thread()->is_in_usable_stack(value_addr)), INTPTR_FORMAT, p2i(value_addr));
247   return value_addr;
248 }
249 
250 BasicLock* StackValue::resolve_monitor_lock(const frame* fr, Location location) {
251   assert(location.is_stack(), "for now we only look at the stack");
252   int word_offset = location.stack_offset() / wordSize;
253   // (stack picture)
254   // high: [     ]  word_offset + 1
255   // low   [     ]  word_offset
256   //
257   // sp->  [     ]  0
258   // the word_offset is the distance from the stack pointer to the lowest address
259   // The frame's original stack pointer, before any extension by its callee
260   // (due to Compiler1 linkage on SPARC), must be used.
261   return (BasicLock*) (fr->unextended_sp() + word_offset);
262 }
263 
264 
265 #ifndef PRODUCT
266 
267 void StackValue::print_on(outputStream* st) const {
268   switch(_type) {
269     case T_INT:
270       st->print("%d (int) %f (float) %x (hex)",  *(int *)&_integer_value, *(float *)&_integer_value,  *(int *)&_integer_value);
271       break;
272 
273     case T_OBJECT:
274       if (_handle_value() != NULL) {
275         _handle_value()->print_value_on(st);
276       } else {
277         st->print("NULL");
278       }
279       st->print(" <" INTPTR_FORMAT ">", p2i(_handle_value()));
280       break;
281 
282     case T_CONFLICT:
283      st->print("conflict");
284      break;

230   if (!reg_map->in_cont()) {
231     address value_addr = loc.is_register()
232       // Value was in a callee-save register
233       ? reg_map->location(VMRegImpl::as_VMReg(loc.register_number()), fr->sp())
234       // Else value was directly saved on the stack. The frame's original stack pointer,
235       // before any extension by its callee (due to Compiler1 linkage on SPARC), must be used.
236       : ((address)fr->unextended_sp()) + loc.stack_offset();
237 
238     assert(value_addr == NULL || reg_map->thread() == NULL || reg_map->thread()->is_in_usable_stack(value_addr), INTPTR_FORMAT, p2i(value_addr));
239     return value_addr;
240   }
241 
242   address value_addr = loc.is_register()
243     ? reg_map->as_RegisterMap()->stack_chunk()->reg_to_location(*fr, reg_map->as_RegisterMap(), VMRegImpl::as_VMReg(loc.register_number()))
244     : reg_map->as_RegisterMap()->stack_chunk()->usp_offset_to_location(*fr, loc.stack_offset());
245 
246   assert(value_addr == NULL || Continuation::is_in_usable_stack(value_addr, reg_map->as_RegisterMap()) || (reg_map->thread() != NULL && reg_map->thread()->is_in_usable_stack(value_addr)), INTPTR_FORMAT, p2i(value_addr));
247   return value_addr;
248 }
249 















250 #ifndef PRODUCT
251 
252 void StackValue::print_on(outputStream* st) const {
253   switch(_type) {
254     case T_INT:
255       st->print("%d (int) %f (float) %x (hex)",  *(int *)&_integer_value, *(float *)&_integer_value,  *(int *)&_integer_value);
256       break;
257 
258     case T_OBJECT:
259       if (_handle_value() != NULL) {
260         _handle_value()->print_value_on(st);
261       } else {
262         st->print("NULL");
263       }
264       st->print(" <" INTPTR_FORMAT ">", p2i(_handle_value()));
265       break;
266 
267     case T_CONFLICT:
268      st->print("conflict");
269      break;
< prev index next >