@@ -4813,7 +4813,7 @@ GlobOpt::ValueNumberDst(IR::Instr **pInstr, Value *src1Val, Value *src2Val)
4813
4813
}
4814
4814
else
4815
4815
{
4816
- return NewGenericValue(src1ValueInfo->Type().ToDefiniteAnyNumber(), dst);
4816
+ return NewGenericValue(src1ValueInfo->Type().ToDefiniteAnyNumber().SetCanBeTaggedValue(true) , dst);
4817
4817
}
4818
4818
break;
4819
4819
@@ -4874,7 +4874,7 @@ GlobOpt::ValueNumberDst(IR::Instr **pInstr, Value *src1Val, Value *src2Val)
4874
4874
{
4875
4875
valueType = ValueType::Number;
4876
4876
}
4877
- return CreateDstUntransferredValue(valueType, instr, src1Val, src2Val);
4877
+ return CreateDstUntransferredValue(valueType.SetCanBeTaggedValue(true) , instr, src1Val, src2Val);
4878
4878
}
4879
4879
4880
4880
case Js::OpCode::Add_A:
@@ -4908,12 +4908,12 @@ GlobOpt::ValueNumberDst(IR::Instr **pInstr, Value *src1Val, Value *src2Val)
4908
4908
{
4909
4909
// If one of them is a float, the result probably is a float instead of just int
4910
4910
// but should always be a number.
4911
- valueType = ValueType::Float;
4911
+ valueType = ValueType::Float.SetCanBeTaggedValue(true) ;
4912
4912
}
4913
4913
else
4914
4914
{
4915
4915
// Could be int, could be number
4916
- valueType = ValueType::Number;
4916
+ valueType = ValueType::Number.SetCanBeTaggedValue(true) ;
4917
4917
}
4918
4918
}
4919
4919
else if (src1ValueInfo->IsLikelyFloat() || src2ValueInfo->IsLikelyFloat())
@@ -4937,7 +4937,7 @@ GlobOpt::ValueNumberDst(IR::Instr **pInstr, Value *src1Val, Value *src2Val)
4937
4937
&& (src2Val && src2ValueInfo->IsNotString() && src2ValueInfo->IsPrimitive()))
4938
4938
{
4939
4939
// If src1 and src2 are not strings and primitive, add should yield a number.
4940
- valueType = ValueType::Number;
4940
+ valueType = ValueType::Number.SetCanBeTaggedValue(true) ;
4941
4941
}
4942
4942
else if((src1Val && src1ValueInfo->IsLikelyString()) || (src2Val && src2ValueInfo->IsLikelyString()))
4943
4943
{
@@ -4958,7 +4958,7 @@ GlobOpt::ValueNumberDst(IR::Instr **pInstr, Value *src1Val, Value *src2Val)
4958
4958
ValueType divValueType = GetDivValueType(instr, src1Val, src2Val, false);
4959
4959
if (divValueType.IsLikelyInt() || divValueType.IsFloat())
4960
4960
{
4961
- return CreateDstUntransferredValue(divValueType, instr, src1Val, src2Val);
4961
+ return CreateDstUntransferredValue(divValueType.SetCanBeTaggedValue(true) , instr, src1Val, src2Val);
4962
4962
}
4963
4963
}
4964
4964
// fall-through
@@ -4990,11 +4990,11 @@ GlobOpt::ValueNumberDst(IR::Instr **pInstr, Value *src1Val, Value *src2Val)
4990
4990
// This should ideally be NewNumberAndLikelyFloatValue since we know the result is a number but not sure if it will
4991
4991
// be a float value. However, that Number/LikelyFloat value type doesn't exist currently and all the necessary
4992
4992
// checks are done for float values (tagged int checks, etc.) so it's sufficient to just create a float value here.
4993
- valueType = ValueType::Float;
4993
+ valueType = ValueType::Float.SetCanBeTaggedValue(true) ;
4994
4994
}
4995
4995
else
4996
4996
{
4997
- valueType = ValueType::Number;
4997
+ valueType = ValueType::Number.SetCanBeTaggedValue(true) ;
4998
4998
}
4999
4999
5000
5000
return CreateDstUntransferredValue(valueType, instr, src1Val, src2Val);
0 commit comments