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! */
22#include " simdjson.h"
33
44/* used for http://dmalloc.com/ Dmalloc - Debug Malloc Library */
55#ifdef DMALLOC
66#include " dmalloc.h"
77#endif
88
9+ /* begin file src/simdjson.cpp */
910/* begin file src/document.cpp */
1011
1112namespace simdjson {
@@ -31,8 +32,7 @@ bool document::set_capacity(size_t capacity) {
3132 return string_buf && tape;
3233}
3334
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 {
3636 uint32_t string_length;
3737 size_t tape_idx = 0 ;
3838 uint64_t tape_val = tape[tape_idx];
@@ -138,8 +138,7 @@ bool document::print_json(std::ostream &os, size_t max_depth) const {
138138 return true ;
139139}
140140
141- WARN_UNUSED
142- bool document::dump_raw_tape (std::ostream &os) const {
141+ bool document::dump_raw_tape (std::ostream &os) const noexcept {
143142 uint32_t string_length;
144143 size_t tape_idx = 0 ;
145144 uint64_t tape_val = tape[tape_idx];
@@ -325,6 +324,9 @@ const std::map<int, const std::string> error_strings = {
325324 {UNSUPPORTED_ARCHITECTURE, " simdjson does not have an implementation"
326325 " supported by this CPU architecture (perhaps"
327326 " 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." },
328330 {UNEXPECTED_ERROR, " Unexpected error, consider reporting this problem as"
329331 " you may have found a bug in simdjson" },
330332};
@@ -2330,7 +2332,7 @@ really_inline uint64_t follows(const uint64_t match, uint64_t &overflow) {
23302332really_inline uint64_t follows (const uint64_t match, const uint64_t filler, uint64_t &overflow) {
23312333 uint64_t follows_match = follows (match, overflow);
23322334 uint64_t result;
2333- overflow |= add_overflow (follows_match, filler, &result);
2335+ overflow |= uint64_t ( add_overflow (follows_match, filler, &result) );
23342336 return result;
23352337}
23362338
@@ -2639,7 +2641,6 @@ namespace simdjson::haswell::simd {
26392641 really_inline Child operator &(const Child other) const { return _mm256_and_si256 (*this , other); }
26402642 really_inline Child operator ^(const Child other) const { return _mm256_xor_si256 (*this , other); }
26412643 really_inline Child bit_andnot (const Child other) const { return _mm256_andnot_si256 (other, *this ); }
2642- really_inline Child operator ~() const { return *this ^ 0xFFu ; }
26432644 really_inline Child& operator |=(const Child other) { auto this_cast = (Child*)this ; *this_cast = *this_cast | other; return *this_cast; }
26442645 really_inline Child& operator &=(const Child other) { auto this_cast = (Child*)this ; *this_cast = *this_cast & other; return *this_cast; }
26452646 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 {
26792680
26802681 really_inline int to_bitmask () const { return _mm256_movemask_epi8 (*this ); }
26812682 really_inline bool any () const { return !_mm256_testz_si256 (*this , *this ); }
2683+ really_inline simd8<bool > operator ~() const { return *this ^ true ; }
26822684 };
26832685
26842686 template <typename T>
@@ -2713,6 +2715,9 @@ namespace simdjson::haswell::simd {
27132715 really_inline simd8<T>& operator +=(const simd8<T> other) { *this = *this + other; return *(simd8<T>*)this ; }
27142716 really_inline simd8<T>& operator -=(const simd8<T> other) { *this = *this - other; return *(simd8<T>*)this ; }
27152717
2718+ // Override to distinguish from bool version
2719+ really_inline simd8<T> operator ~() const { return *this ^ 0xFFu ; }
2720+
27162721 // Perform a lookup assuming the value is between 0 and 16 (undefined behavior for out of range values)
27172722 template <typename L>
27182723 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) {
36753680really_inline uint64_t follows (const uint64_t match, const uint64_t filler, uint64_t &overflow) {
36763681 uint64_t follows_match = follows (match, overflow);
36773682 uint64_t result;
3678- overflow |= add_overflow (follows_match, filler, &result);
3683+ overflow |= uint64_t ( add_overflow (follows_match, filler, &result) );
36793684 return result;
36803685}
36813686
@@ -3982,7 +3987,6 @@ namespace simdjson::westmere::simd {
39823987 really_inline Child operator &(const Child other) const { return _mm_and_si128 (*this , other); }
39833988 really_inline Child operator ^(const Child other) const { return _mm_xor_si128 (*this , other); }
39843989 really_inline Child bit_andnot (const Child other) const { return _mm_andnot_si128 (other, *this ); }
3985- really_inline Child operator ~() const { return *this ^ 0xFFu ; }
39863990 really_inline Child& operator |=(const Child other) { auto this_cast = (Child*)this ; *this_cast = *this_cast | other; return *this_cast; }
39873991 really_inline Child& operator &=(const Child other) { auto this_cast = (Child*)this ; *this_cast = *this_cast & other; return *this_cast; }
39883992 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 {
40224026
40234027 really_inline int to_bitmask () const { return _mm_movemask_epi8 (*this ); }
40244028 really_inline bool any () const { return !_mm_testz_si128 (*this , *this ); }
4029+ really_inline simd8<bool > operator ~() const { return *this ^ true ; }
40254030 };
40264031
40274032 template <typename T>
@@ -4048,6 +4053,9 @@ namespace simdjson::westmere::simd {
40484053 // Store to array
40494054 really_inline void store (T dst[16 ]) const { return _mm_storeu_si128 (reinterpret_cast <__m128i *>(dst), *this ); }
40504055
4056+ // Override to distinguish from bool version
4057+ really_inline simd8<T> operator ~() const { return *this ^ 0xFFu ; }
4058+
40514059 // Addition/subtraction are the same for signed and unsigned
40524060 really_inline simd8<T> operator +(const simd8<T> other) const { return _mm_add_epi8 (*this , other); }
40534061 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) {
50325040really_inline uint64_t follows (const uint64_t match, const uint64_t filler, uint64_t &overflow) {
50335041 uint64_t follows_match = follows (match, overflow);
50345042 uint64_t result;
5035- overflow |= add_overflow (follows_match, filler, &result);
5043+ overflow |= uint64_t ( add_overflow (follows_match, filler, &result) );
50365044 return result;
50375045}
50385046
@@ -5914,9 +5922,9 @@ never_inline bool parse_large_integer(const uint8_t *const buf,
59145922// content and append a space before calling this function.
59155923//
59165924// 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,
59205928 document::parser &parser) {
59215929#ifdef SIMDJSON_SKIPNUMBERPARSING // for performance analysis, it is sometimes
59225930 // useful to skip parsing
@@ -7281,9 +7289,9 @@ never_inline bool parse_large_integer(const uint8_t *const buf,
72817289// content and append a space before calling this function.
72827290//
72837291// 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,
72877295 document::parser &parser) {
72887296#ifdef SIMDJSON_SKIPNUMBERPARSING // for performance analysis, it is sometimes
72897297 // useful to skip parsing
@@ -8658,9 +8666,9 @@ never_inline bool parse_large_integer(const uint8_t *const buf,
86588666// content and append a space before calling this function.
86598667//
86608668// 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,
86648672 document::parser &parser) {
86658673#ifdef SIMDJSON_SKIPNUMBERPARSING // for performance analysis, it is sometimes
86668674 // useful to skip parsing
@@ -9429,3 +9437,4 @@ UNTARGET_REGION
94299437#endif // SIMDJSON_WESTMERE_STAGE2_BUILD_TAPE_H
94309438/* end file src/generic/stage2_streaming_build_tape.h */
94319439/* end file src/generic/stage2_streaming_build_tape.h */
9440+ /* end file src/generic/stage2_streaming_build_tape.h */
0 commit comments