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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1769463002: Allow Crankshaft to tolerate certain do-expressions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Missed comment. Created 4 years, 10 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/crankshaft/hydrogen.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « src/crankshaft/hydrogen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698