예제 #1
0
void PrintObjectClosure::do_object(memOop obj) {
  this->obj = obj;
  obj->print_value();
  if (WizardMode) {
    st->print(" (size = %d)", obj->size());
  }
  st->cr();
}
예제 #2
0
bool rSet::is_object_dirty(memOop obj) {
  assert(!obj->is_new(), "just checking");
  char* current_byte = byte_for(obj->addr());
  char* end_byte     = byte_for(obj->addr() + obj->size());
  while (current_byte <= end_byte) {
    if (*current_byte == 0) return true;
    current_byte++;
  }
  return false;
}
예제 #3
0
int rSet::get_size(memOop obj) {
  unsigned char* p = (unsigned char*) byte_for(obj->addr());
  unsigned char h = *p++;
  if (h <= lim_0 + 1) return h + lim_0;
  if (h == lim_0 + 2) return (*(unsigned char*)  p) + lim_1;
  if (h == lim_0 + 3) return (*(unsigned short*) p) + lim_2;
  if (h == lim_0 + 4) return (*(unsigned int*)   p) + lim_3;
  ShouldNotReachHere();
  return 0;
}
예제 #4
0
void rSet::print_set_for_object(memOop obj) {
  std->print("Remember set for 0x%lx ", obj);
  obj->print_value();
  std->cr();
  if (obj->is_new()) {
    std->print_cr(" object is in new space!");
  } else {
    std->sp();
    char* current_byte = byte_for(obj->addr());
    char* end_byte     = byte_for(obj->addr() + obj->size());
    while (current_byte <= end_byte) {
      if (*current_byte) {
        std->print("_");
      } else {
        std->print("*");
      }
      current_byte++;
    }
    std->cr();
  }
}
예제 #5
0
void rSet::set_size(memOop obj, int size) {
  unsigned char* p = (unsigned char*) byte_for(obj->addr());
  assert(size >= lim_0, "size must be >= max_age");
  if (size < lim_1) { 		// use 1 byte
    *p = (unsigned char) (size - lim_0);
  } else if (size < lim_2) { 	// use 1 + 1 bytes
    *p++ = lim_0 + 2;
    *p   = (unsigned char) (size - lim_1);
  } else if (size < lim_3) { 	// use 1 + 2 bytes
    *p++ = lim_0 + 3;
    *(unsigned short*)p = (unsigned short) (size - lim_2);
  } else { 			// use 1 + 4 bytes
    *p++ = lim_0 + 4;
    *(unsigned int*)p = (unsigned int) (size - lim_3);
  }
}
예제 #6
0
  void do_oop(oop* o) {
    oop obj = *o;
    if (obj->is_new()) {
      // Make sure the the_obj is in the remembered set
      if (!Universe::remembered_set->is_object_dirty(the_obj)) {
	std->cr();
        std->print_cr("New obj reference found in non dirty page.");
	std->print_cr("- object containing the reference:");
	the_obj->print();
	std->print_cr("- the referred object:");
	std->print("[0x%lx]: 0x%lx = ", o, obj);
        obj->print_value();
	std->cr();
	Universe::remembered_set->print_set_for_object(the_obj);
	warning("gc problem");
      }
    }
  }
예제 #7
0
 void do_object(memOop obj) {
   if (obj->is_block() && blockClosureOop(obj)->isCompiledBlock()) {
     blockClosureOop(obj)->deoptimize();
   }
 }