// This function fixes the dummy object allocated by FileDescriptor::allocate() // before the Universe was fully initialized. void JarFileParser::fix_bootstrap() { const int max = MAX_CACHED_PARSERS < MaxCachedJarParsers ? MAX_CACHED_PARSERS : MaxCachedJarParsers; for (int i=0; i<max; i++) { int ref = _cached_parsers[0]; if (ref >= 0) { JarFileParser::Raw parser = ObjectHeap::get_global_ref_object(ref); GUARANTEE(parser.not_null(), "must not be GC'ed yet!"); OopDesc** desc = (OopDesc**)parser().file_descriptor(); OopDesc* n = Universe::file_descriptor_class()->prototypical_near(); // Make it a real FileDescriptor object. oop_write_barrier(desc, n); // This line tests that n is now really a FileDescriptor. FileDescriptor::Raw try_it = parser().file_descriptor(); (void)try_it; } } // We still haven't put the fixed up FileDescriptor into the list of // finalizable objects yet. It's easier just to flush the cache now // and close the FileDescriptors now ... this code is used only in // non-product mode, so there's no need to make it fancy. flush_caches(); }
KNIEXPORT void KNI_SetObjectField(jobject objectHandle, jfieldID fieldID, jobject fromHandle) { OopDesc* object = kni_read_handle(objectHandle); GUARANTEE(object != 0, "null argument to KNI_SetObjectField"); oop_write_barrier(object->obj_field_addr((int)fieldID), kni_read_handle(fromHandle)); }
void set_next(FinalizerConsDesc* n) { oop_write_barrier((OopDesc**) next_addr(), n); }
void set_referent(OopDesc* r) { oop_write_barrier(referent_addr(), r); }
void reinitialize(OopDesc* klass) { GUARANTEE(klass != NULL, "Cannot set class of object to NULL"); oop_write_barrier(&this->_klass, klass); }