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
This commit is contained in:
parent
4da732e321
commit
a99050d40e
@ -1561,6 +1561,7 @@ void HChange::PrintDataTo(StringStream* stream) {
|
|||||||
HUnaryOperation::PrintDataTo(stream);
|
HUnaryOperation::PrintDataTo(stream);
|
||||||
stream->Add(" %s to %s", from().Mnemonic(), to().Mnemonic());
|
stream->Add(" %s to %s", from().Mnemonic(), to().Mnemonic());
|
||||||
|
|
||||||
|
if (CanTruncateToSmi()) stream->Add(" truncating-smi");
|
||||||
if (CanTruncateToInt32()) stream->Add(" truncating-int32");
|
if (CanTruncateToInt32()) stream->Add(" truncating-int32");
|
||||||
if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?");
|
if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?");
|
||||||
if (CheckFlag(kAllowUndefinedAsNaN)) stream->Add(" allow-undefined-as-nan");
|
if (CheckFlag(kAllowUndefinedAsNaN)) stream->Add(" allow-undefined-as-nan");
|
||||||
|
@ -1263,6 +1263,7 @@ class HInstruction : public HValue {
|
|||||||
position_.set_operand_position(index, pos);
|
position_.set_operand_position(index, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CanTruncateToSmi() const { return CheckFlag(kTruncatingToSmi); }
|
||||||
bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); }
|
bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); }
|
||||||
|
|
||||||
virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0;
|
virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0;
|
||||||
@ -1733,7 +1734,7 @@ class HChange V8_FINAL : public HUnaryOperation {
|
|||||||
set_representation(to);
|
set_representation(to);
|
||||||
SetFlag(kUseGVN);
|
SetFlag(kUseGVN);
|
||||||
SetFlag(kCanOverflow);
|
SetFlag(kCanOverflow);
|
||||||
if (is_truncating_to_smi) {
|
if (is_truncating_to_smi && to.IsSmi()) {
|
||||||
SetFlag(kTruncatingToSmi);
|
SetFlag(kTruncatingToSmi);
|
||||||
SetFlag(kTruncatingToInt32);
|
SetFlag(kTruncatingToInt32);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user