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

Unified Diff: src/ppc/simulator-ppc.cc

Issue 1174693002: PPC64: Adjust simulator stack safety margin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Keep 32-bit simulator stack size at 1MB. Created 5 years, 6 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/ppc/simulator-ppc.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/simulator-ppc.cc
diff --git a/src/ppc/simulator-ppc.cc b/src/ppc/simulator-ppc.cc
index 1932631215745152f63a05de52d9d1fe092334aa..118741bc323303410e411903dbaf1c8c6cf096af 100644
--- a/src/ppc/simulator-ppc.cc
+++ b/src/ppc/simulator-ppc.cc
@@ -794,10 +794,11 @@ Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
// Set up simulator support first. Some of this information is needed to
// setup the architecture state.
#if V8_TARGET_ARCH_PPC64
- size_t stack_size = 2 * 1024 * 1024; // allocate 2MB for stack
+ size_t stack_size = FLAG_sim_stack_size * KB;
#else
- size_t stack_size = 1 * 1024 * 1024; // allocate 1MB for stack
+ size_t stack_size = MB; // allocate 1MB for stack
#endif
+ stack_size += 2 * stack_protection_size_;
stack_ = reinterpret_cast<char*>(malloc(stack_size));
pc_modified_ = false;
icount_ = 0;
@@ -823,7 +824,8 @@ Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
// The sp is initialized to point to the bottom (high address) of the
// allocated stack area. To be safe in potential stack underflows we leave
// some buffer below.
- registers_[sp] = reinterpret_cast<intptr_t>(stack_) + stack_size - 64;
+ registers_[sp] =
+ reinterpret_cast<intptr_t>(stack_) + stack_size - stack_protection_size_;
InitializeCoverage();
last_debugger_input_ = NULL;
@@ -1107,9 +1109,8 @@ void Simulator::WriteDW(intptr_t addr, int64_t value) {
// Returns the limit of the stack area to enable checking for stack overflows.
uintptr_t Simulator::StackLimit() const {
- // Leave a safety margin of 1024 bytes to prevent overrunning the stack when
- // pushing values.
- return reinterpret_cast<uintptr_t>(stack_) + 1024;
+ // Leave a safety margin to prevent overrunning the stack when pushing values.
+ return reinterpret_cast<uintptr_t>(stack_) + stack_protection_size_;
}
« no previous file with comments | « src/ppc/simulator-ppc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698