Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
meta: merge node/master into node-chakracore/master
Browse files Browse the repository at this point in the history
Merge d1156da as of 2018-04-10
This commit was automatically generated. For any problems, please contact jackhorton

Reviewed-By: Jack Horton (CHAKRA) <jahorto@microsoft.com>
  • Loading branch information
chakrabot authored and jackhorton committed Apr 12, 2018
2 parents 5cb4d54 + d1156da commit ff5e8e7
Show file tree
Hide file tree
Showing 4,316 changed files with 1,514,869 additions and 801,986 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
59 changes: 21 additions & 38 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,23 @@ Depending on host platform, the selection of toolchains may vary.

* Visual Studio 2017 or the Build Tools thereof

#### OpenSSL asm support

OpenSSL-1.1.0 requires the following asssembler version for use of asm
support.

* gas (GNU assembler) version 2.23 or higher
* xcode version 5.0 or higher
* llvm version 3.3 or higher
* nasm version 2.10 or higher in Windows

Otherwise, `--openssl-no-asm` is added with warning in configure.

*Note:* The forthcoming OpenSSL-1.1.1 will require higher
version. Please refer
https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html for
details.

## Building Node.js on supported platforms

*Note:* All prerequisites can be easily installed by following
Expand Down Expand Up @@ -241,6 +258,9 @@ Prerequisites:
* Basic Unix tools required for some tests,
[Git for Windows](http://git-scm.com/download/win) includes Git Bash
and tools which can be included in the global `PATH`.
* **Optional** (for OpenSSL assembler modules): the [NetWide Assembler](http://www.nasm.us/),
if not installed in the default location it needs to be manually added
to `PATH`.
* **Optional** (to build the MSI): the [WiX Toolset v3.11](http://wixtoolset.org/releases/)
and the [Wix Toolset Visual Studio 2017 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WixToolsetVisualStudio2017Extension).

Expand Down Expand Up @@ -377,44 +397,7 @@ as `deps/icu` (You'll have: `deps/icu/source/...`)

## Building Node.js with FIPS-compliant OpenSSL

It is possible to build Node.js with the
[OpenSSL FIPS module](https://www.openssl.org/docs/fipsnotes.html) on POSIX
systems. Windows is not supported.

Building in this way does not mean the runtime is FIPS 140-2 validated, but
rather that the runtime uses a validated module. In addition, the validation for
the underlying module is only valid if it is deployed in accordance with its
[security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf).
If you need FIPS validated cryptography it is recommended that you read both
the [security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf)
and [user guide](https://openssl.org/docs/fips/UserGuide-2.0.pdf).

### Instructions

1. Obtain a copy of openssl-fips-x.x.x.tar.gz.
To comply with the security policy you must ensure the path
through which you get the file complies with the requirements
for a "secure installation" as described in section 6.6 in
the [user guide](https://openssl.org/docs/fips/UserGuide-2.0.pdf).
For evaluation/experimentation, you can simply download and verify
`openssl-fips-x.x.x.tar.gz` from https://www.openssl.org/source/
2. Extract source to `openssl-fips` folder and `cd openssl-fips`
3. `./config`
4. `make`
5. `make install`
(NOTE: to comply with the security policy you must use the exact
commands in steps 3-5 without any additional options as per
Appendix A in the [security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf).
The only exception is that `./config no-asm` can be
used in place of `./config`, and the FIPSDIR environment variable
may be used to specify a non-standard install folder for the
validated module, as per User Guide sections 4.2.1, 4.2.2, and 4.2.3.
6. Get into Node.js checkout folder
7. `./configure --openssl-fips=/path/to/openssl-fips/installdir`
For example on ubuntu 12 the installation directory was
`/usr/local/ssl/fips-2.0`
8. Build Node.js with `make -j`
9. Verify with `node -p "process.versions.openssl"` (for example `1.0.2a-fips`)
This version of Node.js does not support FIPS.

## Building Node.js with external core modules

Expand Down
25 changes: 12 additions & 13 deletions benchmark/buffers/buffer-compare-instance-method.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ const common = require('../common.js');
const bench = common.createBenchmark(main, {
size: [16, 512, 1024, 4096, 16386],
args: [1, 2, 3, 4, 5],
millions: [1]
n: [1e6]
});

function main({ millions, size, args }) {
const iter = millions * 1e6;
function main({ n, size, args }) {
const b0 = Buffer.alloc(size, 'a');
const b1 = Buffer.alloc(size, 'a');
const b0Len = b0.length;
Expand Down Expand Up @@ -37,41 +36,41 @@ function main({ millions, size, args }) {
case 2:
b0.compare(b1, 0);
bench.start();
for (i = 0; i < iter; i++) {
for (i = 0; i < n; i++) {
b0.compare(b1, 0);
}
bench.end(iter / 1e6);
bench.end(n);
break;
case 3:
b0.compare(b1, 0, b1Len);
bench.start();
for (i = 0; i < iter; i++) {
for (i = 0; i < n; i++) {
b0.compare(b1, 0, b1Len);
}
bench.end(iter / 1e6);
bench.end(n);
break;
case 4:
b0.compare(b1, 0, b1Len, 0);
bench.start();
for (i = 0; i < iter; i++) {
for (i = 0; i < n; i++) {
b0.compare(b1, 0, b1Len, 0);
}
bench.end(iter / 1e6);
bench.end(n);
break;
case 5:
b0.compare(b1, 0, b1Len, 0, b0Len);
bench.start();
for (i = 0; i < iter; i++) {
for (i = 0; i < n; i++) {
b0.compare(b1, 0, b1Len, 0, b0Len);
}
bench.end(iter / 1e6);
bench.end(n);
break;
default:
b0.compare(b1);
bench.start();
for (i = 0; i < iter; i++) {
for (i = 0; i < n; i++) {
b0.compare(b1);
}
bench.end(iter / 1e6);
bench.end(n);
}
}
9 changes: 4 additions & 5 deletions benchmark/buffers/buffer-compare-offset.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const common = require('../common.js');
const bench = common.createBenchmark(main, {
method: ['offset', 'slice'],
size: [16, 512, 1024, 4096, 16386],
millions: [1]
n: [1e6]
});

function compareUsingSlice(b0, b1, len, iter) {
Expand All @@ -17,13 +17,12 @@ function compareUsingOffset(b0, b1, len, iter) {
b0.compare(b1, 1, len, 1, len);
}

function main({ millions, size, method }) {
const iter = millions * 1e6;
function main({ n, size, method }) {
const fn = method === 'slice' ? compareUsingSlice : compareUsingOffset;
bench.start();
fn(Buffer.alloc(size, 'a'),
Buffer.alloc(size, 'b'),
size >> 1,
iter);
bench.end(millions);
n);
bench.end(n);
}
9 changes: 4 additions & 5 deletions benchmark/buffers/buffer-compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@ const common = require('../common.js');

const bench = common.createBenchmark(main, {
size: [16, 512, 1024, 4096, 16386],
millions: [1]
n: [1e6]
});

function main({ millions, size }) {
const iter = millions * 1e6;
function main({ n, size }) {
const b0 = Buffer.alloc(size, 'a');
const b1 = Buffer.alloc(size, 'a');

b1[size - 1] = 'b'.charCodeAt(0);

bench.start();
for (var i = 0; i < iter; i++) {
for (var i = 0; i < n; i++) {
Buffer.compare(b0, b1);
}
bench.end(iter / 1e6);
bench.end(n);
}
8 changes: 4 additions & 4 deletions benchmark/buffers/buffer-read-float.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ const bench = common.createBenchmark(main, {
type: ['Double', 'Float'],
endian: ['BE', 'LE'],
value: ['zero', 'big', 'small', 'inf', 'nan'],
millions: [1]
n: [1e6]
});

function main({ millions, type, endian, value }) {
function main({ n, type, endian, value }) {
type = type || 'Double';
const buff = Buffer.alloc(8);
const fn = `read${type}${endian}`;
Expand All @@ -32,8 +32,8 @@ function main({ millions, type, endian, value }) {
buff[`write${type}${endian}`](values[type][value], 0);

bench.start();
for (var i = 0; i !== millions * 1e6; i++) {
for (var i = 0; i !== n; i++) {
buff[fn](0);
}
bench.end(millions);
bench.end(n);
}
8 changes: 4 additions & 4 deletions benchmark/buffers/buffer-read-with-byteLength.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ const types = [
const bench = common.createBenchmark(main, {
buffer: ['fast', 'slow'],
type: types,
millions: [1],
n: [1e6],
byteLength: [1, 2, 3, 4, 5, 6]
});

function main({ millions, buf, type, byteLength }) {
function main({ n, buf, type, byteLength }) {
const clazz = buf === 'fast' ? Buffer : require('buffer').SlowBuffer;
const buff = new clazz(8);
const fn = `read${type || 'IntBE'}`;

buff.writeDoubleLE(0, 0);
bench.start();
for (var i = 0; i !== millions * 1e6; i++) {
for (var i = 0; i !== n; i++) {
buff[fn](0, byteLength);
}
bench.end(millions);
bench.end(n);
}
9 changes: 5 additions & 4 deletions benchmark/buffers/buffer-read.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,19 @@ const types = [
const bench = common.createBenchmark(main, {
buffer: ['fast', 'slow'],
type: types,
millions: [1]
n: [1e6]
});

function main({ millions, buf, type }) {
function main({ n, buf, type }) {
const clazz = buf === 'fast' ? Buffer : require('buffer').SlowBuffer;
const buff = new clazz(8);
const fn = `read${type || 'UInt8'}`;

buff.writeDoubleLE(0, 0);
bench.start();
for (var i = 0; i !== millions * 1e6; i++) {

for (var i = 0; i !== n; i++) {
buff[fn](0);
}
bench.end(millions);
bench.end(n);
}
28 changes: 14 additions & 14 deletions benchmark/buffers/buffer-write.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const types = [
const bench = common.createBenchmark(main, {
buffer: ['fast', 'slow'],
type: types,
millions: [1]
n: [1e6]
});

const INT8 = 0x7f;
Expand Down Expand Up @@ -60,42 +60,42 @@ const byteLength = {
writeIntBE: 6
};

function main({ millions, buf, type }) {
function main({ n, buf, type }) {
const clazz = buf === 'fast' ? Buffer : require('buffer').SlowBuffer;
const buff = new clazz(8);
const fn = `write${type || 'UInt8'}`;

if (!/\d/.test(fn))
benchSpecialInt(buff, fn, millions);
benchSpecialInt(buff, fn, n);
else if (/Int/.test(fn))
benchInt(buff, fn, millions);
benchInt(buff, fn, n);
else
benchFloat(buff, fn, millions);
benchFloat(buff, fn, n);
}

function benchInt(buff, fn, millions) {
function benchInt(buff, fn, n) {
const m = mod[fn];
bench.start();
for (var i = 0; i !== millions * 1e6; i++) {
for (var i = 0; i !== n; i++) {
buff[fn](i & m, 0);
}
bench.end(millions);
bench.end(n);
}

function benchSpecialInt(buff, fn, millions) {
function benchSpecialInt(buff, fn, n) {
const m = mod[fn];
const byte = byteLength[fn];
bench.start();
for (var i = 0; i !== millions * 1e6; i++) {
for (var i = 0; i !== n; i++) {
buff[fn](i & m, 0, byte);
}
bench.end(millions);
bench.end(n);
}

function benchFloat(buff, fn, millions) {
function benchFloat(buff, fn, n) {
bench.start();
for (var i = 0; i !== millions * 1e6; i++) {
for (var i = 0; i !== n; i++) {
buff[fn](i, 0);
}
bench.end(millions);
bench.end(n);
}
13 changes: 6 additions & 7 deletions benchmark/buffers/dataview-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const types = [

const bench = common.createBenchmark(main, {
type: types,
millions: [1]
n: [1e6]
});

const INT8 = 0x7f;
Expand All @@ -39,18 +39,17 @@ const mod = {
setUint32: UINT32
};

function main({ millions, type }) {
function main({ n, type }) {
type = type || 'Uint8';
const len = millions * 1e6;
const ab = new ArrayBuffer(8);
const dv = new DataView(ab, 0, 8);
const le = /LE$/.test(type);
const fn = `set${type.replace(/[LB]E$/, '')}`;

if (/int/i.test(fn))
benchInt(dv, fn, len, le);
benchInt(dv, fn, n, le);
else
benchFloat(dv, fn, len, le);
benchFloat(dv, fn, n, le);
}

function benchInt(dv, fn, len, le) {
Expand All @@ -60,7 +59,7 @@ function benchInt(dv, fn, len, le) {
for (var i = 0; i < len; i++) {
method.call(dv, 0, i % m, le);
}
bench.end(len / 1e6);
bench.end(len);
}

function benchFloat(dv, fn, len, le) {
Expand All @@ -69,5 +68,5 @@ function benchFloat(dv, fn, len, le) {
for (var i = 0; i < len; i++) {
method.call(dv, 0, i * 0.1, le);
}
bench.end(len / 1e6);
bench.end(len);
}
Loading

0 comments on commit ff5e8e7

Please sign in to comment.