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

Side by Side Diff: third_party/tcmalloc/vendor/src/stacktrace_x86-inl.h

Issue 9701040: Revert 126715 - Update the tcmalloc vendor branch to r144 (gperftools 2.0). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2005, Google Inc. 1 // Copyright (c) 2005, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 #include <stdint.h> // for uintptr_t 57 #include <stdint.h> // for uintptr_t
58 #endif 58 #endif
59 #ifdef HAVE_UNISTD_H 59 #ifdef HAVE_UNISTD_H
60 #include <unistd.h> 60 #include <unistd.h>
61 #endif 61 #endif
62 #ifdef HAVE_MMAP 62 #ifdef HAVE_MMAP
63 #include <sys/mman.h> // for msync 63 #include <sys/mman.h> // for msync
64 #include "base/vdso_support.h" 64 #include "base/vdso_support.h"
65 #endif 65 #endif
66 66
67 #include "gperftools/stacktrace.h" 67 #include "google/stacktrace.h"
68 68
69 #if defined(__linux__) && defined(__i386__) && defined(__ELF__) && defined(HAVE_ MMAP) 69 #if defined(__linux__) && defined(__i386__) && defined(__ELF__) && defined(HAVE_ MMAP)
70 // Count "push %reg" instructions in VDSO __kernel_vsyscall(), 70 // Count "push %reg" instructions in VDSO __kernel_vsyscall(),
71 // preceeding "syscall" or "sysenter". 71 // preceeding "syscall" or "sysenter".
72 // If __kernel_vsyscall uses frame pointer, answer 0. 72 // If __kernel_vsyscall uses frame pointer, answer 0.
73 // 73 //
74 // kMaxBytes tells how many instruction bytes of __kernel_vsyscall 74 // kMaxBytes tells how many instruction bytes of __kernel_vsyscall
75 // to analyze before giving up. Up to kMaxBytes+1 bytes of 75 // to analyze before giving up. Up to kMaxBytes+1 bytes of
76 // instructions could be accessed. 76 // instructions could be accessed.
77 // 77 //
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 if (STRICT_UNWINDING) { 231 if (STRICT_UNWINDING) {
232 // With the stack growing downwards, older stack frame must be 232 // With the stack growing downwards, older stack frame must be
233 // at a greater address that the current one. 233 // at a greater address that the current one.
234 if (new_sp <= old_sp) return NULL; 234 if (new_sp <= old_sp) return NULL;
235 // Assume stack frames larger than 100,000 bytes are bogus. 235 // Assume stack frames larger than 100,000 bytes are bogus.
236 if ((uintptr_t)new_sp - (uintptr_t)old_sp > 100000) return NULL; 236 if ((uintptr_t)new_sp - (uintptr_t)old_sp > 100000) return NULL;
237 } else { 237 } else {
238 // In the non-strict mode, allow discontiguous stack frames. 238 // In the non-strict mode, allow discontiguous stack frames.
239 // (alternate-signal-stacks for example). 239 // (alternate-signal-stacks for example).
240 if (new_sp == old_sp) return NULL; 240 if (new_sp == old_sp) return NULL;
241 if (new_sp > old_sp) { 241 // And allow frames upto about 1MB.
242 // And allow frames upto about 1MB. 242 if ((new_sp > old_sp)
243 const uintptr_t delta = (uintptr_t)new_sp - (uintptr_t)old_sp; 243 && ((uintptr_t)new_sp - (uintptr_t)old_sp > 1000000)) return NULL;
244 const uintptr_t acceptable_delta = 1000000;
245 if (delta > acceptable_delta) {
246 return NULL;
247 }
248 }
249 } 244 }
250 if ((uintptr_t)new_sp & (sizeof(void *) - 1)) return NULL; 245 if ((uintptr_t)new_sp & (sizeof(void *) - 1)) return NULL;
251 #ifdef __i386__ 246 #ifdef __i386__
252 // On 64-bit machines, the stack pointer can be very close to 247 // On 64-bit machines, the stack pointer can be very close to
253 // 0xffffffff, so we explicitly check for a pointer into the 248 // 0xffffffff, so we explicitly check for a pointer into the
254 // last two pages in the address space 249 // last two pages in the address space
255 if ((uintptr_t)new_sp >= 0xffffe000) return NULL; 250 if ((uintptr_t)new_sp >= 0xffffe000) return NULL;
256 #endif 251 #endif
257 #ifdef HAVE_MMAP 252 #ifdef HAVE_MMAP
258 if (!STRICT_UNWINDING) { 253 if (!STRICT_UNWINDING) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 // A frame-size of 0 is used to indicate unknown frame size. 337 // A frame-size of 0 is used to indicate unknown frame size.
343 sizes[n] = 0; 338 sizes[n] = 0;
344 } 339 }
345 #endif 340 #endif
346 n++; 341 n++;
347 } 342 }
348 sp = next_sp; 343 sp = next_sp;
349 } 344 }
350 return n; 345 return n;
351 } 346 }
OLDNEW
« no previous file with comments | « third_party/tcmalloc/vendor/src/stacktrace_win32-inl.h ('k') | third_party/tcmalloc/vendor/src/stacktrace_x86_64-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698