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

Unified Diff: src/hydrogen.cc

Issue 6651019: Merge revisions 6871, 6981, and 7082 to the 3.0 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.0
Patch Set: Fix cut-n-paste errors. Created 9 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 | « src/arm/full-codegen-arm.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index a9f7c7095e93374c47d69508e4698f9c56ac1d87..397ae8e10d34e18b5787ad2a42ca1753920dc094 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -307,6 +307,13 @@ void HBasicBlock::Verify() {
ASSERT(a == b);
}
}
+
+ // Check that the incoming edges are in edge split form.
+ if (predecessors_.length() > 1) {
+ for (int i = 0; i < predecessors_.length(); ++i) {
+ ASSERT(predecessors_[i]->end()->SecondSuccessor() == NULL);
+ }
+ }
}
#endif
@@ -2900,14 +2907,23 @@ void HGraphBuilder::VisitConditional(Conditional* expr) {
then_graph->entry_block(),
else_graph->entry_block());
+ // Visit the true and false subexpressions in the same AST context as the
+ // whole expression.
then_graph->entry_block()->SetJoinId(expr->ThenId());
- ADD_TO_SUBGRAPH(then_graph, expr->then_expression());
+ { SubgraphScope scope(this, then_graph);
+ Visit(expr->then_expression());
+ CHECK_BAILOUT;
+ }
else_graph->entry_block()->SetJoinId(expr->ElseId());
- ADD_TO_SUBGRAPH(else_graph, expr->else_expression());
+ { SubgraphScope scope(this, else_graph);
+ Visit(expr->else_expression());
+ CHECK_BAILOUT;
+ }
- current_subgraph_->AppendJoin(then_graph, else_graph, expr);
- ast_context()->ReturnValue(Pop());
+ if (!ast_context()->IsTest()) {
+ subgraph()->AppendJoin(then_graph, else_graph, expr);
+ }
}
@@ -3742,9 +3758,11 @@ bool HGraphBuilder::TryArgumentsAccess(Property* expr) {
HInstruction* elements = AddInstruction(new HArgumentsElements);
result = new HArgumentsLength(elements);
} else {
+ Push(graph()->GetArgumentsObject());
VisitForValue(expr->key());
if (HasStackOverflow()) return false;
HValue* key = Pop();
+ Drop(1); // Arguments object.
HInstruction* elements = AddInstruction(new HArgumentsElements);
HInstruction* length = AddInstruction(new HArgumentsLength(elements));
AddInstruction(new HBoundsCheck(key, length));
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698