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

Method id

src/vmStructs.cpp:658–677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656}
657
658jmethodID VMMethod::id() {
659 // We may find a bogus NMethod during stack walking, it does not always point to a valid VMMethod
660 const char* const_method = (const char*) SafeAccess::load((void**) at(_method_constmethod_offset));
661 if (!goodPtr(const_method)) {
662 return NULL;
663 }
664
665 const char* cpool = *(const char**) (const_method + _constmethod_constants_offset);
666 unsigned short num = *(unsigned short*) (const_method + _constmethod_idnum_offset);
667 if (goodPtr(cpool)) {
668 VMKlass* holder = *(VMKlass**)(cpool + _pool_holder_offset);
669 if (goodPtr(holder)) {
670 jmethodID* ids = holder->jmethodIDs();
671 if (ids != NULL && num < (size_t)ids[0]) {
672 return ids[num + 1];
673 }
674 }
675 }
676 return NULL;
677}
678
679jmethodID VMMethod::validatedId() {
680 jmethodID method_id = id();

Callers 2

walkVMMethod · 0.80
isStaleMethodIdMethod · 0.80

Calls 1

jmethodIDsMethod · 0.80

Tested by

no test coverage detected