Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index a238c127a6848abb5f52258a40cd4443a0bc5078..7e65ad969e5ba73507e301430fd5d40632dbcd69 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -3569,9 +3569,16 @@ HBasicBlock* HOptimizedGraphBuilder::BuildLoopEntry() { |
HBasicBlock* HOptimizedGraphBuilder::BuildLoopEntry( |
IterationStatement* statement) { |
- HBasicBlock* loop_entry = osr()->HasOsrEntryAt(statement) |
- ? osr()->BuildOsrLoopEntry(statement) |
- : BuildLoopEntry(); |
+ HBasicBlock* loop_entry; |
+ |
+ if (osr()->HasOsrEntryAt(statement)) { |
+ loop_entry = osr()->BuildOsrLoopEntry(statement); |
+ if (function_state()->IsInsideDoExpressionScope()) { |
+ Bailout(kDoExpressionUnmodelable); |
+ } |
+ } else { |
+ loop_entry = BuildLoopEntry(); |
+ } |
return loop_entry; |
} |
@@ -4044,6 +4051,7 @@ FunctionState::FunctionState(HOptimizedGraphBuilder* owner, |
arguments_elements_(NULL), |
inlining_id_(inlining_id), |
outer_source_position_(SourcePosition::Unknown()), |
+ do_expression_scope_count_(0), |
outer_(owner->function_state()) { |
if (outer_ != NULL) { |
// State for an inline function. |
@@ -4828,6 +4836,11 @@ void HOptimizedGraphBuilder::VisitContinueStatement( |
DCHECK(!HasStackOverflow()); |
DCHECK(current_block() != NULL); |
DCHECK(current_block()->HasPredecessor()); |
+ |
+ if (function_state()->IsInsideDoExpressionScope()) { |
+ return Bailout(kDoExpressionUnmodelable); |
+ } |
+ |
Scope* outer_scope = NULL; |
Scope* inner_scope = scope(); |
int drop_extra = 0; |
@@ -4860,6 +4873,11 @@ void HOptimizedGraphBuilder::VisitBreakStatement(BreakStatement* stmt) { |
DCHECK(!HasStackOverflow()); |
DCHECK(current_block() != NULL); |
DCHECK(current_block()->HasPredecessor()); |
+ |
+ if (function_state()->IsInsideDoExpressionScope()) { |
+ return Bailout(kDoExpressionUnmodelable); |
+ } |
+ |
Scope* outer_scope = NULL; |
Scope* inner_scope = scope(); |
int drop_extra = 0; |
@@ -5519,10 +5537,12 @@ void HOptimizedGraphBuilder::VisitNativeFunctionLiteral( |
void HOptimizedGraphBuilder::VisitDoExpression(DoExpression* expr) { |
+ DoExpressionScope scope(this); |
DCHECK(!HasStackOverflow()); |
DCHECK(current_block() != NULL); |
DCHECK(current_block()->HasPredecessor()); |
- return Bailout(kDoExpression); |
+ CHECK_ALIVE(VisitBlock(expr->block())); |
+ Visit(expr->result()); |
} |