@@ -1321,6 +1321,26 @@ LinearScan::EnsureGlobalBailOutRecordTable(Func *func)
1321
1321
return globalBailOutRecordDataTable;
1322
1322
}
1323
1323
1324
+ void
1325
+ LinearScan::SetBitVectorIfTypeSpec (StackSym * sym, Js::RegSlot regSlot, BVFixed * intSyms, BVFixed * floatSyms)
1326
+ {
1327
+ if (sym->IsTypeSpec ())
1328
+ {
1329
+ if (IRType_IsNativeInt (sym->m_type ))
1330
+ {
1331
+ intSyms->Set (regSlot);
1332
+ }
1333
+ else if (IRType_IsFloat (sym->m_type ))
1334
+ {
1335
+ floatSyms->Set (regSlot);
1336
+ }
1337
+ else
1338
+ {
1339
+ Assert (UNREACHED);
1340
+ }
1341
+ }
1342
+ }
1343
+
1324
1344
void
1325
1345
LinearScan::FillBailOutRecord (IR::Instr * instr)
1326
1346
{
@@ -1463,14 +1483,8 @@ LinearScan::FillBailOutRecord(IR::Instr * instr)
1463
1483
1464
1484
StackSym * copyStackSym = copyPropSyms.Value ();
1465
1485
this ->FillBailOutOffset (&funcBailOutData[index].localOffsets [i], copyStackSym, &state, instr);
1466
- if (copyStackSym->IsInt32 ())
1467
- {
1468
- funcBailOutData[index].losslessInt32Syms ->Set (i);
1469
- }
1470
- else if (copyStackSym->IsFloat64 ())
1471
- {
1472
- funcBailOutData[index].float64Syms ->Set (i);
1473
- }
1486
+ SetBitVectorIfTypeSpec (copyStackSym, i, funcBailOutData[index].losslessInt32Syms , funcBailOutData[index].float64Syms );
1487
+
1474
1488
copyPropSymsIter.RemoveCurrent (this ->func ->m_alloc );
1475
1489
}
1476
1490
NEXT_SLISTBASE_ENTRY_EDITING;
@@ -1494,14 +1508,7 @@ LinearScan::FillBailOutRecord(IR::Instr * instr)
1494
1508
AssertMsg (funcBailOutData[index].localOffsets [i] == 0 , " Can't have two active lifetime for the same byte code register" );
1495
1509
1496
1510
this ->FillBailOutOffset (&funcBailOutData[index].localOffsets [i], stackSym, &state, instr);
1497
- if (stackSym->IsInt32 ())
1498
- {
1499
- funcBailOutData[index].losslessInt32Syms ->Set (i);
1500
- }
1501
- else if (stackSym->IsFloat64 ())
1502
- {
1503
- funcBailOutData[index].float64Syms ->Set (i);
1504
- }
1511
+ SetBitVectorIfTypeSpec (stackSym, i, funcBailOutData[index].losslessInt32Syms , funcBailOutData[index].float64Syms );
1505
1512
}
1506
1513
NEXT_BITSET_IN_SPARSEBV;
1507
1514
@@ -1572,7 +1579,7 @@ LinearScan::FillBailOutRecord(IR::Instr * instr)
1572
1579
funcBailOutData[dataIndex].localOffsets [regSlotId] = this ->func ->AdjustOffsetValue (offset);
1573
1580
1574
1581
// We don't support typespec for debug, rework on the bellow assert once we start support them.
1575
- Assert (!stackSym->IsInt32 () && !stackSym-> IsFloat64 () && !stackSym-> IsSimd128 ());
1582
+ Assert (!stackSym->IsTypeSpec ());
1576
1583
}
1577
1584
}
1578
1585
}
@@ -1737,14 +1744,7 @@ LinearScan::FillBailOutRecord(IR::Instr * instr)
1737
1744
else
1738
1745
{
1739
1746
this ->FillBailOutOffset (&outParamOffsets[outParamOffsetIndex], copyStackSym, &state, instr);
1740
- if (copyStackSym->IsInt32 ())
1741
- {
1742
- argOutLosslessInt32Syms->Set (outParamOffsetIndex);
1743
- }
1744
- else if (copyStackSym->IsFloat64 ())
1745
- {
1746
- argOutFloat64Syms->Set (outParamOffsetIndex);
1747
- }
1747
+ SetBitVectorIfTypeSpec (copyStackSym, outParamOffsetIndex, argOutLosslessInt32Syms, argOutFloat64Syms);
1748
1748
}
1749
1749
#if DBG_DUMP
1750
1750
if (PHASE_DUMP (Js::BailOutPhase, this ->func ))
@@ -1861,14 +1861,7 @@ LinearScan::FillBailOutRecord(IR::Instr * instr)
1861
1861
this ->FillBailOutOffset (&outParamOffsets[outParamOffsetIndex], sym, &state, instr);
1862
1862
}
1863
1863
1864
- if (sym->IsFloat64 ())
1865
- {
1866
- argOutFloat64Syms->Set (outParamOffsetIndex);
1867
- }
1868
- else if (sym->IsInt32 ())
1869
- {
1870
- argOutLosslessInt32Syms->Set (outParamOffsetIndex);
1871
- }
1864
+ SetBitVectorIfTypeSpec (sym, outParamOffsetIndex, argOutLosslessInt32Syms, argOutFloat64Syms);
1872
1865
#if DBG_DUMP
1873
1866
if (PHASE_DUMP (Js::BailOutPhase, this ->func ))
1874
1867
{
0 commit comments