起始地址是 0x000000000cfbf2a0
但是print的时候会进行处理,代码见 thread.cpp:
// Called by Threads::print() for VM_PrintThreads operation void JavaThread::print_on(outputStream *st) const { st->print("\"%s\" ", get_thread_name()); oop thread_oop = threadObj(); if (thread_oop != NULL) { st->print("#" INT64_FORMAT " ", java_lang_Thread::thread_id(thread_oop)); if (java_lang_Thread::is_daemon(thread_oop)) st->print("daemon "); st->print("prio=%d ", java_lang_Thread::priority(thread_oop)); } Thread::print_on(st); // print guess for valid stack memory region (assume 4K pages); helps lock debugging st->print_cr("[" INTPTR_FORMAT "]", (intptr_t)last_Java_sp() & ~right_n_bits(12)); if (thread_oop != NULL) { st->print_cr(" java.lang.Thread.State: %s", java_lang_Thread::thread_status_name(thread_oop)); } #ifndef PRODUCT print_thread_state_on(st); _safepoint_state->print_on(st); #endif // PRODUCT }
last_Java_sp() 得到的就是 0x000000000cfbf2a0 ,再经过位运算后 就是 0x000000000cfbf000
217838240 & ~((1<<12) - 1)