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

Unified Diff: src/hydrogen.cc

Issue 6603028: Merge revisions 7030:7051 from bleeding_edge to isolates branch.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 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/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
===================================================================
--- src/hydrogen.cc (revision 7051)
+++ src/hydrogen.cc (working copy)
@@ -1663,8 +1663,7 @@
void HGraph::InsertRepresentationChangeForUse(HValue* value,
HValue* use,
- Representation to,
- bool is_truncating) {
+ Representation to) {
// Insert the representation change right before its use. For phi-uses we
// insert at the end of the corresponding predecessor.
HInstruction* next = NULL;
@@ -1681,6 +1680,7 @@
// information we treat constants like normal instructions and insert the
// change instructions for them.
HInstruction* new_value = NULL;
+ bool is_truncating = use->CheckFlag(HValue::kTruncatingToInt32);
if (value->IsConstant()) {
HConstant* constant = HConstant::cast(value);
// Try to create a new copy of the constant with the new representation.
@@ -1690,7 +1690,7 @@
}
if (new_value == NULL) {
- new_value = new HChange(value, value->representation(), to);
+ new_value = new HChange(value, value->representation(), to, is_truncating);
}
new_value->InsertBefore(next);
@@ -1765,8 +1765,7 @@
for (int i = 0; i < to_convert.length(); ++i) {
HValue* use = to_convert[i];
Representation r_to = to_convert_reps[i];
- bool is_truncating = use->CheckFlag(HValue::kTruncatingToInt32);
- InsertRepresentationChangeForUse(current, use, r_to, is_truncating);
+ InsertRepresentationChangeForUse(current, use, r_to);
}
if (current->uses()->is_empty()) {
@@ -4915,28 +4914,23 @@
VISIT_FOR_VALUE(expr->left());
ASSERT(current_block() != NULL);
- HValue* left = Top();
- HEnvironment* environment_copy = environment()->Copy();
- environment_copy->Pop();
- HSubgraph* right_subgraph;
- right_subgraph = CreateBranchSubgraph(environment_copy);
- ADD_TO_SUBGRAPH(right_subgraph, expr->right());
-
- ASSERT(current_block() != NULL &&
- right_subgraph->exit_block() != NULL);
// We need an extra block to maintain edge-split form.
HBasicBlock* empty_block = graph()->CreateBasicBlock();
- HBasicBlock* join_block = graph()->CreateBasicBlock();
-
+ HBasicBlock* eval_right = graph()->CreateBasicBlock();
HTest* test = is_logical_and
- ? new HTest(left, right_subgraph->entry_block(), empty_block)
- : new HTest(left, empty_block, right_subgraph->entry_block());
+ ? new HTest(Top(), eval_right, empty_block)
+ : new HTest(Top(), empty_block, eval_right);
current_block()->Finish(test);
- empty_block->Goto(join_block);
- right_subgraph->exit_block()->Goto(join_block);
- join_block->SetJoinId(expr->id());
+
+ set_current_block(eval_right);
+ Drop(1); // Value of the left subexpression.
+ VISIT_FOR_VALUE(expr->right());
+
+ HBasicBlock* join_block =
+ CreateJoin(empty_block, current_block(), expr->id());
set_current_block(join_block);
ast_context()->ReturnValue(Pop());
+
} else {
ASSERT(ast_context()->IsEffect());
// In an effect context, we don't need the value of the left
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698