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
#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,
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);