Skip to content

Commit 554ffc3

Browse files
nodejs-github-botalexfernandez
authored andcommitted
deps: update ada to 2.6.10
PR-URL: nodejs#49984 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 89e547a commit 554ffc3

File tree

3 files changed

+33
-13
lines changed

3 files changed

+33
-13
lines changed

deps/ada/ada.cpp

+27-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2023-09-29 13:28:16 -0400. Do not edit! */
1+
/* auto-generated on 2023-09-30 20:34:30 -0400. Do not edit! */
22
/* begin file src/ada.cpp */
33
#include "ada.h"
44
/* begin file src/checkers.cpp */
@@ -9810,6 +9810,17 @@ constexpr bool to_lower_ascii(char* input, size_t length) noexcept {
98109810
#if ADA_NEON
98119811
ada_really_inline bool has_tabs_or_newline(
98129812
std::string_view user_input) noexcept {
9813+
// first check for short strings in which case we do it naively.
9814+
if (user_input.size() < 16) { // slow path
9815+
for (size_t i = 0; i < user_input.size(); i++) {
9816+
if (user_input[i] == '\r' || user_input[i] == '\n' ||
9817+
user_input[i] == '\t') {
9818+
return true;
9819+
}
9820+
}
9821+
return false;
9822+
}
9823+
// fast path for long strings (expected to be common)
98139824
size_t i = 0;
98149825
const uint8x16_t mask1 = vmovq_n_u8('\r');
98159826
const uint8x16_t mask2 = vmovq_n_u8('\n');
@@ -9822,9 +9833,8 @@ ada_really_inline bool has_tabs_or_newline(
98229833
vceqq_u8(word, mask3));
98239834
}
98249835
if (i < user_input.size()) {
9825-
uint8_t buffer[16]{};
9826-
memcpy(buffer, user_input.data() + i, user_input.size() - i);
9827-
uint8x16_t word = vld1q_u8((const uint8_t*)user_input.data() + i);
9836+
uint8x16_t word =
9837+
vld1q_u8((const uint8_t*)user_input.data() + user_input.length() - 16);
98289838
running = vorrq_u8(vorrq_u8(running, vorrq_u8(vceqq_u8(word, mask1),
98299839
vceqq_u8(word, mask2))),
98309840
vceqq_u8(word, mask3));
@@ -9834,6 +9844,17 @@ ada_really_inline bool has_tabs_or_newline(
98349844
#elif ADA_SSE2
98359845
ada_really_inline bool has_tabs_or_newline(
98369846
std::string_view user_input) noexcept {
9847+
// first check for short strings in which case we do it naively.
9848+
if (user_input.size() < 16) { // slow path
9849+
for (size_t i = 0; i < user_input.size(); i++) {
9850+
if (user_input[i] == '\r' || user_input[i] == '\n' ||
9851+
user_input[i] == '\t') {
9852+
return true;
9853+
}
9854+
}
9855+
return false;
9856+
}
9857+
// fast path for long strings (expected to be common)
98379858
size_t i = 0;
98389859
const __m128i mask1 = _mm_set1_epi8('\r');
98399860
const __m128i mask2 = _mm_set1_epi8('\n');
@@ -9847,9 +9868,8 @@ ada_really_inline bool has_tabs_or_newline(
98479868
_mm_cmpeq_epi8(word, mask3));
98489869
}
98499870
if (i < user_input.size()) {
9850-
alignas(16) uint8_t buffer[16]{};
9851-
memcpy(buffer, user_input.data() + i, user_input.size() - i);
9852-
__m128i word = _mm_load_si128((const __m128i*)buffer);
9871+
__m128i word = _mm_loadu_si128(
9872+
(const __m128i*)(user_input.data() + user_input.length() - 16));
98539873
running = _mm_or_si128(
98549874
_mm_or_si128(running, _mm_or_si128(_mm_cmpeq_epi8(word, mask1),
98559875
_mm_cmpeq_epi8(word, mask2))),

deps/ada/ada.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2023-09-29 13:28:16 -0400. Do not edit! */
1+
/* auto-generated on 2023-09-30 20:34:30 -0400. Do not edit! */
22
/* begin file include/ada.h */
33
/**
44
* @file ada.h
@@ -6928,14 +6928,14 @@ inline void url_search_params::sort() {
69286928
#ifndef ADA_ADA_VERSION_H
69296929
#define ADA_ADA_VERSION_H
69306930

6931-
#define ADA_VERSION "2.6.9"
6931+
#define ADA_VERSION "2.6.10"
69326932

69336933
namespace ada {
69346934

69356935
enum {
69366936
ADA_VERSION_MAJOR = 2,
69376937
ADA_VERSION_MINOR = 6,
6938-
ADA_VERSION_REVISION = 9,
6938+
ADA_VERSION_REVISION = 10,
69396939
};
69406940

69416941
} // namespace ada

doc/contributing/maintaining/maintaining-dependencies.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ All dependencies are located within the `deps` directory.
99
This a list of all the dependencies:
1010

1111
* [acorn 8.10.0][]
12-
* [ada 2.6.9][]
12+
* [ada 2.6.10][]
1313
* [base64 0.5.0][]
1414
* [brotli 1.0.9][]
1515
* [c-ares 1.19.0][]
@@ -150,7 +150,7 @@ The [acorn](https://github.com/acornjs/acorn) dependency is a JavaScript parser.
150150
[acorn-walk](https://github.com/acornjs/acorn/tree/master/acorn-walk) is
151151
an abstract syntax tree walker for the ESTree format.
152152

153-
### ada 2.6.9
153+
### ada 2.6.10
154154

155155
The [ada](https://github.com/ada-url/ada) dependency is a
156156
fast and spec-compliant URL parser written in C++.
@@ -319,7 +319,7 @@ it comes from the Chromium team's zlib fork which incorporated
319319
performance improvements not currently available in standard zlib.
320320

321321
[acorn 8.10.0]: #acorn-8100
322-
[ada 2.6.9]: #ada-269
322+
[ada 2.6.10]: #ada-2610
323323
[base64 0.5.0]: #base64-050
324324
[brotli 1.0.9]: #brotli-109
325325
[c-ares 1.19.0]: #c-ares-1190

0 commit comments

Comments
 (0)