Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v14.x] src: use correct outer Context’s microtask queue #38787

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
5962d42
tools: add new ESLint rule: prefer-primordials
targos May 16, 2021
5068db6
tools,lib: tighten prefer-primordials rules for Error statics
aduh95 Nov 7, 2020
1687197
tools,lib: recommend using safe primordials
aduh95 Nov 7, 2020
538ec98
timers: cleanup abort listener on awaitable timers
targos May 16, 2021
2fd37db
lib: add %TypedArray% abstract constructor to primordials
ExE-Boss Nov 7, 2020
1f38c63
module: refactor to use more primordials
aduh95 Nov 7, 2020
64c5f62
tools: update ESLint to 7.11.0
cjihrig Oct 9, 2020
8b2df0c
tools: update ESLint to 7.12.0
cjihrig Oct 25, 2020
8e4a055
tools: update ESLint to 7.12.1
cjihrig Oct 27, 2020
17c8484
tools: update ESLint to 7.13.0
lpinca Nov 8, 2020
845f3ae
test: use `.then(common.mustCall())` for all async IIFEs
addaleax Jul 14, 2020
02233af
tools: add linting rule for async IIFEs
addaleax Jul 14, 2020
1f3fff3
test: add Actions annotation output
mmarchini Aug 1, 2020
22bf488
stream: fix legacy pipe error handling
ronag Sep 18, 2020
ef7d3b1
doc: document changes for `*/promises` alias modules
ExE-Boss Jun 21, 2020
b566802
child_process: refactor to use more primordials
aduh95 Nov 6, 2020
483c1a1
lib,tools: enforce access to prototype from primordials
aduh95 Nov 7, 2020
8c743ca
timers: refactor to use more primordials
targos May 16, 2021
4d35416
http2: add support for TypedArray to getUnpackedSettings
aduh95 Nov 16, 2020
986e79a
lib: refactor to use more primordials
aduh95 Nov 15, 2020
34984f3
errors: refactor to use more primordials
aduh95 Nov 18, 2020
f4cb54d
src: fix label indentation
Trott Nov 21, 2020
abecf46
tools: update ESLint to 7.14.0
cjihrig Nov 21, 2020
66597bc
tools: enable no-nonoctal-decimal-escape lint rule
cjihrig Nov 21, 2020
73b5aa7
lib: refactor primordials.uncurryThis
aduh95 Nov 21, 2020
f59ee44
deps: V8: cherry-pick 86991d0587a1
bcoe Nov 25, 2020
ac47032
policy: refactor to use more primordials
aduh95 Nov 15, 2020
b641c26
tty: refactor to use more primordials
Lxxyx Nov 26, 2020
1462d59
os: refactor to use more primordials
aduh95 Nov 20, 2020
d49ec9b
v8: refactor to use more primordials
aduh95 Nov 20, 2020
5a3192d
perf_hooks: refactor to use more primordials
aduh95 Nov 21, 2020
47b822f
errors: display original symbol name
bcoe Nov 8, 2020
9a6e47e
buffer: refactor to use more primordials
aduh95 Nov 18, 2020
b41bd4f
timers: reject with AbortError on cancellation
targos May 16, 2021
6d63861
worker: refactor to use more primordials
aduh95 Nov 16, 2020
937e270
path: refactor to use more primordials
aduh95 Nov 18, 2020
3f919b3
src: use transferred consistently
danbev Dec 1, 2020
aa23776
querystring: refactor to use more primordials
aduh95 Nov 18, 2020
878907d
module: refactor to use more primordials
aduh95 Nov 21, 2020
beae340
zlib: refactor to use more primordials
aduh95 Nov 20, 2020
d43e1ae
dgram: refactor to use more primordials
aduh95 Nov 19, 2020
efbec9d
readline: refactor to use more primordials
aduh95 Nov 15, 2020
965c963
buffer: refactor to use primordials instead of Array#reduce
aduh95 Dec 4, 2020
16b684e
string_decoder: refactor to use more primordials
aduh95 Nov 21, 2020
bc92cbd
lib: add uncurried accessor properties to `primordials`
ExE-Boss Nov 30, 2020
5c7779d
net: refactor to use more primordials
aduh95 Nov 17, 2020
b39e71b
tools: enable no-unused-expressions lint rule
targos Nov 24, 2020
86867dc
dns: refactor to use more primordials
aduh95 Nov 20, 2020
1a197eb
doc: document ABORT_ERR code
benjamingr Nov 29, 2020
e5de7b6
tools: update ESLint to 7.15.0
cjihrig Dec 6, 2020
a67e392
tools: enable no-unsafe-optional-chaining lint rule
cjihrig Dec 6, 2020
3b54ec5
inspector: refactor to use more primordials
aduh95 Nov 21, 2020
bb8c716
util: simplify constructor retrieval in inspect()
Trott Dec 10, 2020
336d5fb
build: fix make test-npm
ruyadorno Dec 3, 2020
8488818
tools: update ESLint to 7.16.0
Dec 19, 2020
7babb64
tools: update ESLint to 7.17.0
cjihrig Jan 2, 2021
a988af4
lib: refactor to use more primordials in internal/histogram.js
RaisinTen Dec 9, 2020
bf998e3
v8: refactor to use more primordials
aduh95 Dec 5, 2020
4cf665b
doc: expand openssl instructions
mhdawson Dec 17, 2020
74e8cc2
deps: V8: cherry-pick dfcdf7837e23
bcoe Dec 18, 2020
c260d98
events: refactor to use more primordials
aduh95 Nov 17, 2020
40df0dc
deps: V8: cherry-pick 035c305ce776
targos May 1, 2021
55d0cd8
deps: update ICU to 69.1
targos Apr 9, 2021
c46dd77
deps: V8: backport 4bf051d536a1
addaleax Dec 11, 2020
0e077a5
src: use correct outer Context’s microtask queue
addaleax Dec 8, 2020
df3d763
src: use correct microtask queue for checkpoints
addaleax Dec 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ module.exports = {
'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 0, maxBOF: 0 }],
'no-new-require': 'error',
'no-new-symbol': 'error',
'no-nonoctal-decimal-escape': 'error',
'no-obj-calls': 'error',
'no-octal': 'error',
'no-path-concat': 'error',
Expand Down Expand Up @@ -238,6 +239,8 @@ module.exports = {
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-unsafe-negation': 'error',
'no-unsafe-optional-chaining': 'error',
'no-unused-expressions': ['error', { allowShortCircuit: true }],
'no-unused-labels': 'error',
'no-unused-vars': ['error', { args: 'none', caughtErrors: 'all' }],
'no-use-before-define': ['error', {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
- name: Build
run: make build-ci -j2 V=1
- name: Test
run: make run-ci -j2 V=1 TEST_CI_ARGS="-p dots"
run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions"
2 changes: 1 addition & 1 deletion .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
- name: Build
run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn"
- name: Test
run: make run-ci -j2 V=1 TEST_CI_ARGS="-p dots"
run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions"
2 changes: 1 addition & 1 deletion .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
- name: Build
run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn"
- name: Test
run: make run-ci -j2 V=1 TEST_CI_ARGS="-p dots"
run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ test-known-issues: all

# Related CI job: node-test-npm
test-npm: $(NODE_EXE) ## Run the npm test suite on deps/npm.
$(NODE) tools/test-npm-package --install --logfile=test-npm.tap deps/npm test-node
$(NODE) tools/test-npm-package --install --logfile=test-npm.tap deps/npm test

test-npm-publish: $(NODE_EXE)
npm_package_config_publishtest=true $(NODE) deps/npm/test/run.js
Expand Down
1 change: 0 additions & 1 deletion benchmark/_benchmark_progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class BenchmarkProgress {
this.completedConfig = 0;
// Total number of configurations for the current file
this.scheduledConfig = 0;
this.interval; // Updates the elapsed time.
}

startQueue(index) {
Expand Down
6 changes: 4 additions & 2 deletions benchmark/es/destructuring-bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ function runSwapManual(n) {
let x, y, r;
bench.start();
for (let i = 0; i < n; i++) {
x = 1, y = 2;
x = 1;
y = 2;
r = x;
x = y;
y = r;
Expand All @@ -26,7 +27,8 @@ function runSwapDestructured(n) {
let x, y;
bench.start();
for (let i = 0; i < n; i++) {
x = 1, y = 2;
x = 1;
y = 2;
[x, y] = [y, x];
assert.strictEqual(x, 2);
assert.strictEqual(y, 1);
Expand Down
2 changes: 1 addition & 1 deletion benchmark/perf_hooks/bench-eventlooputil.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function main({ method, n }) {
function benchIdleTime(n) {
bench.start();
for (let i = 0; i < n; i++)
nodeTiming.idleTime;
nodeTiming.idleTime; // eslint-disable-line no-unused-expressions
bench.end(n);
}

Expand Down
4 changes: 2 additions & 2 deletions benchmark/process/bench-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function main({ n, operation }) {
case 'get':
bench.start();
for (let i = 0; i < n; i++) {
process.env.PATH;
process.env.PATH; // eslint-disable-line no-unused-expressions
}
bench.end(n);
break;
Expand Down Expand Up @@ -42,7 +42,7 @@ function main({ n, operation }) {
case 'query':
bench.start();
for (let i = 0; i < n; i++) {
'PATH' in process.env;
'PATH' in process.env; // eslint-disable-line no-unused-expressions
}
bench.end(n);
break;
Expand Down
3 changes: 1 addition & 2 deletions benchmark/string_decoder/string-decoder-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ const bench = common.createBenchmark(main, {
function main({ encoding, n }) {
bench.start();
for (let i = 0; i < n; ++i) {
const sd = new StringDecoder(encoding);
!!sd.encoding;
new StringDecoder(encoding);
}
bench.end(n);
}
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,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.64',
'v8_embedder_string': '-node.68',

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

Expand Down
4 changes: 2 additions & 2 deletions deps/icu-small/README-FULL-ICU.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ICU sources - auto generated by shrink-icu-src.py

This directory contains the ICU subset used by --with-intl=full-icu
It is a strict subset of ICU 68 source files with the following exception(s):
* deps/icu-small/source/data/in/icudt68l.dat.bz2 : compressed data file
It is a strict subset of ICU 69 source files with the following exception(s):
* deps/icu-small/source/data/in/icudt69l.dat.bz2 : compressed data file


To rebuild this directory, see ../../tools/icu/README.md
26 changes: 17 additions & 9 deletions deps/icu-small/source/common/bytestriebuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,31 +474,39 @@ BytesTrieBuilder::writeDeltaTo(int32_t jumpTarget) {
U_ASSERT(i>=0);
if(i<=BytesTrie::kMaxOneByteDelta) {
return write(i);
} else {
char intBytes[5];
return write(intBytes, internalEncodeDelta(i, intBytes));
}
char intBytes[5];
int32_t length;
}

int32_t
BytesTrieBuilder::internalEncodeDelta(int32_t i, char intBytes[]) {
U_ASSERT(i>=0);
if(i<=BytesTrie::kMaxOneByteDelta) {
intBytes[0]=(char)i;
return 1;
}
int32_t length=1;
if(i<=BytesTrie::kMaxTwoByteDelta) {
intBytes[0]=(char)(BytesTrie::kMinTwoByteDeltaLead+(i>>8));
length=1;
} else {
if(i<=BytesTrie::kMaxThreeByteDelta) {
intBytes[0]=(char)(BytesTrie::kMinThreeByteDeltaLead+(i>>16));
length=2;
} else {
if(i<=0xffffff) {
intBytes[0]=(char)BytesTrie::kFourByteDeltaLead;
length=3;
} else {
intBytes[0]=(char)BytesTrie::kFiveByteDeltaLead;
intBytes[1]=(char)(i>>24);
length=4;
length=2;
}
intBytes[1]=(char)(i>>16);
intBytes[length++]=(char)(i>>16);
}
intBytes[1]=(char)(i>>8);
intBytes[length++]=(char)(i>>8);
}
intBytes[length++]=(char)i;
return write(intBytes, length);
return length;
}

U_NAMESPACE_END
34 changes: 34 additions & 0 deletions deps/icu-small/source/common/charstr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* created by: Markus W. Scherer
*/

#include <cstdlib>

#include "unicode/utypes.h"
#include "unicode/putil.h"
#include "charstr.h"
Expand Down Expand Up @@ -141,6 +143,38 @@ CharString &CharString::append(const char *s, int32_t sLength, UErrorCode &error
return *this;
}

CharString &CharString::appendNumber(int32_t number, UErrorCode &status) {
if (number < 0) {
this->append('-', status);
if (U_FAILURE(status)) {
return *this;
}
}

if (number == 0) {
this->append('0', status);
return *this;
}

int32_t numLen = 0;
while (number != 0) {
int32_t residue = number % 10;
number /= 10;
this->append(std::abs(residue) + '0', status);
numLen++;
if (U_FAILURE(status)) {
return *this;
}
}

int32_t start = this->length() - numLen, end = this->length() - 1;
while(start < end) {
std::swap(this->data()[start++], this->data()[end--]);
}

return *this;
}

char *CharString::getAppendBuffer(int32_t minCapacity,
int32_t desiredCapacityHint,
int32_t &resultCapacity,
Expand Down
3 changes: 3 additions & 0 deletions deps/icu-small/source/common/charstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ class U_COMMON_API CharString : public UMemory {
return append(s.data(), s.length(), errorCode);
}
CharString &append(const char *s, int32_t sLength, UErrorCode &status);

CharString &appendNumber(int32_t number, UErrorCode &status);

/**
* Returns a writable buffer for appending and writes the buffer's capacity to
* resultCapacity. Guarantees resultCapacity>=minCapacity if U_SUCCESS().
Expand Down
55 changes: 52 additions & 3 deletions deps/icu-small/source/common/cmemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,63 @@
#include <stddef.h>
#include <string.h>
#include "unicode/localpointer.h"
#include "uassert.h"

#if U_DEBUG && defined(UPRV_MALLOC_COUNT)
#include <stdio.h>
#endif


#define uprv_memcpy(dst, src, size) U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size)
#define uprv_memmove(dst, src, size) U_STANDARD_CPP_NAMESPACE memmove(dst, src, size)
// uprv_memcpy and uprv_memmove
#if defined(__clang__)
#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
/* Suppress warnings about addresses that will never be NULL */ \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Waddress\"") \
U_ASSERT(dst != NULL); \
U_ASSERT(src != NULL); \
_Pragma("clang diagnostic pop") \
U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
} UPRV_BLOCK_MACRO_END
#define uprv_memmove(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
/* Suppress warnings about addresses that will never be NULL */ \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Waddress\"") \
U_ASSERT(dst != NULL); \
U_ASSERT(src != NULL); \
_Pragma("clang diagnostic pop") \
U_STANDARD_CPP_NAMESPACE memmove(dst, src, size); \
} UPRV_BLOCK_MACRO_END
#elif defined(__GNUC__)
#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
/* Suppress warnings about addresses that will never be NULL */ \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Waddress\"") \
U_ASSERT(dst != NULL); \
U_ASSERT(src != NULL); \
_Pragma("GCC diagnostic pop") \
U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
} UPRV_BLOCK_MACRO_END
#define uprv_memmove(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
/* Suppress warnings about addresses that will never be NULL */ \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Waddress\"") \
U_ASSERT(dst != NULL); \
U_ASSERT(src != NULL); \
_Pragma("GCC diagnostic pop") \
U_STANDARD_CPP_NAMESPACE memmove(dst, src, size); \
} UPRV_BLOCK_MACRO_END
#else
#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
U_ASSERT(dst != NULL); \
U_ASSERT(src != NULL); \
U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
} UPRV_BLOCK_MACRO_END
#define uprv_memmove(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
U_ASSERT(dst != NULL); \
U_ASSERT(src != NULL); \
U_STANDARD_CPP_NAMESPACE memmove(dst, src, size); \
} UPRV_BLOCK_MACRO_END
#endif

/**
* \def UPRV_LENGTHOF
Expand Down
32 changes: 8 additions & 24 deletions deps/icu-small/source/common/dictbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,9 @@ ThaiBreakEngine::divideUpDictionaryRange( UText *text,
goto foundBest;
}
do {
int32_t wordsMatched = 1;
if (words[(wordsFound + 1) % THAI_LOOKAHEAD].candidates(text, fDictionary, rangeEnd) > 0) {
if (wordsMatched < 2) {
// Followed by another dictionary word; mark first word as a good candidate
words[wordsFound%THAI_LOOKAHEAD].markCurrent();
wordsMatched = 2;
}
// Followed by another dictionary word; mark first word as a good candidate
words[wordsFound%THAI_LOOKAHEAD].markCurrent();

// If we're already at the end of the range, we're done
if ((int32_t)utext_getNativeIndex(text) >= rangeEnd) {
Expand Down Expand Up @@ -503,13 +499,9 @@ LaoBreakEngine::divideUpDictionaryRange( UText *text,
goto foundBest;
}
do {
int32_t wordsMatched = 1;
if (words[(wordsFound + 1) % LAO_LOOKAHEAD].candidates(text, fDictionary, rangeEnd) > 0) {
if (wordsMatched < 2) {
// Followed by another dictionary word; mark first word as a good candidate
words[wordsFound%LAO_LOOKAHEAD].markCurrent();
wordsMatched = 2;
}
// Followed by another dictionary word; mark first word as a good candidate
words[wordsFound%LAO_LOOKAHEAD].markCurrent();

// If we're already at the end of the range, we're done
if ((int32_t)utext_getNativeIndex(text) >= rangeEnd) {
Expand Down Expand Up @@ -699,13 +691,9 @@ BurmeseBreakEngine::divideUpDictionaryRange( UText *text,
goto foundBest;
}
do {
int32_t wordsMatched = 1;
if (words[(wordsFound + 1) % BURMESE_LOOKAHEAD].candidates(text, fDictionary, rangeEnd) > 0) {
if (wordsMatched < 2) {
// Followed by another dictionary word; mark first word as a good candidate
words[wordsFound%BURMESE_LOOKAHEAD].markCurrent();
wordsMatched = 2;
}
// Followed by another dictionary word; mark first word as a good candidate
words[wordsFound%BURMESE_LOOKAHEAD].markCurrent();

// If we're already at the end of the range, we're done
if ((int32_t)utext_getNativeIndex(text) >= rangeEnd) {
Expand Down Expand Up @@ -908,13 +896,9 @@ KhmerBreakEngine::divideUpDictionaryRange( UText *text,
goto foundBest;
}
do {
int32_t wordsMatched = 1;
if (words[(wordsFound + 1) % KHMER_LOOKAHEAD].candidates(text, fDictionary, rangeEnd) > 0) {
if (wordsMatched < 2) {
// Followed by another dictionary word; mark first word as a good candidate
words[wordsFound % KHMER_LOOKAHEAD].markCurrent();
wordsMatched = 2;
}
// Followed by another dictionary word; mark first word as a good candidate
words[wordsFound % KHMER_LOOKAHEAD].markCurrent();

// If we're already at the end of the range, we're done
if ((int32_t)utext_getNativeIndex(text) >= rangeEnd) {
Expand Down
1 change: 1 addition & 0 deletions deps/icu-small/source/common/edits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Edits &Edits::moveArray(Edits &src) U_NOEXCEPT {
}

Edits &Edits::operator=(const Edits &other) {
if (this == &other) { return *this; } // self-assignment: no-op
length = other.length;
delta = other.delta;
numChanges = other.numChanges;
Expand Down
Loading