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

Unified Diff: src/hydrogen.h

Issue 18051010: Make use of templatized convienience functions for adding Hydrogen instructions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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.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 f7ddb20d1ade354f728f00ac57ab86c2e959b4df..1086b2497e080e602d612dc6bc9cd27576f60aef 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -997,6 +997,36 @@ class HGraphBuilder {
return static_cast<I*>(AddInstruction(new(zone()) I(p1, p2, p3)));
}
+ template<class I, class P1, class P2, class P3, class P4>
+ I* Add(P1 p1, P2 p2, P3 p3, P4 p4) {
+ return static_cast<I*>(AddInstruction(new(zone()) I(p1, p2, p3, p4)));
+ }
+
+ template<class I, class P1, class P2, class P3, class P4, class P5>
+ I* Add(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {
+ return static_cast<I*>(AddInstruction(new(zone()) I(p1, p2, p3, p4, p5)));
+ }
+
+ template<class I, class P1, class P2, class P3, class P4, class P5, class P6>
+ I* Add(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) {
+ return static_cast<I*>(AddInstruction(
+ new(zone()) I(p1, p2, p3, p4, p5, p6)));
+ }
+
+ template<class I, class P1, class P2, class P3,
+ class P4, class P5, class P6, class P7>
+ I* Add(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) {
+ return static_cast<I*>(AddInstruction(
+ new(zone()) I(p1, p2, p3, p4, p5, p6, p7)));
+ }
+
+ template<class I, class P1, class P2, class P3, class P4,
+ class P5, class P6, class P7, class P8>
+ I* Add(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) {
+ return static_cast<I*>(AddInstruction(
+ new(zone()) I(p1, p2, p3, p4, p5, p6, p7, p8)));
+ }
+
void AddSimulate(BailoutId id,
RemovableSimulate removable = FIXED_SIMULATE);
@@ -1291,9 +1321,6 @@ class HGraphBuilder {
int elements_size() const {
return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize;
}
- HInstruction* AddInstruction(HInstruction* instr) {
- return builder_->AddInstruction(instr);
- }
HGraphBuilder* builder() { return builder_; }
HGraph* graph() { return builder_->graph(); }
int initial_capacity() {
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698