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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 697473006: Properly handle stack overflows in the AST graph builder. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Harden test case. Created 6 years, 2 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 | « src/compiler/ast-graph-builder.h ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index d7bae5a4197b612cdec3abb69fc4396a8970eeb4..7b5abd191cfe4c12dd2651d953516099833bc168 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -339,24 +339,40 @@ void AstGraphBuilder::VisitForValues(ZoneList<Expression*>* exprs) {
void AstGraphBuilder::VisitForValue(Expression* expr) {
AstValueContext for_value(this);
- if (!HasStackOverflow()) {
+ if (!CheckStackOverflow()) {
expr->Accept(this);
+ } else {
+ ast_context()->ProduceValue(jsgraph()->UndefinedConstant());
}
}
void AstGraphBuilder::VisitForEffect(Expression* expr) {
AstEffectContext for_effect(this);
- if (!HasStackOverflow()) {
+ if (!CheckStackOverflow()) {
expr->Accept(this);
+ } else {
+ ast_context()->ProduceValue(jsgraph()->UndefinedConstant());
}
}
void AstGraphBuilder::VisitForTest(Expression* expr) {
AstTestContext for_condition(this);
- if (!HasStackOverflow()) {
+ if (!CheckStackOverflow()) {
expr->Accept(this);
+ } else {
+ ast_context()->ProduceValue(jsgraph()->UndefinedConstant());
+ }
+}
+
+
+void AstGraphBuilder::Visit(Expression* expr) {
+ // Reuses enclosing AstContext.
+ if (!CheckStackOverflow()) {
+ expr->Accept(this);
+ } else {
+ ast_context()->ProduceValue(jsgraph()->UndefinedConstant());
}
}
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698