summary refs log tree commit diff
path: root/compiler/rustc_serialize/src/opaque.rs
AgeCommit message (Collapse)AuthorLines
2021-12-28Do not use LEB128 for encoding u16 and i16Jakub Beránek-8/+15
2021-12-06avoid string validation in rustc_serialize, check a marker byte insteadThe 8472-4/+17
since the serialization format isn't self-describing we need a way to detect when encoder and decoder don't match up. but that doesn't have to be utf8 validation for strings, which does cost a few % of performance. Instead we can use a marker byte at the end to be reasonably sure that we're dealing with a string and it wasn't overwritten in some way.
2021-03-25Allow for reading raw bytes from rustc_serialize::Decoder without unsafe code.Michael Woerister-29/+15
2021-03-19Move raw bytes handling to Encoder/Decoder.Camille GILLOT-44/+46
2021-03-18Simplify IntEncodedWithFixedSize.Camille GILLOT-13/+5
2021-03-18Move IntEncodedWithFixedSize to rustc_serialize.Camille GILLOT-0/+48
2021-01-11rustc_serialize: fix incorrect signed LEB128 decodingTyson Nottingham-20/+12
The signed LEB128 decoding function used a hardcoded constant of 64 instead of the number of bits in the type of integer being decoded, which resulted in incorrect results for some inputs. Fix this, make the decoding more consistent with the unsigned version, and increase the LEB128 encoding and decoding test coverage.
2021-01-11Serialize incr comp structures to file via fixed-size bufferTyson Nottingham-22/+389
Reduce a large memory spike that happens during serialization by writing the incr comp structures to file by way of a fixed-size buffer, rather than an unbounded vector. Effort was made to keep the instruction count close to that of the previous implementation. However, buffered writing to a file inherently has more overhead than writing to a vector, because each write may result in a handleable error. To reduce this overhead, arrangements are made so that each LEB128-encoded integer can be written to the buffer with only one capacity and error check. Higher-level optimizations in which entire composite structures can be written with one capacity and error check are possible, but would require much more work. The performance is mostly on par with the previous implementation, with small to moderate instruction count regressions. The memory reduction is significant, however, so it seems like a worth-while trade-off.
2021-01-01rustc_serialize: specialize opaque decoding of some u8 sequencesTyson Nottingham-4/+25
2021-01-01rustc_serialize: have read_raw_bytes take MaybeUninit<u8> sliceTyson Nottingham-3/+13
2021-01-01rustc_serialize: specialize opaque encoding of some u8 sequencesTyson Nottingham-0/+12
2020-10-13Replace absolute paths with relative onesest31-3/+3
Modern compilers allow reaching external crates like std or core via relative paths in modules outside of lib.rs and main.rs.
2020-08-30mv compiler to compiler/mark-0/+318