Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nodejs/node-v0.x-archive
base: 0674cbaceb81
Choose a base ref
...
head repository: nodejs/node-v0.x-archive
compare: 709fc160e520
Choose a head ref
  • 9 commits
  • 58 files changed
  • 1 contributor

Commits on Dec 5, 2014

  1. src: remove Async Listener

    Async Listener was the name of the user-facing JS API, and is being
    completely removed. Instead low level hooks directly into the mechanism
    that AL used will be introduced in a future commit.
    
    PR-URL: #8110
    Signed-off-by: Trevor Norris <trev.norris@gmail.com>
    Reviewed-by: Fedor Indutny <fedor@indutny.com>
    Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
    Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
    trevnorris committed Dec 5, 2014
    Copy the full SHA
    b655955 View commit details
    Browse the repository at this point in the history
  2. async-wrap: move MakeCallback to .cc

    MakeCallback is too large a function to be inlined. Likewise, only
    having header files will not allow for any part of AsyncWrap to be
    exposed cleanly via NODE_MODULE_CONTEXT_AWARE_BUILTIN().
    
    PR-URL: #8110
    Signed-off-by: Trevor Norris <trev.norris@gmail.com>
    Reviewed-by: Fedor Indutny <fedor@indutny.com>
    Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
    Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
    trevnorris committed Dec 5, 2014
    Copy the full SHA
    2593c14 View commit details
    Browse the repository at this point in the history
  3. node, async-wrap: remove MakeDomainCallback

    C++ won't deoptimize like JS if specific conditional branches are
    sporadically met in the future. Combined with the amount of code
    duplication removal and simplified maintenance complexity, it makes more
    sense to merge MakeCallback and MakeDomainCallback.
    
    Additionally, type casting in V8 before verifying what that type is will
    cause V8 to abort in debug mode if that type isn't what was expected.
    Fix this by first checking the v8::Value before casting.
    
    PR-URL: #8110
    Signed-off-by: Trevor Norris <trev.norris@gmail.com>
    Reviewed-by: Fedor Indutny <fedor@indutny.com>
    Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
    Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
    trevnorris committed Dec 5, 2014
    Copy the full SHA
    42df679 View commit details
    Browse the repository at this point in the history
  4. 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, causing
    Node to crash.
    
    PR-URL: #8110
    Signed-off-by: Trevor Norris <trev.norris@gmail.com>
    Reviewed-by: Fedor Indutny <fedor@indutny.com>
    Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
    Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
    trevnorris committed Dec 5, 2014
    Copy the full SHA
    b1e9d33 View commit details
    Browse the repository at this point in the history
  5. src: all wrap's now use actual FunctionTemplate

    Instead of simply creating a new v8::Object to contain the connection
    information, instantiate a new instance of a FunctionTemplate. This will
    allow future improvements for debugging and performance probes.
    
    Additionally, the "provider" argument in the ReqWrap constructor is no
    longer optional.
    
    PR-URL: #8110
    Signed-off-by: Trevor Norris <trev.norris@gmail.com>
    Reviewed-by: Fedor Indutny <fedor@indutny.com>
    Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
    Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
    trevnorris committed Dec 5, 2014
    Copy the full SHA
    5962dbe View commit details
    Browse the repository at this point in the history
  6. src: remove unnecessary template parameter

    The template class information is received via the type of the first
    argument. So there is no need to use Wrap<T>(handle).
    
    PR-URL: #8110
    Signed-off-by: Trevor Norris <trev.norris@gmail.com>
    Reviewed-by: Fedor Indutny <fedor@indutny.com>
    Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
    Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
    trevnorris committed Dec 5, 2014
    Copy the full SHA
    add955e View commit details
    Browse the repository at this point in the history
  7. 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: #8110
    Signed-off-by: Trevor Norris <trev.norris@gmail.com>
    Reviewed-by: Fedor Indutny <fedor@indutny.com>
    Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
    Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
    trevnorris committed Dec 5, 2014
    Copy the full SHA
    1293f0a View commit details
    Browse the repository at this point in the history
  8. 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. This adds ~80ns
    to instantiation time.
    
    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. This adds enough code
    complexity that it will not be attempted until the current approach
    demonstrates it is a bottle neck.
    
    PR-URL: #8110
    Signed-off-by: Trevor Norris <trev.norris@gmail.com>
    Reviewed-by: Fedor Indutny <fedor@indutny.com>
    Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
    Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
    trevnorris committed Dec 5, 2014
    Copy the full SHA
    419f18d View commit details
    Browse the repository at this point in the history
  9. 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 any of these callbacks throws an exception, there is no forgiveness
    or recovery. A message will be displayed and a core file dumped.**
    
    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.
    
    - kCallInitHook only affects the calling of the init callback. If the
      request object has been run through the create callback it will always
      run the before/after callbacks. Regardless of kCallInitHook.
    
    - 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: #8110
    Signed-off-by: Trevor Norris <trev.norris@gmail.com>
    Reviewed-by: Fedor Indutny <fedor@indutny.com>
    Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
    Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
    trevnorris committed Dec 5, 2014
    Copy the full SHA
    709fc16 View commit details
    Browse the repository at this point in the history