| Index: src/bootstrapper.cc
|
| diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
|
| index a48bb4df4d7502caae9ea4c0be2854921160a38f..0e95b4b83974334a6419cabc95e600877def9a2b 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,
|
| @@ -2289,6 +2295,12 @@ Genesis::Genesis(Isolate* isolate,
|
| 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_ =
|
|
|