diff --git a/BUILDING.md b/BUILDING.md index eb0606eb2dff65..23d047563a64a7 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -38,7 +38,6 @@ file a new issue. * [Windows Prerequisites](#windows-prerequisites) * [Option 1: Manual install](#option-1-manual-install) * [Option 2: Automated install with WinGet](#option-2-automated-install-with-winget) - * [Option 3: Automated install with Boxstarter](#option-3-automated-install-with-boxstarter) * [Building Node.js](#building-nodejs-2) * [Using ccache](#using-ccache) * [Android](#android) @@ -729,39 +728,6 @@ winget configure .\.configurations\configuration.dsc.yaml To add optional components for MSI or ARM64 builds, refer to [Option 1: Manual install](#option-1-manual-install). -##### Option 3: Automated install with Boxstarter - -A [Boxstarter](https://boxstarter.org/) script can be used for easy setup of -Windows systems with all the required prerequisites for Node.js development. -This script will install the following [Chocolatey](https://chocolatey.org/) -packages: - -* [Git for Windows](https://chocolatey.org/packages/git) with the `git` and - Unix tools added to the `PATH` -* [Python 3.x](https://chocolatey.org/packages/python) -* [Visual Studio 2022 Build Tools](https://chocolatey.org/packages/visualstudio2022buildtools) - with [Visual C++ workload](https://chocolatey.org/packages/visualstudio2022-workload-vctools) -* [NetWide Assembler](https://chocolatey.org/packages/nasm) - -To install Node.js prerequisites using -[Boxstarter WebLauncher](https://boxstarter.org/weblauncher), visit - -with a supported browser. - -Alternatively, you can use PowerShell. Run those commands from -an elevated (Administrator) PowerShell terminal: - -```powershell -Set-ExecutionPolicy Unrestricted -Force -iex ((New-Object System.Net.WebClient).DownloadString('https://boxstarter.org/bootstrapper.ps1')) -get-boxstarter -Force -Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/HEAD/tools/bootstrap/windows_boxstarter -DisableReboots -refreshenv -``` - -The entire installation using Boxstarter will take up approximately 10 GB of -disk space. - #### Building Node.js * Remember to first clone the Node.js repository with the Git command diff --git a/deps/v8/src/strings/unicode-inl.h b/deps/v8/src/strings/unicode-inl.h index 4aa7e8090ca39a..26f77adf28fd2f 100644 --- a/deps/v8/src/strings/unicode-inl.h +++ b/deps/v8/src/strings/unicode-inl.h @@ -10,6 +10,7 @@ #include "src/base/logging.h" #include "src/utils/utils.h" +#include "third_party/simdutf/simdutf.h" namespace unibrow { @@ -219,6 +220,16 @@ bool Utf8::IsValidCharacter(uchar c) { c != kBadChar); } +template <> +bool Utf8::IsAsciiOneByteString(const uint8_t* buffer, size_t size) { + return simdutf::validate_ascii(reinterpret_cast(buffer), size); +} + +template <> +bool Utf8::IsAsciiOneByteString(const uint16_t* buffer, size_t size) { + return false; +} + template Utf8::EncodingResult Utf8::Encode(v8::base::Vector string, char* buffer, size_t capacity, @@ -234,8 +245,17 @@ Utf8::EncodingResult Utf8::Encode(v8::base::Vector string, const Char* characters = string.begin(); size_t content_capacity = capacity - write_null; CHECK_LE(content_capacity, capacity); - uint16_t last = Utf16::kNoPreviousCharacter; size_t read_index = 0; + if (kSourceIsOneByte) { + size_t writeable = std::min(string.size(), content_capacity); + // Just memcpy when possible. + if (writeable > 0 && Utf8::IsAsciiOneByteString(characters, writeable)) { + memcpy(buffer, characters, writeable); + read_index = writeable; + write_index = writeable; + } + } + uint16_t last = Utf16::kNoPreviousCharacter; for (; read_index < string.size(); read_index++) { Char character = characters[read_index]; diff --git a/deps/v8/src/strings/unicode.h b/deps/v8/src/strings/unicode.h index ef1e717b1ea857..b9b5bc2431eb54 100644 --- a/deps/v8/src/strings/unicode.h +++ b/deps/v8/src/strings/unicode.h @@ -212,6 +212,16 @@ class V8_EXPORT_PRIVATE Utf8 { // - valid code point range. static bool ValidateEncoding(const uint8_t* str, size_t length); + template + static bool IsAsciiOneByteString(const Char* buffer, size_t size); + + template <> + inline bool IsAsciiOneByteString(const uint8_t* buffer, size_t size); + + template <> + inline bool IsAsciiOneByteString(const uint16_t* buffer, + size_t size); + // Encode the given characters as Utf8 into the provided output buffer. struct EncodingResult { size_t bytes_written; @@ -223,6 +233,14 @@ class V8_EXPORT_PRIVATE Utf8 { bool replace_invalid_utf8); }; +template <> +inline bool Utf8::IsAsciiOneByteString(const uint8_t* buffer, + size_t size); + +template <> +inline bool Utf8::IsAsciiOneByteString(const uint16_t* buffer, + size_t size); + #if V8_ENABLE_WEBASSEMBLY class V8_EXPORT_PRIVATE Wtf8 { public: diff --git a/tools/bootstrap/README.md b/tools/bootstrap/README.md deleted file mode 100644 index 0b93055811d2ac..00000000000000 --- a/tools/bootstrap/README.md +++ /dev/null @@ -1,2 +0,0 @@ -Refer to [BUILDING.md](../../BUILDING.md#option-3-automated-install-with-boxstarter) for -instructions on how to build Node.js with boxstarter. diff --git a/tools/bootstrap/windows_boxstarter b/tools/bootstrap/windows_boxstarter deleted file mode 100644 index fc860180aab36f..00000000000000 --- a/tools/bootstrap/windows_boxstarter +++ /dev/null @@ -1,24 +0,0 @@ -# Boxstarter (http://boxstarter.org/) script for Node.js prerequisites -# -# To install either open this link in IE or Edge: -# http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/HEAD/tools/bootstrap/windows_boxstarter -# -# Or run those commands in an elevated Powershell terminal: -# iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')) -# get-boxstarter -Force -# Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/HEAD/tools/bootstrap/windows_boxstarter -DisableReboots -# -# For more detail see -# https://github.com/nodejs/node/blob/HEAD/tools/bootstrap/README.md -# - -# Git and Unix tools will be added to the PATH -choco install git -params /GitAndUnixToolsOnPath -y -choco install python3 -y - -# Installs VS 2022 Build Tools -choco install visualstudio2022buildtools -y -choco install visualstudio2022-workload-vctools -y --params="--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.ATL.ARM64 --add Microsoft.NetCore.Component.SDK --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset" - -# NASM -choco install nasm -y