Commit Graph

72 Commits

Author SHA1 Message Date
dcarney@chromium.org
42a8ff87ba add weakcallback without persistent copying
R=svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14566 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-05-07 10:44:30 +00:00
dcarney@chromium.org
cf5ff5a14c first step to remove unsafe handles
R=svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14530 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-05-02 20:18:42 +00:00
mstarzinger@chromium.org
e7c1f322a4 New GC APIs, try 2.
With these APIs, the embedder doesn't need to copy Persistent handles around.

BUG=

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

Patch from Marja Hölttä <marja@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14423 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-24 15:59:23 +00:00
yangguo@chromium.org
d1df0e631d Clean up VMState a little bit.
R=svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14421 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-24 14:44:08 +00:00
mstarzinger@chromium.org
091f0b7f35 Revert the commits adding new GC-related APIs.
We need to solve efficiency problems first.

This reverts the following revisions: 14283 14286 14221 14215

BUG=

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

Patch from Marja Hölttä <marja@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14293 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-16 16:37:04 +00:00
mstarzinger@chromium.org
e8bc8d76ae New GC related APIs: Implicit references.
When using these APIs, the embedder doesn't need to copy Persistent handles around.

BUG=NONE

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

Patch from Marja Hölttä <marja@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14283 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-16 12:57:01 +00:00
mstarzinger@chromium.org
09632968c5 Fix build failures on Win64 since r14215.
R=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14221 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-11 08:08:09 +00:00
mstarzinger@chromium.org
45125e6480 New GC related APIs.
When using these APIs, the embedder doesn't need to copy Persistent handles around.

BUG=NONE

Review URL: https://codereview.chromium.org/13786002
Patch from Marja Hölttä <marja@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14215 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-10 14:53:03 +00:00
mstarzinger@chromium.org
61d9399e8d Disable zapping of global handles in release mode.
R=danno@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14028 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-21 14:18:16 +00:00
dcarney@chromium.org
996f5aef8b Reduce storage size of weak callbacks
R=mstarzinger@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13986 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-19 10:06:20 +00:00
mstarzinger@chromium.org
d6fd3a0767 Enable zapping of disposed global handles in release mode.
R=hpayer@chromium.org
BUG=chromium:176056

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13818 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-04 18:24:37 +00:00
mstarzinger@chromium.org
a3723243b0 Change and disable global handle zapping.
R=yangguo@chromium.org
BUG=chromium:176056
TEST=webkit:storage/indexeddb/create-and-remove-object-store.html

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13680 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-18 10:20:58 +00:00
mstarzinger@chromium.org
7767a08683 Add zapping of disposed persistent handles.
R=svenpanne@chromium.org
BUG=chromium:176056

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13675 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-15 12:18:24 +00:00
svenpanne@chromium.org
a7e88a3435 Unbreak build (offsetof only works for POD types)
TBR=yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13502 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-25 08:54:11 +00:00
svenpanne@chromium.org
52d10a68cb Add Isolate parameter to Persistent class.
BUG=v8:2487

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13501 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-25 08:31:46 +00:00
mstarzinger@chromium.org
c8cf5d90aa Implement VisitHandlesInNewSpaceWithClassIds()
BUG=
TEST=test-api.cc::PersistentHandleInNewSpaceVisitor

Review URL: https://codereview.chromium.org/11365131
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13496 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-24 15:53:16 +00:00
mstarzinger@chromium.org
5cd6913839 Remove unused GlobalHandles::IterateWeakRoots()
BUG=

Review URL: https://codereview.chromium.org/11969037
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13445 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-21 12:31:13 +00:00
mstarzinger@chromium.org
0f5b5dd311 Remove GlobalHandles::number_of_weak_handles_ and number_of_global_object_weak_handles_
This is a preparation patch for inlining MakeWeak() and Clear().

Given that NumberOfWeakHandles() is used only by CHECK_EQ() in serialized.cc and that NumberOfGlobalObjectWeakHandles is unused, it is wasteful to keep track of number_of_weak_handles_ and number_of_global_object_weak_handles_ at every MakeWeak() and Clear(). Instead, we can count the number at the point where NumberOfWeakHandles() or NumberOfGlobalObjectWeakHandles() is called.

BUG=

Review URL: https://codereview.chromium.org/11958015
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13443 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-21 12:15:31 +00:00
mstarzinger@chromium.org
cd6771b831 Remove unused methods about Node::class_id_
BUG=

Review URL: https://codereview.chromium.org/11983002
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13407 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-17 10:42:17 +00:00
mstarzinger@chromium.org
fd4d32e733 Inline SetWrapperClassId() and WrapperClassId()
BUG=
TEST=test-api.cc (WrapperClassId)

Review URL: https://codereview.chromium.org/11961014
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13405 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-16 16:33:09 +00:00
mstarzinger@chromium.org
4e6525da7e Inline MarkIndependent(), MarkPartiallyDependent(), IsIndependent()
TEST=test-api.cc (IndependentWeakHandle, ApiObjectGroupsCycleForScavenger)

Review URL: https://codereview.chromium.org/11879044
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13391 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-16 10:10:53 +00:00
mstarzinger@chromium.org
5fd157db1b Pack GlobalHandles::Node::state_ and three flags into uint8_t
TEST=test-api.cc (ApiObjectGroupsCycle, ApiObjectGroupsCycleForScavenger, IndependentWeakHandle)

Review URL: https://codereview.chromium.org/11875015
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13383 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-15 10:26:48 +00:00
mstarzinger@chromium.org
eeca7c7759 Add GCTracer metrics for a scavenger GC for DOM wrappers
This patch adds the following three metrics for the --trace_gc_nvp option.

nodes_died_in_new_space_; // Number of died nodes in the new space.
nodes_copied_in_new_space_; // Number of copied nodes to the new space.
nodes_promoted; // Number of promoted nodes to the old space.

BUG=
TEST=Manually confirmed that the "--trace_gc --trace_gc_nvp" option prints the metrics

Review URL: https://codereview.chromium.org/11365146
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13159 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-07 09:44:10 +00:00
mstarzinger@chromium.org
a4c4862ed8 Unify object groups iteration in global handles.
This unifies the iteration logic of objects groups iteration in global
handles. The scavenger as well as mark-and-compact now rely on the same
underlying logic.

R=ulan@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13128 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-04 10:23:43 +00:00
mstarzinger@chromium.org
36d128d7b8 Reshuffle an if() condition to not depend on an uninitialized value.
Node::class_id_ contains garbage for newly allocated (FREE) nodes. This patch
changes the code to first test the node state_, then (for non-FREE nodes),
class_id_, and not the other way around.

This does not affect the branch taken (i.e. the current code is correct),
but makes Valgrind and MSan happy.

Review URL: https://codereview.chromium.org/11362158
Patch from Evgeniy Stepanov <eugenis@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12903 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-08 14:40:55 +00:00
mstarzinger@chromium.org
762c36b6fb Allow collection of DOM objects in minor GC cycles.
A design document: https://docs.google.com/a/google.com/document/d/16DeHrzkm3cO9XCPT1aK3Y5qgUxXB3RFmueqQWYmN2rI/edit

Performance & memory results: https://docs.google.com/a/google.com/document/d/1h0-EsHu7T0sSMuZm5eE0r1e8sCAzY3weLvsDUpOSngE/edit

The WebKit side patch: https://bugs.webkit.org/show_bug.cgi?id=98725

At present no one is using the V8 APIs this patch is going to add. After this patch is landed, the WebKit side patch will use it.

BUG=

Review URL: https://codereview.chromium.org/11085015
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12874 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-06 17:32:15 +00:00
svenpanne@chromium.org
9dc2c5b83d Add an API for enumerating persistent handles
This API lets the embedder enumerate handles that have class ids. WebKit will
use this feature during garbage collection to compute object groups for DOM
nodes. Previously, we kept a list of DOM nodes on the WebKit side, but that
list is redundant with the global handles list in V8.

Review URL: https://codereview.chromium.org/11190011
Patch from Adam Barth <abarth@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12750 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-18 06:52:37 +00:00
vegorov@chromium.org
47b6027c37 Add HeapProfiler::GetPersistentHandleCount to be able to track the number of persistent handles
It turns out that an increasing number of persistent handles is a good signal for bugs in the bindings layer

BUG=none
TEST=cctest/test-heap-profiler/PersistentHandleCount

Review URL: https://chromiumcodereview.appspot.com/9620007
Patch from Jochen Eisinger <jochen@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10960 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-07 17:38:50 +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
vitalyr@chromium.org
da40f3da1d Update comments in the global handles interface.
(I also reordered functions in the .cc file to match the order in the
.h file.)

R=antonm@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8188 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-06 16:18:59 +00:00
vitalyr@chromium.org
5872e8ee2f Refactor storage of global handles.
We used to have a linked list of nodes that were internally
block-allocated.

I kept the node blocks and put them on two lists: 1) the list of all
allocated blocks, 2) the list of blocks with used nodes. (1) is used
to reclaim blocks and (2) is used for traversal during GC. To make
traversal on scavenges faster the nodes holding new space objects are
grouped in an auxiliary array.

This changes the minimal memory usage from 5 words per global handle
to 4. Additional word is used for new space handles.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8186 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-06 15:23:04 +00:00
vitalyr@chromium.org
35211e959e Assert that independent handles do not participate in grouping.
Review URL: http://codereview.chromium.org/7044007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7941 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-18 15:28:43 +00:00
vegorov@chromium.org
925107046e Extend Handle API with MarkIndependent.
Garbage collector is free to ignore object groups for independent handles and can collect then in minor collections.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7915 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-17 12:18:19 +00:00
vitalyr@chromium.org
302037d44e Make object groups and implicit references a bit more lightweight.
We can only call malloc/free once per group and we can avoid scanning
through a list of NULLs if we keep unprocessed groups in the beginning.

I also changed the internal representation of implicit references to
hold a handle to the parent (instead of a direct pointer). The
prologue callback must not trigger a GC, but it's better to be safe.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7521 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-06 19:17:54 +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
antonm@chromium.org
a7bb1d5278 Introduce one way dependencies into object grouping.
Those are necessary to properly manage relationship between objects in cases
when they don't form proper tree structure.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7202 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-16 12:02:28 +00:00
mikhail.naganov@gmail.com
e0829eee10 Fix bit field for GlobalHandles::Node State in MSVC.
TBR=vitalyr@chromium.org
BUG=1243
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7136 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 17:29:37 +00:00
mikhail.naganov@gmail.com
1d45870320 Fix for win32 after r7125. For some reason introducing a bit field into GlobalHandles::Node causes a trouble.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7131 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 13:45:35 +00:00
mikhail.naganov@gmail.com
dee9c00267 Add an interface for an embedder to provide information about native
objects retained by object groups and global handles.

This information is then used during heap snapshot generation
to provide a more complete memory picture.

This patch will be needed to fix https://bugs.webkit.org/show_bug.cgi?id=53659.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7125 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 12:05:31 +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
antonm@chromium.org
ce9a7396dc Fix some fotgotten variable names.
TBR=vegorov@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5762 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-03 13:29:01 +00:00
antonm@chromium.org
20938fc53c Attempt to collect more garbage before panicking with out of memory.
Currently weak handles retain an object for another GC round (oftem times,
major GC round.)  Instrumenting Chromium shows that navigation leaves
many global objects which are only collected in next go.  Let's
attempt to collect more garbage when approacing OOM condition.

This is a better version of rolled out r5455: now it's correctly
rebuilds object groups between additional GCs.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5761 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-03 13:00:28 +00:00
ager@chromium.org
598de609a2 Revert r5455 from bleeding_edge: attempt to collect more garbage
before panicking with out of memory.

TBR=antonm@chromium.org
Review URL: http://codereview.chromium.org/4034002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5681 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-21 06:16:52 +00:00
erik.corry@gmail.com
d46fb9d454 New attempt to make the allocation routines 64 bit clean.
This one has been approved by the 64 bit compiler in MSVC
2005 so I hope it also passes the 2008 version.

The --max-new-space-size option is now in kBytes.
The --max-old-space-size option is now in MBytes.

Some issues remain with 64 bit heaps and the counters.  See
http://code.google.com/p/v8/issues/detail?id=887
Review URL: http://codereview.chromium.org/3573005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5559 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-30 07:22:53 +00:00
erik.corry@gmail.com
2d0c23bc82 Revert attempt to make heap size 32/64 clean. This change needs to
be done from Windows where the compiler is stricter about truncating
changes.
Review URL: http://codereview.chromium.org/3454035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5545 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-28 12:49:25 +00:00
erik.corry@gmail.com
28d7064856 More correctness around PrintF and 32/64 bit values.
Fix test after 64 bit heap size change.
Review URL: http://codereview.chromium.org/3432032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5543 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-28 11:44:30 +00:00