Commit Graph

9114 Commits (358c2901567c005689dceef1361754cca95ca14e)

Author SHA1 Message Date
Ben Noordhuis 358c290156 build: remove unused Carbon dependency
Libuv as of joyent/libuv@d48168a no longer has link-time dependencies
on the Carbon framework or any other frameworks.
2013-09-04 09:59:17 +02:00
Trevor Norris 7a235f924b string_bytes: use extern for length and write utf8
If the string is external then the length can be quickly retrieved. This
is especially faster for large strings that are being treated as UTF8.
Also, if the string is external then there's no need for a full
String::WriteUtf8 operation. A simple memcpy will do.
2013-09-03 10:04:58 -07:00
isaacs 906a175a0b process: Add internal _rawDebug() method
This is useful when we need to push some debugging messages out to
stderr, without going through the Writable class, or triggering any kind
of nextTick or callback behavior.
2013-09-02 20:15:40 -07:00
isaacs cb53cfd8b5 src: Remove outdated comment re assert()
It's a normal function now, not a macro.
2013-09-02 20:15:40 -07:00
Ben Noordhuis ed8d97f572 uv: upgrade to v0.11.12
* upgrade deps/uv/ to v0.11.12.
* update files in src/ after a libuv API change.
2013-09-03 01:17:58 +02:00
Ben Noordhuis 185c515c9f src: clean up CLI argument parser
* Exit with an error message when the option is not a node or V8 option.

* Remove the option_end_index global.  Needs to happen anyway for
  the multi-context work, might as well land it in master now.

* Add a smidgen of const-correctness.

* Pay off a few years of accrued technical debt.
2013-09-02 21:41:12 +02:00
Ben Noordhuis d6fb764cc2 test: don't use --max-stack-size=0
--max-stack-size was removed in 3a87b31, use --stack-size instead.
What's more, a zero length stack will likely crash the process.
2013-09-02 21:00:00 +02:00
Ben Noordhuis c5ed96a4b1 test: speed up simple/test-fs-watch
Don't wait a full second before starting the watcher, 10 ms ought to be
more than enough time.  Reduces running time from 1250 ms to 250 ms on
my system.
2013-09-01 14:50:19 +02:00
isaacs 2be09f9493 Merge remote-tracking branch 'ry/v0.10' 2013-08-31 17:58:44 -07:00
isaacs 00a1d3633c benchmark: Fix execArgv handling
Bug in 01f3b46 causes the same benchmark to be run repeatedly.

Not so useful for the compare scripts.
2013-08-31 17:58:17 -07:00
isaacs cece100082 Merge remote-tracking branch 'ry/v0.10' 2013-08-31 11:29:51 -07:00
isaacs 01f3b468a9 benchmark: Support passing v8 flags to benchmarks
The better to test --use-strict effects on performance.

(Spoiler: it has no measurable effect on performance.)
2013-08-31 10:36:44 -07:00
Ben Noordhuis 10ccbd501f Revert "src: call uv_loop_delete() on exit in debug mode"
Don't call uv_loop_delete() until we've figured out a way to gracefully
close open handles.  See also commit 4915884 and its subsequent revert
in commit 980cbd5.

This reverts commit 556b890ad9.
2013-08-30 23:28:22 +02:00
Ben Noordhuis bbed881ec4 Revert "src: close libuv handles on exit"
This change is not entirely ready for prime time: it's making ~50 tests
fail on Windows, mostly due to timeouts.  It's up for debate who is
at fault here: node.js or libuv.

It does however expose a libuv bug on OS X, where the event loop
sometimes gets stuck in uv__io_poll() when there is a single
UV_SHUTDOWN request left in the queue.  Needs further investigation.

This reverts commit 4915884da6.
2013-08-30 23:28:14 +02:00
Trevor Norris 8a272cabe2 test: move smalloc segfault tests to pummel
These tests take a while to complete, and the issue only potentially
appears under heavy load.
2013-08-30 13:55:53 -07:00
Ben Noordhuis 4915884da6 src: close libuv handles on exit
Commit 556b890 added a call to uv_loop_delete() with the intent of
catching handle lifecycle bugs.  It worked because it exposed one:

    process.on('exit', function() {
      console.log('bye');  // Asserts.
    });

When run, it asserts with the following message:

    Assertion failed: (!uv__has_active_reqs(loop)), function
    uv__loop_delete, file ../deps/uv/src/unix/loop.c, line 150.

That's because libuv as of joyent/libuv@3f2d4d5 checks that there are
no in-flight requests when the event loop is destroyed.  In the test
case above, the write request for the string hasn't completed yet by
the time node.js exits: the string itself has most likely been written
but libuv hasn't had the opportunity to return the write request to
node.js.

That's why this commit adds a cleanup step right before exit where it
explicitly closes all open handles, then waits until the event loop
exits naturally.

Named pipes (UNIX domain sockets) are shut down first in order to flush
pending write requests.  Should go some way towards fixing the Windows
issue where output on stdout/stderr sometimes gets truncated.

Fixes joyent/libuv#911.
2013-08-30 18:39:37 +02:00
Bert Belder e83a0cd016 uv: upgrade to v0.11.11 2013-08-29 15:38:32 +02:00
Ben Noordhuis a9eb96d020 src: remove unused Persistent<FunctionTemplate> 2013-08-29 14:28:28 +02:00
Ben Noordhuis 653f62a709 crypto: remove NodeBIO::GetMethod()
Remove NodeBIO::GetMethod() and replace calls to BIO_new() with calls
to the new NodeBIO::New() function.

This commit basically reshuffles some code in order to make it explicit
that the NodeBIO BIO_METHOD is const.
2013-08-29 14:25:57 +02:00
Ben Noordhuis 8e596c4e15 crypto: make root_cert_store variable extern
Before this commit it was declared static (in a header file!), meaning
it got duplicated in every file that includes it.

A few duplicated pointers is not the end of the world but it introduces
a lot of potential for confusion because root_cert_store in file A is
not the root_cert_store in file B.

Moral of the story: don't declare static variables in header files.
2013-08-29 14:05:44 +02:00
Ben Noordhuis 21911db392 crypto: remove misleading comment 2013-08-29 14:02:11 +02:00
Ben Noordhuis 699f636d97 crypto: make error buffer non-static
Doesn't matter now but it will if/when we have support for multiple
threads.
2013-08-29 13:57:30 +02:00
Domenic Denicola 02fde585b1 vm: document vm2's changes.
- The caveats no longer apply.
- Document options arguments, including `displayErrors` and the
  different things it means in each place.
- Re-did examples to be more on point, e.g. `runInContext` example
  runs multiple scripts in the same context.
- Documented how `vm.createContext`s meaning has substantially changed,
  and is now more of a "contextifier" than a "creator."
- Reordered vm functions to be readable in order; the concept of
  contextifying needs to come before `runInContext` and
  `runInNewContext`.
- Documented new `vm.isContext`.
- Documented the `vm.Script` constructor, instead of `createScript`,
  since factory methods are silly and we wanted to document the class's
  methods anyway.
- Documented `script.runInContext`.
- Change stability to stable, if I may be so bold.
2013-08-28 22:27:24 -07:00
Domenic Denicola fd3657610e vm: update API to use options argument
Passing a filename is still supported in place of certain options
arguments, for backward-compatibility, but timeout and display-errors
are not translated since those were undocumented.

Also managed to eliminate an extra stack trace line by not calling
through the `createScript` export.

Added a few message tests to show how `displayErrors` works.
2013-08-28 22:27:24 -07:00
Bert Belder de7d698df7 pipe_wrap: squelch integer type conversion warning 2013-08-28 23:36:00 +02:00
Timothy J Fontaine 93b062468b timer_wrap: Timer.now always update loop time
In `Timer.now` always update the loop time by calling uv_update_time.
Previously we were trying to cache the loop time to prevent extra
syscalls. While a noble goal, it can cause timers to fire early in
certain circumstances. Especially seen in cpu bound work loads or work
loads with synchronous file operations.
2013-08-28 11:29:33 -07:00
isaacs 96358613f9 Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/ChangeLog
	deps/uv/include/uv-darwin.h
	deps/uv/src/unix/darwin.c
	deps/uv/src/unix/fsevents.c
	deps/uv/src/version.c
	lib/_stream_writable.js
	src/node_version.h
2013-08-28 10:11:17 -07:00
isaacs fbb963b5d5 stream: check _events before _events.error
This fixes the regression introduced by 5458079, which breaks the
net/net-pipe benchmark script.

Closes #6145
2013-08-28 09:35:39 -07:00
Ben Noordhuis 29d3624dae crypto: make randomBytes/pbkdf2 cbs domain aware
Make the crypto.randomBytes() and crypto.pbkdf2() callback functions
run inside the current domain (if any.)

Fixes #3965.
2013-08-28 12:37:49 +02:00
Domenic Denicola 9c110d8027 vm: add isContext; prevent double-contextifying
Previously, calling `vm.createContext(o)` repeatedly on the same `o`
would cause new C++ `ContextifyContext`s to be created and stored on
`o`, while the previous resident went off into leaked-memory limbo.
Now, repeatedly trying to contextify a sandbox will do nothing after
the first time.

To detect this, an independently-useful `vm.isContext(sandbox)` export
was added.
2013-08-28 12:11:09 +02:00
Domenic Denicola a3bf3d10ef vm: use MakeWeak to fix leaking contexts
This is always something you should do when using `SetHiddenValue`,
apparently. Fixes #6115. Thanks @tjfontaine for the tips.
2013-08-28 12:11:09 +02:00
Domenic Denicola a54f65ce75 vm: rip out ObjectWrap from ContextifyContext
This was a remnant of the original Contextify code, wherein
ContextifyContext was a user-exposed object. In vm, it is not, so all
of the ObjectWrap and function-template stuff for the ContextifyContext
constructor is now unnecessary.
2013-08-28 12:11:09 +02:00
isaacs 02eb9c834a doc: Adjust util stability index to 'API Frozen'
Closes #6087
2013-08-27 19:52:49 -07:00
isaacs 73d328de24 doc: Adjust util stability index to 'API Frozen'
Closes #6087
2013-08-27 19:52:10 -07:00
isaacs ba72f8cad8 doc: mark repl as stable
Closes #6090
2013-08-27 18:09:26 -07:00
Mathias Buus ba72570eae stream: change default hwm for objectMode to 16 2013-08-27 18:02:30 -07:00
isaacs ee695e935d child_process: Avoid extra copy for string stdio
There's no need to create a new Buffer instance if we're just going to
immediately call toString() at the end anyway.  Better to create a
string up front, and setEncoding() on the streams, and do a string
concatenation instead.
2013-08-27 17:28:57 -07:00
Seth Fitzsimmons 711d1934ea child_process: Callback with Buffers from exec
Only return strings when encoding is not null.
2013-08-27 17:28:51 -07:00
Trevor Norris 26bc8db33f v8: upgrade to 3.20.17 2013-08-27 15:18:12 -07:00
isaacs a3da3e7312 stream: Pass 'buffer' encoding to decoded writables
Since the encoding is no longer relevant once it is decoded to a Buffer,
it is confusing and incorrect to pass the encoding as 'utf8' or whatever
in those cases.

Closes #6119
2013-08-27 14:53:06 -07:00
Forrest L Norvell d86814aeca domains: deprecate domain.dispose().
Follows @isaacs's recommendations in joyent/node#5018. Includes some
updates to documentation but not examples.

Conflicts:
	lib/domain.js
2013-08-27 11:05:14 -07:00
isaacs 645418e9f1 fs: Expose birthtime on stat objects
Just do the best we can with whatever libuv gives us.

Also, document the semantics of `ctime` and the compatibility with
Windows.
2013-08-27 10:42:18 -07:00
Jay Beavers 474d58c111 doc: Small update of readme for Windows users 2013-08-27 09:09:35 -07:00
isaacs 1df77a7438 lib: Add missing copyright notices 2013-08-27 07:27:39 -07:00
Ben Noordhuis 8d567f43d0 src: remove two pointless globals from node.cc
De-globalize use_npn and use_sni, they're only used in GetFeatures().
2013-08-27 16:14:46 +02:00
Ben Noordhuis 556b890ad9 src: call uv_loop_delete() on exit in debug mode
Should make tracing with valgrind a little easier on the eye and
possibly help expose libuv handle lifecycle issues.
2013-08-27 14:47:50 +02:00
Ben Noordhuis 3a87b31bfa src: remove --max-stack-size option
Ad-hoc duplicate of V8's --stack-size option.  Superfluous in other
words.  Remove it.
2013-08-27 14:09:37 +02:00
Ben Noordhuis 0523da64d2 cares_wrap: drop UV_HANDLE_FIELDS from ares_task_t
UV_HANDLE_FIELDS is a libuv implementation detail.  The ares_task_t
struct only uses the uv_loop_t* field so be explicit about that.
2013-08-27 13:20:42 +02:00
Ben Noordhuis 9fc006618f src: fix up unused/unordered imports 2013-08-27 00:13:50 +02:00
Trevor Norris 873b5f8428 buffer: fix assert fail from JS API
Length arguments passed to SlowBuffer were coerced to Int32, not Uint32,
so passing a negative number would throw the following:

node: ../src/smalloc.cc:244: void node::smalloc::Alloc(): Assertion `length <= kMaxLength' failed.
Aborted (core dumped)

That has been fixed by coercing to Uint32 and comparing the value
against kMaxLength.
2013-08-26 14:12:00 -07:00