about summary refs log tree commit diff
path: root/src/libserialize/leb128.rs
AgeCommit message (Collapse)AuthorLines
2020-06-02Rename directories for some compiler crates from `libx` to `librustc_x`Vadim Petrochenkov-110/+0
libarena -> librustc_arena libfmt_macros -> librustc_parse_format libgraphviz -> librustc_graphviz libserialize -> librustc_serialize
2020-02-11Micro-optimize the heck out of LEB128 reading and writing.Nicholas Nethercote-50/+14
This commit makes the following writing improvements: - Removes the unnecessary `write_to_vec` function. - Reduces the number of conditions per loop from 2 to 1. - Avoids a mask and a shift on the final byte. And the following reading improvements: - Removes an unnecessary type annotation. - Fixes a dangerous unchecked slice access. Imagine a slice `[0x80]` -- the current code will read past the end of the slice some number of bytes. The bounds check at the end will subsequently trigger, unless something bad (like a crash) happens first. The cost of doing bounds check in the loop body is negligible. - Avoids a mask on the final byte. And the following improvements for both reading and writing: - Changes `for` to `loop` for the loops, avoiding an unnecessary condition on each iteration. This also removes the need for `leb128_size`. All of these changes give significant perf wins, up to 5%.
2019-12-22Format the worldMark Rousskov-20/+26
2019-08-02libserialize: Unconfigure tests during normal buildVadim Petrochenkov-44/+0
2019-06-26Fix clippy::cast_loslessIgor Matuszewski-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-08-15Mark libserialize functions as inlineBurntPizza-0/+1
2018-08-11A few cleanups for fmt_macros, graphviz, apfloat, target, serialize and termljedrz-2/+2
2018-06-27Make opaque::Encoder append-only and make it infallibleJohn Kåre Alsaker-27/+11
2018-01-09Make leb128 coding a bit faster.Michael Woerister-62/+102
2017-02-03Bump version, upgrade bootstrapAlex Crichton-2/+0
This commit updates the version number to 1.17.0 as we're not on that version of the nightly compiler, and at the same time this updates src/stage0.txt to bootstrap from freshly minted beta compiler and beta Cargo.
2016-12-30Fix rebase fallout and compilation fixesest31-2/+2
2016-12-30impl Step for iu128Simonas Kazlauskas-10/+1
Also fix the leb128 tests
2016-12-30Fix LEB128 to work with the stage1Simonas Kazlauskas-24/+24
Stage 1 can’t really handle negative 128-bit literals, but an equivalent bit-not is fine
2016-12-30Such large. Very 128. Much bits.Simonas Kazlauskas-30/+31
This commit introduces 128-bit integers. Stage 2 builds and produces a working compiler which understands and supports 128-bit integers throughout. The general strategy used is to have rustc_i128 module which provides aliases for iu128, equal to iu64 in stage9 and iu128 later. Since nowhere in rustc we rely on large numbers being supported, this strategy is good enough to get past the first bootstrap stages to end up with a fully working 128-bit capable compiler. In order for this strategy to work, number of locations had to be changed to use associated max_value/min_value instead of MAX/MIN constants as well as the min_value (or was it max_value?) had to be changed to use xor instead of shift so both 64-bit and 128-bit based consteval works (former not necessarily producing the right results in stage1). This commit includes manual merge conflict resolution changes from a rebase by @est31.
2016-12-15Use StableHasher everywhereAriel Ben-Yehuda-14/+40
The standard implementations of Hasher have architecture-dependent results when hashing integers. This causes problems when the hashes are stored within metadata - metadata written by one host architecture can't be read by another. To fix that, implement an architecture-independent StableHasher and use it in all places an architecture-independent hasher is needed. Fixes #38177.
2016-10-18Inline read_{un,}signed_leb128 and opaque::Decoder functions.Nicholas Nethercote-0/+2
These functions are all hot in rustc and inlining them speeds up most of the rustc-benchmarks by 1--2%.
2016-09-20Remove librbml and the RBML-tagged auto-encoder/decoder.Eduard Burtescu-0/+151