Beispiel #1
0
  void ObjectHeader::clear_remember() {
    for(;;) {
      if(inflated_header_p()) {
        inflated_header()->clear_remember();
        return;
      } else {
        HeaderWord orig    = header;
        orig.f.inflated    = 0;
        HeaderWord new_val = orig;
        new_val.f.Remember = 0;

        if(header.atomic_set(orig, new_val)) return;
      }
    }
  }
Beispiel #2
0
  void ObjectHeader::set_zone(gc_zone zone) {
    for(;;) {
      if(inflated_header_p()) {
        inflated_header()->set_zone(zone);
        return;
      } else {
        HeaderWord orig    = header;
        orig.f.inflated    = 0;
        HeaderWord new_val = orig;
        new_val.f.zone     = zone;

        if(header.atomic_set(orig, new_val)) return;
      }
    }
  }
Beispiel #3
0
  void ObjectHeader::set_lock_contended() {
    for(;;) {
      if(inflated_header_p()) {
        inflated_header()->set_lock_contended();
        return;
      } else {
        HeaderWord orig    = header;
        orig.f.inflated    = 0;
        HeaderWord new_val = orig;
        new_val.f.LockContended = 1;

        if(header.atomic_set(orig, new_val)) return;
      }
    }
  }
Beispiel #4
0
  void ObjectHeader::unpin() {
    for(;;) {
      if(inflated_header_p()) {
        inflated_header()->unpin();
        return;
      } else {
        HeaderWord orig    = header;
        orig.f.inflated    = 0;
        HeaderWord new_val = orig;
        new_val.f.Pinned   = 0;

        if(header.atomic_set(orig, new_val)) return;
      }
    }
  }
Beispiel #5
0
  void ObjectHeader::set_in_immix() {
    for(;;) {
      if(inflated_header_p()) {
        inflated_header()->set_in_immix();
        return;
      } else {
        HeaderWord orig    = header;
        orig.f.inflated    = 0;
        HeaderWord new_val = orig;
        new_val.f.InImmix  = 1;

        if(header.atomic_set(orig, new_val)) return;
      }
    }
  }
Beispiel #6
0
  void ObjectHeader::mark(unsigned int which) {
    for(;;) {
      if(inflated_header_p()) {
        inflated_header()->mark(which);
        return;
      } else {
        HeaderWord orig    = header;
        orig.f.inflated    = 0;
        HeaderWord new_val = orig;
        new_val.f.Marked   = which;

        if(header.atomic_set(orig, new_val)) return;
      }
    }
  }
Beispiel #7
0
  void ObjectHeader::set_age(unsigned int age) {
    for(;;) {
      if(inflated_header_p()) {
        inflated_header()->set_age(age);
        return;
      } else {
        HeaderWord orig    = header;
        orig.f.inflated    = 0;
        HeaderWord new_val = orig;
        new_val.f.age      = age;

        if(header.atomic_set(orig, new_val)) return;
      }
    }
  }
Beispiel #8
0
    void set_forward(ObjectHeader* fwd) {
      // If the header is inflated, repoint it.
      if(inflated_header_p()) {
        InflatedHeader* ih = deflate_header();

        ih->set_object(fwd);
        fwd->set_inflated_header(ih);
      }

      flags().Forwarded = 1;

      // DO NOT USE klass() because we need to get around the
      // write barrier!
      ivars_ = reinterpret_cast<Object*>(fwd);
    }
Beispiel #9
0
  void ObjectHeader::clear_handle(STATE) {
    for(;;) {
      if(inflated_header_p()) {
        inflated_header()->set_handle(state, NULL);
        return;
      } else {
        HeaderWord orig = header;
        orig.f.meaning  = eAuxWordHandle;

        HeaderWord new_val = orig;
        new_val.f.meaning  = eAuxWordEmpty;
        new_val.f.aux_word = 0;

        if(header.atomic_set(orig, new_val)) return;
      }
    }
  }
Beispiel #10
0
  bool ObjectHeader::pin() {
    // Can't pin young objects!
    if(young_object_p()) return false;

    for(;;) {
      if(inflated_header_p()) {
        return inflated_header()->pin();
      } else {
        HeaderWord orig    = header;
        orig.f.inflated    = 0;
        HeaderWord new_val = orig;
        new_val.f.Pinned   = 1;

        if(header.atomic_set(orig, new_val)) return true;
      }
    }
    return true;
  }
Beispiel #11
0
 ObjectFlags& flags() {
   if(inflated_header_p()) return inflated_header()->flags();
   return header.f;
 }
Beispiel #12
0
 ObjectFlags& flags() const {
   if(inflated_header_p()) return inflated_header()->flags();
   return const_cast<ObjectFlags&>(header.f);
 }