Commit 64025696 authored by Jérémy Lal's avatar Jérémy Lal

Imported Upstream version 5.4.0~dfsg

parent 62f7fd61
lib/internal/v8_prof_polyfill.js
lib/internal/v8_prof_processor.js
lib/punycode.js
test/addons/doc-*/
test/fixtures
......
......@@ -84,6 +84,8 @@ rules:
# list: https://github.com/eslint/eslint/tree/master/docs/rules#variables
## disallow use of undefined variables (globals)
no-undef: 2
## disallow declaration of variables that are not used in the code
no-unused-vars: [2, {"args": "none"}]
# Custom rules in tools/eslint-rules
require-buffer: 2
......
This diff is collapsed.
......@@ -493,6 +493,9 @@ bench-url: all
bench-events: all
@$(NODE) benchmark/common.js events
bench-util: all
@$(NODE) benchmark/common.js util
bench-all: bench bench-misc bench-array bench-buffer bench-url bench-events
bench: bench-net bench-http bench-fs bench-tls
......
......@@ -37,7 +37,7 @@ back in to the TSC.
* [Starting a Working Group](#starting-a-wg)
* [Bootstrap Governance](#bootstrap-governance)
### [Website](https://github.com/nodejs/website)
### [Website](https://github.com/nodejs/nodejs.org)
The website working group's purpose is to build and maintain a public
website for the `Node.js` project.
......@@ -452,40 +452,13 @@ By making a contribution to this project, I certify that:
* (c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified it.
### Moderation Policy
The [Node.js Moderation Policy] applies to this WG.
### Code of Conduct
This Code of Conduct is adapted from [Rust's wonderful
CoC](https://github.com/rust-lang/rust/wiki/Note-development-policy#conduct).
* We are committed to providing a friendly, safe and welcoming
environment for all, regardless of gender, sexual orientation,
disability, ethnicity, religion, or similar personal characteristic.
* Please avoid using overtly sexual nicknames or other nicknames that
might detract from a friendly, safe and welcoming environment for
all.
* Please be kind and courteous. There's no need to be mean or rude.
* Respect that people have differences of opinion and that every
design or implementation choice carries a trade-off and numerous
costs. There is seldom a right answer.
* Please keep unstructured critique to a minimum. If you have solid
ideas you want to experiment with, make a fork and see how it works.
* We will exclude you from interaction if you insult, demean or harass
anyone. That is not welcome behaviour. We interpret the term
"harassment" as including the definition in the [Citizen Code of
Conduct](http://citizencodeofconduct.org/); if you have any lack of
clarity about what might be included in that concept, please read
their definition. In particular, we don't tolerate behavior that
excludes people in socially marginalized groups.
* Private harassment is also unacceptable. No matter who you are, if
you feel you have been or are being harassed or made uncomfortable
by a community member, please contact one of the channel ops or any
of the TC members immediately with a capture (log, photo, email) of
the harassment if possible. Whether you're a regular contributor or
a newcomer, we care about making this community a safe place for you
and we've got your back.
* Likewise any spamming, trolling, flaming, baiting or other
attention-stealing behaviour is not welcome.
* Avoid the use of personal pronouns in code comments or
documentation. There is no need to address persons when explaining
code (e.g. "When the developer")
The [Node.js Code of Conduct][] applies to this WG.
[Node.js Code of Conduct]: https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md
[Node.js Moderation Policy]: https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md
'use strict';
var common = require('../common.js');
var assert = require('assert');
var bench = common.createBenchmark(main, {
prim: [
null,
undefined,
'a',
1,
true,
{0: 'a'},
[1, 2, 3],
new Array([1, 2, 3])
],
n: [25]
});
function main(conf) {
var prim = conf.prim;
var n = +conf.n;
var primArray;
var primArrayCompare;
var x;
primArray = new Array();
primArrayCompare = new Array();
for (x = 0; x < (1e5); x++) {
primArray.push(prim);
primArrayCompare.push(prim);
}
bench.start();
for (x = 0; x < n; x++) {
assert.deepEqual(primArray, primArrayCompare);
}
bench.end(n);
}
'use strict';
var common = require('../common.js');
var assert = require('assert');
var bench = common.createBenchmark(main, {
prim: [
null,
undefined,
'a',
1,
true,
{0: 'a'},
[1, 2, 3],
new Array([1, 2, 3])
],
n: [1e5]
});
function main(conf) {
var prim = conf.prim;
var n = +conf.n;
var x;
bench.start();
for (x = 0; x < n; x++) {
assert.deepEqual(new Array([prim]), new Array([prim]));
}
bench.end(n);
}
'use strict';
var common = require('../common.js');
var assert = require('assert');
var bench = common.createBenchmark(main, {
type: ('Int8Array Uint8Array Int16Array Uint16Array Int32Array Uint32Array ' +
'Float32Array Float64Array Uint8ClampedArray').split(' '),
n: [1]
});
function main(conf) {
var type = conf.type;
var clazz = global[type];
var n = +conf.n;
bench.start();
var actual = new clazz(n * 1e6);
var expected = new clazz(n * 1e6);
assert.deepEqual(actual, expected);
bench.end(n);
}
'use strict';
const common = require('../common.js');
const bench = common.createBenchmark(main, {
n: [1024]
});
const zero = new Buffer(0);
function main(conf) {
var n = +conf.n;
bench.start();
for (let i = 0; i < n * 1024; i++) {
new Buffer(zero);
}
bench.end(n);
}
'use strict';
const common = require('../common');
const fs = require('fs');
const bench = common.createBenchmark(main, {
n: [1e4],
});
function main(conf) {
const n = conf.n >>> 0;
bench.start();
(function r(cntr) {
if (--cntr <= 0)
return bench.end(n);
fs.readdir(__dirname + '/../../lib/', function() {
r(cntr);
});
}(n));
}
'use strict';
const common = require('../common');
const fs = require('fs');
const bench = common.createBenchmark(main, {
n: [1e4],
});
function main(conf) {
const n = conf.n >>> 0;
bench.start();
for (var i = 0; i < n; i++) {
fs.readdirSync(__dirname + '/../../lib/');
}
bench.end(n);
}
'use strict';
const common = require('../common');
const HTTPParser = process.binding('http_parser').HTTPParser;
const REQUEST = HTTPParser.REQUEST;
const kOnHeaders = HTTPParser.kOnHeaders | 0;
const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;
const kOnBody = HTTPParser.kOnBody | 0;
const kOnMessageComplete = HTTPParser.kOnMessageComplete | 0;
const CRLF = '\r\n';
const bench = common.createBenchmark(main, {
fields: [4, 8, 16, 32],
n: [1e5],
});
function main(conf) {
const fields = conf.fields >>> 0;
const n = conf.n >>> 0;
var header = `GET /hello HTTP/1.1${CRLF}Content-Type: text/plain${CRLF}`;
for (var i = 0; i < fields; i++) {
header += `X-Filler${i}: ${Math.random().toString(36).substr(2)}${CRLF}`;
}
header += CRLF;
processHeader(new Buffer(header), n);
}
function processHeader(header, n) {
const parser = newParser(REQUEST);
bench.start();
for (var i = 0; i < n; i++) {
parser.execute(header, 0, header.length);
parser.reinitialize(REQUEST);
}
bench.end(n);
}
function newParser(type) {
const parser = new HTTPParser(type);
parser.headers = [];
parser[kOnHeaders] = function() { };
parser[kOnHeadersComplete] = function() { };
parser[kOnBody] = function() { };
parser[kOnMessageComplete] = function() { };
return parser;
}
'use strict';
const common = require('../common');
const bench = common.createBenchmark(main, {
n: [1e5],
});
function main(conf) {
const n = conf.n >>> 0;
bench.start();
for (var i = 0; i < n; i++) {
// Access every item in object to process values.
Object.keys(process.env);
}
bench.end(n);
}
'use strict';
const common = require('../common');
const bench = common.createBenchmark(main, {
n: [1e6]
});
function main(conf) {
const n = conf.n >>> 0;
bench.start();
for (var i = 0; i < n; i++) {
process.hrtime();
}
bench.end(n);
}
var util = require('util');
var common = require('../common.js');
var bench = common.createBenchmark(main, {n: [5e6]});
function main(conf) {
var n = conf.n | 0;
bench.start();
for (var i = 0; i < n; i += 1) {
var r = util.inspect({a: 'a', b: 'b', c: 'c', d: 'd'});
}
bench.end(n);
}
......@@ -29,6 +29,7 @@
#include "src/api.h"
#include "src/objects.h"
#include "src/utils.h"
namespace v8 {
namespace internal {
......@@ -379,11 +380,32 @@ AstRawString* AstValueFactory::GetString(uint32_t hash, bool is_one_byte,
bool AstValueFactory::AstRawStringCompare(void* a, void* b) {
const AstRawString* lhs = static_cast<AstRawString*>(a);
const AstRawString* rhs = static_cast<AstRawString*>(b);
if (lhs->is_one_byte() != rhs->is_one_byte()) return false;
if (lhs->length() != rhs->length()) return false;
if (lhs->hash() != rhs->hash()) return false;
int len = lhs->byte_length();
if (rhs->byte_length() != len) return false;
return memcmp(lhs->raw_data(), rhs->raw_data(), len) == 0;
const unsigned char* l = lhs->raw_data();
const unsigned char* r = rhs->raw_data();
size_t length = rhs->length();
if (lhs->is_one_byte()) {
if (rhs->is_one_byte()) {
return CompareCharsUnsigned(reinterpret_cast<const uint8_t*>(l),
reinterpret_cast<const uint8_t*>(r),
length) == 0;
} else {
return CompareCharsUnsigned(reinterpret_cast<const uint8_t*>(l),
reinterpret_cast<const uint16_t*>(r),
length) == 0;
}
} else {
if (rhs->is_one_byte()) {
return CompareCharsUnsigned(reinterpret_cast<const uint16_t*>(l),
reinterpret_cast<const uint8_t*>(r),
length) == 0;
} else {
return CompareCharsUnsigned(reinterpret_cast<const uint16_t*>(l),
reinterpret_cast<const uint16_t*>(r),
length) == 0;
}
}
}
} // namespace internal
} // namespace v8
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title> Node.js v5.3.0 Manual &amp; Documentation</title>
<title> Node.js v5.4.0 Manual &amp; Documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic">
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
......@@ -61,7 +61,7 @@
<div id="column1" data-id="_toc" class="interior">
<header>
<h1>Node.js v5.3.0 Documentation</h1>
<h1>Node.js v5.4.0 Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......
This diff is collapsed.
This diff is collapsed.