rust/compiler/rustc_metadata/src
bors adaac6b166 Auto merge of #110634 - saethlin:pointy-decoder, r=cjgillot
Rewrite MemDecoder around pointers not a slice

This is basically https://github.com/rust-lang/rust/pull/109910 but I'm being a lot more aggressive. The pointer-based structure means that it makes a lot more sense to absorb more complexity into `MemDecoder`, most of the diff is just complexity moving from one place to another.

The primary argument for this structure is that we only incur a single bounds check when doing multi-byte reads from a `MemDecoder`. With the slice-based implementation we need to do those with `data[position..position + len]` , which needs to account for `position + len` wrapping. It would be possible to dodge the first bounds check if we stored a slice that starts at `position`, but that would require updating the pointer and length on every read.

This PR also embeds the failure path in a separate function, which means that this PR should subsume all the perf wins observed in https://github.com/rust-lang/rust/pull/109867.
2023-04-26 02:36:42 +00:00
..
rmeta Auto merge of #110634 - saethlin:pointy-decoder, r=cjgillot 2023-04-26 02:36:42 +00:00
creader.rs Revert "Remove #[alloc_error_handler] from the compiler and library" 2023-04-25 00:08:35 +02:00
dependency_format.rs Replace enum ==s with matches where it makes sense 2023-01-30 12:26:26 +00:00
errors.rs Revert "Remove #[alloc_error_handler] from the compiler and library" 2023-04-25 00:08:35 +02:00
foreign_modules.rs Rename some OwnerId fields. 2022-10-29 20:28:38 +11:00
fs.rs Only compute the crate hash when necessary. 2023-03-08 09:30:22 +11:00
lib.rs Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
locator.rs Box large enum variants 2023-04-09 21:59:28 +02:00
native_libs.rs The name of NativeLib will be presented 2023-03-19 11:23:19 +08:00