本文整理汇总了C++中objArrayOop类的典型用法代码示例。如果您正苦于以下问题:C++ objArrayOop类的具体用法?C++ objArrayOop怎么用?C++ objArrayOop使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了objArrayOop类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: oop_oop_iterate_elements_specialized
void ObjArrayKlass::oop_oop_iterate_elements_specialized(objArrayOop a, OopClosureType* closure) {
T* p = (T*)a->base();
T* const end = p + a->length();
for (;p < end; p++) {
Devirtualizer<nv>::do_oop(closure, p);
}
}
示例2: extend
static objArrayOop extend(objArrayOop old_pic) {
int old_size = old_pic->length()/2;
if (old_size >= size_of_largest_interpreterPIC) return NULL;
objArrayOop result = allocate(old_size + 1);
for (int index = 1; index <= old_size*2; index++) {
result->obj_at_put(index, old_pic->obj_at(index));
}
return result;
}
示例3: compute_vtable_size_and_num_mirandas
// this function computes the vtable size (including the size needed for miranda
// methods) and the number of miranda methods in this class
// Note on Miranda methods: Let's say there is a class C that implements
// interface I. Let's say there is a method m in I that neither C nor any
// of its super classes implement (i.e there is no method of any access, with
// the same name and signature as m), then m is a Miranda method which is
// entered as a public abstract method in C's vtable. From then on it should
// treated as any other public method in C for method over-ride purposes.
void klassVtable::compute_vtable_size_and_num_mirandas(int &vtable_length,
int &num_miranda_methods,
klassOop super,
objArrayOop methods,
AccessFlags class_flags,
Handle classloader,
Symbol* classname,
objArrayOop local_interfaces,
TRAPS
) {
No_Safepoint_Verifier nsv;
// set up default result values
vtable_length = 0;
num_miranda_methods = 0;
// start off with super's vtable length
instanceKlass* sk = (instanceKlass*)super->klass_part();
vtable_length = super == NULL ? 0 : sk->vtable_length();
// go thru each method in the methods table to see if it needs a new entry
int len = methods->length();
for (int i = 0; i < len; i++) {
assert(methods->obj_at(i)->is_method(), "must be a methodOop");
methodHandle mh(THREAD, methodOop(methods->obj_at(i)));
if (needs_new_vtable_entry(mh, super, classloader, classname, class_flags, THREAD)) {
vtable_length += vtableEntry::size(); // we need a new entry
}
}
// compute the number of mirandas methods that must be added to the end
num_miranda_methods = get_num_mirandas(super, methods, local_interfaces);
vtable_length += (num_miranda_methods * vtableEntry::size());
if (Universe::is_bootstrapping() && vtable_length == 0) {
// array classes don't have their superclass set correctly during
// bootstrapping
vtable_length = Universe::base_vtable_size();
}
if (super == NULL && !Universe::is_bootstrapping() &&
vtable_length != Universe::base_vtable_size()) {
// Someone is attempting to redefine java.lang.Object incorrectly. The
// only way this should happen is from
// SystemDictionary::resolve_from_stream(), which will detect this later
// and throw a security exception. So don't assert here to let
// the exception occur.
vtable_length = Universe::base_vtable_size();
}
assert(super != NULL || vtable_length == Universe::base_vtable_size(),
"bad vtable size for class Object");
assert(vtable_length % vtableEntry::size() == 0, "bad vtable length");
assert(vtable_length >= Universe::base_vtable_size(), "vtable too small");
}
示例4: oop_oop_iterate_range_specialized
void ObjArrayKlass::oop_oop_iterate_range_specialized(objArrayOop a, OopClosureType* closure, int start, int end) {
if (Devirtualizer<nv>::do_metadata(closure)) {
Devirtualizer<nv>::do_klass(closure, a->klass());
}
T* low = start == 0 ? cast_from_oop<T*>(a) : a->obj_at_addr<T>(start);
T* high = (T*)a->base() + end;
oop_oop_iterate_elements_specialized_bounded<nv, T>(a, closure, low, high);
}
示例5: adjust_method_entries
void constantPoolCacheOopDesc::adjust_method_entries(objArrayOop old_methods,
objArrayOop new_methods) {
for (int i = 0; i < old_methods->length(); i++) {
methodOop old_method = (methodOop) old_methods->obj_at(i);
if (! old_method->is_old_version())
continue;
for (int j = 0; j < length(); j++) {
if (entry_at(j)->is_method_entry()) {
entry_at(j)->adjust_method_entry(old_method, (methodOop) new_methods->obj_at(i));
}
}
}
}
示例6: setup_deoptimization_and_return_new_sp
extern "C" oop* setup_deoptimization_and_return_new_sp(oop* old_sp, int* old_fp, objArrayOop frame_array, int* current_frame) {
ResourceMark rm;
// Save all parameters for later use (check unpack_frame_array)
::old_sp = old_sp;
::old_fp = old_fp;
::frame_array = frame_array;
::cur_fp = current_frame;
smiOop number_of_vframes = smiOop(frame_array->obj_at(StackChunkBuilder::number_of_vframes_index));
smiOop number_of_locals = smiOop(frame_array->obj_at(StackChunkBuilder::number_of_locals_index));
assert(number_of_vframes->is_smi(), "must be smi");
assert(number_of_locals->is_smi(), "must be smi");
new_sp = old_sp - frame::interpreter_stack_size(number_of_vframes->value(),
number_of_locals->value());
return new_sp;
}
示例7: oop_pc_follow_contents_specialized
inline void oop_pc_follow_contents_specialized(objArrayOop obj, int index, ParCompactionManager* cm) {
const size_t len = size_t(obj->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*)obj->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++) {
cm->mark_and_push<T>(e);
}
if (end_index < len) {
cm->push_objarray(obj, end_index); // Push the continuation.
}
}
示例8: oop_oop_iterate_elements_specialized_bounded
void ObjArrayKlass::oop_oop_iterate_elements_specialized_bounded(
objArrayOop a, OopClosureType* closure, void* low, void* high) {
T* const l = (T*)low;
T* const h = (T*)high;
T* p = (T*)a->base();
T* end = p + a->length();
if (p < l) {
p = l;
}
if (end > h) {
end = h;
}
for (;p < end; ++p) {
Devirtualizer<nv>::do_oop(closure, p);
}
}
示例9:
inline size_t G1CMTask::scan_objArray(objArrayOop obj, MemRegion mr) {
obj->oop_iterate(_cm_oop_closure, mr);
return mr.word_size();
}
示例10: oop_oop_iterate_range_specialized
void ObjArrayKlass::oop_oop_iterate_range_specialized(objArrayOop a, OopClosureType* closure, int start, int end) {
T* low = start == 0 ? cast_from_oop<T*>(a) : a->obj_at_addr<T>(start);
T* high = (T*)a->base() + end;
oop_oop_iterate_elements_specialized_bounded<nv, T>(a, closure, low, high);
}
示例11: deallocate
static void deallocate(objArrayOop pic) {
int entry = (pic->length()/2) - 1;
oop first = free_list()->obj_at(entry);
pic->obj_at_put(1, first);
free_list()->obj_at_put(entry, pic);
}
示例12: set_first
static void set_first(objArrayOop pic, oop first, oop second) {
pic->obj_at_put(1, first);
pic->obj_at_put(2, second);
}
示例13: set_last
static void set_last(objArrayOop pic, oop first, oop second) {
int size = pic->length();
pic->obj_at_put(size--, second);
pic->obj_at_put(size, first);
}
示例14: set_second
static void set_second(objArrayOop pic, oop first, oop second) {
pic->obj_at_put(3, first);
pic->obj_at_put(4, second);
}
示例15: flush_method_JNIid_cache
void flush_method_JNIid_cache() {
for (int i = 0; i < _old_methods->length(); i++) {
methodOop mop = (methodOop)_old_methods->obj_at(i);
JNIid *mid = mop->jni_id();
if (mid != NULL) {
// don't need to call JNIid::lock() since we are at a safepoint
mid->set_resolved_method((methodOop)NULL, (klassOop)NULL);
}
}
}