Retain subclass valueinfo while optimizing BailOnNotObject in OptTagChecks
Fixes OS#13115740.
In OptTagCheks currently, the valueinfo is being replaced by a new valueinfo changing the valuetype turning off Bits::CanBeTaggedValue for a BailOnNotObject instruction.
The initial valueInfo can be an IntRange ranging from 0 - INT_MAX for something like an array length. If the array length symbol is the opnd of BailOnNotObject then, the valueInfo will change to INT_MIN to INT_MAX.
Avoid this by preserving the subclass info while changing the value type.
function test0() {
var ui16 = new Uint16Array();
for (var _strvar0 in ui16) {
litObj1.prop0 = ui16.length; // Array Length int specialized with int range 0 - INT_MAX
if (litObj1.prop0.prop0) { // Generates BailOnNotObject on array length and force sets the value info to INT_MIN - INT_MAX
ui16.length; // We end up with a negative lower bound on array length, assertion is fired during typespec
}
}
}