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
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
When switching into compatibility mode by setting `data` event listener,
`_read()` method will be called immediately. If method implementation
invokes callback in the same tick - all emitted `data` events will be
discarded, because `data` listener wasn't set yet.
Raise a TypeError when the argument to send() or sendto() is anything
but a Buffer.
Fixes the following assertion:
$ node -e 'require("dgram").createSocket("udp4").send("BAM")'
node: ../../src/udp_wrap.cc:220: static v8::Handle<v8::Value>
node::UDPWrap::DoSend(const v8::Arguments&, int): Assertion
`Buffer::HasInstance(args[0])' failed.
Aborted (core dumped)
Fixes#4496.
V8 3.15 has new API functions that let you specify the Isolate. V8 and
node.js generally spend 0.5-3.5% of the time in pthread_getspecific(),
looking up the current Isolate. Avoid that overhead by making "our"
isolate global so we can pass it around. The change to the new API is
introduced in follow-up commits.
The test was failing in debug mode because the timeouts were set too
low. Fix that by increasing the timeouts. Admittedly not a great fix.
If this test keeps playing up, it's probably best to remove it.
Fixes#4528.
Tests can leave the tty in non-blocking mode. If the test runner tries
to print to stdout/stderr after that and the tty buffer is full, it'll
die with a EAGAIN OSError. Ergo, put the tty back in blocking mode
before proceeding.
This test is timing sensitive and hence quite unreliable with debug
builds. What's worse is that it leaves a stray child process behind
that listens on the default test port and that makes all the tests
that come after it fail with EADDRINUSE errors.
Allows for arbitrary path to executable spawned using `fork`. This
fixes some issues around running multiple versions of node with workers
and allows arbitrary IPC with compatible executables.
Fixes#3248.
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.
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.
In JS, the expression ".1" is a floating point number. Issue 4268 concerns the
REPL interpreting floating point numbers that lead with a "." as keywords. The
original bugfix worked for this specific case but not for the general case:
var x = [
.1,
.2,
.3
];
The attached change and test (`.1+.1` should be `.2`) fix the bug.
Closes#4513.
Some performance counter related functions are not available on Windows
XP and Windows Server 2003, which caused node to call a NULL pointer.
Closes#4462Closes#4511
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.
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.