Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ on:
- deps/uvwasi/**
- deps/v8/third_party/abseil-cpp/**
- deps/v8/third_party/highway/**
- deps/v8/third_party/simdutf/**
- deps/zlib/**
- deps/zstd/**
- doc/**
Expand Down Expand Up @@ -92,6 +93,7 @@ on:
- deps/uvwasi/**
- deps/v8/third_party/abseil-cpp/**
- deps/v8/third_party/highway/**
- deps/v8/third_party/simdutf/**
- deps/zlib/**
- deps/zstd/**
- doc/**
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,7 @@ ifeq ($(SKIP_SHARED_DEPS), 1)
$(RM) -r $(TARNAME)/deps/uvwasi
$(RM) -r $(TARNAME)/deps/v8/third_party/abseil-cpp
$(RM) -r $(TARNAME)/deps/v8/third_party/highway
$(RM) -r $(TARNAME)/deps/v8/third_party/simdutf
$(RM) -r $(TARNAME)/deps/zlib
$(RM) -r $(TARNAME)/deps/zstd
else
Expand Down
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.32',
'v8_embedder_string': '-node.33',

##### V8 defaults for Node.js #####

Expand Down
3 changes: 1 addition & 2 deletions deps/ada/ada.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
'type': 'static_library',
'include_dirs': [
'.',
'<(DEPTH)/deps/v8/third_party/simdutf',
],
'direct_dependent_settings': {
'include_dirs': ['.'],
Expand All @@ -17,7 +16,7 @@
'ADA_USE_SIMDUTF=1',
],
'dependencies': [
'../../tools/v8_gypfiles/v8.gyp:simdutf',
'../../tools/v8_gypfiles/simdutf.gyp:simdutf',
],
'sources': [ '<@(ada_sources)' ]
},
Expand Down
1 change: 1 addition & 0 deletions deps/v8/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4584,6 +4584,7 @@ cc_library(
name = "simdutf",
srcs = ["third_party/simdutf/simdutf.cpp"],
hdrs = ["third_party/simdutf/simdutf.h"],
strip_include_prefix = "third_party/simdutf",
copts = select({
"@v8//bazel/config:is_clang": ["-std=c++20"],
"@v8//bazel/config:is_gcc": ["-std=gnu++2a"],
Expand Down
16 changes: 13 additions & 3 deletions deps/v8/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2516,6 +2516,16 @@ group("v8_abseil") {
]
}

group("v8_simdutf") {
public_deps = [ "//third_party/simdutf" ]
public_configs = [ ":simdutf_include_config" ]

visibility = [ "./*" ]
}
config("simdutf_include_config") {
include_dirs = [ "//third_party/simdutf" ]
}

group("zoslib") {
if (current_os == "zos") {
deps = [ "//third_party/zoslib" ]
Expand Down Expand Up @@ -5308,6 +5318,7 @@ v8_header_set("v8_internal_headers") {
":v8_headers",
":v8_maybe_icu",
":v8_shared_internal_headers",
":v8_simdutf",
"//third_party/fp16",
]

Expand All @@ -5323,7 +5334,6 @@ v8_header_set("v8_internal_headers") {
":v8_heap_base_headers",
":v8_libbase",
":v8_maybe_temporal",
"//third_party/simdutf",
]
if (v8_enable_experimental_tq_to_tsa) {
deps += [ ":run_torque_to_tsa" ]
Expand Down Expand Up @@ -6727,7 +6737,7 @@ v8_source_set("v8_base_without_compiler") {
":v8_headers",
":v8_internal_headers",
":v8_maybe_icu",
"//third_party/simdutf",
":v8_simdutf",
]
if (v8_enable_experimental_tq_to_tsa) {
public_deps += [ ":run_torque_to_tsa" ]
Expand Down Expand Up @@ -8287,9 +8297,9 @@ v8_executable("d8") {
":v8",
":v8_libbase",
":v8_libplatform",
":v8_simdutf",
":v8_tracing",
"//build/win:default_exe_manifest",
"//third_party/simdutf",
]

if (is_posix || is_fuchsia) {
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -557,10 +557,10 @@ include_rules = [
'+third_party/fp16/src/include',
'+third_party/fuzztest',
'+third_party/ittapi/include',
'+third_party/simdutf',
'+third_party/v8/codegen',
'+third_party/vtune',
'+hwy/highway.h',
'+simdutf.h',
# Abseil features are allow-listed. Please use your best judgement when adding
# to this set -- if in doubt, email v8-dev@. For general guidance, refer to
# the Chromium guidelines (though note that some requirements in V8 may be
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/builtins/builtins-typed-array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "simdutf.h"
#include "src/base/logging.h"
#include "src/base/macros.h"
#include "src/builtins/builtins-utils-inl.h"
Expand All @@ -15,7 +16,6 @@
#include "src/objects/objects-inl.h"
#include "src/objects/option-utils.h"
#include "src/objects/simd.h"
#include "third_party/simdutf/simdutf.h"

namespace v8::internal {

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/objects/string-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <type_traits>

#include "absl/functional/overload.h"
#include "simdutf.h"
#include "src/common/assert-scope.h"
#include "src/common/globals.h"
#include "src/execution/isolate-utils.h"
Expand All @@ -38,7 +39,6 @@
#include "src/torque/runtime-macro-shims.h"
#include "src/torque/runtime-support.h"
#include "src/utils/utils.h"
#include "third_party/simdutf/simdutf.h"

// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/objects/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <memory>
#include <optional>

#include "simdutf.h"
#include "src/base/bits.h"
#include "src/base/export-template.h"
#include "src/base/small-vector.h"
Expand All @@ -21,7 +22,6 @@
#include "src/objects/tagged.h"
#include "src/sandbox/external-pointer.h"
#include "src/strings/unicode-decoder.h"
#include "third_party/simdutf/simdutf.h"

// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/strings/unicode-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include "src/strings/unicode.h"
// Include the non-inl header before the rest of the headers.

#include "simdutf.h"
#include "src/base/logging.h"
#include "src/utils/utils.h"
#include "third_party/simdutf/simdutf.h"

namespace unibrow {

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/strings/unicode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#endif

#include "hwy/highway.h"
#include "third_party/simdutf/simdutf.h"
#include "simdutf.h"

namespace unibrow {

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/test/cctest/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ v8_executable("cctest") {
"../..:v8_for_testing",
"../..:v8_libbase",
"../..:v8_libplatform",
"../..:v8_simdutf",
"../../tools/debug_helper:v8_debug_helper",
"//third_party/simdutf",
]

data_deps = [ "../../tools:v8_testrunner" ]
Expand Down
2 changes: 1 addition & 1 deletion node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,7 @@
'libraries': [ '-framework CoreFoundation -framework Security' ],
}],
[ 'node_shared_simdutf=="false" and node_use_bundled_v8!="false"', {
'dependencies': [ 'tools/v8_gypfiles/v8.gyp:simdutf#host' ],
'dependencies': [ 'tools/v8_gypfiles/simdutf.gyp:simdutf#host' ],
}],
[ 'node_shared_libuv=="false"', {
'dependencies': [ 'deps/uv/uv.gyp:libuv#host' ],
Expand Down
2 changes: 1 addition & 1 deletion node.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
}],

[ 'node_shared_simdutf=="false" and node_use_bundled_v8!="false"', {
'dependencies': [ 'tools/v8_gypfiles/v8.gyp:simdutf' ],
'dependencies': [ 'tools/v8_gypfiles/simdutf.gyp:simdutf' ],
}],

[ 'node_shared_brotli=="false"', {
Expand Down
59 changes: 25 additions & 34 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,24 @@
benchmarkTools ? import ./tools/nix/benchmarkTools.nix { inherit pkgs; },
}:

assert pkgs.lib.assertMsg (
withTemporal || !(builtins.hasAttr "temporal_capi" sharedLibDeps)
) "`sharedLibDeps` must not contain `temporal_capi` when `withTemporal` is false";
assert pkgs.lib.assertMsg (
withPerfetto || !(builtins.hasAttr "perfetto" sharedLibDeps)
) "`sharedLibDeps` must not contain `perfetto` when `withPerfetto` is false";

let
useSharedICU = if builtins.isString icu then icu == "system" else icu != null;
useSharedAda = builtins.hasAttr "ada" sharedLibDeps;
useSharedOpenSSL = builtins.hasAttr "openssl" sharedLibDeps;
needsRustCompiler = withTemporal && !(builtins.hasAttr "temporal_capi" sharedLibDeps);

useSharedPerfetto = builtins.hasAttr "perfetto" sharedLibDeps;
useSharedTemporal = builtins.hasAttr "temporal_capi" sharedLibDeps;
needsRustCompiler = withTemporal && !useSharedTemporal;
sharedV8Deps = builtins.filter (depName: builtins.hasAttr depName sharedLibDeps) ([
"abseil"
"highway"
"perfetto"
"simdutf"
"temporal_capi"
]);

nativeBuildInputs =
pkgs.nodejs-slim_latest.nativeBuildInputs
Expand All @@ -64,11 +74,7 @@ let
pkgs.rustc
];
buildInputs =
pkgs.lib.optional useSharedICU icu
++ pkgs.lib.optional (builtins.hasAttr "abseil" sharedLibDeps) sharedLibDeps.abseil
++ pkgs.lib.optional (builtins.hasAttr "highway" sharedLibDeps) sharedLibDeps.highway
++ pkgs.lib.optional (withPerfetto && useSharedPerfetto) sharedLibDeps.perfetto
++ pkgs.lib.optional (withTemporal && useSharedTemporal) sharedLibDeps.temporal_capi;
pkgs.lib.optional useSharedICU icu ++ builtins.map (depName: sharedLibDeps.${depName}) sharedV8Deps;

# Put here only the configure flags that affect the V8 build
configureFlags = [
Expand All @@ -80,10 +86,7 @@ let
)
"--v8-${if withTemporal then "enable" else "disable"}-temporal-support"
]
++ pkgs.lib.optional (builtins.hasAttr "abseil" sharedLibDeps) "--shared-abseil"
++ pkgs.lib.optional (builtins.hasAttr "highway" sharedLibDeps) "--shared-highway"
++ pkgs.lib.optional (withPerfetto && useSharedPerfetto) "--shared-perfetto"
++ pkgs.lib.optional (withTemporal && useSharedTemporal) "--shared-temporal_capi"
++ builtins.map (depName: "--shared-${depName}") sharedV8Deps
++ pkgs.lib.optional withPerfetto "--with-perfetto";
in
pkgs.mkShell {
Expand Down Expand Up @@ -129,26 +132,14 @@ pkgs.mkShell {
++ pkgs.lib.optional (!withSSL) "--without-ssl"
++ pkgs.lib.optional loadJSBuiltinsDynamically "--node-builtin-modules-path=${builtins.toString ./.}"
++ pkgs.lib.optional (useSeparateDerivationForV8 != false) "--without-bundled-v8"
++
pkgs.lib.concatMap
(name: [
"--shared-${name}"
"--shared-${name}-libpath=${pkgs.lib.getLib sharedLibDeps.${name}}/lib"
"--shared-${name}-include=${pkgs.lib.getInclude sharedLibDeps.${name}}/include"
])
(
builtins.attrNames (
if (useSeparateDerivationForV8 != false) then
builtins.removeAttrs sharedLibDeps [
"abseil"
"highway"
"simdutf"
"temporal_capi"
]
else
sharedLibDeps
)
)
++ builtins.map (name: "--shared-${name}") (
builtins.attrNames (
if (useSeparateDerivationForV8 != false) then
builtins.removeAttrs sharedLibDeps sharedV8Deps
else
sharedLibDeps
)
)
);
}
// (
Expand Down
5 changes: 4 additions & 1 deletion tools/nix/sharedLibDeps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
nbytes
nghttp2
simdjson
simdutf
uvwasi
zlib
zstd
Expand All @@ -28,6 +27,10 @@
hdr-histogram = pkgs.hdrhistogram_c;
highway = pkgs.libhwy;
http-parser = pkgs.llhttp;
simdutf = pkgs.simdutf.overrideAttrs (old: {
# TODO: remove this once the pin we use has picked up https://github.com/NixOS/nixpkgs/pull/557405
cmakeFlags = old.cmakeFlags ++ [ (pkgs.lib.cmakeFeature "SIMDUTF_CXX_STANDARD" "20") ];
});
}
// (pkgs.lib.optionalAttrs withLief {
inherit (pkgs) lief;
Expand Down
7 changes: 6 additions & 1 deletion tools/nix/v8.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
let
useSharedAbseil = builtins.elem "--shared-abseil" configureFlags;
useSharedHighway = builtins.elem "--shared-highway" configureFlags;
useSharedSimdutf = builtins.elem "--shared-simdutf" configureFlags;
src =
let
inherit (lib) fileset;
Expand All @@ -47,6 +48,7 @@ let
]
++ lib.optional (!useSharedAbseil) ../../tools/v8_gypfiles/abseil.gyp
++ lib.optional (!useSharedHighway) ../../tools/v8_gypfiles/highway.gyp
++ lib.optional (!useSharedSimdutf) ../../tools/v8_gypfiles/simdutf.gyp
++ lib.optional (
builtins.elem "--with-perfetto" configureFlags
&& !(builtins.elem "--shared-perfetto" configureFlags)
Expand Down Expand Up @@ -76,6 +78,7 @@ let
]
++ lib.optional useSharedAbseil ../../deps/v8/third_party/abseil-cpp
++ lib.optional useSharedHighway ../../deps/v8/third_party/highway
++ lib.optional useSharedSimdutf ../../deps/v8/third_party/simdutf
));
trackedFiles =
({
Expand Down Expand Up @@ -201,7 +204,9 @@ stdenv.mkDerivation (finalAttrs: {
''
}

install -Dm644 deps/v8/third_party/simdutf/simdutf.h -t $out/include
${lib.optionalString (
!useSharedSimdutf
) "install -Dm644 deps/v8/third_party/simdutf/simdutf.h -t $out/include"}
find deps/v8/include -name '*.h' -print0 | while read -r -d "" file; do
install -Dm644 "$file" -T "$out/include/''${file#deps/v8/include/}"
done
Expand Down
22 changes: 22 additions & 0 deletions tools/v8_gypfiles/simdutf.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
'includes': ['toolchain.gypi'],
'targets': [
{
'target_name': 'simdutf',
'type': 'static_library',
'toolsets': ['host', 'target'],
'variables': {
'SIMDUTF_ROOT': '../../deps/v8/third_party/simdutf',
},
'all_dependent_settings': {
'include_dirs': [
'<(SIMDUTF_ROOT)',
],
},
'include_dirs': ['.'],
'sources': [
'<(SIMDUTF_ROOT)/simdutf.cpp',
],
}, # simdutf
],
}
Loading
Loading