зеркало из https://github.com/mozilla/gecko-dev.git
Bug 969436 - Changed the SafepointReader constructor to properly read safepoints, depending on the size of PackedRegisterMask; r=Nicolas B. Pierron
This commit is contained in:
Родитель
2406f8b916
Коммит
a373f95583
|
@ -43,12 +43,20 @@ SafepointWriter::writeOsiCallPointOffset(uint32_t osiCallPointOffset)
|
|||
static void
|
||||
WriteRegisterMask(CompactBufferWriter &stream, uint32_t bits)
|
||||
{
|
||||
if (sizeof(PackedRegisterMask) == 8)
|
||||
if (sizeof(PackedRegisterMask) == 1)
|
||||
stream.writeByte(bits);
|
||||
else
|
||||
stream.writeUnsigned(bits);
|
||||
}
|
||||
|
||||
static int32_t
|
||||
ReadRegisterMask(CompactBufferReader &stream)
|
||||
{
|
||||
if (sizeof(PackedRegisterMask) == 1)
|
||||
return stream.readByte();
|
||||
return stream.readUnsigned();
|
||||
}
|
||||
|
||||
void
|
||||
SafepointWriter::writeGcRegs(LSafepoint *safepoint)
|
||||
{
|
||||
|
@ -342,20 +350,20 @@ SafepointReader::SafepointReader(IonScript *script, const SafepointIndex *si)
|
|||
osiCallPointOffset_ = stream_.readUnsigned();
|
||||
|
||||
// gcSpills is a subset of allGprSpills.
|
||||
allGprSpills_ = GeneralRegisterSet(stream_.readUnsigned());
|
||||
allGprSpills_ = GeneralRegisterSet(ReadRegisterMask(stream_));
|
||||
if (allGprSpills_.empty()) {
|
||||
gcSpills_ = allGprSpills_;
|
||||
valueSpills_ = allGprSpills_;
|
||||
slotsOrElementsSpills_ = allGprSpills_;
|
||||
} else {
|
||||
gcSpills_ = GeneralRegisterSet(stream_.readUnsigned());
|
||||
slotsOrElementsSpills_ = GeneralRegisterSet(stream_.readUnsigned());
|
||||
gcSpills_ = GeneralRegisterSet(ReadRegisterMask(stream_));
|
||||
slotsOrElementsSpills_ = GeneralRegisterSet(ReadRegisterMask(stream_));
|
||||
#ifdef JS_PUNBOX64
|
||||
valueSpills_ = GeneralRegisterSet(stream_.readUnsigned());
|
||||
valueSpills_ = GeneralRegisterSet(ReadRegisterMask(stream_));
|
||||
#endif
|
||||
}
|
||||
|
||||
allFloatSpills_ = FloatRegisterSet(stream_.readUnsigned());
|
||||
allFloatSpills_ = FloatRegisterSet(ReadRegisterMask(stream_));
|
||||
|
||||
advanceFromGcRegs();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче