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

Unified Diff: src/bootstrapper.cc

Issue 217013002: Revert r20335 - "Raise StackOverflow during bootstrapping" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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') | no next file with comments »
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 ce625b7495a33dc015907298f841ae51ee06001a..6496e2629cb29415d364875d368d884777369c03 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1476,6 +1476,11 @@ 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,
@@ -2609,16 +2614,8 @@ 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.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;
- }
+ if (check.HasOverflowed()) 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698