Reviewers: Michael Starzinger,
Message:
PTAL
Description:
Fix stack overflow test failures with no snap.
[email protected]
BUG=chromium:119429
Please review this at http://codereview.chromium.org/9963108/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/bootstrapper.cc
M src/debug.cc
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index
a48bb4df4d7502caae9ea4c0be2854921160a38f..d0e89c1cd7110be71fdfd75d358524423fdd825a
100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -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,
@@ -1362,6 +1368,7 @@ bool Genesis::CompileScriptCached(Vector<const char>
name,
? top_context->builtins()
: top_context->global());
bool has_pending_exception;
+
Execution::Call(fun, receiver, 0, NULL, &has_pending_exception);
if (has_pending_exception) return false;
return true;
Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index
457531fa36cd3f768812e6c5a6a118d0395a9d8b..99256ba21a88a8510978e5578ab0c4f541982b0a
100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -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);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev