Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1270)

Unified Diff: src/bootstrapper.cc

Issue 178073002: Raise StackOverflow during bootstrapping (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Raise StackOverflow during bootstrapping Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/isolate.h » ('j') | test/cctest/test-api.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index b6e8dc5bc8faa3bf21d1f80fb5e920a29ec0f31f..3bed246e2b5e964ebc2f764b7e77383c54d12cbd 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1473,11 +1473,6 @@ bool Genesis::CompileNative(Isolate* isolate,
#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);
- if (check.HasOverflowed()) return false;
bool result = CompileScriptCached(isolate,
name,
@@ -2607,8 +2602,16 @@ Genesis::Genesis(Isolate* 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.
+ const uint32_t stack_to_get_through_genesis = 3500 * sizeof(intptr_t);
StackLimitCheck check(isolate);
- if (check.HasOverflowed()) return;
+ if (check.WillOverflow(stack_to_get_through_genesis)) {
+ // Only raise a StackOverflow if there is a valid current context
+ if (isolate->context() != NULL) {
+ isolate->StackOverflow();
+ isolate->OptionalRescheduleException(true);
+ }
+ return;
+ }
// We can only de-serialize a context if the isolate was initialized from
// a snapshot. Otherwise we have to build the context from scratch.
« no previous file with comments | « no previous file | src/isolate.h » ('j') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698