Commit Graph

7653 Commits (47f3fc9a2671bca3f70726f9bbbb8f2b56ac1dc3)

Author SHA1 Message Date
Scott Blomquist 5a39df4959 windows: fix perfctr crash on XP and 2003
Some performance counter related functions are not available on Windows
XP and Windows Server 2003, which caused node to call a NULL pointer.

Closes #4462
Closes #4511
2013-01-03 23:31:26 +01:00
Ben Noordhuis a7d8c21bca Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	configure
	deps/uv/src/unix/core.c
	deps/uv/test/test-fs-event.c
	src/node_version.h
2013-01-03 20:02:31 +01:00
Ben Noordhuis aad2013508 repl: allow overriding builtins
Don't give names of built-in libraries special treatment.
Changes the REPL's behavior from this:

  > var path = 42
  > path
  A different "path" already exists globally

To this:

  > var path = 42
  > path
  42

Fixes #4512.
2013-01-03 19:58:47 +01:00
Ben Noordhuis 875c1106c6 node: remove ev-emul.h
libev has been deprecated since v0.6. Add-on authors have had two major
release cycles to upgrade. Out it goes.
2013-01-03 19:58:38 +01:00
Ben Noordhuis ce1b33a9dc v8: remove optimization switches
Remove compiler switches from $(TOPLEVEL)/deps/v8/build/common.gypi,
we set them globally in $(TOPLEVEL)/common.gypi.

Commit 7b4d95a introduced the switches again, resulting in V8 getting
built without any optimizations.

This commit is essentially a rehash of commit 4b8629d.
2013-01-03 02:37:22 +01:00
Fedor Indutny 8a96bb42c6 test: make tests work with newer v8 2013-01-02 12:13:47 +04:00
Fedor Indutny 5e57bcc3ce bindings: update to new v8 apis
GetPointerFromInternalField() is deprecated now, we should use
GetAlignedPointerFromInternalField().
2013-01-02 12:13:46 +04:00
Fedor Indutny 7b4d95a976 deps: update v8 to 3.15.11 2013-01-01 16:07:02 +04:00
Tim Bradshaw 50e88d0b66 os: change CPU time from Integer to Number
CPU time values must be Numbers, not Integers, as they can be too large
for Integers on 32 bit platforms.
2012-12-31 18:09:36 +01:00
Ben Noordhuis 9e32c2ef3e dgram: fix double implicit bind error
Calling send() on an unbound socket forces an implicit bind to
a random port.

332fea5 made the 'listening' event asynchronous. Unfortunately,
it also introduced a bug where the implicit bind was tried more
than once if send() was called again before the first bind operation
completed.

Address that by keeping track of the bind status and making sure that
bind() is called only once.

Fixes #4499.
2012-12-31 17:53:00 +01:00
Ben Noordhuis acc085e131 doc: add CONTRIBUTING.md 2012-12-31 01:50:48 +01:00
isaacs 44ceb5d8f5 blog: Post for v0.9.5 2012-12-29 17:26:32 -08:00
isaacs 30bd774fbd Now working on 0.9.6 2012-12-29 17:25:40 -08:00
isaacs 9ff2b0b658 Merge branch 'v0.9.5-release' 2012-12-29 17:25:25 -08:00
isaacs 01994e8119 2012.12.30, Version 0.9.5 (Unstable)
* assert: improve support for new execution contexts (lukebayes)

* domain: use camelCase instead of snake_case (isaacs)

* domain: Do not use uncaughtException handler (isaacs)

* fs: make 'end' work with ReadStream without 'start' (Ben Noordhuis)

* https: optimize createConnection() (Ryunosuke SATO)

* buffer: speed up base64 encoding by 20% (Ben Noordhuis)

* doc: Colorize API stabilitity index headers in docs (Luke Arduini)

* net: socket.readyState corrections (bentaber)

* http: Performance enhancements for http under streams2 (isaacs)

* stream: fix to emit end event on http.ClientResponse (Shigeki Ohtsu)

* stream: fix event handler leak in readstream pipe and unpipe (Andreas Madsen)

* build: Support ./configure --tag switch (Maciej Małecki)

* repl: don't touch `require.cache` (Nathan Rajlich)

* node: Emit 'exit' event when exiting for an uncaught exception (isaacs)
2012-12-29 16:54:24 -08:00
isaacs 6c80ef01c1 node: emit 'exit' when exiting with error
Fix #3555
2012-12-29 16:53:23 -08:00
isaacs 7550e31d1a benchmark: Make flamegraphs a bit more useful 2012-12-29 15:32:26 -08:00
isaacs ecdde7df15 benchmark: Set port range properly on Linux 2012-12-29 15:32:26 -08:00
isaacs e11668b244 net: Don't go through Stream API when ondata is used
This speeds up http_simple by around 6%.
2012-12-29 15:32:25 -08:00
isaacs f423287453 http: Separate out the storeHeader closure 2012-12-29 15:32:25 -08:00
isaacs ba94f9d6f8 timers: Move list.ontimeout to separate function 2012-12-29 15:32:25 -08:00
isaacs aec2f733f9 net: Move createWriteReq to separate function 2012-12-29 15:32:25 -08:00
isaacs 9785ab6057 http: Replace "in" usage with "=== undefined"
Speeds up http benchmarks.
2012-12-29 15:32:25 -08:00
lukebayes ae1b0ca7a5 assert: improve support for new execution contexts
More detailed information in GH-693
2012-12-29 11:19:14 -08:00
isaacs 1c2910d94c test-message: Add setTimeout and nextTick message tests 2012-12-29 10:37:31 -08:00
isaacs ec8ebaf300 domain: use camelCase instead of snake_case
While it's true that error objects have a history of getting snake_case
properties attached by the host system, it's a point of confusion to
Node users that comes up a lot.  It's still 'experimental', so best to
change this sooner rather than later.
2012-12-29 10:37:31 -08:00
isaacs 4401bb47bf domain: Do not use uncaughtException handler
This adds a process._fatalException method which is called into from
C++ in order to either emit the 'uncaughtException' method, or emit
'error' on the active domain.

The 'uncaughtException' event is an implementation detail that it would
be nice to deprecate one day, so exposing it as part of the domain
machinery is not ideal.

Fix #4375
2012-12-29 10:37:30 -08:00
Ben Noordhuis a7cc53067d deps: upgrade libuv to 4997738 2012-12-29 17:34:41 +01:00
Ben Noordhuis c6e958d44d fs: make 'end' work with ReadStream without 'start'
Make `fs.createReadStream({ end: 42 })` work.

Before this commit, it worked only when used like this:
`fs.createReadStream({ start: 0, end: 42 })` - only when `start` was specified
by the caller.

Fixes #4423.
2012-12-28 18:33:51 +01:00
Ben Noordhuis 910e24b53d fs: remove fs.sendfile()
Said function has been broken (and useless) since v0.6.0. Remove it altogether.

Fixes #3854.
2012-12-28 18:24:35 +01:00
Ryunosuke SATO c4fc0febfa https: optimize https.createConnection()
Stop using `arguments` for performance and readability.
2012-12-28 16:42:51 +01:00
Ben Noordhuis a329729537 buffer: speed up base64 encoding by 20%
Remove a lot of branches from the inner loop. Speeds up buf.toString('base64')
by about 20%.

Before:

  $ time out/Release/node benchmark/buffer-base64-encode.js
  real    0m6.607s
  user    0m5.508s
  sys     0m1.088s

After:

  $ time out/Release/node benchmark/buffer-base64-encode.js
  real    0m5.520s
  user    0m4.520s
  sys     0m0.992s
2012-12-28 13:20:07 +01:00
Luke Arduini 192192a09e Colorize API stabilitity index headers in docs
Noted in @shtylman's #3898, API stability notes are easy to overlook
in the html documentation. This can be especially troublesome if the API
is deprecated. This commit gives visual feedback by adding in a class
to the html docs when they're generated. The API headers with
corresponding colors are also listed in the 'About this Documentation'
page for easy reference.
2012-12-27 18:38:56 -08:00
bentaber e576208eba net: socket.readyState corrections
socket.readyState, .readable, and .writable behavior changed as
a result of the new streaming interfaces. Updated to be backwards
compatible with current API and adds regression test.

closes #4461
2012-12-27 17:53:28 -08:00
Ryunosuke SATO fde338bf83 stream: speed up instantiation of readable stream
- Stream.apply -> Stream.call
2012-12-27 17:46:34 -08:00
Ryunosuke SATO 697484df82 domain: speed up domain.create
Use `EventEmitter.call` instead of `EventEmitter.apply` because of performance.
2012-12-27 17:45:36 -08:00
Ryunosuke SATO 8936868e9b http: remove unused variable
The module variable `END_OF_FILE` was no longer needed from 1d369317.
2012-12-27 15:09:04 -08:00
isaacs 4be9c695f0 build: Add hyphen to custom build tags
so that ./configure --tag=foo makes a version number like v0.9.5-foo
instead of v0.9.5foo
2012-12-26 20:35:00 -08:00
Maciej Małecki c2e71dd51d build: allow to specify custom tags
When building custom `node` versions (e.g., floating features/fixes from
different versions) it's often useful to specify a custom tag which
easily identifies build when invoking `node -v`.

Introduce a way to specify this tag in `node_version.h` file or by
running `./configure --tag="<tag>"`. Insert it right after the patch
version (and before `-pre`, if build is not a release).
2012-12-26 20:15:17 -08:00
isaacs d76eacd4e6 http: Handle end only when stream is not dumped
This fixes regression introduced in some cases by 8bf0c15
2012-12-26 15:57:49 -08:00
isaacs 54740c8b24 lint 2012-12-26 15:26:53 -08:00
Ryunosuke SATO 0db521d0b0 repl: remove 'repl' from automatic loading libs
In repl, calling `repl` twice shows the following message:
```
> repl
A different "repl" already exists globally
```
2012-12-26 15:25:00 -08:00
Ryunosuke SATO 31cffae2ba repl: add 'domain' to automatic loading libs
`domain` should be a member of automatic loading libs in `repl`.

Conflicts:

	lib/repl.js
2012-12-26 15:23:31 -08:00
Shigeki Ohtsu 8bf0c15a5b stream2: fix to emit end event on http.ClientResponse 2012-12-26 15:20:48 -08:00
Andreas Madsen ce30683012 doc: document the finish event
Since the stream implementer is not expected to overwrite
.end() the finish event is necessary in order to know when
no more data can be written
2012-12-26 14:56:02 -08:00
Andreas Madsen d68ee22dda stream: do only fake drain when unpiped stream is the source
If the destination had multiply read streams piped to it,
they would all decrease the awaitDrain state and thereby
start the flow
2012-12-26 14:56:02 -08:00
Andreas Madsen 5daa701aba stream: fix event handler leak in readstream pipe and unpipe
After a stream was unpiped there would stil be residual event handlers
2012-12-26 14:56:02 -08:00
Ryunosuke SATO 27a91387ae util: fix deprecation message in `util.pump` 2012-12-26 14:54:56 -08:00
Ben Noordhuis d2e7ca0449 test: add regression test for #4463 2012-12-25 22:18:57 +01:00
Ben Taber 526d852565 net: allow socket end before connect
Fix a bug where calling .end() on a socket without calling .connect() first
throws a TypeError:

  TypeError: Cannot read property 'shutdown' of undefined
      at Socket.onSocketFinish (net.js:194:20)
      at Socket.EventEmitter.emit (events.js:91:17)
      at Socket.Writable.end (_stream_writable.js:281:10)
      at Socket.end (net.js:352:31)

Fixes #4463.
2012-12-25 22:18:56 +01:00