Commit Graph

55 Commits

Author SHA1 Message Date
svenpanne@chromium.org
23d681c50b Removed RuntimeProfilerRateLimiter class and RuntimeProfiler::IsSomeIsolateInJS.
Removing the former was basically a consequence of removing the latter. The net
effect is, apart from less code, that the signal sender thread is much more
explicit about its logic now.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13212 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-12 15:26:04 +00:00
svenpanne@chromium.org
17def81fc9 Use count-based profiling exclusively.
Review URL: https://codereview.chromium.org/11437016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13158 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-07 08:55:06 +00:00
jkummerow@chromium.org
bd69d3d5c3 Revert "Perform CPU sampling by CPU sampling thread only iff processing thread is not running."
This reverts r12985.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13104 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-30 10:26:21 +00:00
jkummerow@chromium.org
7f824867f6 Perform CPU sampling by CPU sampling thread only iff processing thread is not running.
- perform CPU profiler sampling in the sampler thread as we used to;
- skip sampling in the sampling thread if processing thread is running;
- only install SIGPROF handler when CPU profiling is enabled.

BUG=v8:2364

Review URL: https://codereview.chromium.org/11231002
Patch from Sergey Rogulenko <rogulenko@google.com> and Andrey Kosyakov <caseq@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12985 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-16 10:38:10 +00:00
mstarzinger@chromium.org
37759f4d64 Implement committed physical memory stats for Linux.
The patch introduces CommittedPhysicalMemory function to
the Heap class that reports committed *physical* memory acquired
for the heap from the OS.
It is important because some OSes may defer actual committment on e.g.
first access to the region.
So reporting just plain committed size led to various weird artifacts
like showing V8 allocated memory higher than the whole process
private size.

BUG=v8:2191

Review URL: https://codereview.chromium.org/11066118
Patch from Alexei Filippov <alph@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12793 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-22 16:33:10 +00:00
jkummerow@chromium.org
62223bd2c0 Revert recent CPU profiler changes because they broke --prof.
This reverts r12649 and r12650.

BUG=v8:2364

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12745 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-17 12:24:31 +00:00
jkummerow@chromium.org
ecc7f4baad Replacing circular queue by single buffer in CPU Profiler.
BUG=None

Review URL: https://codereview.chromium.org/10871039
Patch from Sergey Rogulenko <rogulenko@google.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12650 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-02 10:51:00 +00:00
jkummerow@chromium.org
dfb4218a04 Moving cpu profiling into its own thread.
BUG=None

Review URL: https://codereview.chromium.org/10857035
Patch from Sergey Rogulenko <rogulenko@google.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12649 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-02 09:58:11 +00:00
mstarzinger@chromium.org
5b64362706 Revert r12625 due to sandbox incompatibility.
Original message: Implement committed physical memory stats for Linux.
This had to be reverted because it crashes when compiled into Chromium
due to the sandbox not allowing the mincore call.

R=verwaest@chromium.org
BUG=v8:2191

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12640 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-01 12:11:06 +00:00
mstarzinger@chromium.org
974a2268bb Implement committed physical memory stats for Linux.
The patch introduces CommittedPhysicalMemory function to the Heap class
that reports committed *physical* memory acquired from the OS.
It is important because some OSes may postpone actual commitment on e.g.
first access to the previously committed region.
So reporting just plain committed size led to various weird artifacts
like DevTools showing V8 allocated memory higher than the whole process
private size.

BUG=v8:2191

Review URL: https://codereview.chromium.org/10961042
Patch from Alexei Filippov <alph@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12625 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-27 13:27:50 +00:00
ulan@chromium.org
6df4bcfecf Add support for running low level profiler on Android.
R=mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12469 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-06 15:01:20 +00:00
svenpanne@chromium.org
b1e95913a0 Valgrind cleanliness, part 6: Introduce OS::TearDown, cleaning up 2 mutexes.
Review URL: https://chromiumcodereview.appspot.com/10084003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11320 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-13 14:08:31 +00:00
danno@chromium.org
db86043160 Minimize uses of lazy initialization by adding explicit initialization functions.
BUG=118686

Review URL: https://chromiumcodereview.appspot.com/9976003
Patch from Philippe Liard <pliard@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11239 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-05 14:10:39 +00:00
danno@chromium.org
63f033576c Fix performance regressions due to lazy initialization.
This CL:
- Adds a new trait parameter to LazyInstance to let it initialize the instance
  without paying the cost of atomic operations (which are expensive on Mac).
  This only works for users who don't care about thread-safety and this is now
the default initialization trait used by LazyInstance in v8.

- Reverts the changes that were made in r11010 in isolate.{cc,h}. That lets
  Isolate's accessors be as cheap as they were before (but adds one static initializer).

- Adds OS::PostSetup() used to initialize the math functions which depend on CPU features.
That lets the math functions get rid of CallOnce().

BUG=118686

Review URL: https://chromiumcodereview.appspot.com/9873023
Patch from Philippe Liard <pliard@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11198 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-30 14:30:46 +00:00
fschneider@chromium.org
1f7d42efc9 Landing for pliard@chromium.org: Remove static initializers in v8.
This change includes two CLs by pliard@chromium.org:

1. http://codereview.chromium.org/9447052/ (Add CallOnce() and simple LazyInstance implementation):

Note that this implementation of LazyInstance does not handle global destructors (i.e. the lazy instances are never deleted).

This CL was initially reviewed on codereview.appspot.com:
http://codereview.appspot.com/5687064/



2.  http://codereview.chromium.org/9455088/ (Remove static initializers in v8):
This CL depends on CL 9447052 (adding CallOnce and LazyInstance).
It is based on a patch sent by Digit.

With this patch applied, we have only one static initializer left (in atomicops_internals_x86_gcc.cc). This static initializer populates a structure used by x86 atomic operations. It seems that we can hardly remove it. If possible, it will be removed in a next CL. 

This CL also modifies the presubmit script to check the number of static initializers.


BUG=v8:1859
Review URL: https://chromiumcodereview.appspot.com/9666052

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11010 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-12 13:56:56 +00:00
vegorov@chromium.org
fbc230e42b Ensure that executable pages are properly guarded.
Split executable memory chunks into two pieces: header with all metadata (protection: RW) and body (protection: RWX). Separate header from metadata with a guard page and add a guard page after the page body.

R=erik.corry@gmail.com
BUG=http://crbug.com/115151

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10809 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-23 12:11:24 +00:00
erik.corry@gmail.com
79112684b5 Increase size of small stacks from 32k to 64k to avoid hitting
limits in Chromium.
http://code.google.com/p/chromium/issues/detail?id=112843
Review URL: https://chromiumcodereview.appspot.com/9353006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10615 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-07 08:00:36 +00:00
erik.corry@gmail.com
ee1d0fc5c6 Reduce the space used by the stack for the profiling thread.
Review URL: https://chromiumcodereview.appspot.com/9117032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10490 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-24 15:48:16 +00:00
yangguo@chromium.org
11e779185b Parallelize cpplint in presubmit and fix usage of DISALLOW_* macros.
BUG=v8:1653

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10465 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-20 16:17:08 +00:00
erik.corry@gmail.com
a02dbe4258 Revert 10413-10416 initial memory use reduction due to
test failures.
Review URL: http://codereview.chromium.org/9178014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10417 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-17 13:13:55 +00:00
erik.corry@gmail.com
3403e76682 Reduce boot-up memory use of V8.
Reduce signal sender thread stack size to 32k.
Commit partial old-space pages to reduce minimum memory use.
This is a rebase of http://codereview.chromium.org/9017009/
Review URL: http://codereview.chromium.org/9179012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10413 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-17 11:38:25 +00:00
erik.corry@gmail.com
70da367f6b More spelling changes.
Review URL: http://codereview.chromium.org/9231009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10407 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-16 12:38:59 +00:00
erik.corry@gmail.com
b3e0761e38 Cosmetic changes ("set up" is a verb, "setup" is a noun).
Review URL: http://codereview.chromium.org/9139051

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10399 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-13 13:09:52 +00:00
yangguo@chromium.org
5253363cc2 Add netbsd support to gyp build.
Review URL: http://codereview.chromium.org/9071004
Patch from Matthew Sporleder <msporleder@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10341 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-05 12:17:08 +00:00
erik.corry@gmail.com
034eb17387 sync the OpenBSD code with Linux. Committing http://codereview.chromium.org/8499016/ for Robert Nagy
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9927 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-09 12:01:45 +00:00
vegorov@chromium.org
1a0423b54f Fix leakage of virtual address space on Linux platform.
Ensure that unmap return values are checked in debug mode.

R=erik.corry@gmail.com
BUG=v8:1701

Review URL: http://codereview.chromium.org/8060052

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9480 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-29 12:23:05 +00:00
sgjesse@chromium.org
8a6108de95 Remove the ability to compile without logging and profiling
The preprocessor defines ENABLE_LOGGING_AND_PROFILING and ENABLE_VMSTATE_TRACKING has been removed as these where required to be turned on for Crankshaft to work. To re-enable reducing the binary size by leaving out heap and CPU profiler a new set of defines needs to be created.

R=ager@chromium.org

BUG=v8:1271
TEST=all

Review URL: http://codereview.chromium.org//7350014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8622 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-13 09:09:04 +00:00
ager@chromium.org
15429da469 Remove heap protection support.
It does not currently work and when it did work we never got it fast
enough to be useful.

R=kmillikin@chromium.org

Review URL: http://codereview.chromium.org/7324051

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8601 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-11 14:03:21 +00:00
vitalyr@chromium.org
bbaed5b82e Fix a few issues breaking cctest/test-lockers/Regress1433:
o The thread local state in an isolate has to be initialized before
  it's used.
o v8::Locker was incorrectly tracking whether it's the topmost one.
o Waking the profiler thread on shutdown should not leave the
  semaphore counter in an inconsitent state.

R=fschneider@chromium.org
BUG=v8:1522
TEST=cctest/test-lockers/Regress1433

Review URL: http://codereview.chromium.org/7309013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8537 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-05 15:49:39 +00:00
mikhail.naganov@gmail.com
508b22c436 "Deiceolate" Thread classes.
Thread class was receiving an isolate parameter by default.
This approact violates the assumption that only VM threads
can have an associated isolate, and can lead to troubles,
because accessing the same isolate from different threads
leads to race conditions.

This was found by investigating mysterious failures of the
CPU profiler layout test on Linux Chromium. As almost all
threads were associated with some isolate, the sampler was
trying to sample them.

As a side effect, we have also fixed the DebuggerAgent test.

Thanks to Vitaly for help in fixing isolates handling!

R=vitalyr@chromium.org
BUG=none
TEST=none

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8259 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-10 09:54:04 +00:00
mikhail.naganov@gmail.com
3b2470d296 Fix presubmit errors catched by a more recent version of cpplint.py.
Mainly, there were errors concerning blank lines before and after class access
control sections [whitespace/blank_line].

BEFORE an access control section (e.g. public:, private:) there should be a
blank line (except for the section right after the class declaration).

AFTER an access control section there should be no blank line.

TBR=ager@chromium.org

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8193 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-07 07:17:46 +00:00
erik.corry@gmail.com
6d7d3b8d77 Fix compilation on OpenBSD. Patch from Robert Nagy in
http://code.google.com/p/v8/issues/detail?id=1420
Review URL: http://codereview.chromium.org/7104024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8141 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-01 11:09:32 +00:00
vitalyr@chromium.org
d932b5f768 Do not rely on uniqueness of pthread_t
Patch by Dmitry Lomov.

pthreads implementations are free to reuse pthread_t (thread id) after
the thread has died. This change gets rid of ThreadHandle class and
replaces it with v8-managed thread identifiers.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7575 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-11 23:46:22 +00:00
vitalyr@chromium.org
04537cb227 Use v8::internal threading support in samples/shell.cc.
We need this for isolates testing. To make it work I had to extend the
internal Thread constructor with an option to set the stack size (see
the comment in shell.cc).

BUG=1264

Review URL: http://codereview.chromium.org/6711068

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7289 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-21 15:04:17 +00:00
vitalyr@chromium.org
7976ca2cbc Merge isolates to bleeding_edge.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7271 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 20:35:07 +00:00
vitalyr@chromium.org
76e226f832 Revert r7268: it borked the history.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7269 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 19:41:05 +00:00
vitalyr@chromium.org
6ff7fdebd3 Merge isolates to bleeding_edge.
Review URL: http://codereview.chromium.org/6685088

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 18:49:56 +00:00
mikhail.naganov@gmail.com
3eb151ebea Bug: OS::MemoryMappedFile::open() should not truncate a pre-existing file.
Patch by Mark Lam from Hewlett-Packard Development Company, LP

Review URL: http://codereview.chromium.org/6543039

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6872 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-21 17:17:26 +00:00
mikhail.naganov@gmail.com
7984684ec9 Introducing MemoryMappedExternalResource for creating an external
resource from a memory mapped file for creating strings.

Patch by Mark Lam from Hewlett-Packard Development Company, LP

Review URL: http://codereview.chromium.org/6240002/

Relanded with Windows compilation issues fixed.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6401 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 14:28:15 +00:00
mikhail.naganov@gmail.com
53cbbe4a23 Revert "Introducing MemoryMappedExternalResource for creating an external"
Windows compilation is broken. Will fix and reland later.

This reverts commit fe13ffaa6d0c3435bfe1ae930813e456650ec980.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6389 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 11:20:10 +00:00
mikhail.naganov@gmail.com
890a0f6b52 Introducing MemoryMappedExternalResource for creating an external
resource from a memory mapped file for creating strings.

Patch by Mark Lam from Hewlett-Packard Development Company, LP

Review URL: http://codereview.chromium.org/6240002/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6386 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 10:48:06 +00:00
sgjesse@chromium.org
c89021d162 Added labelled thread names to help with some debugging activity. Right now,
the only platform that it works on is linux (using the prctl API to set the
names of the threads). Other platforms are setup to build properly if the
flag is set, but their thread names are not currently set.

Patch by Mark Lam from Hewlett-Packard Development Company, LP

Review URL: http://codereview.chromium.org/6070009


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6141 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-04 09:09:50 +00:00
kasperl@chromium.org
90b3370374 Update V8 to version 3.0 (re-land r5920).
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5922 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 11:31:57 +00:00
kasperl@chromium.org
51b494d096 Revert r5920. Will re-land shortly.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 11:01:02 +00:00
kasperl@chromium.org
e5860bd6a8 Update V8 to version 3.0.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5920 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 09:11:56 +00:00
mikhail.naganov@gmail.com
646a578b3f Simplify ProfLazyMode test on Linux.
Instead of installing signal handler, count samples taken.

Review URL: http://codereview.chromium.org/5325003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5891 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-25 15:54:52 +00:00
vitalyr@chromium.org
e6b33bd20b Support profiling based on linux kernel performance events.
Since 2.6.31 perf_events interface has been available in the
kernel. There's a nice tool called "perf" (linux-2.6/tools/perf) that
uses this interface and provides capabilities similar to oprofile. The
simplest form of its usage is just dumping the raw log (trace) of
events generated by the kernel. In this patch I'm adding a script
(tools/ll_prof.py) to build profiles based on perf trace and our code
log. All the heavy-lifting is done by perf. Compared to oprofile agent
this approach does not require recompilation and supports code moving
garbage collections.

Expected usage is documented in the ll_prof's help. Basically one
should run V8 under perf passing --ll-prof flag and then the produced
logs can be analyzed by tools/ll_prof.py.

The new --ll-prof flag enables logging of generated code object
locations and names (like --log-code), and also of their bodies, which
can be later disassembled and annotated by the script.

Review URL: http://codereview.chromium.org/3831002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5663 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-19 16:45:11 +00:00
sgjesse@chromium.org
165c0369fb Fix compilation for ARMv4 for OpenBSD/FreeBSD
This is a port of r5260.
Review URL: http://codereview.chromium.org/3165021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5280 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-17 07:17:20 +00:00
erik.corry@gmail.com
068e0bc032 Add ReleaseStore function on OpenBSD.
Review URL: http://codereview.chromium.org/2916001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5036 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-08 08:12:17 +00:00
mikhail.naganov@gmail.com
c520e28dcb Make VM state tracking to be independent of logging and profiling.
Also pull out VMState into its own set of source files.

Review URL: http://codereview.chromium.org/1519027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4361 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-08 13:37:39 +00:00