1
- /* auto-generated on Mon Mar 2 14:10:52 PST 2020. Do not edit! */
1
+ /* auto-generated on Mon Mar 2 15:35:47 PST 2020. Do not edit! */
2
2
#include " simdjson.h"
3
3
4
4
/* used for http://dmalloc.com/ Dmalloc - Debug Malloc Library */
5
5
#ifdef DMALLOC
6
6
#include " dmalloc.h"
7
7
#endif
8
8
9
+ /* begin file src/simdjson.cpp */
9
10
/* begin file src/document.cpp */
10
11
11
12
namespace simdjson {
@@ -31,8 +32,7 @@ bool document::set_capacity(size_t capacity) {
31
32
return string_buf && tape;
32
33
}
33
34
34
- WARN_UNUSED
35
- bool document::print_json (std::ostream &os, size_t max_depth) const {
35
+ bool document::print_json (std::ostream &os, size_t max_depth) const noexcept {
36
36
uint32_t string_length;
37
37
size_t tape_idx = 0 ;
38
38
uint64_t tape_val = tape[tape_idx];
@@ -138,8 +138,7 @@ bool document::print_json(std::ostream &os, size_t max_depth) const {
138
138
return true ;
139
139
}
140
140
141
- WARN_UNUSED
142
- bool document::dump_raw_tape (std::ostream &os) const {
141
+ bool document::dump_raw_tape (std::ostream &os) const noexcept {
143
142
uint32_t string_length;
144
143
size_t tape_idx = 0 ;
145
144
uint64_t tape_val = tape[tape_idx];
@@ -325,6 +324,9 @@ const std::map<int, const std::string> error_strings = {
325
324
{UNSUPPORTED_ARCHITECTURE, " simdjson does not have an implementation"
326
325
" supported by this CPU architecture (perhaps"
327
326
" it's a non-SIMD CPU?)." },
327
+ {INCORRECT_TYPE, " The JSON element does not have the requested type." },
328
+ {NUMBER_OUT_OF_RANGE, " The JSON number is too large or too small to fit within the requested type." },
329
+ {NO_SUCH_FIELD, " The JSON field referenced does not exist in this object." },
328
330
{UNEXPECTED_ERROR, " Unexpected error, consider reporting this problem as"
329
331
" you may have found a bug in simdjson" },
330
332
};
@@ -2330,7 +2332,7 @@ really_inline uint64_t follows(const uint64_t match, uint64_t &overflow) {
2330
2332
really_inline uint64_t follows (const uint64_t match, const uint64_t filler, uint64_t &overflow) {
2331
2333
uint64_t follows_match = follows (match, overflow);
2332
2334
uint64_t result;
2333
- overflow |= add_overflow (follows_match, filler, &result);
2335
+ overflow |= uint64_t ( add_overflow (follows_match, filler, &result) );
2334
2336
return result;
2335
2337
}
2336
2338
@@ -2639,7 +2641,6 @@ namespace simdjson::haswell::simd {
2639
2641
really_inline Child operator &(const Child other) const { return _mm256_and_si256 (*this , other); }
2640
2642
really_inline Child operator ^(const Child other) const { return _mm256_xor_si256 (*this , other); }
2641
2643
really_inline Child bit_andnot (const Child other) const { return _mm256_andnot_si256 (other, *this ); }
2642
- really_inline Child operator ~() const { return *this ^ 0xFFu ; }
2643
2644
really_inline Child& operator |=(const Child other) { auto this_cast = (Child*)this ; *this_cast = *this_cast | other; return *this_cast; }
2644
2645
really_inline Child& operator &=(const Child other) { auto this_cast = (Child*)this ; *this_cast = *this_cast & other; return *this_cast; }
2645
2646
really_inline Child& operator ^=(const Child other) { auto this_cast = (Child*)this ; *this_cast = *this_cast ^ other; return *this_cast; }
@@ -2679,6 +2680,7 @@ namespace simdjson::haswell::simd {
2679
2680
2680
2681
really_inline int to_bitmask () const { return _mm256_movemask_epi8 (*this ); }
2681
2682
really_inline bool any () const { return !_mm256_testz_si256 (*this , *this ); }
2683
+ really_inline simd8<bool > operator ~() const { return *this ^ true ; }
2682
2684
};
2683
2685
2684
2686
template <typename T>
@@ -2713,6 +2715,9 @@ namespace simdjson::haswell::simd {
2713
2715
really_inline simd8<T>& operator +=(const simd8<T> other) { *this = *this + other; return *(simd8<T>*)this ; }
2714
2716
really_inline simd8<T>& operator -=(const simd8<T> other) { *this = *this - other; return *(simd8<T>*)this ; }
2715
2717
2718
+ // Override to distinguish from bool version
2719
+ really_inline simd8<T> operator ~() const { return *this ^ 0xFFu ; }
2720
+
2716
2721
// Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values)
2717
2722
template <typename L>
2718
2723
really_inline simd8<L> lookup_16 (simd8<L> lookup_table) const {
@@ -3675,7 +3680,7 @@ really_inline uint64_t follows(const uint64_t match, uint64_t &overflow) {
3675
3680
really_inline uint64_t follows (const uint64_t match, const uint64_t filler, uint64_t &overflow) {
3676
3681
uint64_t follows_match = follows (match, overflow);
3677
3682
uint64_t result;
3678
- overflow |= add_overflow (follows_match, filler, &result);
3683
+ overflow |= uint64_t ( add_overflow (follows_match, filler, &result) );
3679
3684
return result;
3680
3685
}
3681
3686
@@ -3982,7 +3987,6 @@ namespace simdjson::westmere::simd {
3982
3987
really_inline Child operator &(const Child other) const { return _mm_and_si128 (*this , other); }
3983
3988
really_inline Child operator ^(const Child other) const { return _mm_xor_si128 (*this , other); }
3984
3989
really_inline Child bit_andnot (const Child other) const { return _mm_andnot_si128 (other, *this ); }
3985
- really_inline Child operator ~() const { return *this ^ 0xFFu ; }
3986
3990
really_inline Child& operator |=(const Child other) { auto this_cast = (Child*)this ; *this_cast = *this_cast | other; return *this_cast; }
3987
3991
really_inline Child& operator &=(const Child other) { auto this_cast = (Child*)this ; *this_cast = *this_cast & other; return *this_cast; }
3988
3992
really_inline Child& operator ^=(const Child other) { auto this_cast = (Child*)this ; *this_cast = *this_cast ^ other; return *this_cast; }
@@ -4022,6 +4026,7 @@ namespace simdjson::westmere::simd {
4022
4026
4023
4027
really_inline int to_bitmask () const { return _mm_movemask_epi8 (*this ); }
4024
4028
really_inline bool any () const { return !_mm_testz_si128 (*this , *this ); }
4029
+ really_inline simd8<bool > operator ~() const { return *this ^ true ; }
4025
4030
};
4026
4031
4027
4032
template <typename T>
@@ -4048,6 +4053,9 @@ namespace simdjson::westmere::simd {
4048
4053
// Store to array
4049
4054
really_inline void store (T dst[16 ]) const { return _mm_storeu_si128 (reinterpret_cast <__m128i *>(dst), *this ); }
4050
4055
4056
+ // Override to distinguish from bool version
4057
+ really_inline simd8<T> operator ~() const { return *this ^ 0xFFu ; }
4058
+
4051
4059
// Addition/subtraction are the same for signed and unsigned
4052
4060
really_inline simd8<T> operator +(const simd8<T> other) const { return _mm_add_epi8 (*this , other); }
4053
4061
really_inline simd8<T> operator -(const simd8<T> other) const { return _mm_sub_epi8 (*this , other); }
@@ -5032,7 +5040,7 @@ really_inline uint64_t follows(const uint64_t match, uint64_t &overflow) {
5032
5040
really_inline uint64_t follows (const uint64_t match, const uint64_t filler, uint64_t &overflow) {
5033
5041
uint64_t follows_match = follows (match, overflow);
5034
5042
uint64_t result;
5035
- overflow |= add_overflow (follows_match, filler, &result);
5043
+ overflow |= uint64_t ( add_overflow (follows_match, filler, &result) );
5036
5044
return result;
5037
5045
}
5038
5046
@@ -5914,9 +5922,9 @@ never_inline bool parse_large_integer(const uint8_t *const buf,
5914
5922
// content and append a space before calling this function.
5915
5923
//
5916
5924
// Our objective is accurate parsing (ULP of 0 or 1) at high speed.
5917
- really_inline bool parse_number (const uint8_t *const buf,
5918
- const uint32_t offset,
5919
- bool found_minus,
5925
+ really_inline bool parse_number (UNUSED const uint8_t *const buf,
5926
+ UNUSED const uint32_t offset,
5927
+ UNUSED bool found_minus,
5920
5928
document::parser &parser) {
5921
5929
#ifdef SIMDJSON_SKIPNUMBERPARSING // for performance analysis, it is sometimes
5922
5930
// useful to skip parsing
@@ -7281,9 +7289,9 @@ never_inline bool parse_large_integer(const uint8_t *const buf,
7281
7289
// content and append a space before calling this function.
7282
7290
//
7283
7291
// Our objective is accurate parsing (ULP of 0 or 1) at high speed.
7284
- really_inline bool parse_number (const uint8_t *const buf,
7285
- const uint32_t offset,
7286
- bool found_minus,
7292
+ really_inline bool parse_number (UNUSED const uint8_t *const buf,
7293
+ UNUSED const uint32_t offset,
7294
+ UNUSED bool found_minus,
7287
7295
document::parser &parser) {
7288
7296
#ifdef SIMDJSON_SKIPNUMBERPARSING // for performance analysis, it is sometimes
7289
7297
// useful to skip parsing
@@ -8658,9 +8666,9 @@ never_inline bool parse_large_integer(const uint8_t *const buf,
8658
8666
// content and append a space before calling this function.
8659
8667
//
8660
8668
// Our objective is accurate parsing (ULP of 0 or 1) at high speed.
8661
- really_inline bool parse_number (const uint8_t *const buf,
8662
- const uint32_t offset,
8663
- bool found_minus,
8669
+ really_inline bool parse_number (UNUSED const uint8_t *const buf,
8670
+ UNUSED const uint32_t offset,
8671
+ UNUSED bool found_minus,
8664
8672
document::parser &parser) {
8665
8673
#ifdef SIMDJSON_SKIPNUMBERPARSING // for performance analysis, it is sometimes
8666
8674
// useful to skip parsing
@@ -9429,3 +9437,4 @@ UNTARGET_REGION
9429
9437
#endif // SIMDJSON_WESTMERE_STAGE2_BUILD_TAPE_H
9430
9438
/* end file src/generic/stage2_streaming_build_tape.h */
9431
9439
/* end file src/generic/stage2_streaming_build_tape.h */
9440
+ /* end file src/generic/stage2_streaming_build_tape.h */
0 commit comments