diff --git a/js/src/jit/Safepoints.cpp b/js/src/jit/Safepoints.cpp index 0d9a16f701d1..89b53ba1e309 100644 --- a/js/src/jit/Safepoints.cpp +++ b/js/src/jit/Safepoints.cpp @@ -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(); }