Revision: 11238
Author:   [email protected]
Date:     Thu Apr  5 07:01:39 2012
Log:      Adjust stack limit again to avoid overflow on 64 bit windows

Also add additional stack check.

[email protected]

Review URL: https://chromiumcodereview.appspot.com/10006010
http://code.google.com/p/v8/source/detail?r=11238

Modified:
 /branches/bleeding_edge/src/bootstrapper.cc
 /branches/bleeding_edge/src/flag-definitions.h
 /branches/bleeding_edge/test/mjsunit/regress/regress-119429.js

=======================================
--- /branches/bleeding_edge/src/bootstrapper.cc Tue Apr  3 08:54:07 2012
+++ /branches/bleeding_edge/src/bootstrapper.cc Thu Apr  5 07:01:39 2012
@@ -2295,6 +2295,12 @@
   HandleScope scope;
   SaveContext saved_context(isolate);

+ // During genesis, the boilerplate for stack overflow won't work until the
+  // environment has been at least partially initialized. Add a stack check
+  // before entering JS code to catch overflow early.
+  StackLimitCheck check(Isolate::Current());
+  if (check.HasOverflowed()) return;
+
   Handle<Context> new_context = Snapshot::NewContextFromSnapshot();
   if (!new_context.is_null()) {
     global_context_ =
=======================================
--- /branches/bleeding_edge/src/flag-definitions.h      Thu Apr  5 05:32:35 2012
+++ /branches/bleeding_edge/src/flag-definitions.h      Thu Apr  5 07:01:39 2012
@@ -312,7 +312,7 @@
 // execution.cc
 // Slightly less than 1MB on 64-bit, since Windows' default stack size for
 // the main execution thread is 1MB for both 32 and 64-bit.
-DEFINE_int(stack_size, kPointerSize * 125,
+DEFINE_int(stack_size, kPointerSize * 123,
            "default size of stack region v8 is allowed to use (in kBytes)")

 // frames.cc
=======================================
--- /branches/bleeding_edge/test/mjsunit/regress/regress-119429.js Thu Apr 5 05:32:35 2012 +++ /branches/bleeding_edge/test/mjsunit/regress/regress-119429.js Thu Apr 5 07:01:39 2012
@@ -29,7 +29,7 @@

 var d = 0;
 function recurse() {
-  if (++d == 25515) { // A magic number just below stack overflow  on ia32
+  if (++d == 25135) { // A magic number just below stack overflow  on ia32
     %DebugBreak();
   }
   recurse();

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to