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

Unified Diff: src/hydrogen.h

Issue 18050004: Add 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 | « 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 97c9a6a21b1ffe9a0fefc8428c9ea1954515294f..086f830faf7769350484c5b44c26f195412f448f 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -994,9 +994,27 @@ class HGraphBuilder {
// Adding instructions.
HInstruction* AddInstruction(HInstruction* instr);
+
+ template<class I>
+ I* Add() { return static_cast<I*>(AddInstruction(new(zone()) I())); }
+
+ template<class I, class P1>
+ I* Add(P1 p1) {
+ return static_cast<I*>(AddInstruction(new(zone()) I(p1)));
+ }
+
+ template<class I, class P1, class P2>
+ I* Add(P1 p1, P2 p2) {
+ return static_cast<I*>(AddInstruction(new(zone()) I(p1, p2)));
+ }
+
+ template<class I, class P1, class P2, class P3>
+ I* Add(P1 p1, P2 p2, P3 p3) {
+ return static_cast<I*>(AddInstruction(new(zone()) I(p1, p2, p3)));
+ }
+
void AddSimulate(BailoutId id,
RemovableSimulate removable = FIXED_SIMULATE);
- HBoundsCheck* AddBoundsCheck(HValue* index, HValue* length);
HReturn* AddReturn(HValue* value);
« 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