Skip to content

Commit

Permalink
update to 12.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwang committed Sep 10, 2019
1 parent 067339a commit a19bb09
Show file tree
Hide file tree
Showing 2,910 changed files with 128,270 additions and 69,694 deletions.
2 changes: 1 addition & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ If you are updating tests and want to run tests in a single test file
(e.g. `test/parallel/test-stream2-transform.js`):

```text
$ python tools/test.py parallel/test-stream2-transform.js
$ python tools/test.py test/parallel/test-stream2-transform.js
```

You can execute the entire suite of tests for a given subsystem
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V12.md#12.8.0">12.8.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V12.md#12.9.1">12.9.1</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V12.md#12.9.0">12.9.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V12.md#12.8.1">12.8.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V12.md#12.8.0">12.8.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V12.md#12.7.0">12.7.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V12.md#12.6.0">12.6.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V12.md#12.5.0">12.5.0</a><br/>
Expand Down
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,16 @@ clean: ## Remove build artifacts.
$(RM) -r node_modules
@if [ -d deps/icu ]; then echo deleting deps/icu; $(RM) -r deps/icu; fi
$(RM) test.tap
# Next one is legacy remove this at some point
$(RM) -r test/tmp*
$(RM) -r test/.tmp*
$(MAKE) testclean
$(MAKE) test-addons-clean
$(MAKE) bench-addons-clean

.PHONY: testclean
testclean:
# Next one is legacy remove this at some point
$(RM) -r test/tmp*
$(RM) -r test/.tmp*

.PHONY: distclean
distclean:
$(RM) -r out
Expand Down Expand Up @@ -294,6 +298,10 @@ jstest: build-addons build-js-native-api-tests build-node-api-tests ## Runs addo
$(CI_JS_SUITES) \
$(CI_NATIVE_SUITES)

.PHONY: tooltest
tooltest:
@$(PYTHON) test/tools/test-js2c.py

.PHONY: coverage-run-js
coverage-run-js:
$(RM) -r out/$(BUILDTYPE)/.coverage
Expand All @@ -311,6 +319,7 @@ test: all ## Runs default tests, linters, and builds docs.
$(MAKE) -s build-node-api-tests
$(MAKE) -s cctest
$(MAKE) -s jstest
$(MAKE) -s tooltest

.PHONY: test-only
test-only: all ## For a quick test, does not run linter or build docs.
Expand All @@ -319,6 +328,7 @@ test-only: all ## For a quick test, does not run linter or build docs.
$(MAKE) build-node-api-tests
$(MAKE) cctest
$(MAKE) jstest
$(MAKE) tooltest

# Used by `make coverage-test`
test-cov: all
Expand Down Expand Up @@ -509,7 +519,7 @@ test-ci-native: | test/addons/.buildstamp test/js-native-api/.buildstamp test/no
test-ci-js: | clear-stalled
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
--mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \
$(TEST_CI_ARGS) $(CI_JS_SUITES) --skip-tests=sequential/test-benchmark-napi
$(TEST_CI_ARGS) $(CI_JS_SUITES)
@echo "Clean up any leftover processes, error if found."
ps awwx | grep Release/node | grep -v grep | cat
@PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
Expand Down
19 changes: 19 additions & 0 deletions benchmark/buffers/buffer-copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';
const common = require('../common.js');

const bench = common.createBenchmark(main, {
bytes: [0, 8, 128, 32 * 1024],
partial: ['true', 'false'],
n: [6e6]
});

function main({ n, bytes, partial }) {
const source = Buffer.allocUnsafe(bytes);
const target = Buffer.allocUnsafe(bytes);
const sourceStart = (partial === 'true' ? Math.floor(bytes / 2) : 0);
bench.start();
for (let i = 0; i < n; i++) {
source.copy(target, 0, sourceStart);
}
bench.end(n);
}
4 changes: 4 additions & 0 deletions benchmark/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ function Benchmark(fn, configs, options) {
if (options && options.flags) {
this.flags = this.flags.concat(options.flags);
}
if (process.env.NODE_BENCHMARK_FLAGS) {
const flags = process.env.NODE_BENCHMARK_FLAGS.split(/\s+/);
this.flags = this.flags.concat(flags);
}
// Holds process.hrtime value
this._time = [0, 0];
// Used to make sure a benchmark only start a timer once
Expand Down
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,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.16',
'v8_embedder_string': '-node.15',

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

Expand Down
45 changes: 22 additions & 23 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import shlex
import subprocess
import shutil
import string
from distutils.spawn import find_executable as which

# If not run from node/, cd to node/.
Expand Down Expand Up @@ -402,6 +401,11 @@
help='build with Large Pages support. This feature is supported only on Linux kernel' +
'>= 2.6.38 with Transparent Huge pages enabled and FreeBSD')

parser.add_option('--use-largepages-script-lld',
action='store_true',
dest='node_use_large_pages_script_lld',
help='link against the LLVM ld linker script. Implies -fuse-ld=lld in the linker flags')

intl_optgroup.add_option('--with-intl',
action='store',
dest='with_intl',
Expand Down Expand Up @@ -626,18 +630,14 @@ def print_verbose(x):

def b(value):
"""Returns the string 'true' if value is truthy, 'false' otherwise."""
if value:
return 'true'
else:
return 'false'
return 'true' if value else 'false'

def B(value):
"""Returns 1 if value is truthy, 0 otherwise."""
if value:
return 1
else:
return 0
return 1 if value else 0

def to_utf8(s):
return s if isinstance(s, str) else s.decode("utf-8")

def pkg_config(pkg):
"""Run pkg-config on the specified package
Expand All @@ -652,7 +652,7 @@ def pkg_config(pkg):
try:
proc = subprocess.Popen(shlex.split(pkg_config) + args,
stdout=subprocess.PIPE)
val = proc.communicate()[0].strip()
val = to_utf8(proc.communicate()[0]).strip()
except OSError as e:
if e.errno != errno.ENOENT: raise e # Unexpected error.
return (None, None, None, None) # No pkg-config/pkgconf installed.
Expand All @@ -668,10 +668,10 @@ def try_check_compiler(cc, lang):
except OSError:
return (False, False, '', '')

proc.stdin.write('__clang__ __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ '
'__clang_major__ __clang_minor__ __clang_patchlevel__')
proc.stdin.write(b'__clang__ __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ '
b'__clang_major__ __clang_minor__ __clang_patchlevel__')

values = (proc.communicate()[0].split() + ['0'] * 7)[0:7]
values = (to_utf8(proc.communicate()[0]).split() + ['0'] * 7)[0:7]
is_clang = values[0] == '1'
gcc_version = tuple(map(int, values[1:1+3]))
clang_version = tuple(map(int, values[4:4+3])) if is_clang else None
Expand All @@ -696,7 +696,7 @@ def get_version_helper(cc, regexp):
consider adjusting the CC environment variable if you installed
it in a non-standard prefix.''')

match = re.search(regexp, proc.communicate()[1])
match = re.search(regexp, to_utf8(proc.communicate()[1]))

if match:
return match.group(2)
Expand All @@ -715,7 +715,7 @@ def get_nasm_version(asm):
return '0'

match = re.match(r"NASM version ([2-9]\.[0-9][0-9]+)",
proc.communicate()[0])
to_utf8(proc.communicate()[0]))

if match:
return match.group(1)
Expand Down Expand Up @@ -746,7 +746,7 @@ def get_gas_version(cc):
consider adjusting the CC environment variable if you installed
it in a non-standard prefix.''')

gas_ret = proc.communicate()[1]
gas_ret = to_utf8(proc.communicate()[1])
match = re.match(r"GNU assembler version ([2-9]\.[0-9]+)", gas_ret)

if match:
Expand Down Expand Up @@ -811,10 +811,8 @@ def cc_macros(cc=None):
consider adjusting the CC environment variable if you installed
it in a non-standard prefix.''')

p.stdin.write('\n')
out = p.communicate()[0]

out = str(out).split('\n')
p.stdin.write(b'\n')
out = to_utf8(p.communicate()[0]).split('\n')

k = {}
for line in out:
Expand Down Expand Up @@ -1055,6 +1053,7 @@ def configure_node(o):
raise Exception(
'Large pages need Linux kernel version >= 2.6.38')
o['variables']['node_use_large_pages'] = b(options.node_use_large_pages)
o['variables']['node_use_large_pages_script_lld'] = b(options.node_use_large_pages_script_lld)

if options.no_ifaddrs:
o['defines'] += ['SUNOS_NO_IFADDRS']
Expand Down Expand Up @@ -1294,7 +1293,7 @@ def glob_to_var(dir_base, dir_sub, patch_dir):

def configure_intl(o):
def icu_download(path):
depFile = 'tools/icu/current_ver.dep';
depFile = 'tools/icu/current_ver.dep'
with open(depFile) as f:
icus = json.load(f)
# download ICU, if needed
Expand Down Expand Up @@ -1363,7 +1362,7 @@ def write_config(data, name):
o['variables']['icu_small'] = b(True)
locs = set(options.with_icu_locales.split(','))
locs.add('root') # must have root
o['variables']['icu_locales'] = string.join(locs,',')
o['variables']['icu_locales'] = ','.join(str(loc) for loc in locs)
# We will check a bit later if we can use the canned deps/icu-small
elif with_intl == 'full-icu':
# full ICU
Expand Down Expand Up @@ -1503,7 +1502,7 @@ def write_config(data, name):
elif int(icu_ver_major) < icu_versions['minimum_icu']:
error('icu4c v%s.x is too old, v%d.x or later is required.' %
(icu_ver_major, icu_versions['minimum_icu']))
icu_endianness = sys.byteorder[0];
icu_endianness = sys.byteorder[0]
o['variables']['icu_ver_major'] = icu_ver_major
o['variables']['icu_endianness'] = icu_endianness
icu_data_file_l = 'icudt%s%s.dat' % (icu_ver_major, 'l')
Expand Down
11 changes: 11 additions & 0 deletions deps/nghttp2/lib/includes/nghttp2/nghttp2.h
Original file line number Diff line number Diff line change
Expand Up @@ -2648,6 +2648,17 @@ nghttp2_option_set_max_deflate_dynamic_table_size(nghttp2_option *option,
NGHTTP2_EXTERN void nghttp2_option_set_no_closed_streams(nghttp2_option *option,
int val);

/**
* @function
*
* This function sets the maximum number of outgoing SETTINGS ACK and
* PING ACK frames retained in :type:`nghttp2_session` object. If
* more than those frames are retained, the peer is considered to be
* misbehaving and session will be closed. The default value is 1000.
*/
NGHTTP2_EXTERN void nghttp2_option_set_max_outbound_ack(nghttp2_option *option,
size_t val);

/**
* @function
*
Expand Down
4 changes: 2 additions & 2 deletions deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
* @macro
* Version number of the nghttp2 library release
*/
#define NGHTTP2_VERSION "1.39.1"
#define NGHTTP2_VERSION "1.39.2"

/**
* @macro
* Numerical representation of the version number of the nghttp2 library
* release. This is a 24 bit number with 8 bits for major number, 8 bits
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
*/
#define NGHTTP2_VERSION_NUM 0x012701
#define NGHTTP2_VERSION_NUM 0x012702

#endif /* NGHTTP2VER_H */
5 changes: 5 additions & 0 deletions deps/nghttp2/lib/nghttp2_option.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,8 @@ void nghttp2_option_set_no_closed_streams(nghttp2_option *option, int val) {
option->opt_set_mask |= NGHTTP2_OPT_NO_CLOSED_STREAMS;
option->no_closed_streams = val;
}

void nghttp2_option_set_max_outbound_ack(nghttp2_option *option, size_t val) {
option->opt_set_mask |= NGHTTP2_OPT_MAX_OUTBOUND_ACK;
option->max_outbound_ack = val;
}
5 changes: 5 additions & 0 deletions deps/nghttp2/lib/nghttp2_option.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ typedef enum {
NGHTTP2_OPT_MAX_SEND_HEADER_BLOCK_LENGTH = 1 << 8,
NGHTTP2_OPT_MAX_DEFLATE_DYNAMIC_TABLE_SIZE = 1 << 9,
NGHTTP2_OPT_NO_CLOSED_STREAMS = 1 << 10,
NGHTTP2_OPT_MAX_OUTBOUND_ACK = 1 << 11,
} nghttp2_option_flag;

/**
Expand All @@ -80,6 +81,10 @@ struct nghttp2_option {
* NGHTTP2_OPT_MAX_DEFLATE_DYNAMIC_TABLE_SIZE
*/
size_t max_deflate_dynamic_table_size;
/**
* NGHTTP2_OPT_MAX_OUTBOUND_ACK
*/
size_t max_outbound_ack;
/**
* Bitwise OR of nghttp2_option_flag to determine that which fields
* are specified.
Expand Down
9 changes: 7 additions & 2 deletions deps/nghttp2/lib/nghttp2_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ static int session_new(nghttp2_session **session_ptr,
(*session_ptr)->remote_settings.max_concurrent_streams = 100;

(*session_ptr)->max_send_header_block_length = NGHTTP2_MAX_HEADERSLEN;
(*session_ptr)->max_outbound_ack = NGHTTP2_DEFAULT_MAX_OBQ_FLOOD_ITEM;

if (option) {
if ((option->opt_set_mask & NGHTTP2_OPT_NO_AUTO_WINDOW_UPDATE) &&
Expand Down Expand Up @@ -516,6 +517,10 @@ static int session_new(nghttp2_session **session_ptr,
option->no_closed_streams) {
(*session_ptr)->opt_flags |= NGHTTP2_OPTMASK_NO_CLOSED_STREAMS;
}

if (option->opt_set_mask & NGHTTP2_OPT_MAX_OUTBOUND_ACK) {
(*session_ptr)->max_outbound_ack = option->max_outbound_ack;
}
}

rv = nghttp2_hd_deflate_init2(&(*session_ptr)->hd_deflater,
Expand Down Expand Up @@ -6857,7 +6862,7 @@ int nghttp2_session_add_ping(nghttp2_session *session, uint8_t flags,
mem = &session->mem;

if ((flags & NGHTTP2_FLAG_ACK) &&
session->obq_flood_counter_ >= NGHTTP2_MAX_OBQ_FLOOD_ITEM) {
session->obq_flood_counter_ >= session->max_outbound_ack) {
return NGHTTP2_ERR_FLOODED;
}

Expand Down Expand Up @@ -7002,7 +7007,7 @@ int nghttp2_session_add_settings(nghttp2_session *session, uint8_t flags,
return NGHTTP2_ERR_INVALID_ARGUMENT;
}

if (session->obq_flood_counter_ >= NGHTTP2_MAX_OBQ_FLOOD_ITEM) {
if (session->obq_flood_counter_ >= session->max_outbound_ack) {
return NGHTTP2_ERR_FLOODED;
}
}
Expand Down
8 changes: 6 additions & 2 deletions deps/nghttp2/lib/nghttp2_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ typedef struct {
response frames are stacked up, which leads to memory exhaustion.
The value selected here is arbitrary, but safe value and if we have
these frames in this number, it is considered suspicious. */
#define NGHTTP2_MAX_OBQ_FLOOD_ITEM 10000
#define NGHTTP2_DEFAULT_MAX_OBQ_FLOOD_ITEM 1000

/* The default value of maximum number of concurrent streams. */
#define NGHTTP2_DEFAULT_MAX_CONCURRENT_STREAMS 0xffffffffu
Expand Down Expand Up @@ -258,8 +258,12 @@ struct nghttp2_session {
size_t num_idle_streams;
/* The number of bytes allocated for nvbuf */
size_t nvbuflen;
/* Counter for detecting flooding in outbound queue */
/* Counter for detecting flooding in outbound queue. If it exceeds
max_outbound_ack, session will be closed. */
size_t obq_flood_counter_;
/* The maximum number of outgoing SETTINGS ACK and PING ACK in
outbound queue. */
size_t max_outbound_ack;
/* The maximum length of header block to send. Calculated by the
same way as nghttp2_hd_deflate_bound() does. */
size_t max_send_header_block_length;
Expand Down
1 change: 1 addition & 0 deletions deps/uv/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Makefile.in
/test/run-benchmarks
/test/run-benchmarks.exe
/test/run-benchmarks.dSYM
test_file_*

*.sln
*.sln.cache
Expand Down
1 change: 1 addition & 0 deletions deps/uv/.mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Sam Roberts <vieuxtech@gmail.com> <sam@strongloop.com>
San-Tai Hsu <vanilla@fatpipi.com>
Santiago Gimeno <santiago.gimeno@quantion.es> <santiago.gimeno@gmail.com>
Saúl Ibarra Corretgé <saghul@gmail.com>
Saúl Ibarra Corretgé <saghul@gmail.com> <s@saghul.net>
Shigeki Ohtsu <ohtsu@iij.ad.jp> <ohtsu@ohtsu.org>
Timothy J. Fontaine <tjfontaine@gmail.com>
Yasuhiro Matsumoto <mattn.jp@gmail.com>
Expand Down
Loading

0 comments on commit a19bb09

Please sign in to comment.