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

Unified Diff: src/hydrogen.h

Issue 23710081: Implement IfNot() in terms of If(), and add missing IfNot(HValue*) method. (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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index 50e22f5287ac83001e5f024b2bffeeaacac7a780..b27701c4af5513d619156c44926ef2b170ec33eb 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -1305,10 +1305,19 @@ class HGraphBuilder {
return compare;
}
+ template<class Condition>
+ Condition* IfNot(HValue* p) {
+ Condition* compare = If<Condition>(p);
+ HBasicBlock* block0 = compare->SuccessorAt(0);
+ HBasicBlock* block1 = compare->SuccessorAt(1);
+ compare->SetSuccessorAt(0, block1);
+ compare->SetSuccessorAt(1, block0);
+ return compare;
+ }
+
template<class Condition, class P2>
Condition* IfNot(HValue* p1, P2 p2) {
- Condition* compare = builder()->New<Condition>(p1, p2);
- AddCompare(compare);
+ Condition* compare = If<Condition>(p1, p2);
HBasicBlock* block0 = compare->SuccessorAt(0);
HBasicBlock* block1 = compare->SuccessorAt(1);
compare->SetSuccessorAt(0, block1);
@@ -1318,8 +1327,7 @@ class HGraphBuilder {
template<class Condition, class P2, class P3>
Condition* IfNot(HValue* p1, P2 p2, P3 p3) {
- Condition* compare = builder()->New<Condition>(p1, p2, p3);
- AddCompare(compare);
+ Condition* compare = If<Condition>(p1, p2, p3);
HBasicBlock* block0 = compare->SuccessorAt(0);
HBasicBlock* block1 = compare->SuccessorAt(1);
compare->SetSuccessorAt(0, block1);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698