예제 #1
0
void ConstantPool::klass_at_put(int index, JavaClass* k) {
  GUARANTEE(k->is_java_class(), "sanity");
  GUARANTEE(k->obj() == Universe::class_from_id(k->class_id()), "sanity");
  tag_at_put(index, JVM_CONSTANT_Class);
  // We may have put a symbol pointer here, so clear the write barrier bit
  OopDesc** klass = obj()->obj_field_addr(offset_from_index(index));
  // another possible location for the klass is mmaped/malloced Monet bundle
  if (ObjectHeap::contains(klass)) {
    ObjectHeap::clear_bit_for(klass);
  }
  int_field_put(offset_from_index(index), k->class_id());
}
예제 #2
0
void ObjArray::iterate(OopVisitor* visitor) {
#if USE_OOP_VISITOR
  Oop::iterate(visitor);

  NamedField field("length", true);
  visitor->do_uint(&field, length_offset(), true);

  for (int index = 0; index < length(); index++) {
    IndexableField field(index, true);
    visitor->do_oop(&field, offset_from_index(index), true);
  }
#endif
}
예제 #3
0
ReturnOop ConstantPool::checked_symbol_at(int index JVM_TRAPS) {
  if (is_within_bounds(index)) {
    int offset = offset_from_index(index);
    if (ConstantTag::is_symbol(tag_value_at(index))) {
      Oop::Raw result(obj_field(offset));
      if (result().is_symbol()) {
        return result.obj();
      } else {
        return resolve_symbol_at_offset(offset JVM_NO_CHECK_AT_BOTTOM);
      }
    }
  }

  Throw::error(invalid_constant JVM_NO_CHECK_AT_BOTTOM);
  return 0;
}
예제 #4
0
void ConstantPool::resolved_static_method_at_put(int index, Oop* m) {
  tag_at_put(index, JVM_CONSTANT_ResolvedStaticMethod);
  obj_field_put(offset_from_index(index), m);
}
예제 #5
0
void ObjArray::obj_at_put(int index, OopDesc* value) {
  obj_field_put(offset_from_index(index), value);
}