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
34 changes: 0 additions & 34 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
<https://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/HEAD/tools/bootstrap/windows_boxstarter>
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
Expand Down
22 changes: 21 additions & 1 deletion deps/v8/src/strings/unicode-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

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

namespace unibrow {

Expand Down Expand Up @@ -219,6 +220,16 @@ bool Utf8::IsValidCharacter(uchar c) {
c != kBadChar);
}

template <>
bool Utf8::IsAsciiOneByteString<uint8_t>(const uint8_t* buffer, size_t size) {
return simdutf::validate_ascii(reinterpret_cast<const char*>(buffer), size);
}

template <>
bool Utf8::IsAsciiOneByteString<uint16_t>(const uint16_t* buffer, size_t size) {
return false;
}

template <typename Char>
Utf8::EncodingResult Utf8::Encode(v8::base::Vector<const Char> string,
char* buffer, size_t capacity,
Expand All @@ -234,8 +245,17 @@ Utf8::EncodingResult Utf8::Encode(v8::base::Vector<const Char> 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];

Expand Down
18 changes: 18 additions & 0 deletions deps/v8/src/strings/unicode.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,16 @@ class V8_EXPORT_PRIVATE Utf8 {
// - valid code point range.
static bool ValidateEncoding(const uint8_t* str, size_t length);

template <typename Char>
static bool IsAsciiOneByteString(const Char* buffer, size_t size);

template <>
inline bool IsAsciiOneByteString<uint8_t>(const uint8_t* buffer, size_t size);

template <>
inline bool IsAsciiOneByteString<uint16_t>(const uint16_t* buffer,
size_t size);

// Encode the given characters as Utf8 into the provided output buffer.
struct EncodingResult {
size_t bytes_written;
Expand All @@ -223,6 +233,14 @@ class V8_EXPORT_PRIVATE Utf8 {
bool replace_invalid_utf8);
};

template <>
inline bool Utf8::IsAsciiOneByteString<uint8_t>(const uint8_t* buffer,
size_t size);

template <>
inline bool Utf8::IsAsciiOneByteString<uint16_t>(const uint16_t* buffer,
size_t size);

#if V8_ENABLE_WEBASSEMBLY
class V8_EXPORT_PRIVATE Wtf8 {
public:
Expand Down
2 changes: 0 additions & 2 deletions tools/bootstrap/README.md

This file was deleted.

24 changes: 0 additions & 24 deletions tools/bootstrap/windows_boxstarter

This file was deleted.