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

Unified Diff: src/hydrogen.h

Issue 18331004: Refactoring and cleanup of control instructions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase to ToT Created 7 years, 5 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/code-stubs-hydrogen.cc ('k') | src/hydrogen.cc » ('j') | 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 e951b19b03252770623453745bc90d965b52e8cb..6c1aba5db66d709231b996207965af7146b758e9 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -1151,13 +1151,6 @@ class HGraphBuilder {
if (!finished_) End();
}
- HInstruction* IfCompare(
- HValue* left,
- HValue* right,
- Token::Value token);
-
- HInstruction* IfCompareMap(HValue* left, Handle<Map> map);
-
template<class Condition>
HInstruction* If(HValue *p) {
HControlInstruction* compare = new(zone()) Condition(p);
@@ -1172,6 +1165,13 @@ class HGraphBuilder {
return compare;
}
+ template<class Condition, class P2, class P3>
+ HInstruction* If(HValue* p1, P2 p2, P3 p3) {
+ HControlInstruction* compare = new(zone()) Condition(p1, p2, p3);
+ AddCompare(compare);
+ return compare;
+ }
+
template<class Condition, class P2>
HInstruction* IfNot(HValue* p1, P2 p2) {
HControlInstruction* compare = new(zone()) Condition(p1, p2);
@@ -1183,17 +1183,15 @@ class HGraphBuilder {
return compare;
}
- HInstruction* OrIfCompare(
- HValue* p1,
- HValue* p2,
- Token::Value token) {
- Or();
- return IfCompare(p1, p2, token);
- }
-
- HInstruction* OrIfCompareMap(HValue* left, Handle<Map> map) {
- Or();
- return IfCompareMap(left, map);
+ template<class Condition, class P2, class P3>
+ HInstruction* IfNot(HValue* p1, P2 p2, P3 p3) {
+ HControlInstruction* compare = new(zone()) Condition(p1, p2, p3);
+ AddCompare(compare);
+ HBasicBlock* block0 = compare->SuccessorAt(0);
+ HBasicBlock* block1 = compare->SuccessorAt(1);
+ compare->SetSuccessorAt(0, block1);
+ compare->SetSuccessorAt(1, block0);
+ return compare;
}
template<class Condition>
@@ -1208,17 +1206,10 @@ class HGraphBuilder {
return If<Condition>(p1, p2);
}
- HInstruction* AndIfCompare(
- HValue* p1,
- HValue* p2,
- Token::Value token) {
- And();
- return IfCompare(p1, p2, token);
- }
-
- HInstruction* AndIfCompareMap(HValue* left, Handle<Map> map) {
- And();
- return IfCompareMap(left, map);
+ template<class Condition, class P2, class P3>
+ HInstruction* OrIf(HValue* p1, P2 p2, P3 p3) {
+ Or();
+ return If<Condition>(p1, p2, p3);
}
template<class Condition>
@@ -1233,6 +1224,12 @@ class HGraphBuilder {
return If<Condition>(p1, p2);
}
+ template<class Condition, class P2, class P3>
+ HInstruction* AndIf(HValue* p1, P2 p2, P3 p3) {
+ And();
+ return If<Condition>(p1, p2, p3);
+ }
+
void Or();
void And();
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698