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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10440099: Adding unary op optimizations. missing assembly operations/ (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 8118)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -65,6 +65,7 @@
M(CloneContext, CloneContextComp) \
M(CatchEntry, CatchEntryComp) \
M(BinaryOp, BinaryOpComp) \
+ M(UnaryOp, UnaryOpComp) \
#define FORWARD_DECLARATION(ShortName, ClassName) class ClassName;
@@ -1283,6 +1284,8 @@
Value* left,
Value* right)
: op_kind_(op_kind), instance_call_(instance_call) {
+ ASSERT(left != NULL);
+ ASSERT(right != NULL);
inputs_[0] = left;
inputs_[1] = right;
}
@@ -1305,6 +1308,32 @@
DISALLOW_COPY_AND_ASSIGN(BinaryOpComp);
};
+
+class UnaryOpComp : public TemplateComputation<1> {
+ public:
+ UnaryOpComp(Token::Kind op_kind,
+ InstanceCallComp* instance_call,
+ Value* value) : op_kind_(op_kind), instance_call_(instance_call) {
+ ASSERT(value != NULL);
+ inputs_[0] = value;
+ }
+
+ Value* value() const { return inputs_[0]; }
+ Token::Kind op_kind() const { return op_kind_; }
+
+ InstanceCallComp* instance_call() const { return instance_call_; }
+
+ virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+ DECLARE_COMPUTATION(UnaryOp)
+
+ private:
+ const Token::Kind op_kind_;
+ InstanceCallComp* instance_call_;
+
+ DISALLOW_COPY_AND_ASSIGN(UnaryOpComp);
+};
+
#undef DECLARE_COMPUTATION

Powered by Google App Engine
This is Rietveld 408576698