本文整理汇总了C++中Klass::java_mirror方法的典型用法代码示例。如果您正苦于以下问题:C++ Klass::java_mirror方法的具体用法?C++ Klass::java_mirror怎么用?C++ Klass::java_mirror使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Klass
的用法示例。
在下文中一共展示了Klass::java_mirror方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: oop_verify_on
void klassKlass::oop_verify_on(oop obj, outputStream* st) {
Klass::oop_verify_on(obj, st);
guarantee(obj->is_perm(), "should be in permspace");
guarantee(obj->is_klass(), "should be klass");
Klass* k = Klass::cast(klassOop(obj));
if (k->super() != NULL) {
guarantee(k->super()->is_perm(), "should be in permspace");
guarantee(k->super()->is_klass(), "should be klass");
}
klassOop ko = k->secondary_super_cache();
if( ko != NULL ) {
guarantee(ko->is_perm(), "should be in permspace");
guarantee(ko->is_klass(), "should be klass");
}
for( uint i = 0; i < primary_super_limit(); i++ ) {
oop ko = k->adr_primary_supers()[i]; // Cannot use normal accessor because it asserts
if( ko != NULL ) {
guarantee(ko->is_perm(), "should be in permspace");
guarantee(ko->is_klass(), "should be klass");
}
}
if (k->java_mirror() != NULL || (k->oop_is_instance() && instanceKlass::cast(klassOop(obj))->is_loaded())) {
guarantee(k->java_mirror() != NULL, "should be allocated");
guarantee(k->java_mirror()->is_perm(), "should be in permspace");
guarantee(k->java_mirror()->is_instance(), "should be instance");
}
if (k->name() != NULL) {
guarantee(Universe::heap()->is_in_permanent(k->name()),
"should be in permspace");
guarantee(k->name()->is_symbol(), "should be symbol");
}
}
示例2: oop_at
oop AOTCompiledMethod::oop_at(int index) const {
if (index == 0) { // 0 is reserved
return NULL;
}
Metadata** entry = _metadata_got + (index - 1);
intptr_t meta = (intptr_t)*entry;
if ((meta & 1) == 1) {
// already resolved
Klass* k = (Klass*)(meta & ~1);
return k->java_mirror();
}
// The entry is string which we need to resolve.
const char* meta_name = _heap->get_name_at((int)meta);
int klass_len = build_u2_from((address)meta_name);
const char* klass_name = meta_name + 2;
// Quick check the current method's holder.
Klass* k = _method->method_holder();
ResourceMark rm; // for signature_name()
if (strncmp(k->signature_name(), klass_name, klass_len) != 0) { // Does not match?
// Search klass in got cells in DSO which have this compiled method.
k = _heap->get_klass_from_got(klass_name, klass_len, _method);
}
int method_name_len = build_u2_from((address)klass_name + klass_len);
guarantee(method_name_len == 0, "only klass is expected here");
meta = ((intptr_t)k) | 1;
*entry = (Metadata*)meta; // Should be atomic on x64
return k->java_mirror();
}
示例3: return
} UNSAFE_END
UNSAFE_ENTRY(jclass, Unsafe_GetJavaMirror(JNIEnv *env, jobject unsafe, jlong metaspace_klass)) {
Klass* klass = (Klass*) (address) metaspace_klass;
return (jclass) JNIHandles::make_local(klass->java_mirror());
} UNSAFE_END
示例4: add_for_basic_type_arrays
// add the basic type array class and its multi-dimensional array classes to the list
static void add_for_basic_type_arrays(Klass* k) {
JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
assert(that != NULL, "no JvmtiGetLoadedClassesClosure");
assert(that->available(), "no list");
for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
oop mirror = l->java_mirror();
that->set_element(that->get_index(), mirror);
that->set_index(that->get_index() + 1);
}
}
示例5: add_with_loader
static void add_with_loader(Klass* k, ClassLoaderData* loader_data) {
JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this();
if (that->available()) {
oop class_loader = loader_data->class_loader();
if (class_loader == JNIHandles::resolve(that->get_initiatingLoader())) {
for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) {
oop mirror = l->java_mirror();
that->set_element(that->get_index(), mirror);
that->set_index(that->get_index() + 1);
}
}
}
}
示例6: do_object
void do_object(oop obj) {
// The METHODS() OBJARRAYS CANNOT BE MADE READ-ONLY, even though
// it is never modified. Otherwise, they will be pre-marked; the
// GC marking phase will skip them; and by skipping them will fail
// to mark the methods objects referenced by the array.
if (obj->is_klass()) {
mark_object(obj);
Klass* k = klassOop(obj)->klass_part();
mark_object(k->java_mirror());
if (obj->blueprint()->oop_is_instanceKlass()) {
instanceKlass* ik = (instanceKlass*)k;
mark_object(ik->methods());
mark_object(ik->constants());
}
if (obj->blueprint()->oop_is_javaArray()) {
arrayKlass* ak = (arrayKlass*)k;
mark_object(ak->component_mirror());
}
return;
}
// Mark constantPool tags and the constantPoolCache.
else if (obj->is_constantPool()) {
constantPoolOop pool = constantPoolOop(obj);
mark_object(pool->cache());
pool->shared_tags_iterate(&mark_objects);
return;
}
// Mark all method objects.
if (obj->is_method()) {
mark_object(obj);
}
}