Skip to content

Commit

Permalink
taking a stab
Browse files Browse the repository at this point in the history
Signed-off-by: Heinz N. Gies <[email protected]>
  • Loading branch information
Licenser committed Aug 23, 2024
1 parent 21cc445 commit 9f2f78c
Show file tree
Hide file tree
Showing 10 changed files with 174 additions and 81 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ colored = { version = "2.0", optional = true }
getopts = { version = "0.2", optional = true }
jemallocator = { version = "0.5", optional = true }
perfcnt = { version = "0.8", optional = true }
iex = { version = "0.2", optional = false }

ref-cast = "1.0"

Expand Down
1 change: 1 addition & 0 deletions src/impls/avx2/deser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use crate::{
clippy::too_many_lines
)]
#[cfg_attr(not(feature = "no-inline"), inline)]
#[iex::iex]
pub(crate) unsafe fn parse_str<'invoke, 'de>(
input: SillyWrapper<'de>,
data: &'invoke [u8],
Expand Down
1 change: 1 addition & 0 deletions src/impls/native/deser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::{
};

#[allow(clippy::cast_possible_truncation)]
#[iex::iex]
pub(crate) unsafe fn parse_str<'invoke, 'de>(
input: SillyWrapper<'de>,
data: &'invoke [u8],
Expand Down
1 change: 1 addition & 0 deletions src/impls/neon/deser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ fn find_bs_bits_and_quote_bits(v0: uint8x16_t, v1: uint8x16_t) -> (u32, u32) {

#[allow(clippy::if_not_else, clippy::too_many_lines)]
#[cfg_attr(not(feature = "no-inline"), inline)]
#[iex::iex]
pub(crate) fn parse_str<'invoke, 'de>(
input: SillyWrapper<'de>,
data: &'invoke [u8],
Expand Down
1 change: 1 addition & 0 deletions src/impls/portable/deser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::{
};

#[cfg_attr(not(feature = "no-inline"), inline)]
#[iex::iex]
pub(crate) unsafe fn parse_str<'invoke, 'de>(
input: SillyWrapper<'de>,
data: &'invoke [u8],
Expand Down
1 change: 1 addition & 0 deletions src/impls/simd128/deser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use crate::{
clippy::too_many_lines
)]
#[cfg_attr(not(feature = "no-inline"), inline)]
#[iex::iex]
pub(crate) fn parse_str<'invoke, 'de>(
input: SillyWrapper<'de>,
data: &'invoke [u8],
Expand Down
1 change: 1 addition & 0 deletions src/impls/sse42/deser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use arch::{
#[target_feature(enable = "sse4.2")]
#[allow(clippy::if_not_else, clippy::cast_possible_wrap)]
#[cfg_attr(not(feature = "no-inline"), inline)]
#[iex::iex]
pub(crate) unsafe fn parse_str<'invoke, 'de>(
input: SillyWrapper<'de>,
data: &'invoke [u8],
Expand Down
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ mod numberparse;
mod safer_unchecked;
mod stringparse;

use iex::Outcome;
use safer_unchecked::GetSaferUnchecked;
use stage2::StackState;

Expand Down Expand Up @@ -547,6 +548,7 @@ impl<'de> Deserializer<'de> {
feature = "runtime-detection",
any(target_arch = "x86_64", target_arch = "x86"),
))]
#[iex::iex]
pub(crate) unsafe fn parse_str_<'invoke>(
input: *mut u8,
data: &'invoke [u8],
Expand Down Expand Up @@ -606,6 +608,7 @@ impl<'de> Deserializer<'de> {
target_feature = "simd128",
target_arch = "aarch64",
)))]
#[iex::iex]
pub(crate) unsafe fn parse_str_<'invoke>(
input: *mut u8,
data: &'invoke [u8],
Expand All @@ -620,6 +623,7 @@ impl<'de> Deserializer<'de> {
}
#[cfg_attr(not(feature = "no-inline"), inline)]
#[cfg(all(feature = "portable", not(feature = "runtime-detection")))]
#[iex::iex]
pub(crate) unsafe fn parse_str_<'invoke>(
input: *mut u8,
data: &'invoke [u8],
Expand All @@ -639,6 +643,7 @@ impl<'de> Deserializer<'de> {
not(feature = "portable"),
not(feature = "runtime-detection"),
))]
#[iex::iex]
pub(crate) unsafe fn parse_str_<'invoke>(
input: *mut u8,
data: &'invoke [u8],
Expand All @@ -656,6 +661,7 @@ impl<'de> Deserializer<'de> {
not(feature = "runtime-detection"),
not(feature = "portable"),
))]
#[iex::iex]
pub(crate) unsafe fn parse_str_<'invoke>(
input: *mut u8,
data: &'invoke [u8],
Expand All @@ -668,6 +674,7 @@ impl<'de> Deserializer<'de> {

#[cfg_attr(not(feature = "no-inline"), inline)]
#[cfg(all(target_arch = "aarch64", not(feature = "portable")))]
#[iex::iex]
pub(crate) unsafe fn parse_str_<'invoke>(
input: *mut u8,
data: &'invoke [u8],
Expand All @@ -679,6 +686,7 @@ impl<'de> Deserializer<'de> {
}
#[cfg_attr(not(feature = "no-inline"), inline)]
#[cfg(all(target_feature = "simd128", not(feature = "portable")))]
#[iex::iex]
pub(crate) unsafe fn parse_str_<'invoke>(
input: *mut u8,
data: &'invoke [u8],
Expand Down Expand Up @@ -906,6 +914,7 @@ impl<'de> Deserializer<'de> {
&mut buffer.stage2_stack,
tape,
)
.into_result()
}

/// Creates a serializer from a mutable slice of bytes using a temporary
Expand Down
Loading

0 comments on commit 9f2f78c

Please sign in to comment.