Fix stack overflow test failures with no snap.
authordanno@chromium.org <danno@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 3 Apr 2012 15:54:07 +0000 (15:54 +0000)
committerdanno@chromium.org <danno@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 3 Apr 2012 15:54:07 +0000 (15:54 +0000)
R=mstarzinger@chromium.org
BUG=chromium:119429

Review URL: https://chromiumcodereview.appspot.com/9963108

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11220 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/bootstrapper.cc
src/debug.cc

index a48bb4d..298652e 100644 (file)
@@ -1301,6 +1301,12 @@ bool Genesis::CompileNative(Vector<const char> name, Handle<String> source) {
 #ifdef ENABLE_DEBUGGER_SUPPORT
   isolate->debugger()->set_compiling_natives(true);
 #endif
+  // 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 false;
+
   bool result = CompileScriptCached(name,
                                     source,
                                     NULL,
index 457531f..99256ba 100644 (file)
@@ -820,6 +820,9 @@ bool Debug::Load() {
           v8::Handle<ObjectTemplate>(),
           NULL);
 
+  // Fail if no context could be created.
+  if (context.is_null()) return false;
+
   // Use the debugger context.
   SaveContext save(isolate_);
   isolate_->set_context(*context);