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

Unified Diff: src/platform.h

Issue 40219: Get rid or heap allocation in stack sampler to avoid deadlocks. (Closed)
Patch Set: CHECK(a > b) -> CHECK_GT Created 11 years, 10 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
« no previous file with comments | « src/log.cc ('k') | test/cctest/test-log-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform.h
diff --git a/src/platform.h b/src/platform.h
index b58067f5ba002cb845e1cb9d17bff087c2dcb62f..32937083a8d5c9c9f579b3973ed1ead416df9f76 100644
--- a/src/platform.h
+++ b/src/platform.h
@@ -466,26 +466,9 @@ class TickSample {
unsigned int sp; // Stack pointer.
unsigned int fp; // Frame pointer.
StateTag state; // The state of the VM.
- SmartPointer<Address> stack; // Call stack, null-terminated.
-
- inline TickSample& operator=(const TickSample& rhs) {
- if (this == &rhs) return *this;
- pc = rhs.pc;
- sp = rhs.sp;
- fp = rhs.fp;
- state = rhs.state;
- DeleteArray(stack.Detach());
- stack = rhs.stack;
- return *this;
- }
-
- inline void InitStack(int depth) {
- if (depth) {
- stack = SmartPointer<Address>(NewArray<Address>(depth + 1));
- // null-terminate
- stack[depth] = 0;
- }
- }
+ static const int kMaxFramesCount = 5;
+ EmbeddedVector<Address, kMaxFramesCount> stack; // Call stack.
+ int frames_count; // Number of captured frames.
};
class Sampler {
« no previous file with comments | « src/log.cc ('k') | test/cctest/test-log-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698