MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / fromJavaClass

Method fromJavaClass

src/vmStructs.h:263–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261class VMKlass : VMStructs {
262 public:
263 static VMKlass* fromJavaClass(JNIEnv* env, jclass cls) {
264 if (_has_perm_gen) {
265 jobject klassOop = env->GetObjectField(cls, _klass);
266 return (VMKlass*)(*(uintptr_t**)klassOop + 2);
267 } else if (sizeof(VMKlass*) == 8) {
268 return (VMKlass*)(uintptr_t)env->GetLongField(cls, _klass);
269 } else {
270 return (VMKlass*)(uintptr_t)env->GetIntField(cls, _klass);
271 }
272 }
273
274 static VMKlass* fromHandle(uintptr_t handle) {
275 if (_has_perm_gen) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected