Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Jul 6, 2013
  1. @bnoordhuis

    lib, src: upgrade after v8 api change

    bnoordhuis authored
    This is a big commit that touches just about every file in the src/
    directory. The V8 API has changed in significant ways. The most
    important changes are:
    
    * Binding functions take a const v8::FunctionCallbackInfo<T>& argument
      rather than a const v8::Arguments& argument.
    
    * Binding functions return void rather than v8::Handle<v8::Value>. The
      return value is returned with the args.GetReturnValue().Set() family
      of functions.
    
    * v8::Persistent<T> no longer derives from v8::Handle<T> and no longer
      allows you to directly dereference the object that the persistent
      handle points to. This means that the common pattern of caching
      oft-used JS values in a persistent handle no longer quite works,
      you first need to reconstruct a v8::Local<T> from the persistent
      handle with the Local<T>::New(isolate, persistent) factory method.
    
    A handful of (internal) convenience classes and functions have been
    added to make dealing with the new API a little easier.
    
    The most visible one is node::Cached<T>, which wraps a v8::Persistent<T>
    with some template sugar. It can hold arbitrary types but so far it's
    exclusively used for v8::Strings (which was by far the most commonly
    cached handle type.)
Commits on Jun 17, 2013
  1. @bnoordhuis

    src: clean up `using` directives

    bnoordhuis authored
    Remove the unused ones and alphabetically sort the ones that remain.
Commits on Jun 11, 2013
  1. @bnoordhuis

    src: upgrade after v8 api change

    bnoordhuis authored
    The prototype of v8::Persistent<T>::MakeWeak() has changed. Update the
    code in src/ to follow suit.
Commits on Mar 20, 2013
  1. @trevnorris @bnoordhuis

    src: pass Isolate to all applicable api

    trevnorris authored bnoordhuis committed
    Update the api to pass node_isolate to all supported methods.
    
    Much thanks to Ben Noordhuis and his work in 51f6e6a.
  2. @trevnorris @bnoordhuis

    bindings: update api

    trevnorris authored bnoordhuis committed
    All compile time warnings about using deprecated APIs have been
    suppressed by updating node's API. Though there are still many function
    calls that can accept Isolate, and still need to be updated.
    
    node_isolate had to be added as an extern variable in node.h and
    node_object_wrap.h
    
    Also a couple small fixes for Error handling.
    
    Before v8 3.16.6 the error stack message was lazily written when it was
    needed, which allowed you to change the message after instantiation.
    Then the stack would be written with the new message the first time it
    was accessed. Though that has changed. Now it creates the stack message
    on instantiation. So setting a different message afterwards won't be
    displayed.
    
    This is not a complete fix for the problem. Getting error without any
    message isn't very useful.
Commits on Feb 25, 2013
  1. @bnoordhuis
Commits on Feb 11, 2013
  1. @bnoordhuis

    typed arrays: make call-as-function work for ctors

    bnoordhuis authored
    Turn call-as-function calls into constructor calls. Makes the following
    snippet work:
    
      var buf = ArrayBuffer(32);  // no 'new' but does the right thing
Commits on Feb 10, 2013
  1. @bnoordhuis

    typed arrays: copy Buffer in typed array constructor

    bnoordhuis authored
    Convert the Buffer to an ArrayBuffer. The typed_array.buffer property
    should be an ArrayBuffer to avoid confusion: a Buffer doesn't have a
    byteLength property and more importantly, its slice() method works
    subtly different.
    
    That means that before this commit:
    
      var buf = new Buffer(1);
      var arr = new Int8Array(buf);
      assert.equal(arr.buffer, buf);
      assert(arr.buffer instanceof Buffer);
    
    And now:
    
      var buf = new Buffer(1);
      var arr = new Int8Array(buf);
      assert.notEqual(arr.buffer, buf);
      assert(arr.buffer instanceof ArrayBuffer);
  2. @bnoordhuis

    typed arrays: make DataView throw on non-ArrayBuffer

    bnoordhuis authored
    Make the DataView constructor throw an exception when the first
    argument is not an ArrayBuffer. Follows the spec and the browsers.
  3. @bnoordhuis

    Revert "typed arrays: only share ArrayBuffer backing store"

    bnoordhuis authored
    We're going to fix this differently. The real bug is that
    Buffer::HasInstance() returns true for typed arrays.
    
    This reverts commit 01ee551.
  4. @bnoordhuis

    Revert "typed arrays: copy non-ArrayBuffer in DataView ctor"

    bnoordhuis authored
    We're going to follow browser behavior here.
    
    This reverts commit 7b0770b.
Commits on Feb 6, 2013
  1. @bnoordhuis

    typed arrays: copy non-ArrayBuffer in DataView ctor

    bnoordhuis authored
    This is commit 01ee551, except for the DataView type this time.
    
    Make the behavior of DataView consistent with that of typed arrays:
    make a copy of the backing store.
  2. @bnoordhuis

    typed arrays: only share ArrayBuffer backing store

    bnoordhuis authored
    Follow browser behavior, only share the backing store when it's a
    ArrayBuffer. That is:
    
      var abuf = new ArrayBuffer(32);
      var a = new Int8Array(abuf);
      var b = new Int8Array(abuf);
      a[0] = 0;
      b[0] = 1;
      assert(a[0] === b[0]);  // a and b share memory
    
    But:
    
      var a = new Int8Array(32);
      var b = new Int8Array(a);
      a[0] = 0;
      b[0] = 1;
      assert(a[0] !== b[0]);  // a and b don't share memory
    
    The typed arrays spec allows both `a[0] === b[0]` and `a[0] !=== b[0]`
    but Chrome and Firefox implement the behavior where memory is not
    shared.
    
    Copying the memory is less efficient but let's do it anyway for the
    sake of the Principle of Least Surprise.
    
    Fixes #4714.
Commits on Jan 19, 2013
  1. @bnoordhuis

    typed arrays: fix DataView endianness regression

    bnoordhuis authored
    Fix an off-by-one error introduced in 9fe3734 that caused a regression
    in the default endianness used for writes in DataView::setGeneric().
    
    Fixes #4626.
Commits on Jan 16, 2013
  1. @deanm @isaacs

    TypedArrays: Improve dataview perf without endian param

    deanm authored isaacs committed
    V8 seems to be particularly slow converting an undefined value to false
    in BooleanValue.
    
    Revert this when we upgrade to V8 3.17, or whenever the fix discussed
    in http://code.google.com/p/v8/issues/detail?id=2487 lands in V8.
Commits on Jan 11, 2013
  1. @isaacs

    Merge remote-tracking branch 'ry/v0.8' into master

    isaacs authored
    Conflicts:
    	AUTHORS
    	ChangeLog
    	Makefile
    	src/node_version.h
Commits on Jan 9, 2013
  1. @bnoordhuis

    typed arrays: fix 32 bit size/index overflow

    bnoordhuis authored
    Fix an out-of-bound read/write bug due to integer wrapping. Reported by
    Dean McNamee.
  2. @deanm @bnoordhuis

    typed arrays: implement load and store swizzling

    deanm authored bnoordhuis committed
    Implement load and store swizzling operations. This reduces an unneeded
    back and forth between types and additionally keeps the value in the
    swappable type until it is swapped. This is important for correctness
    when dealing with floating point, to avoid the possibility of loading
    the bits of a signaling NaN (because it isn't yet swapped) into the FPU.
    
    This additionally produces better code (comments are mine):
    
    gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
    
    setValue<double>:
      movd  %xmm0, %rax         ; fp reg -> gen reg
      bswapq  %rax              ; 64-bit byte swap
      movq  %rax, (%r15,%r12)   ; store
  3. @deanm @bnoordhuis

    typed arrays: swizzle with compiler intrinsics

    deanm authored bnoordhuis committed
    Implement swizzling with compiler intrinsics and be aware of the native
    endianness to correctly swap on big endian machines.
    
    This introduces a template function to swap the bytes of a value,
    and macros for the low level swap (taking advantage of gcc and msvc
    intrinsics). This produces code like the following (comments are mine):
    
    gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
    
    setValue<double>:
      movd  %xmm0, %rax         ; fp reg -> gen reg
      bswapq  %rax              ; 64-bit byte swap
      movd  %rax, %xmm0         ; gen reg -> fp reg
      movq  %xmm0, (%r15,%r12)  ; store
  4. @bnoordhuis

    typed arrays: undo local changes

    bnoordhuis authored
    Partially revert 5664dd2, 6573fc3 and 7788a6b to ease landing changes
    from upstream.
Commits on Jan 8, 2013
  1. @deanm @bnoordhuis

    typed arrays: don't declare as module

    deanm authored bnoordhuis committed
    TypedArrays is not a module, it is attached to the global object.
    Don't register it with Node's module system.
  2. @deanm @bnoordhuis

    typed arrays: replace switch with templates

    deanm authored bnoordhuis committed
    Convert TypedArray's TypeName implementation to template specialization
    instead of a switch() statement.
Commits on Jan 7, 2013
  1. @bnoordhuis
  2. @bnoordhuis
Commits on Jan 4, 2013
  1. @bnoordhuis

    src: use static_cast where appropriate

    bnoordhuis authored
    Use static_cast instead of reinterpret_cast when casting from void*
    to another type.
    
    This is mostly an aesthetic change but may help catch bugs when the
    affected code is modified.
Commits on Jan 2, 2013
  1. @indutny

    bindings: update to new v8 apis

    indutny authored
    GetPointerFromInternalField() is deprecated now, we should use
    GetAlignedPointerFromInternalField().
Commits on Dec 17, 2012
  1. @deanm @bnoordhuis

    typed arrays: fix missing type in SizeOfArrayElementForType()

    deanm authored bnoordhuis committed
    When Mikael Bourges-Sevenier added support for Uint8ClampedArray in 67fc1da,
    the new type was not added to SizeOfArrayElementForType().
  2. @deanm @bnoordhuis

    typed arrays: re-export SizeOfArrayElementForType()

    deanm authored bnoordhuis committed
    Although it is not used externally by node, it is needed by upstream and Plask.
    
    This effectively reverts:
    
        commit 1444801
        Author: Aaron Jacobs <jacobsa@google.com>
        Date:   Thu Mar 15 13:26:35 2012 +1100
    
            typed arrays: unexport SizeOfArrayElementForType()
    
            It isn't used anywhere else, so made it an implementation detail in
            v8_typed_array.cc.
Commits on Nov 5, 2012
  1. @bnoordhuis

    typed arrays: add slice() support to ArrayBuffer

    Anthony Pesch authored bnoordhuis committed
Commits on Oct 23, 2012
  1. @isaacs
  2. @jacobsa @bnoordhuis

    typed arrays: use `signed char` for signed int8s

    jacobsa authored bnoordhuis committed
    The C standard allows plain `char` to be unsigned. The build environment
    at Google trips this issue.
Commits on Oct 13, 2012
  1. @deanm @bnoordhuis

    typed arrays: remove unnecessary special-casing

    deanm authored bnoordhuis committed
    Uint32Value() on undefined is equal to 0, no need to special case it.
  2. @deanm @bnoordhuis

    typed arrays: simplify typed array get() and set()

    deanm authored bnoordhuis committed
    Instead of duplicating V8's logic (including clamping), just simply call into
    V8's Get() and Set() methods, which handles all conversions and typing.
Commits on Apr 18, 2012
  1. @isaacs

    Merge remote-tracking branch 'ry/v0.6' into master

    isaacs authored
    Conflicts:
    	AUTHORS
    	ChangeLog
    	LICENSE
    	Makefile
    	deps/http_parser/test.c
    	deps/npm/AUTHORS
    	deps/npm/html/api/bin.html
    	deps/npm/html/api/bugs.html
    	deps/npm/html/api/commands.html
    	deps/npm/html/api/config.html
    	deps/npm/html/api/deprecate.html
    	deps/npm/html/api/docs.html
    	deps/npm/html/api/edit.html
    	deps/npm/html/api/explore.html
    	deps/npm/html/api/help-search.html
    	deps/npm/html/api/init.html
    	deps/npm/html/api/install.html
    	deps/npm/html/api/link.html
    	deps/npm/html/api/load.html
    	deps/npm/html/api/ls.html
    	deps/npm/html/api/npm.html
    	deps/npm/html/api/outdated.html
    	deps/npm/html/api/owner.html
    	deps/npm/html/api/pack.html
    	deps/npm/html/api/prefix.html
    	deps/npm/html/api/prune.html
    	deps/npm/html/api/publish.html
    	deps/npm/html/api/rebuild.html
    	deps/npm/html/api/restart.html
    	deps/npm/html/api/root.html
    	deps/npm/html/api/run-script.html
    	deps/npm/html/api/search.html
    	deps/npm/html/api/shrinkwrap.html
    	deps/npm/html/api/start.html
    	deps/npm/html/api/stop.html
    	deps/npm/html/api/submodule.html
    	deps/npm/html/api/tag.html
    	deps/npm/html/api/test.html
    	deps/npm/html/api/uninstall.html
    	deps/npm/html/api/unpublish.html
    	deps/npm/html/api/update.html
    	deps/npm/html/api/version.html
    	deps/npm/html/api/view.html
    	deps/npm/html/api/whoami.html
    	deps/npm/html/doc/README.html
    	deps/npm/html/doc/adduser.html
    	deps/npm/html/doc/bin.html
    	deps/npm/html/doc/bugs.html
    	deps/npm/html/doc/build.html
    	deps/npm/html/doc/bundle.html
    	deps/npm/html/doc/cache.html
    	deps/npm/html/doc/changelog.html
    	deps/npm/html/doc/coding-style.html
    	deps/npm/html/doc/completion.html
    	deps/npm/html/doc/config.html
    	deps/npm/html/doc/deprecate.html
    	deps/npm/html/doc/developers.html
    	deps/npm/html/doc/disputes.html
    	deps/npm/html/doc/docs.html
    	deps/npm/html/doc/edit.html
    	deps/npm/html/doc/explore.html
    	deps/npm/html/doc/faq.html
    	deps/npm/html/doc/folders.html
    	deps/npm/html/doc/help-search.html
    	deps/npm/html/doc/help.html
    	deps/npm/html/doc/index.html
    	deps/npm/html/doc/init.html
    	deps/npm/html/doc/install.html
    	deps/npm/html/doc/json.html
    	deps/npm/html/doc/link.html
    	deps/npm/html/doc/list.html
    	deps/npm/html/doc/npm.html
    	deps/npm/html/doc/outdated.html
    	deps/npm/html/doc/owner.html
    	deps/npm/html/doc/pack.html
    	deps/npm/html/doc/prefix.html
    	deps/npm/html/doc/prune.html
    	deps/npm/html/doc/publish.html
    	deps/npm/html/doc/rebuild.html
    	deps/npm/html/doc/registry.html
    	deps/npm/html/doc/removing-npm.html
    	deps/npm/html/doc/restart.html
    	deps/npm/html/doc/root.html
    	deps/npm/html/doc/run-script.html
    	deps/npm/html/doc/scripts.html
    	deps/npm/html/doc/search.html
    	deps/npm/html/doc/semver.html
    	deps/npm/html/doc/shrinkwrap.html
    	deps/npm/html/doc/star.html
    	deps/npm/html/doc/start.html
    	deps/npm/html/doc/stop.html
    	deps/npm/html/doc/submodule.html
    	deps/npm/html/doc/tag.html
    	deps/npm/html/doc/test.html
    	deps/npm/html/doc/uninstall.html
    	deps/npm/html/doc/unpublish.html
    	deps/npm/html/doc/update.html
    	deps/npm/html/doc/version.html
    	deps/npm/html/doc/view.html
    	deps/npm/html/doc/whoami.html
    	deps/npm/lib/npm.js
    	deps/npm/man/man1/npm.1
    	deps/npm/man/man3/npm.3
    	deps/npm/node_modules/fstream-npm/fstream-npm.js
    	deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json
    	deps/npm/node_modules/fstream-npm/package.json
    	deps/npm/node_modules/node-gyp/LICENSE
    	deps/npm/node_modules/node-gyp/lib/build.js
    	deps/npm/node_modules/node-gyp/lib/install.js
    	deps/npm/node_modules/node-gyp/node_modules/ansi/package.json
    	deps/npm/node_modules/node-gyp/node_modules/glob/package.json
    	deps/npm/node_modules/node-gyp/package.json
    	deps/npm/package.json
    	deps/uv/test/test-fs.c
    	deps/v8/src/regexp-macro-assembler-tracer.cc
    	deps/v8/src/version.cc
    	src/node_version.h
    	src/platform_sunos.cc
    	test/simple/test-net-write-after-close.js
    	wscript
Commits on Apr 12, 2012
  1. @jacobsa @bnoordhuis

    typed arrays: unexport SizeOfArrayElementForType()

    jacobsa authored bnoordhuis committed
    It isn't used anywhere else, so made it an implementation detail in
    v8_typed_array.cc.
Something went wrong with that request. Please try again.