| 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());
|
| }
|
| }
|
|
|
|
|