HChange is only deletable under certain circumstances.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/11092075

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12702 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 348736ef
...@@ -1194,7 +1194,7 @@ class HUnaryOperation: public HTemplateInstruction<1> { ...@@ -1194,7 +1194,7 @@ class HUnaryOperation: public HTemplateInstruction<1> {
return reinterpret_cast<HUnaryOperation*>(value); return reinterpret_cast<HUnaryOperation*>(value);
} }
HValue* value() { return OperandAt(0); } HValue* value() const { return OperandAt(0); }
virtual void PrintDataTo(StringStream* stream); virtual void PrintDataTo(StringStream* stream);
}; };
...@@ -1270,8 +1270,8 @@ class HChange: public HUnaryOperation { ...@@ -1270,8 +1270,8 @@ class HChange: public HUnaryOperation {
virtual HType CalculateInferredType(); virtual HType CalculateInferredType();
virtual HValue* Canonicalize(); virtual HValue* Canonicalize();
Representation from() { return value()->representation(); } Representation from() const { return value()->representation(); }
Representation to() { return representation(); } Representation to() const { return representation(); }
bool deoptimize_on_undefined() const { bool deoptimize_on_undefined() const {
return CheckFlag(kDeoptimizeOnUndefined); return CheckFlag(kDeoptimizeOnUndefined);
} }
...@@ -1292,7 +1292,9 @@ class HChange: public HUnaryOperation { ...@@ -1292,7 +1292,9 @@ class HChange: public HUnaryOperation {
virtual bool DataEquals(HValue* other) { return true; } virtual bool DataEquals(HValue* other) { return true; }
private: private:
virtual bool IsDeletable() const { return true; } virtual bool IsDeletable() const {
return !from().IsTagged() || value()->type().IsSmi();
}
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment