deps: update simdjson to 3.12.3
PR-URL: https://github.com/nodejs/node/pull/57682 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
parent
e0cd138e52
commit
375a6413d5
63
deps/simdjson/simdjson.cpp
vendored
63
deps/simdjson/simdjson.cpp
vendored
@ -1,4 +1,4 @@
|
|||||||
/* auto-generated on 2025-02-14 16:11:36 -0500. Do not edit! */
|
/* auto-generated on 2025-03-27 15:01:10 -0400. Do not edit! */
|
||||||
/* including simdjson.cpp: */
|
/* including simdjson.cpp: */
|
||||||
/* begin file simdjson.cpp */
|
/* begin file simdjson.cpp */
|
||||||
#define SIMDJSON_SRC_SIMDJSON_CPP
|
#define SIMDJSON_SRC_SIMDJSON_CPP
|
||||||
@ -2431,7 +2431,7 @@ enum error_code {
|
|||||||
SUCCESS = 0, ///< No error
|
SUCCESS = 0, ///< No error
|
||||||
CAPACITY, ///< This parser can't support a document that big
|
CAPACITY, ///< This parser can't support a document that big
|
||||||
MEMALLOC, ///< Error allocating memory, most likely out of memory
|
MEMALLOC, ///< Error allocating memory, most likely out of memory
|
||||||
TAPE_ERROR, ///< Something went wrong, this is a generic error
|
TAPE_ERROR, ///< Something went wrong, this is a generic error. Fatal/unrecoverable error.
|
||||||
DEPTH_ERROR, ///< Your document exceeds the user-specified depth limitation
|
DEPTH_ERROR, ///< Your document exceeds the user-specified depth limitation
|
||||||
STRING_ERROR, ///< Problem while parsing a string
|
STRING_ERROR, ///< Problem while parsing a string
|
||||||
T_ATOM_ERROR, ///< Problem while parsing an atom starting with the letter 't'
|
T_ATOM_ERROR, ///< Problem while parsing an atom starting with the letter 't'
|
||||||
@ -2456,13 +2456,21 @@ enum error_code {
|
|||||||
PARSER_IN_USE, ///< parser is already in use.
|
PARSER_IN_USE, ///< parser is already in use.
|
||||||
OUT_OF_ORDER_ITERATION, ///< tried to iterate an array or object out of order (checked when SIMDJSON_DEVELOPMENT_CHECKS=1)
|
OUT_OF_ORDER_ITERATION, ///< tried to iterate an array or object out of order (checked when SIMDJSON_DEVELOPMENT_CHECKS=1)
|
||||||
INSUFFICIENT_PADDING, ///< The JSON doesn't have enough padding for simdjson to safely parse it.
|
INSUFFICIENT_PADDING, ///< The JSON doesn't have enough padding for simdjson to safely parse it.
|
||||||
INCOMPLETE_ARRAY_OR_OBJECT, ///< The document ends early.
|
INCOMPLETE_ARRAY_OR_OBJECT, ///< The document ends early. Fatal/unrecoverable error.
|
||||||
SCALAR_DOCUMENT_AS_VALUE, ///< A scalar document is treated as a value.
|
SCALAR_DOCUMENT_AS_VALUE, ///< A scalar document is treated as a value.
|
||||||
OUT_OF_BOUNDS, ///< Attempted to access location outside of document.
|
OUT_OF_BOUNDS, ///< Attempted to access location outside of document.
|
||||||
TRAILING_CONTENT, ///< Unexpected trailing content in the JSON input
|
TRAILING_CONTENT, ///< Unexpected trailing content in the JSON input
|
||||||
NUM_ERROR_CODES
|
NUM_ERROR_CODES
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Some errors are fatal and invalidate the document. This function returns true if the
|
||||||
|
* error is fatal. It returns true for TAPE_ERROR and INCOMPLETE_ARRAY_OR_OBJECT.
|
||||||
|
* Once a fatal error is encountered, the on-demand document is no longer valid and
|
||||||
|
* processing should stop.
|
||||||
|
*/
|
||||||
|
inline bool is_fatal(error_code error) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It is the convention throughout the code that the macro SIMDJSON_DEVELOPMENT_CHECKS determines whether
|
* It is the convention throughout the code that the macro SIMDJSON_DEVELOPMENT_CHECKS determines whether
|
||||||
* we check for OUT_OF_ORDER_ITERATION. The logic behind it is that these errors only occurs when the code
|
* we check for OUT_OF_ORDER_ITERATION. The logic behind it is that these errors only occurs when the code
|
||||||
@ -2765,14 +2773,30 @@ SIMDJSON_IMPL_CONCEPT(op_append, operator+=)
|
|||||||
#undef SIMDJSON_IMPL_CONCEPT
|
#undef SIMDJSON_IMPL_CONCEPT
|
||||||
} // namespace details
|
} // namespace details
|
||||||
|
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
concept string_view_like = std::is_convertible_v<T, std::string_view> &&
|
||||||
|
!std::is_convertible_v<T, const char*>;
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
concept constructible_from_string_view = std::is_constructible_v<T, std::string_view>
|
||||||
|
&& !std::is_same_v<T, std::string_view>
|
||||||
|
&& std::is_default_constructible_v<T>;
|
||||||
|
|
||||||
|
template<typename M>
|
||||||
|
concept string_view_keyed_map = string_view_like<typename M::key_type>
|
||||||
|
&& requires(std::remove_cvref_t<M>& m, typename M::key_type sv, typename M::mapped_type v) {
|
||||||
|
{ m.emplace(sv, v) } -> std::same_as<std::pair<typename M::iterator, bool>>;
|
||||||
|
};
|
||||||
|
|
||||||
/// Check if T is a container that we can append to, including:
|
/// Check if T is a container that we can append to, including:
|
||||||
/// std::vector, std::deque, std::list, std::string, ...
|
/// std::vector, std::deque, std::list, std::string, ...
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept appendable_containers =
|
concept appendable_containers =
|
||||||
details::supports_emplace_back<T> || details::supports_emplace<T> ||
|
(details::supports_emplace_back<T> || details::supports_emplace<T> ||
|
||||||
details::supports_push_back<T> || details::supports_push<T> ||
|
details::supports_push_back<T> || details::supports_push<T> ||
|
||||||
details::supports_add<T> || details::supports_append<T> ||
|
details::supports_add<T> || details::supports_append<T> ||
|
||||||
details::supports_insert<T>;
|
details::supports_insert<T>) && !string_view_keyed_map<T>;
|
||||||
|
|
||||||
/// Insert into the container however possible
|
/// Insert into the container however possible
|
||||||
template <appendable_containers T, typename... Args>
|
template <appendable_containers T, typename... Args>
|
||||||
@ -2840,6 +2864,8 @@ concept optional_type = requires(std::remove_cvref_t<T> obj) {
|
|||||||
{ static_cast<bool>(obj) } -> std::same_as<bool>; // convertible to bool
|
{ static_cast<bool>(obj) } -> std::same_as<bool>; // convertible to bool
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace concepts
|
} // namespace concepts
|
||||||
} // namespace simdjson
|
} // namespace simdjson
|
||||||
#endif // SIMDJSON_SUPPORTS_DESERIALIZATION
|
#endif // SIMDJSON_SUPPORTS_DESERIALIZATION
|
||||||
@ -4511,6 +4537,11 @@ extern SIMDJSON_DLLIMPORTEXPORT const uint32_t digit_to_val32[886];
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace simdjson {
|
namespace simdjson {
|
||||||
|
|
||||||
|
inline bool is_fatal(error_code error) noexcept {
|
||||||
|
return error == TAPE_ERROR || error == INCOMPLETE_ARRAY_OR_OBJECT;
|
||||||
|
}
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
// We store the error code so we can validate the error message is associated with the right code
|
// We store the error code so we can validate the error message is associated with the right code
|
||||||
struct error_code_info {
|
struct error_code_info {
|
||||||
@ -4696,7 +4727,7 @@ namespace internal {
|
|||||||
{ SUCCESS, "SUCCESS: No error" },
|
{ SUCCESS, "SUCCESS: No error" },
|
||||||
{ CAPACITY, "CAPACITY: This parser can't support a document that big" },
|
{ CAPACITY, "CAPACITY: This parser can't support a document that big" },
|
||||||
{ MEMALLOC, "MEMALLOC: Error allocating memory, we're most likely out of memory" },
|
{ MEMALLOC, "MEMALLOC: Error allocating memory, we're most likely out of memory" },
|
||||||
{ TAPE_ERROR, "TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc." },
|
{ TAPE_ERROR, "TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc. This is a fatal and unrecoverable error." },
|
||||||
{ DEPTH_ERROR, "DEPTH_ERROR: The JSON document was too deep (too many nested objects and arrays)" },
|
{ DEPTH_ERROR, "DEPTH_ERROR: The JSON document was too deep (too many nested objects and arrays)" },
|
||||||
{ STRING_ERROR, "STRING_ERROR: Problem while parsing a string" },
|
{ STRING_ERROR, "STRING_ERROR: Problem while parsing a string" },
|
||||||
{ T_ATOM_ERROR, "T_ATOM_ERROR: Problem while parsing an atom starting with the letter 't'" },
|
{ T_ATOM_ERROR, "T_ATOM_ERROR: Problem while parsing an atom starting with the letter 't'" },
|
||||||
@ -4721,7 +4752,7 @@ namespace internal {
|
|||||||
{ PARSER_IN_USE, "PARSER_IN_USE: Cannot parse a new document while a document is still in use." },
|
{ PARSER_IN_USE, "PARSER_IN_USE: Cannot parse a new document while a document is still in use." },
|
||||||
{ OUT_OF_ORDER_ITERATION, "OUT_OF_ORDER_ITERATION: Objects and arrays can only be iterated when they are first encountered." },
|
{ OUT_OF_ORDER_ITERATION, "OUT_OF_ORDER_ITERATION: Objects and arrays can only be iterated when they are first encountered." },
|
||||||
{ INSUFFICIENT_PADDING, "INSUFFICIENT_PADDING: simdjson requires the input JSON string to have at least SIMDJSON_PADDING extra bytes allocated, beyond the string's length. Consider using the simdjson::padded_string class if needed." },
|
{ INSUFFICIENT_PADDING, "INSUFFICIENT_PADDING: simdjson requires the input JSON string to have at least SIMDJSON_PADDING extra bytes allocated, beyond the string's length. Consider using the simdjson::padded_string class if needed." },
|
||||||
{ INCOMPLETE_ARRAY_OR_OBJECT, "INCOMPLETE_ARRAY_OR_OBJECT: JSON document ended early in the middle of an object or array." },
|
{ INCOMPLETE_ARRAY_OR_OBJECT, "INCOMPLETE_ARRAY_OR_OBJECT: JSON document ended early in the middle of an object or array. This is a fatal and unrecoverable error." },
|
||||||
{ SCALAR_DOCUMENT_AS_VALUE, "SCALAR_DOCUMENT_AS_VALUE: A JSON document made of a scalar (number, Boolean, null or string) is treated as a value. Use get_bool(), get_double(), etc. on the document instead. "},
|
{ SCALAR_DOCUMENT_AS_VALUE, "SCALAR_DOCUMENT_AS_VALUE: A JSON document made of a scalar (number, Boolean, null or string) is treated as a value. Use get_bool(), get_double(), etc. on the document instead. "},
|
||||||
{ OUT_OF_BOUNDS, "OUT_OF_BOUNDS: Attempt to access location outside of document."},
|
{ OUT_OF_BOUNDS, "OUT_OF_BOUNDS: Attempt to access location outside of document."},
|
||||||
{ TRAILING_CONTENT, "TRAILING_CONTENT: Unexpected trailing content in the JSON input."}
|
{ TRAILING_CONTENT, "TRAILING_CONTENT: Unexpected trailing content in the JSON input."}
|
||||||
@ -6787,7 +6818,7 @@ public:
|
|||||||
* The memory allocation is strict: you
|
* The memory allocation is strict: you
|
||||||
* can you use this function to increase
|
* can you use this function to increase
|
||||||
* or lower the amount of allocated memory.
|
* or lower the amount of allocated memory.
|
||||||
* Passsing zero clears the memory.
|
* Passing zero clears the memory.
|
||||||
*/
|
*/
|
||||||
error_code allocate(size_t len) noexcept;
|
error_code allocate(size_t len) noexcept;
|
||||||
/** @private Capacity in bytes, in terms
|
/** @private Capacity in bytes, in terms
|
||||||
@ -9185,7 +9216,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
|||||||
// floor(log(5**power)/log(2))
|
// floor(log(5**power)/log(2))
|
||||||
//
|
//
|
||||||
// Note that this is not magic: 152170/(1<<16) is
|
// Note that this is not magic: 152170/(1<<16) is
|
||||||
// approximatively equal to log(5)/log(2).
|
// approximately equal to log(5)/log(2).
|
||||||
// The 1<<16 value is a power of two; we could use a
|
// The 1<<16 value is a power of two; we could use a
|
||||||
// larger power of 2 if we wanted to.
|
// larger power of 2 if we wanted to.
|
||||||
//
|
//
|
||||||
@ -15545,7 +15576,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
|||||||
// floor(log(5**power)/log(2))
|
// floor(log(5**power)/log(2))
|
||||||
//
|
//
|
||||||
// Note that this is not magic: 152170/(1<<16) is
|
// Note that this is not magic: 152170/(1<<16) is
|
||||||
// approximatively equal to log(5)/log(2).
|
// approximately equal to log(5)/log(2).
|
||||||
// The 1<<16 value is a power of two; we could use a
|
// The 1<<16 value is a power of two; we could use a
|
||||||
// larger power of 2 if we wanted to.
|
// larger power of 2 if we wanted to.
|
||||||
//
|
//
|
||||||
@ -21769,7 +21800,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
|||||||
// floor(log(5**power)/log(2))
|
// floor(log(5**power)/log(2))
|
||||||
//
|
//
|
||||||
// Note that this is not magic: 152170/(1<<16) is
|
// Note that this is not magic: 152170/(1<<16) is
|
||||||
// approximatively equal to log(5)/log(2).
|
// approximately equal to log(5)/log(2).
|
||||||
// The 1<<16 value is a power of two; we could use a
|
// The 1<<16 value is a power of two; we could use a
|
||||||
// larger power of 2 if we wanted to.
|
// larger power of 2 if we wanted to.
|
||||||
//
|
//
|
||||||
@ -28149,7 +28180,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
|||||||
// floor(log(5**power)/log(2))
|
// floor(log(5**power)/log(2))
|
||||||
//
|
//
|
||||||
// Note that this is not magic: 152170/(1<<16) is
|
// Note that this is not magic: 152170/(1<<16) is
|
||||||
// approximatively equal to log(5)/log(2).
|
// approximately equal to log(5)/log(2).
|
||||||
// The 1<<16 value is a power of two; we could use a
|
// The 1<<16 value is a power of two; we could use a
|
||||||
// larger power of 2 if we wanted to.
|
// larger power of 2 if we wanted to.
|
||||||
//
|
//
|
||||||
@ -34891,7 +34922,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
|||||||
// floor(log(5**power)/log(2))
|
// floor(log(5**power)/log(2))
|
||||||
//
|
//
|
||||||
// Note that this is not magic: 152170/(1<<16) is
|
// Note that this is not magic: 152170/(1<<16) is
|
||||||
// approximatively equal to log(5)/log(2).
|
// approximately equal to log(5)/log(2).
|
||||||
// The 1<<16 value is a power of two; we could use a
|
// The 1<<16 value is a power of two; we could use a
|
||||||
// larger power of 2 if we wanted to.
|
// larger power of 2 if we wanted to.
|
||||||
//
|
//
|
||||||
@ -41457,7 +41488,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
|||||||
// floor(log(5**power)/log(2))
|
// floor(log(5**power)/log(2))
|
||||||
//
|
//
|
||||||
// Note that this is not magic: 152170/(1<<16) is
|
// Note that this is not magic: 152170/(1<<16) is
|
||||||
// approximatively equal to log(5)/log(2).
|
// approximately equal to log(5)/log(2).
|
||||||
// The 1<<16 value is a power of two; we could use a
|
// The 1<<16 value is a power of two; we could use a
|
||||||
// larger power of 2 if we wanted to.
|
// larger power of 2 if we wanted to.
|
||||||
//
|
//
|
||||||
@ -47468,7 +47499,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
|||||||
// floor(log(5**power)/log(2))
|
// floor(log(5**power)/log(2))
|
||||||
//
|
//
|
||||||
// Note that this is not magic: 152170/(1<<16) is
|
// Note that this is not magic: 152170/(1<<16) is
|
||||||
// approximatively equal to log(5)/log(2).
|
// approximately equal to log(5)/log(2).
|
||||||
// The 1<<16 value is a power of two; we could use a
|
// The 1<<16 value is a power of two; we could use a
|
||||||
// larger power of 2 if we wanted to.
|
// larger power of 2 if we wanted to.
|
||||||
//
|
//
|
||||||
@ -53078,7 +53109,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
|||||||
// floor(log(5**power)/log(2))
|
// floor(log(5**power)/log(2))
|
||||||
//
|
//
|
||||||
// Note that this is not magic: 152170/(1<<16) is
|
// Note that this is not magic: 152170/(1<<16) is
|
||||||
// approximatively equal to log(5)/log(2).
|
// approximately equal to log(5)/log(2).
|
||||||
// The 1<<16 value is a power of two; we could use a
|
// The 1<<16 value is a power of two; we could use a
|
||||||
// larger power of 2 if we wanted to.
|
// larger power of 2 if we wanted to.
|
||||||
//
|
//
|
||||||
|
987
deps/simdjson/simdjson.h
vendored
987
deps/simdjson/simdjson.h
vendored
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user