Commit a99050d4 authored by verwaest@chromium.org's avatar verwaest@chromium.org

Set kTruncatingToSmi for HChange only when To rep is Smi

BUG=
R=verwaest@chromium.org

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

Patch from Weiliang Lin <weiliang.lin@intel.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20385 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4da732e3
......@@ -1561,6 +1561,7 @@ void HChange::PrintDataTo(StringStream* stream) {
HUnaryOperation::PrintDataTo(stream);
stream->Add(" %s to %s", from().Mnemonic(), to().Mnemonic());
if (CanTruncateToSmi()) stream->Add(" truncating-smi");
if (CanTruncateToInt32()) stream->Add(" truncating-int32");
if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?");
if (CheckFlag(kAllowUndefinedAsNaN)) stream->Add(" allow-undefined-as-nan");
......
......@@ -1263,6 +1263,7 @@ class HInstruction : public HValue {
position_.set_operand_position(index, pos);
}
bool CanTruncateToSmi() const { return CheckFlag(kTruncatingToSmi); }
bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); }
virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0;
......@@ -1733,7 +1734,7 @@ class HChange V8_FINAL : public HUnaryOperation {
set_representation(to);
SetFlag(kUseGVN);
SetFlag(kCanOverflow);
if (is_truncating_to_smi) {
if (is_truncating_to_smi && to.IsSmi()) {
SetFlag(kTruncatingToSmi);
SetFlag(kTruncatingToInt32);
}
......
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