Skip to content

Commit 1d143a6

Browse files
committed
deps: V8: revert e3cddbedb205
simdutf's `atomic_binary_to_base64` requires `std::atomic_ref`. `std::atomic_ref` is only available in LLVM 19, which is only available in Xcode 16.3, which is only available on macOS 15. This also includes a revert of dfd7a5a3c9f57, which modifed the affected lines. Refs: llvm/llvm-project#76647 Refs: v8/v8@e3cddbe PR-URL: nodejs#58064 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
1 parent 5d65e22 commit 1d143a6

File tree

5 files changed

+11
-88
lines changed

5 files changed

+11
-88
lines changed

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# Reset this number to 0 on major V8 upgrades.
4040
# Increment by one for each non-official patch applied to deps/v8.
41-
'v8_embedder_string': '-node.5',
41+
'v8_embedder_string': '-node.7',
4242

4343
##### V8 defaults for Node.js #####
4444

deps/v8/BUILD.bazel

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4401,12 +4401,6 @@ cc_library(
44014401
name = "simdutf",
44024402
srcs = ["third_party/simdutf/simdutf.cpp"],
44034403
hdrs = ["third_party/simdutf/simdutf.h"],
4404-
copts = select({
4405-
"@v8//bazel/config:is_clang": ["-std=c++20"],
4406-
"@v8//bazel/config:is_gcc": ["-std=gnu++2a"],
4407-
"@v8//bazel/config:is_windows": ["/std:c++20"],
4408-
"//conditions:default": [],
4409-
}),
44104404
)
44114405

44124406
v8_library(

deps/v8/src/builtins/builtins-typed-array.cc

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -832,16 +832,11 @@ BUILTIN(Uint8ArrayPrototypeToBase64) {
832832
// is false.
833833
// 11. Return CodePointsToString(outAscii).
834834

835-
size_t simd_result_size;
836-
if (uint8array->buffer()->is_shared()) {
837-
simd_result_size = simdutf::atomic_binary_to_base64(
838-
std::bit_cast<const char*>(uint8array->DataPtr()), length,
839-
reinterpret_cast<char*>(output->GetChars(no_gc)), alphabet);
840-
} else {
841-
simd_result_size = simdutf::binary_to_base64(
842-
std::bit_cast<const char*>(uint8array->DataPtr()), length,
843-
reinterpret_cast<char*>(output->GetChars(no_gc)), alphabet);
844-
}
835+
// TODO(rezvan): Make sure to add a path for SharedArrayBuffers when
836+
// simdutf library got updated. Also, add a test for it.
837+
size_t simd_result_size = simdutf::binary_to_base64(
838+
std::bit_cast<const char*>(uint8array->GetBuffer()->backing_store()),
839+
length, reinterpret_cast<char*>(output->GetChars(no_gc)), alphabet);
845840
DCHECK_EQ(simd_result_size, output_length);
846841
USE(simd_result_size);
847842
}
@@ -1068,6 +1063,9 @@ BUILTIN(Uint8ArrayPrototypeToHex) {
10681063
return *isolate->factory()->empty_string();
10691064
}
10701065

1066+
const char* bytes =
1067+
std::bit_cast<const char*>(uint8array->GetBuffer()->backing_store());
1068+
10711069
// 4. Let out be the empty String.
10721070
DirectHandle<SeqOneByteString> output;
10731071
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
@@ -1078,8 +1076,8 @@ BUILTIN(Uint8ArrayPrototypeToHex) {
10781076
// b. Set hex to StringPad(hex, 2, "0", start).
10791077
// c. Set out to the string-concatenation of out and hex.
10801078
// 6. Return out.
1081-
return Uint8ArrayToHex(std::bit_cast<const char*>(uint8array->DataPtr()),
1082-
length, uint8array->buffer()->is_shared(), output);
1079+
return Uint8ArrayToHex(bytes, length, uint8array->buffer()->is_shared(),
1080+
output);
10831081
}
10841082

10851083
} // namespace internal

deps/v8/test/mjsunit/harmony/regress/regress-416166113.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

deps/v8/test/mjsunit/harmony/uint8-array-to-base64-on-shared-array-buffer.js

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)