0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00
Commit Graph

135 Commits

Author SHA1 Message Date
Fedor Indutny
8e28193cc2 tls_wrap: DRY ClientHelloParser
Share ClientHelloParser code between `tls_wrap.cc` and `node_crypto.cc`.

fix #5959
2013-08-06 16:13:01 +04:00
Timothy J Fontaine
032373df7f build: fix ia32 sunos, elfwrap only needs -64 2013-08-05 14:33:55 -07:00
Timothy J Fontaine
e851fef60f build: embed the mdb_v8.so into the binary
This builds and includes the mdb_v8.so in the binary of node so mdb
can be sure to always use the latest version
2013-08-05 14:19:29 -07:00
isaacs
22c68fdc1d src: Replace macros with util functions 2013-08-01 15:08:01 -07:00
Ben Noordhuis
34b0a36120 src: don't use NewExternal() with unaligned strings
V8 3.20.9 enforces that external pointers are aligned on a two-byte
boundary.

We cannot portably guarantee that for the source code strings that
tools/js2c.py generates so simply stop using String::NewExternal()
altogether (and by extension String::ExternalAsciiStringResource).

Fixes the following run-time assert:

  FATAL ERROR: v8::String::NewExternal() Pointer is not aligned
2013-07-29 05:11:00 +02:00
Ben Noordhuis
0330bdf519 lib: macro-ify type checks
Increases the grep factor. Makes it easier to harmonize type checks
across the code base.
2013-07-24 21:49:35 +02:00
Ben Noordhuis
4b279f0092 src: rename macros.py to notrace_macros.py
This incarnation of macros.py is only used to disable the (d)trace
macros. Rename it so it better reflects its purpose. A new macros.py
will be added in a follow-up commit.
2013-07-24 21:49:18 +02:00
Ben Noordhuis
d4c14c1fe5 src: add libuv bindings module
Exports:

* all UV_E* error codes
* a uv_err_name() binding
2013-07-20 12:04:35 +02:00
Trevor Norris
d817843d2e smalloc: create separate module
It will be confusing if later on we add Buffer#dispose(), and smalloc is
its own cpp api anyways. So instead create a new require('smalloc') to
expose the previous Buffer.alloc/dispose methods, and expose copyOnto
and kMaxLength as well.

Other changes:
* Added documentation and additional tests.
* smalloc::CopyOnto has changed from using assert() to throwing errors
  on bad argument values because it is not exposed to the user.
* Minor style fixes.
2013-07-19 13:36:13 -07:00
Nathan Rajlich
567c72b8c5 configure: fix the --without-ssl option
Closes #5807.
2013-07-09 11:27:37 -07:00
Ben Noordhuis
110a9cd8db lib, src: upgrade after v8 api change
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.)
2013-07-06 17:44:44 +02:00
Trevor Norris
ec90e6e80a slab_allocator: remove SlabAllocator
Now that Buffer instantiation has improved, the SlabAllocator is an
unnecessary layer of complexity preventing further performance
optimizations.

Currently there is a small performance loss with very small stream
requests, but this will soon be addressed.
2013-07-03 14:56:27 -07:00
Trevor Norris
8f3f9f7830 smalloc: initial implementation
smalloc is a simple utility for quickly allocating external memory onto
js objects. This will be used to centralize how memory is managed in
node, and will become the backer for Buffers. So in the future crypto's
SlabBuffer, stream's SlabAllocator will be removed.

Note on the js API: because no arguments are optional the order of
arguments have been placed to match their cc counterparts as closely as
possible.
2013-06-18 15:37:51 -07:00
Fedor Indutny
af80e7bc6e tls: introduce TLSSocket based on tls_wrap binding
Split `tls.js` into `_tls_legacy.js`, containing legacy
`createSecurePair` API, and `_tls_wrap.js` containing new code based on
`tls_wrap` binding.

Remove tests that are no longer useful/valid.
2013-06-16 09:30:15 +02:00
Fedor Indutny
03e008ddb8 tls_wrap: embed TLS encryption into streamwrap 2013-06-16 09:30:14 +02:00
Fedor Indutny
6978e998ee process: abstract out HandleToStream
Originally contributed by @tjfontaine, but modified to be faster and
more generic.
2013-06-15 21:44:50 +02:00
Ben Noordhuis
a7820a15e7 src: replace ngx-queue.h with queue.h
No functional changes, just one less entry in the LICENSE file.
2013-06-04 12:22:03 +02:00
Timothy J Fontaine
23509eb9e8 dtrace: unify dtrace and systemtap interfaces 2013-05-22 20:19:31 -07:00
isaacs
61c9f78c63 Merge remote-tracking branch 'ry/v0.10' into master
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/ChangeLog
	deps/uv/config-unix.mk
	deps/uv/src/unix/stream.c
	deps/uv/src/version.c
	deps/uv/uv.gyp
	src/node.cc
	src/node_buffer.cc
	src/node_crypto.cc
	src/node_version.h
	src/stream_wrap.cc
	src/stream_wrap.h
2013-05-17 14:04:54 -07:00
Timothy J Fontaine
f0d80d7db0 dtrace: enable uv's probes if enabled 2013-05-15 15:07:53 -07:00
isaacs
64fc34b270 src: Add StringBytes static util class
Four functions:

- StringBytes::StorageSize()
- StringBytes::Size()
- StringBytes::Write()
- StringBytes::Encode()
2013-05-14 13:51:24 -07:00
Andrew Paprocki
c081809344 vm: add support for timeout argument
Add a watchdog class which executes a timer in a separate event loop in
a separate thread that will terminate v8 execution if it expires.

Add timeout argument to functions in vm module which use the watchdog
if a non-zero timeout is specified.
2013-04-29 23:38:19 +02:00
Timothy J Fontaine
39dfe94682 build: libv8_base.a is now libv8_base.<arch>.a
This fixes generating the v8 contstants for dtrace on smartos
2013-04-18 01:18:16 +02:00
Timothy J Fontaine
951e0b69fa http: split Client into _http_client.js 2013-04-17 00:08:28 +02:00
Timothy J Fontaine
6717fdccb4 http: move Server and ServerResponse out 2013-04-17 00:08:28 +02:00
Timothy J Fontaine
dc9f97b7b9 http: move OutgoingMessage into it's own file 2013-04-17 00:08:28 +02:00
Timothy J Fontaine
bb56489f21 http: move parsers into _http_common.js 2013-04-17 00:08:28 +02:00
Timothy J Fontaine
5909a9c9bd http: move IncomingMessage into its own file 2013-04-17 00:08:28 +02:00
Timothy J Fontaine
62e4f89765 http: split Agent into its own file 2013-04-17 00:08:28 +02:00
Ben Noordhuis
0d5595ac60 Revert "crypto: use better memory BIO implementation"
This change shouldn't have landed in the stable branch. It's a feature,
not a bug fix.

This reverts commit 58f93ffc4a.
This reverts commit 8c8ebe49b6.
This reverts commit ba0f7b8066.
This reverts commit 21f3c5c367.
2013-04-10 13:54:15 +02:00
isaacs
2c9a38d059 Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	deps/v8/src/json-parser.h
	lib/crypto.js
	src/node_version.h
2013-04-05 09:02:48 -07:00
Fedor Indutny
58f93ffc4a crypto: use better memory BIO implementation 2013-04-05 04:12:13 +04:00
Paddy Byers
d8852aa9e8 build: depend on v8 postmortem-metadata if enabled 2013-04-04 01:46:56 +02:00
Dave Pacheco
ec69fcf425 build: allow building with dtrace on osx 2013-04-03 09:52:56 -07:00
Dave Pacheco
fe7440ce19 build: allow building with dtrace on osx 2013-03-30 01:04:00 +01:00
Fedor Indutny
3d913fec83 Revert "sunos: unbreak build after v8 downgrade"
This reverts commit f80f3c5f62.
2013-02-26 07:57:12 +00:00
Ben Noordhuis
f80f3c5f62 sunos: unbreak build after v8 downgrade
Commit 3d67f89 ("fix generation of v8 constants on freebsd") is an
unfortunate victim of this rollback.

Revert "dtrace: fix generation of v8 constants on freebsd"
Revert "dtrace: More style"
Revert "dtrace: Make D style more D-ish"
Revert "dtrace: x64 ustack helper"
Revert "dtrace: fix style in ustack helper"
Revert "dtrace: SeqAsciiString was renamed to SeqOneByteString in v8"

This reverts commit 3d67f89552.
This reverts commit 321b8eec08.
This reverts commit 38df9d51a2.
This reverts commit f9afb3f010.
This reverts commit 13296e4b13.
This reverts commit 3b715edda9.
2013-02-26 01:30:44 +01:00
Trevor Norris
22b84e6216 buffer: floating point read/write improvements
Improvements:
* floating point operations are approx 4x's faster
* Now write quiet NaN's
* all read/write on floating point now done in C, so no more need for
  lib/buffer_ieee754.js
* float values have more accurate min/max value checks
* add additional benchmarks for buffers read/write
* created benchmark/_bench_timer.js which is a simple library that
  can be included into any benchmark and provides an intelligent tracker
  for sync and async tests
* add benchmarks for DataView set methods
* add checks and tests to make sure offset is greater than 0
2013-01-16 10:17:20 -08:00
Fedor Indutny
f9afb3f010 dtrace: x64 ustack helper 2013-01-07 23:04:11 +04:00
Scott Blomquist
a616774281 windows: improve Visual Studio Express build support
* Moved generated files to a clearer directory.
* Improved detection logic for ctrpp.exe tool.

Closes #4482
2013-01-03 23:38:25 +01:00
Maciej Małecki
f84bf5b6b1 build: allow to specify custom tags
When building custom `node` versions (e.g., floating features/fixes from
different versions) it's often useful to specify a custom tag which
easily identifies build when invoking `node -v`.

Introduce a way to specify this tag in `node_version.h` file or by
running `./configure --tag="<tag>"`. Insert it right after the patch
version (and before `-pre`, if build is not a release).

Closes #4452.
2012-12-21 12:44:33 -08:00
Scott Blomquist
841b7f534b Ease building with VS Express by checking in generated files. 2012-12-21 11:05:55 -08:00
Fedor Indutny
a3877ab53e Revert "build: enable DEAD_CODE_STRIPPING on OS X"
This reverts commit 02dffb063e.
DEAD_CODE_STRIPPING is stripping out CRYPTO_set_add_lock_callback
symbol on which some addons are relying.
2012-12-17 19:20:44 +04:00
isaacs
420e07c577 streams2: The new stream base classes 2012-12-13 17:00:23 -08:00
Scott Blomquist
f657ce685d windows: add tracing with performance counters
Patch by Henry Rawas and Scott Blomquist.
2012-11-21 01:21:53 +01:00
Ben Noordhuis
1e738c5ef2 build: make python executable configurable
Upstreamed in https://codereview.chromium.org/11418101/

Fixes #4287.
2012-11-20 22:47:45 +01:00
Stephen Gallagher
38809e3985 build: allow linking against system libuv 2012-11-16 23:34:13 +01:00
Timothy J Fontaine
02dffb063e build: enable DEAD_CODE_STRIPPING on OS X 2012-11-06 00:18:36 +01:00
Stephen Gallagher
73ff653a8d build: allow linking against system c-ares 2012-11-06 00:18:35 +01:00
Stephen Gallagher
bfd78b69fc build: allow linking against system http_parser 2012-11-06 00:18:35 +01:00