Bug 32103 - Add zombies to JSC
Summary: Add zombies to JSC
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-02 21:47 PST by Oliver Hunt
Modified: 2009-12-03 12:38 PST (History)
3 users (show)

See Also:


Attachments
Patch (13.08 KB, patch)
2009-12-02 21:53 PST, Oliver Hunt
barraclough: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2009-12-02 21:47:31 PST
While working on GC issues recently I found it useful to implement zombies in JSC.  With a few assertions added it nailed the gc bugs i was hunting fairly quickly so i figure in the interests of saving people time in future it should get placed in trunk.
Comment 1 Oliver Hunt 2009-12-02 21:53:58 PST
Created attachment 44209 [details]
Patch
Comment 2 WebKit Review Bot 2009-12-02 21:57:09 PST
style-queue ran check-webkit-style on attachment 44209 [details] without any errors.
Comment 3 Gavin Barraclough 2009-12-02 22:17:41 PST
Comment on attachment 44209 [details]
Patch

> -#define COLLECT_ON_EVERY_ALLOCATION 0
> +#define COLLECT_ON_EVERY_ALLOCATION 1

Yeah, I don't think you mean that.  I'm only guessing.

> -                        imp->~JSCell();
> +#if ENABLE(JSC_ZOMBIES)
> +                        if (!imp->isZombie()) {
> +                            const ClassInfo* info = imp->classInfo();
> +#endif
> +                            imp->~JSCell();
> +#if ENABLE(JSC_ZOMBIES)
> +                            new (imp) JSZombie(info, JSZombie::leakedZombieStructure());
> +                            heap.numZombies++;
> +                        }
> +#endif

Personally I think this might be a little nicer as:

#if ENABLE(JSC_ZOMBIES)
                        if (!imp->isZombie()) {
                            const ClassInfo* info = imp->classInfo();
                            imp->~JSCell();
                            new (imp) JSZombie(info, JSZombie::leakedZombieStructure());
                            heap.numZombies++;
                        }
#else
                        imp->~JSCell();
#endif


BRRrrrraaaiiiiiinnnnzzzzzzzzzzzzzzzzzzzzz+
Comment 4 Oliver Hunt 2009-12-02 22:26:43 PST
Committed r51624
Comment 5 JSC Zombie 2009-12-02 22:57:16 PST
MMmoorrre BRRrrrraaaiiiiiinnnnzzzzzzzzzzzzzzzzzzzzz.
Comment 6 Geoffrey Garen 2009-12-03 12:38:42 PST
LOL