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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10827387: Reenable elimination of strict equals when right side is true. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 10862)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -156,8 +156,6 @@
// Compile time type of the computation, which typically depends on the
// compile time types (and possibly propagated types) of its inputs.
virtual RawAbstractType* CompileType() const = 0;
- // TODO(srdjan): Make this abstract so that it gets correctly implemented
- // in all computations.
virtual intptr_t ResultCid() const { return kDynamicCid; }
// Mutate assigned_vars to add the local variable index for all
@@ -304,6 +302,8 @@
// Returns true if the value represents constant null.
virtual bool BindsToConstantNull() const = 0;
+ // Assert if BindsToConstant() is false, otherwise returns constant.
regis 2012/08/16 21:43:52 Missing empty line. Or group with BindsToConstant(
srdjan 2012/08/16 22:11:06 Added empty line.
+ virtual const Object& BoundConstant() const = 0;
// Reminder: The type of the constant null is the bottom type, which is more
// specific than any type.
@@ -360,6 +360,7 @@
// Returns true if the value represents a constant.
virtual bool BindsToConstant() const;
+ virtual const Object& BoundConstant() const;
// Returns true if the value represents constant null.
virtual bool BindsToConstantNull() const;
@@ -399,6 +400,7 @@
// Returns true if the value represents a constant.
virtual bool BindsToConstant() const { return true; }
+ virtual const Object& BoundConstant() const { return value(); }
// Returns true if the value represents constant null.
virtual bool BindsToConstantNull() const { return value().IsNull(); }
@@ -505,7 +507,6 @@
virtual void PrintOperandsTo(BufferFormatter* f) const;
virtual bool CanDeoptimize() const { return false; }
-
virtual intptr_t ResultCid() const { return kBoolCid; }
private:
@@ -701,7 +702,6 @@
virtual bool CanDeoptimize() const { return false; }
virtual Definition* TryReplace(BindInstr* instr);
-
virtual intptr_t ResultCid() const { return kBoolCid; }
private:
@@ -735,9 +735,8 @@
virtual void PrintOperandsTo(BufferFormatter* f) const;
virtual bool CanDeoptimize() const { return true; }
+ virtual intptr_t ResultCid() const;
- virtual intptr_t ResultCid() const { return kBoolCid; }
-
private:
const intptr_t token_pos_;
const intptr_t try_index_;
@@ -777,9 +776,8 @@
virtual void PrintOperandsTo(BufferFormatter* f) const;
virtual bool CanDeoptimize() const { return true; }
+ virtual intptr_t ResultCid() const;
- virtual intptr_t ResultCid() const { return kBoolCid; }
-
private:
const intptr_t token_pos_;
const intptr_t try_index_;
@@ -1164,6 +1162,7 @@
virtual void PrintOperandsTo(BufferFormatter* f) const;
virtual bool CanDeoptimize() const { return false; }
+ virtual intptr_t ResultCid() const { return kBoolCid; }
private:
const intptr_t token_pos_;
@@ -1616,6 +1615,7 @@
DECLARE_COMPUTATION(BinaryOp)
virtual bool CanDeoptimize() const { return true; }
+ virtual intptr_t ResultCid() const;
private:
const Token::Kind op_kind_;
@@ -1642,6 +1642,7 @@
virtual intptr_t ArgumentCount() const { return 2; }
virtual bool CanDeoptimize() const { return true; }
+ virtual intptr_t ResultCid() const;
private:
const Token::Kind op_kind_;
@@ -1672,6 +1673,7 @@
DECLARE_COMPUTATION(UnarySmiOp)
virtual bool CanDeoptimize() const { return true; }
+ virtual intptr_t ResultCid() const { return kSmiCid; }
private:
const Token::Kind op_kind_;
@@ -1741,6 +1743,7 @@
DECLARE_COMPUTATION(DoubleToDouble)
virtual bool CanDeoptimize() const { return true; }
+ virtual intptr_t ResultCid() const { return kDoubleCid; }
private:
InstanceCallComp* instance_call_;
@@ -1761,6 +1764,7 @@
virtual intptr_t ArgumentCount() const { return 1; }
virtual bool CanDeoptimize() const { return true; }
+ virtual intptr_t ResultCid() const { return kDoubleCid; }
private:
InstanceCallComp* instance_call_;

Powered by Google App Engine
This is Rietveld 408576698