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

Unified Diff: src/hydrogen.cc

Issue 23710070: Allow control intructions to have side effects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | « no previous file | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.cc » ('J')
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 4e00ba6907fd60f59e25f0570c812b6727ad30ec..810cdbc9151cab82d7a0fd577318e2053c65dffe 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -2630,7 +2630,8 @@ void EffectContext::ReturnInstruction(HInstruction* instr, BailoutId ast_id) {
void EffectContext::ReturnControl(HControlInstruction* instr,
BailoutId ast_id) {
- ASSERT(!instr->HasObservableSideEffects());
+ // We can ignore ObservableSideEffects here since CreateJoin will add
titzer 2013/09/19 16:24:27 I find this comment confusing and would rather jus
oliv 2013/09/19 16:38:00 Done.
+ // Simulates anyway.
HBasicBlock* empty_true = owner()->graph()->CreateBasicBlock();
HBasicBlock* empty_false = owner()->graph()->CreateBasicBlock();
instr->SetSuccessorAt(0, empty_true);
@@ -2671,7 +2672,8 @@ void ValueContext::ReturnInstruction(HInstruction* instr, BailoutId ast_id) {
void ValueContext::ReturnControl(HControlInstruction* instr, BailoutId ast_id) {
- ASSERT(!instr->HasObservableSideEffects());
+ // We can ignore ObservableSideEffects here since CreateJoin will add
+ // Simulates anyway.
if (!arguments_allowed() && instr->CheckFlag(HValue::kIsArguments)) {
return owner()->Bailout(kBadValueContextForArgumentsObjectValue);
}
@@ -2729,7 +2731,9 @@ void TestContext::ReturnInstruction(HInstruction* instr, BailoutId ast_id) {
void TestContext::ReturnControl(HControlInstruction* instr, BailoutId ast_id) {
- ASSERT(!instr->HasObservableSideEffects());
+ // We can ignore ObservableSideEffects here since both HGoto instructions
+ // insert a different Simulate, thus we will directly deoptimize into the
+ // correct branch.
HBasicBlock* empty_true = owner()->graph()->CreateBasicBlock();
HBasicBlock* empty_false = owner()->graph()->CreateBasicBlock();
instr->SetSuccessorAt(0, empty_true);
@@ -8044,12 +8048,11 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
return ast_context()->ReturnControl(result, expr->id());
} else {
if (combined_rep.IsTagged() || combined_rep.IsNone()) {
- HCompareGeneric* result =
- new(zone()) HCompareGeneric(context, left, right, op);
- result->set_observed_input_representation(1, left_rep);
- result->set_observed_input_representation(2, right_rep);
+ HCompareGenericAndBranch* result =
+ New<HCompareGenericAndBranch>(left, right, op);
+ result->set_observed_input_representation(left_rep, right_rep);
result->set_position(expr->position());
- return ast_context()->ReturnInstruction(result, expr->id());
+ return ast_context()->ReturnControl(result, expr->id());
} else {
HCompareNumericAndBranch* result =
New<HCompareNumericAndBranch>(left, right, op);
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698