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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10911057: Add check for non-smi to the IL and use it for class checks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('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 11768)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -1294,6 +1294,7 @@
M(SmiToDouble, SmiToDoubleComp) \
M(CheckClass, CheckClassComp) \
M(CheckSmi, CheckSmiComp) \
+ M(CheckNonSmi, CheckNonSmiComp) \
M(Constant, ConstantComp) \
M(CheckEitherNonSmi, CheckEitherNonSmiComp) \
M(UnboxedDoubleBinaryOp, UnboxedDoubleBinaryOpComp) \
@@ -3248,6 +3249,35 @@
};
+class CheckNonSmiComp : public TemplateComputation<1> {
+ public:
+ CheckNonSmiComp(Value* value, intptr_t original_deopt_id)
+ : original_deopt_id_(original_deopt_id) {
+ ASSERT(value != NULL);
+ ASSERT(original_deopt_id != Isolate::kNoDeoptId);
+ inputs_[0] = value;
+ }
+
+ DECLARE_COMPUTATION(CheckNonSmi)
+
+ virtual bool CanDeoptimize() const { return true; }
+ virtual intptr_t ResultCid() const { return kIllegalCid; }
+
+ virtual bool AttributesEqual(Computation* other) const { return true; }
+
+ virtual bool HasSideEffect() const { return false; }
+
+ Value* value() const { return inputs_[0]; }
+
+ virtual intptr_t deopt_id() const { return original_deopt_id_; }
+
+ private:
+ const intptr_t original_deopt_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(CheckNonSmiComp);
+};
+
+
class CheckArrayBoundComp : public TemplateComputation<2> {
public:
CheckArrayBoundComp(Value* array,
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698