void ObjArrayKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) { cm->follow_klass(this); if (UseCompressedOops) { oop_pc_follow_contents_specialized<narrowOop>(objArrayOop(obj), 0, cm); } else { oop_pc_follow_contents_specialized<oop>(objArrayOop(obj), 0, cm); } }
void objArrayKlass::oop_follow_contents(oop obj) { // Retrieve length information since header information mutates the object oop* base = objArrayOop(obj)->objs(1); oop* end = base + objArrayOop(obj)->length(); // header + instance variables memOopKlass::oop_follow_contents(obj); // indexables while (base < end) MarkSweep::reverse_and_push(base++); }
void bootstrap::parse_file() { // Check version number int version_number = get_integer(); if (version_number > 100) { _new_format = true; lprintf(", n"); version_number -= 100; } else { _new_format = false; } if (Bytecodes::version() == version_number) { } else { lprintf("\n"); lprintf("Bytecode version conflict\n"); lprintf(" excpected: %d\n", Bytecodes::version()); lprintf(" received: %d\n", version_number); exit(-1); } Universe::_systemDictionaryObj = objArrayOop(get_object()); nilObj = memOop(get_object()); trueObj = memOop(get_object()); falseObj = memOop(get_object()); smiKlassObj = klassOop(get_object()); Universe::_memOopKlassObj = klassOop(get_object()); Universe::_objArrayKlassObj = klassOop(get_object()); Universe::_byteArrayKlassObj = klassOop(get_object()); symbolKlassObj = klassOop(get_object()); doubleKlassObj = klassOop(get_object()); Universe::_methodKlassObj = klassOop(get_object()); Universe::_associationKlassObj = klassOop(get_object()); zeroArgumentBlockKlassObj = klassOop(get_object()); oneArgumentBlockKlassObj = klassOop(get_object()); twoArgumentBlockKlassObj = klassOop(get_object()); threeArgumentBlockKlassObj = klassOop(get_object()); fourArgumentBlockKlassObj = klassOop(get_object()); fiveArgumentBlockKlassObj = klassOop(get_object()); sixArgumentBlockKlassObj = klassOop(get_object()); sevenArgumentBlockKlassObj = klassOop(get_object()); eightArgumentBlockKlassObj = klassOop(get_object()); nineArgumentBlockKlassObj = klassOop(get_object()); contextKlassObj = klassOop(get_object()); Universe::_asciiCharacters = objArrayOop(get_object()); Universe::_vframeKlassObj = HasActivationClass ? klassOop(get_object()) : klassOop(nilObj); klassOop platform_klass = klassOop(Universe::find_global(os::platform_class_name())); associationOop assoc = Universe::find_global_association("Platform"); if (platform_klass != NULL && assoc != NULL) { assoc->set_value(platform_klass); } }
void objArrayKlass::oop_oop_iterate(oop obj, OopClosure* blk) { // Retrieve length information in case the iterator mutates the object oop* p = objArrayOop(obj)->objs(0); int len = objArrayOop(obj)->length(); // header + instance variables memOopKlass::oop_oop_iterate(obj, blk); // indexables blk->do_oop(p++); for (int index = 1; index <= len; index++) { blk->do_oop(p++); } }
static objArrayOop allocate(int size) { oop first = free_list()->obj_at(size - 1); if (first == nilObj) { return objArrayKlass::allocate_tenured_pic(size*2); } free_list()->obj_at_put(size - 1, objArrayOop(first)->obj_at(1)); objArrayOop result = objArrayOop(first); assert(result->is_objArray(), "must be object array"); assert(result->is_old(), "must be tenured"); assert(result->length() == size * 2, "checking size"); return result; }
void objArrayKlass::oop_layout_iterate(oop obj, ObjectLayoutClosure* blk) { // Retrieve length information in case the iterator mutates the object oop* p = objArrayOop(obj)->objs(0); int len = objArrayOop(obj)->length(); // header + instance variables memOopKlass::oop_layout_iterate(obj, blk); // indexables blk->do_oop("length", p++); blk->begin_indexables(); for (int index = 1; index <= len; index++) { blk->do_indexable_oop(index, p++); } blk->end_indexables(); }
objArrayOop InterpretedIC::pic_array() { assert(send_type() == Bytecodes::polymorphic_send, "Must be a polymorphic send site"); objArrayOop result = objArrayOop(second_word()); assert(result->is_objArray(), "interpreter pic must be object array"); assert(result->length() >= 4, "pic should contain at least two entries"); return result; }
size_t G1CMObjArrayProcessor::process_slice(oop obj) { HeapWord* const decoded_address = decode_array_slice(obj); // Find the start address of the objArrayOop. // Shortcut the BOT access if the given address is from a humongous object. The BOT // slide is fast enough for "smaller" objects in non-humongous regions, but is slower // than directly using heap region table. G1CollectedHeap* g1h = G1CollectedHeap::heap(); HeapRegion* r = g1h->heap_region_containing(decoded_address); HeapWord* const start_address = r->is_humongous() ? r->humongous_start_region()->bottom() : g1h->block_start(decoded_address); assert(oop(start_address)->is_objArray(), "Address " PTR_FORMAT " does not refer to an object array ", p2i(start_address)); assert(start_address < decoded_address, "Object start address " PTR_FORMAT " must be smaller than decoded address " PTR_FORMAT, p2i(start_address), p2i(decoded_address)); objArrayOop objArray = objArrayOop(start_address); size_t already_scanned = decoded_address - start_address; size_t remaining = objArray->size() - already_scanned; return process_array_slice(objArray, decoded_address, remaining); }
void InterpretedIC::clear() { if (is_empty()) return; if (send_type() == Bytecodes::polymorphic_send) { // recycle PIC assert(second_word()->is_objArray(), "must be a pic"); Interpreter_PICs::deallocate(objArrayOop(second_word())); } set(Bytecodes::original_send_code_for(send_code()), oop(selector()), smiOop_zero); }
int objArrayKlass::oop_scavenge_tenured_contents(oop obj) { // header + instance variables memOopKlass::oop_scavenge_tenured_contents(obj); // indexables objArrayOop o = objArrayOop(obj); oop* base = o->objs(1); oop* end = base + o->length(); while (base < end) scavenge_tenured_oop(base++); return object_size(o->length()); }
objArrayOop HCodeBuffer::oops() { BlockScavenge bs; Klass* klass = Universe::objArrayKlassObj()->klass_part(); objArrayOop result = objArrayOop(klass->allocateObjectSize(oopLength())); for (int index = 0; index < oopLength(); index++) result->obj_at_put(index + 1, _oops->at(index)); return result; }
void ObjArrayKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) { assert(obj->is_array(), "obj must be array"); objArrayOop a = objArrayOop(obj); if (Devirtualizer<nv>::do_metadata(closure)) { Devirtualizer<nv>::do_klass(closure, a->klass()); } oop_oop_iterate_elements_bounded<nv>(a, closure, mr); }
void ObjArrayKlass::oop_oop_iterate_range(oop obj, OopClosureType* closure, int start, int end) { assert(obj->is_array(), "obj must be array"); objArrayOop a = objArrayOop(obj); if (UseCompressedOops) { oop_oop_iterate_range_specialized<nv, narrowOop>(a, closure, start, end); } else { oop_oop_iterate_range_specialized<nv, oop>(a, closure, start, end); } }
objArrayOop oopFactory::new_objArray(GrowableArray<oop>* array) { BlockScavenge bs; FlagSetting(processSemaphore, true); int size = array->length(); objArrayKlass* ok = (objArrayKlass*) Universe::objArrayKlassObj()->klass_part(); objArrayOop result = objArrayOop(ok->allocateObjectSize(size)); for (int index = 1; index <= size; index++) { result->obj_at_put(index, array->at(index-1)); } return result; }
void objArrayKlass::oop_short_print_on(oop obj, outputStream* st) { const int MaxPrintLen = 255; // to prevent excessive output -Urs assert_objArray(obj,"Argument must be objArray"); objArrayOop array = objArrayOop(obj); int len = array->length(); int n = min(MaxElementPrintSize, len); st->print("'"); for(int index = 1; index <= n && st->position() < MaxPrintLen; index++) { array->obj_at(index)->print_value_on(st); st->print(", "); } if (n < len) st->print("... "); else st->print("' "); oop_print_value_on(obj, st); }
int ObjArrayKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { assert (obj->is_array(), "obj must be array"); objArrayOop a = objArrayOop(obj); // Get size before changing pointers. // Don't call size() or oop_size() since that is a virtual call. int size = a->object_size(); if (Devirtualizer<nv>::do_metadata(closure)) { Devirtualizer<nv>::do_klass(closure, obj->klass()); } oop_oop_iterate_elements<nv>(a, closure); return size; }
int ObjArrayKlass::oop_oop_iterate_range(oop obj, OopClosureType* closure, int start, int end) { assert(obj->is_array(), "obj must be array"); objArrayOop a = objArrayOop(obj); // Get size before changing pointers. // Don't call size() or oop_size() since that is a virtual call int size = a->object_size(); if (UseCompressedOops) { oop_oop_iterate_range_specialized<nv, narrowOop>(a, closure, start, end); } else { oop_oop_iterate_range_specialized<nv, oop>(a, closure, start, end); } return size; }
void objArrayKlass::objarray_follow_contents(oop obj, int index) { objArrayOop a = objArrayOop(obj); const size_t len = size_t(a->length()); const size_t beg_index = size_t(index); assert(beg_index < len || len == 0, "index too large"); const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride); const size_t end_index = beg_index + stride; T* const base = (T*)a->base(); T* const beg = base + beg_index; T* const end = base + end_index; // Push the non-NULL elements of the next stride on the marking stack. for (T* e = beg; e < end; e++) { MarkSweep::mark_and_push<T>(e); } if (end_index < len) { MarkSweep::push_objarray(a, end_index); // Push the continuation. } }
objArrayOop as_objArray() { assert(Handles::oop_at(index)->is_objArray(), "type check"); return objArrayOop(Handles::oop_at(index)); }
parser->add_dcmd_option(argument); } } /* * Will Fill in a java object array with alternating names of parsed command line options and * the value that has been parsed for it: * { name, value, name, value ... } * This can then be checked from java. */ WB_ENTRY(jobjectArray, WB_ParseCommandLine(JNIEnv* env, jobject o, jstring j_cmdline, jobjectArray arguments)) ResourceMark rm; DCmdParser parser; const char* c_cmdline = java_lang_String::as_utf8_string(JNIHandles::resolve(j_cmdline)); objArrayOop argumentArray = objArrayOop(JNIHandles::resolve_non_null(arguments)); objArrayHandle argumentArray_ah(THREAD, argumentArray); int length = argumentArray_ah->length(); for (int i = 0; i < length; i++) { oop argument_oop = argumentArray_ah->obj_at(i); fill_in_parser(&parser, argument_oop); } CmdLine cmdline(c_cmdline, strlen(c_cmdline), true); parser.parse(&cmdline,',',CHECK_NULL); Klass* k = SystemDictionary::Object_klass(); objArrayOop returnvalue_array = oopFactory::new_objArray(k, parser.num_arguments() * 2, CHECK_NULL); objArrayHandle returnvalue_array_ah(THREAD, returnvalue_array);
objArrayOop oopFactory::new_objArray(int size) { objArrayKlass* ok = (objArrayKlass*) Universe::objArrayKlassObj()->klass_part(); return objArrayOop(ok->allocateObjectSize(size)); }
// constructor friend objArrayOop as_objArrayOop(void* p) { return objArrayOop(as_memOop(p)); }
void InterpretedIC_Iterator::init_iteration() { _pic = NULL; _index = 0; // determine initial state switch (_ic->send_type()) { case Bytecodes::interpreted_send: if (_ic->is_empty()) { // anamorphic call site (has never been executed => no type information) _number_of_targets = 0; _info = anamorphic; } else { // monomorphic call site _number_of_targets = 1; _info = monomorphic; set_klass(_ic->second_word()); set_method(_ic->first_word()); } break; case Bytecodes::compiled_send : _number_of_targets = 1; _info = monomorphic; set_klass(_ic->second_word()); assert(_ic->first_word()->is_smi(), "must have jumpTableEntry"); set_method(_ic->first_word()); assert(is_compiled(), "bad type"); break; case Bytecodes::accessor_send : // fall through case Bytecodes::primitive_send : _number_of_targets = 1; _info = monomorphic; set_klass(_ic->second_word()); set_method(_ic->first_word()); assert(is_interpreted(), "bad type"); break; case Bytecodes::megamorphic_send: // no type information stored _number_of_targets = 0; _info = megamorphic; break; case Bytecodes::polymorphic_send: // information on many types _pic = objArrayOop(_ic->second_word()); _number_of_targets = _pic->length() / 2; _info = polymorphic; set_klass(_pic->obj_at(2)); set_method(_pic->obj_at(1)); break; case Bytecodes::predicted_send: if (_ic->is_empty() || _ic->second_word() == smiKlassObj) { _number_of_targets = 1; _info = monomorphic; } else { _number_of_targets = 2; _info = polymorphic; } set_klass(smiKlassObj); set_method(interpreter_normal_lookup(smiKlassObj, selector()).value()); assert(_method != NULL && _method->is_mem(), "this method must be there"); break; default: ShouldNotReachHere(); } assert((number_of_targets() > 1) == (_info == polymorphic), "inconsistency"); }
size_t G1CMObjArrayProcessor::process_obj(oop obj) { assert(should_be_sliced(obj), "Must be an array object %d and large " SIZE_FORMAT, obj->is_objArray(), (size_t)obj->size()); return process_array_slice(objArrayOop(obj), (HeapWord*)obj, (size_t)objArrayOop(obj)->size()); }