Commit Graph

428 Commits (70cc9968f667ce110a3a99db6a24b64eb8a3c32e)

Author SHA1 Message Date
Timothy J Fontaine 53b4accb6e v8: Fix compliation with GCC 4.8
Supresses a very loud warning from GCC 4.8 about unused typedefs

Original url https://codereview.chromium.org/69413002
2014-08-04 15:11:36 -07:00
Fedor Indutny 530af9cb8e v8: Interrupts must not mask stack overflow.
Backport of https://codereview.chromium.org/339883002
2014-07-31 09:26:09 -07:00
Fedor Indutny eba7aae107 gyp: fix post-mortem in v0.11
Expose missing constants and keep symbols on OSX.
2014-07-23 18:56:49 +04:00
Fedor Indutny 3530fa9cd0 deps: backport 4ed5fde4f from v8 upstream
Original commit message:

    Fix x64 MathMinMax for negative untagged int32 arguments.

    An untagged int32 has zeros in the upper half even if it is negative.
    Using cmpq to compare such numbers will incorrectly ignore the sign.

    BUG=164442
    R=mvstanton@chromium.org

    Review URL: https://chromiumcodereview.appspot.com/11665007

    git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@13273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-07-18 14:57:18 +04:00
Timothy J Fontaine e9170cbc3d v8: shift heap space for aslr on 64bit
Previously we were only shifting the address space for ASLR on 32bit
processes, apply the same shift for 64bit so processes don't
get artificially limited native heap.
2014-06-06 15:07:30 -07:00
Felix Geisendörfer 881ac26f27 deps/v8: Apply REPLACE_INVALID_UTF8 patch
- https://codereview.chromium.org/121173009/
- https://code.google.com/p/v8/source/detail?r=18683

Note: The v8 test case did not cleanly apply, so it's missing from this
patch. I'm assuming this is not a problem if the v8 test suite is not
part of the node build / test system. If that's the case I'll fix it.
Otherwise the test case will be integrated once v8 is upgraded.
2014-06-06 15:07:29 -07:00
Fedor Indutny a960d1707a deps: backport 23f2736a from v8 upstream
Original text:

    Fix corner case in x64 compare stubs.

    BUG=v8:2416

    Review URL: https://codereview.chromium.org/11413087

fix #7528
2014-05-02 22:53:27 +04:00
Ben Noordhuis 3f3a71e61e deps: fix v8 link error with glibc < 2.17
Commit f9ced08 switches V8 on Linux over from gettimeofday() to
clock_getres() and clock_gettime().  As of glibc 2.17, those functions
live in libc.  For older versions, we need to pull them in from librt.

Fixes the following link-time error;

    Release/obj.target/deps/v8/tools/gyp/libv8_base.a(platform-posix.o):
    In function `v8::internal::OS::Ticks()':
    platform-posix.cc:(.text+0x93c):
    undefined reference to `clock_gettime'
    platform-posix.cc:(.text+0x989):
    undefined reference to `clock_getres'

Fixes #7514.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-28 19:34:07 +04:00
Ben Noordhuis f9ced08de3 deps: make v8 use CLOCK_REALTIME_COARSE
Date.now() indirectly calls gettimeofday() on Linux and that's a system
call that is extremely expensive on virtualized systems when the host
operating system has to emulate access to the hardware clock.

Case in point: output from `perf record -c 10000 -e cycles:u -g -i`
for a benchmark/http_simple bytes/8 benchmark with a light load of
50 concurrent clients:

    53.69%     node  node                 [.] v8::internal::OS::TimeCurrentMillis()
               |
               --- v8::internal::OS::TimeCurrentMillis()
                  |
                  |--99.77%-- v8::internal::Runtime_DateCurrentTime(v8::internal::Arguments, v8::internal::Isolate*)
                  |          0x23587880618e

That's right - over half of user time spent inside the V8 function that
calls gettimeofday().

Notably, nearly all system time gets attributed to acpi_pm_read(), the
kernel function that reads the ACPI power management timer:

    32.49%     node  [kernel.kallsyms]    [k] acpi_pm_read
               |
               --- acpi_pm_read
                  |
                  |--98.40%-- __getnstimeofday
                  |          getnstimeofday
                  |          |
                  |          |--71.61%-- do_gettimeofday
                  |          |          sys_gettimeofday
                  |          |          system_call_fastpath
                  |          |          0x7fffbbaf6dbc
                  |          |          |
                  |          |          |--98.72%-- v8::internal::OS::TimeCurrentMillis()

The cost of the gettimeofday() system call is normally measured in
nanoseconds but we were seeing 100 us averages and spikes >= 1000 us.
The numbers were so bad, my initial hunch was that the node process was
continuously getting rescheduled inside the system call...

v8::internal::OS::TimeCurrentMillis()'s most frequent caller is
v8::internal::Runtime_DateCurrentTime(), the V8 run-time function
that's behind Date.now().  The timeout handling logic in lib/http.js
and lib/net.js calls into lib/timers.js and that module will happily
call Date.now() hundreds or even thousands of times per second.
If you saw exports._unrefActive() show up in --prof output a lot,
now you know why.

That's why this commit makes V8 switch over to clock_gettime() on Linux.
In particular, it checks if CLOCK_REALTIME_COARSE is available and has
a resolution <= 1 ms because in that case the clock_gettime() call can
be fully serviced from the vDSO.

It speeds up the aforementioned benchmark by about 100% on the affected
systems and should go a long way toward addressing the latency issues
that StrongLoop customers have been reporting.

This patch will be upstreamed as a CR against V8 3.26.  I'm sending it
as a pull request for v0.10 first because that's what our users are
running and because the delta between 3.26 and 3.14 is too big to
reasonably back-port the patch.  I'll open a pull request for the
master branch once the CR lands upstream.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-24 14:02:05 -07:00
Ben Noordhuis 6bd78fd770 deps: fix v8 valgrind warning
Fix the following valgrind warning:

    Conditional jump or move depends on uninitialised value(s)
        at 0x7D64E7: v8::internal::GlobalHandles::IterateAllRootsWithClassIds(v8::internal::ObjectVisitor*) (global-handles.cc:613)
        by 0x94DCDC: v8::internal::NativeObjectsExplorer::FillRetainedObjects() (profile-generator.cc:2849)
        # etc.

This was fixed upstream in r12903 and released in 3.15.2 but that commit
was never back-ported to the 3.14 branch that node.js v0.10 uses.

The code itself works okay; this commit simply shuffles the clauses in
an `if` statement to check that the node is in use before checking its
class id (which is uninitialized if the node is not in use.)
2014-03-07 03:29:00 +04:00
Fedor Indutny fac8f396cc deps: backport 883637bd from latest v8
Original commit message:

  VS2013 contains a number of improvements, most notably the addition
  of all C99 math functions.

  I'm a little bit concerned about the change I had to make in
  cpu-profiler.cc, but I spent quite a bit of time looking at it and was
  unable to figure out any rational explanation for the warning. It's
  possible it's spurious. Since it seems like a useful warning in
  general   though, I chose not to disable globally at the gyp level.

  I do think someone with expertise here should probably try to
  determine if this is a legitimate warning.

  BUG=288948
  R=dslomov@chromium.org

  Review URL: https://codereview.chromium.org/23449035

NOTE: Path applied without `cpu-profiler.cc` changes because in our
version it was looking totally different.
2014-02-01 00:45:55 +04:00
svenpanne@chromium.org 196184d332 v8: backport codereview.chromium.org/11362182
Keep the number of descriptors below
DescriptorArray::kMaxNumberOfDescriptors even for accessors

Review URL: https://codereview.chromium.org/11362182
2014-01-10 23:32:08 +00:00
Ben Noordhuis 2eaef9f6da cluster, v8: fix --logfile=%p.log
The %p is replaced with the current PID.  This used to work in node.js
v0.9.7 but it seems to have been lost somewhere along the way.

This commit makes the fix from 6b713b52 ("cluster: make --prof work for
workers") work again.  Without it, all log data ends up in a single
file and is unusable because the addresses are all wrong.
2013-12-18 15:36:12 -08:00
jkummerow@chromium.org 39e2426b20 v8: backport fix for CVE-2013-{6639|6640}
Quoting CVE-2013-6639:

    The DehoistArrayIndex function in hydrogen-dehoist.cc in Google V8
    before 3.22.24.7, as used in Google Chrome before 31.0.1650.63,
    allows remote attackers to cause a denial of service (out-of-bounds
    write) or possibly have unspecified other impact via JavaScript code
    that sets the value of an array element with a crafted index.

Quoting CVE-2013-6640:

    The DehoistArrayIndex function in hydrogen-dehoist.cc in Google V8
    before 3.22.24.7, as used in Google Chrome before 31.0.1650.63,
    allows remote attackers to cause a denial of service (out-of-bounds
    read) via JavaScript code that sets a variable to the value of an
    array element with a crafted index.

Like 6b92a7, this is unlikely to affect node.js because it only runs
local, trusted code.  However, if there exists some module somewhere
that populates an array index with remotely provided data this could
very well be used to crash a remote server running node.  Defense in
depth and all.

This is a backport of upstream commit r17801. Original commit log:

    Limit size of dehoistable array indices

    LOG=Y
    BUG=chromium:319835,chromium:319860
    R=dslomov@chromium.org

    Review URL: https://codereview.chromium.org/74113002
2013-12-14 02:55:29 +04:00
yangguo@chromium.org 007393a09d v8: use correct timezone information on Solaris
`timezone` variable contains the difference, in seconds, between UTC and
local standard time (see `man 3 localtime` on Solaris).

Call to `tzset` is required to apply contents of `TZ` variable to
`timezone` variable.

BUG=v8:2064

Review URL: https://chromiumcodereview.appspot.com/10967066
Patch from Maciej Małecki <me@mmalecki.com>.

This is a back-port of upstream commit r12802 and a forward port of
commit 9fa953d from the v0.8 branch.  V8 3.22 in the master branch
contains the patch so no further forward-porting is necessary.
2013-11-12 15:15:32 +01:00
Ben Noordhuis 3dcc9b93e1 v8: unbreak `make native` build
The security fix from commit 6b92a713 also back-ported the test case.
Said test case relies on API that is only available in newer versions
of V8 and, as a result, broke the `make native` and `make <arch.mode>`
builds.  This commit reverts that part of the back-port.  Fixes the
following build error:

  ../test/cctest/test-api.cc: In function ‘void TestRegress260106()’:
  ../test/cctest/test-api.cc:17712:34: error: ‘class v8::Context’ has
  no member named ‘GetIsolate’
2013-11-09 22:27:22 +01:00
mstarzinger@chromium.org 6b92a71321 v8: back-port fix for CVE-2013-2882
Quoting the CVE:

    Google V8, as used in Google Chrome before 28.0.1500.95, allows
    remote attackers to cause a denial of service or possibly have
    unspecified other impact via vectors that leverage "type confusion."

Likely has zero impact on node.js because it only runs local, trusted
code but let's apply it anyway.

This is a back-port of upstream commit r15665. Original commit log:

    Use internal array as API function cache.

    R=yangguo@chromium.org
    BUG=chromium:260106
    TEST=cctest/test-api/Regress260106

    Review URL: https://codereview.chromium.org/19159003

Fixes #5973.
2013-08-05 18:17:24 +02:00
Ben Noordhuis 41fc46e52f v8: add setVariableValue debugger command
Issue 2399 part 1: In debugger allow modifying local variable values
Issue 2399 part 2: In debugger allow modifying local variable values

Review URL: https://codereview.chromium.org/11415042
Review URL: https://codereview.chromium.org/11412310

This is a back-port of upstream svn commits r13122 and r13202.
2013-06-17 15:24:45 +02:00
Andrei Sedoi cc517497e6 v8: fix build for mips32r2 architecture
This is a floating patch as a backport from v8 3.15.0
Committed: https://code.google.com/p/v8/source/detail?r=12833
2013-06-14 17:48:33 +02:00
Trevor Norris 5d4ac272c7 v8: fix pointer arithmetic undefined behavior
Clang branch release_33 would optimize out a != NULL check because of
some undefined behavior. This is a floating patch as a backport of that
fix.

Committed: http://code.google.com/p/v8/source/detail?r=13570
2013-06-11 14:39:25 -07:00
Timothy J Fontaine e2385839d7 v8: re-apply floating patches 2013-05-23 14:00:20 -07:00
Timothy J Fontaine dbe142c4ed v8: fix GetLocalizedMessage usage
As is the backport of the abort on uncaught exception wouldn't compile
because we it was passing in `this` when it was unnecessary.
2013-05-23 14:00:19 -07:00
Timothy J Fontaine 279361b277 v8: update to 3.14.5.9 2013-05-23 13:39:12 -07:00
Fedor Indutny 55d058e624 v8: cherry-pick 75311294 from upstream
Quote from commit message:

    Create a new HandleScope for each JSON-parsed object to avoid
    excessive growth.
2013-04-03 22:11:32 +04:00
verwaest@chromium.org 14417fdb3f v8: Unify kMaxArguments with number of bits used to encode it.
Increase the number of bits by 1 by making Flags unsigned.

BUG=chromium:211741

Review URL: https://chromiumcodereview.appspot.com/12886008

This is a back-port of commits 13964 and 13988 addressing CVE-2013-2632.
2013-03-23 17:14:28 +01:00
Timothy J Fontaine 4432dc8187 v8: move 32 bit heap hint on sunos
Setting the V8 heap at or near 0x20000000 on 32bit sunos only allows
512 MB of heap space, instead on sunos move this to 0x80000000.

Fixes #4010.
2013-03-15 01:31:05 +01:00
isaacs 51c8b0ede3 V8: Reapply floating patches 2013-03-06 12:59:59 -08:00
isaacs 81c278d58d V8: Upgrade to 3.14.5.8 2013-03-06 12:59:58 -08:00
yangguo@chromium.org cfacde3ac6 v8: Hardfloat does not imply VFPv3, only VFPv2.
Raspberry Pi is an example.

BUG=v8:2393

Review URL: https://chromiumcodereview.appspot.com/11570061
Patch from Chi-Thanh Christopher Nguyen <nguyenchithanh@gmail.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@13232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

This is a backport of v8/v8@44419ad089.
2013-02-26 18:44:02 +01:00
Ben Noordhuis c80bde1781 v8: work around String::WriteAscii segfault
See http://code.google.com/p/v8/issues/detail?id=2493 for details.

This commit reapplies 9668df8. The issue has been fixed upstream but
reappeared after last night's downgrade to V8 3.14.5 in commit b15a10e.

Conflicts:
	test/simple/test-buffer.js
2013-02-26 18:27:30 +01:00
Fedor Indutny aa98539277 v8: fix postmortem and dtrace helper build
Regardless of previous @bnoordhuis' changes
2013-02-26 08:17:21 +00:00
Ben Noordhuis 03fe7fb55c v8: reapply floating patches
Reapply floating patches. Special mention: also reapplies 017009f but
with the extra change of removing DescriptorArray::kTransitionsIndex
from the postmortem metadata generator because said field no longer
exists in V8 3.14.
2013-02-25 23:45:02 +01:00
Ben Noordhuis b15a10e7a0 deps: downgrade v8 to 3.14.5
V8 3.15 and newer have stability and performance issues. Roll back to
a known-good version.
2013-02-25 23:45:02 +01:00
isaacs e4a856e0ba V8: Reapply floating patches 2013-02-08 17:18:41 -08:00
isaacs 0c2e5ec840 V8: Upgrade to 3.15.11.15 2013-02-08 17:17:45 -08:00
Bryan Cantrill 202b5db4ef v8: loosen artificial mmap constraint
Fixes #4010.
2013-02-06 13:30:59 +04:00
isaacs 7a2ebce8d8 V8: Reapply floating patches 2013-01-24 09:10:01 -08:00
isaacs 8024252877 V8: Upgrade to 3.15.11.10 2013-01-24 09:10:01 -08:00
Ben Noordhuis 8b0f3ce397 v8: add %p option to --logfile, expands to pid
Useful when you are profiling multiple instances of V8 concurrently.
Submitted upstream: http://code.google.com/p/v8/issues/detail?id=2503

Refs #4617.
2013-01-18 01:33:12 +01:00
Ben Noordhuis 9668df8b39 v8: work around String::WriteAscii segfault
See http://code.google.com/p/v8/issues/detail?id=2493 for details.
Once the patch lands in upstream V8, this commit can be reverted.
2013-01-15 23:46:30 +01:00
yangguo@chromium.org 926c90bc64 v8: Hardfloat does not imply VFPv3, only VFPv2.
Raspberry Pi is an example.

BUG=v8:2393

Review URL: https://chromiumcodereview.appspot.com/11570061
Patch from Chi-Thanh Christopher Nguyen <nguyenchithanh@gmail.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@13232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

This is a backport of v8/v8@44419ad089.
2013-01-13 18:26:58 +01:00
Ben Noordhuis 8018113910 v8: remove optimization switches
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.
2013-01-12 00:34:36 +04:00
Fedor Indutny d22bd9e3c4 deps: update v8 to 3.15.11.7 2013-01-12 00:10:45 +04:00
yangguo@chromium.org 438e0c6d75 v8: Hardfloat does not imply VFPv3, only VFPv2.
Raspberry Pi is an example.

BUG=v8:2393

Review URL: https://chromiumcodereview.appspot.com/11570061
Patch from Chi-Thanh Christopher Nguyen <nguyenchithanh@gmail.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@13232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

This is a backport of v8/v8@44419ad089.
2013-01-10 17:02:59 -08:00
Ben Noordhuis 93591a2a88 v8: remove optimization switches
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.
2013-01-04 20:06:03 +04:00
Fedor Indutny 0054264d88 v8: update to 3.15.11.5 2013-01-04 15:44:47 +04:00
Ben Noordhuis ce1b33a9dc v8: remove optimization switches
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.
2013-01-03 02:37:22 +01:00
Fedor Indutny 7b4d95a976 deps: update v8 to 3.15.11 2013-01-01 16:07:02 +04:00
Ben Noordhuis a25ebb1997 v8: fix dragonflybsd build
* fix gyp build
* don't require libexecinfo, it's not there
* libpthread doesn't implement sem_timedwait(), fall back to sem_wait()

Upstreamed in https://codereview.chromium.org/11421013/
2012-11-20 22:48:26 +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