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

Unified Diff: runtime/vm/intermediate_language.h

Issue 9615025: Implement '==', '!=' and instanceof (without code generation). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 | « runtime/vm/flow_graph_compiler_x64.cc ('k') | tests/language/src/BoolTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 5111)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -33,6 +33,8 @@
// | StoreInstanceField <StoreInstanceFieldNode> <Value> <Value>
// | LoadStaticField <Field>
// | StoreStaticField <StoreStaticFieldNode> <Value>
+// | BooleanNegate <Value>
+// | InstanceOf <Value> <Type>
//
// <Value> ::=
// Temp <int>
@@ -61,7 +63,9 @@
M(LoadInstanceField, LoadInstanceFieldComp) \
M(StoreInstanceField, StoreInstanceFieldComp) \
M(LoadStaticField, LoadStaticFieldComp) \
- M(StoreStaticField, StoreStaticFieldComp)
+ M(StoreStaticField, StoreStaticFieldComp) \
+ M(BooleanNegate, BooleanNegateComp) \
+ M(InstanceOf, InstanceOfComp)
#define FORWARD_DECLARATION(ShortName, ClassName) class ClassName;
@@ -443,6 +447,52 @@
};
+// Note overrideable, built-in: value? false : true.
+class BooleanNegateComp : public Computation {
+ public:
+ explicit BooleanNegateComp(Value* value) : value_(value) {}
+
+ DECLARE_COMPUTATION(BooleanNegateComp)
+
+ Value* value() const { return value_; }
+
+ private:
+ Value* value_;
+
+ DISALLOW_COPY_AND_ASSIGN(BooleanNegateComp);
+};
+
+
+class InstanceOfComp : public Computation {
+ public:
+ InstanceOfComp(intptr_t node_id,
+ intptr_t token_index,
+ Value* value,
+ const AbstractType& type,
+ bool negate_result)
+ : node_id_(node_id),
+ token_index_(token_index),
+ value_(value),
+ type_(type),
+ negate_result_(negate_result) {}
+
+ DECLARE_COMPUTATION(InstanceOfComp)
+
+ Value* value() const { return value_; }
+ bool negate_result() const { return negate_result_; }
+ const AbstractType& type() const { return type_; }
+
+ private:
+ const intptr_t node_id_;
+ const intptr_t token_index_;
+ Value* value_;
+ const AbstractType& type_;
+ const bool negate_result_;
+
+ DISALLOW_COPY_AND_ASSIGN(InstanceOfComp);
+};
+
+
#undef DECLARE_COMPUTATION
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | tests/language/src/BoolTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698