deps: update libuv to 1.0.1

PR-URL: https://github.com/joyent/node/pull/8785
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
crypto: cast uv_thread_t to unsigned long

Should work in all platforms and it fixes this compilation problem
on OSX:

../src/node_crypto.cc:154:3: error: no matching function for call to
'CRYPTO_THREADID_set_numeric'
  CRYPTO_THREADID_set_numeric(tid, uv_thread_self());
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../deps/openssl/openssl/include/openssl/../../crypto/crypto.h:435:6:
    note: candidate function not viable: no known conversion from
          'uv_thread_t' (aka '_opaque_pthread_t *') to 'unsigned long'
          for 2nd argument
          void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned
          long val);
               ^
               1 error generated.

PR-URL: https://github.com/joyent/node/pull/8785
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Revert "crypto: cast uv_thread_t to unsigned long"

This reverts commit 0308ad2ce53f73368f265d5e7ee4c0e9f07600a6.
crypto: store thread id as pointer-sized

In https://github.com/MSOpenTech/libuv/commit/59658a8de7cc05a58327a164fd2ed4b050f8b4f4
the return of uv_thread_self() was changed from unsigned long to
uv_thread_t.

uv_thread_t is a HANDLE (pointer-sized) on Windows, which means that
on Win64 it cannot be stored with CRYPTO_THREADID_set_numeric without
data loss.

Furthermore, without this change there will be a build break on Windows
when the libuv change is integrated into Node, because of the
conversion from HANDLE to unsigned long.

Other related commits:
https://github.com/joyent/node/commit/5845a6bcd5b36168bdddeb85da8d8d9d36de7642
https://github.com/MSOpenTech/libuv/commit/919d8ec63ac53566ad1f090058ec15966bd0e960
src: remove async listener

Async listener will have minor reimplementation in a future commit in
the form of hooks for user implemented API. Though for simplicity of
testing it's being completely removed first.

PR-URL: https://github.com/joyent/node/pull/8110
async-wrap: move MakeCallback to .cc

MakeCallback is too large a function to have as an inline. Correct that
by moving it to a .cc file.

PR-URL: https://github.com/joyent/node/pull/8110
node, async-wrap: remove MakeDomainCallback

A lot of code duplication for the removal of a single if statement is
not worth the added code complexity.

Also fixed using v8::Value::As<T>() before verifying the type of the
Value. Casting to an incorrect type will cause V8 to abort in debug
mode.

PR-URL: https://github.com/joyent/node/pull/8110
node: fix throws before timer module is loaded

An edge case could occur when the setImmediate() in _fatalException()
would fire before the timers module had been loaded globally and cause
Node to crash.

PR-URL: https://github.com/joyent/node/pull/8110
src: all wrap's now use actual FunctionTemplate

Instead of just creating a new Object to contain the connection
information, instantiate a new instance of a FunctionTemplate. This will
allow future improvements for debugging and performance probes.

Additionally class providers have been clarified such that the
"provider" field in req_wrap.h is no longer optional.

PR-URL: https://github.com/joyent/node/pull/8110
src: remove unnecessary template parameter

PR-URL: https://github.com/joyent/node/pull/8110
async-wrap: expose async-wrap as binding

Expose basic hooks for AsyncWrap via the async_wrap binding. Right now
only the PROVIDER types are exposed. This is a preliminary step before
more functionality is added.

PR-URL: https://github.com/joyent/node/pull/8110
async-wrap: explicitly pass parent

When instantiating a new AsyncWrap allow the parent AsyncWrap to be
passed. This is useful for cases like TCP incoming connections, so the
connection can be tied to the server receiving the connection.

Because the current architecture instantiates the *Wrap inside a
v8::FunctionCallback, the parent pointer is currently wrapped inside a
new v8::External every time and passed as an argument. A future
optimization would be to add the v8::External as the data field when
creating the v8::FunctionTemplate, change the pointer just before making
the call then NULL'ing it out afterwards. Though this will only knock
off an estimated 80ns, and the added code complexity is high. So not
worth doing until the current approach is proven to be a bottleneck.

PR-URL: https://github.com/joyent/node/pull/8110
async-wrap: add event hooks

Call a user-defined callback at specific points in the lifetime of an
asynchronous event. Which are on instantiation, just before/after the
callback has been run. If the error callback also throws an exception
there will be no mercy and the application will be forced to shutdown.

Currently these only tie into AsyncWrap, meaning no call to a hook
callback will be made for timers or process.nextTick() events. Though
those will be added in a future commit.

Here are a few notes on how to make the hooks work:

- The "this" of all event hook callbacks is the request object.
- The zero field (kCallInitHook) of the flags object passed to
  setupHooks() must be set != 0 before the init callback will be called.
- In the "init" callback the property "_asyncQueue" must be attached to
  the request object. e.g.

  function initHook() {
    this._asyncQueue = {};
  }

- DO NOT inspect the properties of the object in the init callback.
  Since the object is in the middle of being instantiated there are some
  cases when a getter is not complete, and doing so will cause Node to
  crash.

PR-URL: https://github.com/joyent/node/pull/8110
WIP: abort if async hook function throws exception