36 if (fillStack) { |
36 if (fillStack) { |
37 // We need to skip the NativeCallStack::NativeCallStack frame if a tail call is NOT used |
37 // We need to skip the NativeCallStack::NativeCallStack frame if a tail call is NOT used |
38 // to call os::get_native_stack. A tail call is used if _NMT_NOINLINE_ is not defined |
38 // to call os::get_native_stack. A tail call is used if _NMT_NOINLINE_ is not defined |
39 // (which means this is not a slowdebug build), and we are on 64-bit (except Windows). |
39 // (which means this is not a slowdebug build), and we are on 64-bit (except Windows). |
40 // This is not necessarily a rule, but what has been obvserved to date. |
40 // This is not necessarily a rule, but what has been obvserved to date. |
41 #define TAIL_CALL (!defined(_NMT_NOINLINE_) && !defined(WINDOWS) && defined(_LP64)) |
41 #if (defined(_NMT_NOINLINE_) || defined(_WINDOWS) || !defined(_LP64)) |
42 #if !TAIL_CALL |
42 // Not a tail call. |
43 toSkip++; |
43 toSkip++; |
44 #if (defined(_NMT_NOINLINE_) && defined(BSD) && defined(_LP64)) |
44 #if (defined(_NMT_NOINLINE_) && defined(BSD) && defined(_LP64)) |
45 // Mac OS X slowdebug builds have this odd behavior where NativeCallStack::NativeCallStack |
45 // Mac OS X slowdebug builds have this odd behavior where NativeCallStack::NativeCallStack |
46 // appears as two frames, so we need to skip an extra frame. |
46 // appears as two frames, so we need to skip an extra frame. |
47 toSkip++; |
47 toSkip++; |
48 #endif |
48 #endif // Special-case for BSD. |
49 #endif |
49 #endif // Not a tail call. |
50 os::get_native_stack(_stack, NMT_TrackingStackDepth, toSkip); |
50 os::get_native_stack(_stack, NMT_TrackingStackDepth, toSkip); |
51 } else { |
51 } else { |
52 for (int index = 0; index < NMT_TrackingStackDepth; index ++) { |
52 for (int index = 0; index < NMT_TrackingStackDepth; index ++) { |
53 _stack[index] = NULL; |
53 _stack[index] = NULL; |
54 } |
54 } |