Commit Graph

171 Commits

Author SHA1 Message Date
hpayer@chromium.org
fffadaf9ba Unlink evacuation candidates from list of pages before starting sweeper threads.
Removed FinalizeSweeping().

BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13886 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-08 14:41:21 +00:00
hpayer@chromium.org
80195113ab Wait for sweeper threads in EnsureSweeperProgress() only if the main thread finished its sweeping phase.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13830 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-05 17:32:02 +00:00
hpayer@chromium.org
1630954005 Fix assert in PagedSpace::SizeOfObject for concurrent sweeping.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13814 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-04 15:47:59 +00:00
hpayer@chromium.org
74b6f0f321 Fix Win64 compilation problem.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13785 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-01 12:46:20 +00:00
hpayer@chromium.org
a9374e2fea Set unswept free bytes for concurent sweeper.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13776 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-28 15:07:28 +00:00
hpayer@chromium.org
e819dd2869 Shrinking of PagedSpace is done only by sweeper.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13758 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-27 12:59:52 +00:00
hpayer@chromium.org
492396f2ab Fixed IsSweepingComplete and EnsureSweeperProgress helper functions.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13596 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-05 15:48:59 +00:00
jkummerow@chromium.org
1c1fdc7da2 Better fix for MemoryChunk::owner().
Pointer arithmetic such as "owner_ - kFailureTag" is undefined behaviour
unless owner_ points to a valid object.

This allowed Clang to assume the subtraction would never be NULL,
causing problems in the caller (see https://codereview.chromium.org/12090072/).

To fix this, we should cast owner_ to intptr_t before doing the
arithmetic.

Review URL: https://codereview.chromium.org/12096089
Patch from Hans Wennborg <hans@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13570 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-31 15:36:24 +00:00
jkummerow@chromium.org
ddc175f244 Work around a bug in Clang that optimizes away a NULL check
Review URL: https://codereview.chromium.org/12090072

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13562 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-30 17:35:29 +00:00
hpayer@chromium.org
44caabb1cd Parallel and concurrent sweeping.
Sweep old pointer space and old data space concurrently to the main mutator thread and in parallel.

BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13552 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-30 12:19:32 +00:00
danno@chromium.org
c31454ac37 Use MemoryChunk-based allocation for deoptimization entry code
This is done by first committing the deoptimization entry code with a minimal
area size (OS::CommitPageSize) and later using CommitArea to adjust the size.

Committed: http://code.google.com/p/v8/source/detail?r=13494

Review URL: https://chromiumcodereview.appspot.com/11566011
Patch from Haitao Feng <haitao.feng@intel.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13532 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-29 09:09:55 +00:00
danno@chromium.org
63ec79a4a4 Revert r13494: "Use MemoryChunk-based allocation for deoptimization entry code"
This patch seems to cause crashes on Windows.

TBR=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13495 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-24 15:48:07 +00:00
danno@chromium.org
de17ce7701 Use MemoryChunk-based allocation for deoptimization entry code
This is done by first committing the deoptimization entry code with a minimal
area size (OS::CommitPageSize) and later using CommitArea to adjust the size.

Review URL: https://codereview.chromium.org/11566011
Patch from Haitao Feng <haitao.feng@intel.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13494 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-24 15:14:33 +00:00
hpayer@chromium.org
f6f55dcd97 Prepare FreeList for parallel and concurrent sweeping.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13198 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-11 17:45:01 +00:00
danno@chromium.org
5a40f006f9 Remove unused private member variables found by clang -Wunused-private-field
Review URL: https://codereview.chromium.org/11414207
Patch from Adam Klein <adamk@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13096 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-29 15:13:49 +00:00
hpayer@chromium.org
5a6c1e5109 Fixed pointer arithmetic in write barrier for large objects when marking progress bar is used.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13073 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-28 10:53:39 +00:00
hpayer@chromium.org
865828f37e Forward white to grey transition only if slot is before the progress bar of a given object.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13063 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-26 16:16:49 +00:00
mstarzinger@chromium.org
5dec1423a4 Implement progress bar for large objects.
This implements incremental scanning of large objects using a progress
bar in the page header of such objects. Note that this requires forward
white to gray transitions in the write barrier and hence is disabled by
default for now.

R=ulan@chromium.org,hpayer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12978 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-15 17:57:40 +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
verwaest@chromium.org
72424b3987 Move DescriptorArray into the map.
Review URL: https://chromiumcodereview.appspot.com/11188031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12746 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-17 13:04:49 +00:00
mvstanton@chromium.org
b3c0ed8245 Enable --verify-heap in release mode
R=mstarzinger@chromium.org
BUG=v8:2120

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12713 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-12 11:41:14 +00:00
verwaest@chromium.org
6e1bafc808 Revert "Allow partial scanning of large arrays in order to avoid"
This reverts commit r12619.

BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12660 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-04 11:09:17 +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
erik.corry@gmail.com
aba09dcf2e Allow partial scanning of large arrays in order to avoid
mark stack overflow.  This is a reland of r12609 -
https://chromiumcodereview.appspot.com/10959011 - but
this time VisitPointers has been fixed (it used to assume
that the first slot was on the first page of a large object).
Review URL: https://chromiumcodereview.appspot.com/10996018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12619 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-26 12:17:24 +00:00
erik.corry@gmail.com
e8ffc2bebd Make the speed of incremental marking depend also on the rate
at which we are hitting expensive write barrier operations,
not just on the rate of allocation.
Review URL: https://chromiumcodereview.appspot.com/10974003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12618 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-26 11:35:42 +00:00
erik.corry@gmail.com
5547815daf Revert 12609 (Allow partial scanning of large arrays)
due to crashes in unbox-double-arrays.js test.
Review URL: https://chromiumcodereview.appspot.com/10996017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12610 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-26 08:55:19 +00:00
erik.corry@gmail.com
a54e007a95 Allow partial scanning of large arrays in order to avoid
mark stack overflow.
Review URL: https://chromiumcodereview.appspot.com/10959011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12609 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-26 08:33:15 +00:00
erik.corry@gmail.com
5a8d1764bc Refactoring of snapshots. This simplifies and improves
the speed of deserializing code.  The current startup
time improvement for V8 is around 6%, but code deserialization
is speeded up disproportionately, and we will soon have more
code in the snapshot.
* Removed support for deserializing into large object space.
  The regular pages are 1Mbyte now and that is plenty.  This
  is a big simplification.
* Instead of reserving space for the snapshot we actually
  allocate it now.  This removes some special casing from
  the memory management and simplifies deserialization since
  we are just bumping a pointer rather than calling the
  normal allocation routines during deserialization.
* Record in the snapshot how much we need to boot up and
  allocate it instead of just assuming that allocations in
  a new VM will always be linear.
* In the snapshot we always address an object as a negative
  offset from the current allocation point.  We used to
  sometimes address from the start of the deserialized data,
  but this is less useful now that we have good support for
  roots and repetitions in the deserialization data.
* Code objects were previously deserialized (like other
  objects) by alternating raw data (deserialized with memcpy)
  and pointers (to external references, other objects, etc.).
  Now we deserialize code objects with a single memcpy,
  followed by a series of skips and pointers that partially
  overwrite the code we memcopied out of the snapshot.
  The skips are sometimes merged into the following
  instruction in the deserialization data to reduce dispatch
  time.
* Integers in the snapshot were stored in a variable length
  format that gives a compact representation for small positive
  integers.  This is still the case, but the new encoding can
  be decoded without branches or conditional instructions,
  which is faster on a modern CPU.
Review URL: https://chromiumcodereview.appspot.com/10918067

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12505 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-14 11:16:56 +00:00
ulan@chromium.org
390580e49f Use correct size of objects in PrintShortHeapStatistics.
R=mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-25 12:51:03 +00:00
vegorov@chromium.org
49989753ea Don't ignore return value of CommitCodePage in AllocateAlignedMemory.
Release the mapping as whole if commit failed to avoid leaking virtual address space.

R=mstarzinger@chromium.org
BUG=chromium:118625

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11471 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-30 15:02:43 +00:00
mstarzinger@chromium.org
40895f0250 Cleanup test-alloc unit test case.
This makes the test-alloc test case more robust against changes to the
initial heap size. It correctly simulates a full space now instead of
trying to fill the space up by allocating filler objects.

R=svenpanne@chromium.org
TEST=cctest/test-alloc

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11284 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-12 10:06:32 +00:00
erik.corry@gmail.com
f00631b710 Reduce initial boot-up memory use. This is an other attempt at what
http://codereview.chromium.org/9179012 was trying to achieve.  This
time I am going for 80% of the benefit with around 5% of the complexity.

It works by reducing the size of the first page in each space.  Unlike the
previous change there is no attempt to grow pages, we just allocate more
full-sized pages when we need more memory.  For this reason the first pages are
not quite as small (compare
http://codereview.chromium.org/9179012/diff/1/src/snapshot.h with the changes
in spaces.cc in this cl):  We want to be able to do a little bit of allocation
before we have to add a full-sized page to the space.
Review URL: https://chromiumcodereview.appspot.com/9950048

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11203 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-02 08:32:31 +00:00
vegorov@chromium.org
b7b2fd4cec Implement a hash based look-up to speed up containing address check in large
object space. Before, it was a link-list based look-up, and make this function
a little bit 'hot' from profile point.

BUG=v8:853
TEST=

Review URL: https://chromiumcodereview.appspot.com/9634005
Patch from Zhongping Wang <kewpie.w.zp@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11084 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-19 12:08:20 +00:00
vegorov@chromium.org
97b94a9150 Ensure that inner pseudo-chunks are correctly initialized in FreeQueuedChunks.
Fields introduced with guarding code space pages (area_start_, area_end_) were not correctly handled which lead to errors in StoreBuffer filtering.

R=mstarzinger@chromium.org
TEST=mozilla/data/js1_5/GC/regress-203278-2.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10927 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-05 16:39:25 +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
53c6838cce Remove 5 unused flags.
Review URL: https://chromiumcodereview.appspot.com/9362014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10646 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-08 15:39:41 +00:00
vegorov@chromium.org
a7b0481b6d Tweak compaction candidate selection to avoid keeping page with low occupancy around.
Increase slots buffer chain length to 15 to make compaction more aggressive and usefull.

Pass gc and collector selection reasons to GCTracer to allow more meaningull --gc-trace.

Print fragmentation of spaces that we do not compact.

R=erik.corry@gmail.com

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10601 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-03 14:16:40 +00:00
erik.corry@gmail.com
3cfac4da0a Revert memory saving change due to failures on multithreaded tests
on Windows.
Review URL: https://chromiumcodereview.appspot.com/9104039

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10569 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-31 13:33:44 +00:00
erik.corry@gmail.com
f5feac9e98 Reduce memory use immediately after boot.
This is a recommit of https://chromiumcodereview.appspot.com/9289047
with changes noted in comments in the codereview tool.
Review URL: https://chromiumcodereview.appspot.com/9233050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10562 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-31 11:22:35 +00:00
erik.corry@gmail.com
a9428d2bcc Revert 10542 (boot time memory reduction) due to map alignment
issues on 64 bit.
Review URL: https://chromiumcodereview.appspot.com/9295047

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10544 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-30 10:20:13 +00:00
erik.corry@gmail.com
419ea5fcc3 Reduce boot-up memory use of V8.
This is a recommit of http://codereview.chromium.org/9179012
after fixing what turned out to be unrelated out-of-memory
errors.
That was a rebase of http://codereview.chromium.org/9017009/
Review URL: https://chromiumcodereview.appspot.com/9289047

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10542 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-30 09:15:34 +00:00
erik.corry@gmail.com
be288cf2b4 Initially unmap one of the semispaces to reduce memory use at boot time.
Review URL: https://chromiumcodereview.appspot.com/9117035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10491 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-24 16:00:19 +00:00
vegorov@chromium.org
3fd6ba109e When adjusting page's live bytes counter from the mutator adjust owners unswept free bytes counter.
R=mstarzinger@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10426 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-18 09:21:07 +00:00
mstarzinger@chromium.org
f3045d3802 Fix corner-case in heap size estimation.
Empty but unswept pages could cause the unswept_free_bytes counter to
to be off in case heap gets shrunk and page gets released before it was
swept properly.

R=vegorov@chromium.org
BUG=v8:1893

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10421 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-17 14:09:12 +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
fdc163bbbb Make from-space initially uncommitted for another 1Mbyte
improvement in boot time memory usage.
Review URL: http://codereview.chromium.org/9242008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10415 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-17 12:09:11 +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