diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/v8/src/codegen/source-position-table.cc | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/v8/src/codegen/source-position-table.cc')
-rw-r--r-- | chromium/v8/src/codegen/source-position-table.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/chromium/v8/src/codegen/source-position-table.cc b/chromium/v8/src/codegen/source-position-table.cc index 0f03867331e..a07f76e4d10 100644 --- a/chromium/v8/src/codegen/source-position-table.cc +++ b/chromium/v8/src/codegen/source-position-table.cc @@ -49,10 +49,10 @@ void SubtractFromEntry(PositionTableEntry* value, // Helper: Encode an integer. template <typename T> -void EncodeInt(std::vector<byte>* bytes, T value) { +void EncodeInt(ZoneVector<byte>* bytes, T value) { using unsigned_type = typename std::make_unsigned<T>::type; // Zig-zag encoding. - static const int kShift = sizeof(T) * kBitsPerByte - 1; + static constexpr int kShift = sizeof(T) * kBitsPerByte - 1; value = ((static_cast<unsigned_type>(value) << 1) ^ (value >> kShift)); DCHECK_GE(value, 0); unsigned_type encoded = static_cast<unsigned_type>(value); @@ -67,7 +67,7 @@ void EncodeInt(std::vector<byte>* bytes, T value) { } // Encode a PositionTableEntry. -void EncodeEntry(std::vector<byte>* bytes, const PositionTableEntry& entry) { +void EncodeEntry(ZoneVector<byte>* bytes, const PositionTableEntry& entry) { // We only accept ascending code offsets. DCHECK_GE(entry.code_offset, 0); // Since code_offset is not negative, we use sign to encode is_statement. @@ -115,7 +115,7 @@ Vector<const byte> VectorFromByteArray(ByteArray byte_array) { } #ifdef ENABLE_SLOW_DCHECKS -void CheckTableEquals(const std::vector<PositionTableEntry>& raw_entries, +void CheckTableEquals(const ZoneVector<PositionTableEntry>& raw_entries, SourcePositionTableIterator* encoded) { // Brute force testing: Record all positions and decode // the entire table to verify they are identical. @@ -133,8 +133,14 @@ void CheckTableEquals(const std::vector<PositionTableEntry>& raw_entries, } // namespace SourcePositionTableBuilder::SourcePositionTableBuilder( - SourcePositionTableBuilder::RecordingMode mode) - : mode_(mode), previous_() {} + Zone* zone, SourcePositionTableBuilder::RecordingMode mode) + : mode_(mode), + bytes_(zone), +#ifdef ENABLE_SLOW_DCHECKS + raw_entries_(zone), +#endif + previous_() { +} void SourcePositionTableBuilder::AddPosition(size_t code_offset, SourcePosition source_position, |