On 6/12/19 10:35 AM, Nick Gasson wrote: > I also replaced the call to _get_previous_fp() in os::current_frame() with > > *(intptr_t **)__builtin_frame_address(0); > > As it generates the same code and avoids the `register intptr_t **fp > __asm__ (SPELL_REG_FP);' declaration which clang doesn't support. Also > the following comment in _get_previous_fp seems to be wrong: > > // fp is for this frame (_get_previous_fp). We want the fp for the > // caller of os::current_frame*(), so go up two frames. However, for > // optimized builds, _get_previous_fp() will be inlined, so only go > // up 1 frame in that case. > #ifdef _NMT_NOINLINE_ > return **(intptr_t***)fp; > #else > return *fp; > #endif
All of this seems horribly fragile. I'll have a look at what this is supposed to be used for and think about a stable and robust way to do it. -- Andrew Haley Java Platform Lead Engineer Red Hat UK Ltd. <https://www.redhat.com> https://keybase.io/andrewhaley EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671