Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: third_party/tcmalloc/chromium/src/stacktrace_x86-inl.h

Issue 9320005: [NOT TO COMMIT!] Replace third_party/tcmalloc/chromium with tcmalloc r136 (the latest). (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/tcmalloc/chromium/src/stacktrace_x86-inl.h
diff --git a/third_party/tcmalloc/chromium/src/stacktrace_x86-inl.h b/third_party/tcmalloc/chromium/src/stacktrace_x86-inl.h
index 0f8c4de1957768bc6a79c1e678ae3b90002aa264..cba78132fb55d1e851b90c497ec79337642e0c82 100644
--- a/third_party/tcmalloc/chromium/src/stacktrace_x86-inl.h
+++ b/third_party/tcmalloc/chromium/src/stacktrace_x86-inl.h
@@ -65,9 +65,6 @@ typedef ucontext ucontext_t;
#endif
#include "google/stacktrace.h"
-#if defined(KEEP_SHADOW_STACKS)
-#include "linux_shadow_stacks.h"
-#endif // KEEP_SHADOW_STACKS
#if defined(__linux__) && defined(__i386__) && defined(__ELF__) && defined(HAVE_MMAP)
// Count "push %reg" instructions in VDSO __kernel_vsyscall(),
@@ -241,9 +238,14 @@ static void **NextStackFrame(void **old_sp, const void *uc) {
// In the non-strict mode, allow discontiguous stack frames.
// (alternate-signal-stacks for example).
if (new_sp == old_sp) return NULL;
- // And allow frames upto about 1MB.
- if ((new_sp > old_sp)
- && ((uintptr_t)new_sp - (uintptr_t)old_sp > 1000000)) return NULL;
+ if (new_sp > old_sp) {
+ // And allow frames upto about 1MB.
+ const uintptr_t delta = (uintptr_t)new_sp - (uintptr_t)old_sp;
+ const uintptr_t acceptable_delta = 1000000;
+ if (delta > acceptable_delta) {
+ return NULL;
+ }
+ }
}
if ((uintptr_t)new_sp & (sizeof(void *) - 1)) return NULL;
#ifdef __i386__
@@ -319,21 +321,6 @@ int GET_STACK_TRACE_OR_FRAMES {
#endif
int n = 0;
-#if defined(KEEP_SHADOW_STACKS)
- void **shadow_ip_stack;
- void **shadow_sp_stack;
- int stack_size;
- shadow_ip_stack = (void**) get_shadow_ip_stack(&stack_size);
- shadow_sp_stack = (void**) get_shadow_sp_stack(&stack_size);
- int shadow_index = stack_size - 1;
- for (int i = stack_size - 1; i >= 0; i--) {
- if (sp == shadow_sp_stack[i]) {
- shadow_index = i;
- break;
- }
- }
- void **prev_sp = NULL;
-#endif // KEEP_SHADOW_STACKS
while (sp && n < max_depth) {
if (*(sp+1) == reinterpret_cast<void *>(0)) {
// In 64-bit code, we often see a frame that
@@ -346,17 +333,8 @@ int GET_STACK_TRACE_OR_FRAMES {
void **next_sp = NextStackFrame<!IS_STACK_FRAMES, IS_WITH_CONTEXT>(sp, ucp);
if (skip_count > 0) {
skip_count--;
-#if defined(KEEP_SHADOW_STACKS)
- shadow_index--;
-#endif // KEEP_SHADOW_STACKS
} else {
result[n] = *(sp+1);
-#if defined(KEEP_SHADOW_STACKS)
- if ((shadow_index > 0) && (sp == shadow_sp_stack[shadow_index])) {
- shadow_index--;
- }
-#endif // KEEP_SHADOW_STACKS
-
#if IS_STACK_FRAMES
if (next_sp > sp) {
sizes[n] = (uintptr_t)next_sp - (uintptr_t)sp;
@@ -367,25 +345,7 @@ int GET_STACK_TRACE_OR_FRAMES {
#endif
n++;
}
-#if defined(KEEP_SHADOW_STACKS)
- prev_sp = sp;
-#endif // KEEP_SHADOW_STACKS
sp = next_sp;
}
-
-#if defined(KEEP_SHADOW_STACKS)
- if (shadow_index >= 0) {
- for (int i = shadow_index; i >= 0; i--) {
- if (shadow_sp_stack[i] > prev_sp) {
- result[n] = shadow_ip_stack[i];
- if (n + 1 < max_depth) {
- n++;
- continue;
- }
- }
- break;
- }
- }
-#endif // KEEP_SHADOW_STACKS
return n;
}
« no previous file with comments | « third_party/tcmalloc/chromium/src/stacktrace_win32-inl.h ('k') | third_party/tcmalloc/chromium/src/static_vars.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698