| 656 | } |
| 657 | |
| 658 | jmethodID 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 | |
| 679 | jmethodID VMMethod::validatedId() { |
| 680 | jmethodID method_id = id(); |
no test coverage detected