Bug 32103

Summary: Add zombies to JSC
Product: WebKit Reporter: Oliver Hunt <oliver>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ggaren, webkit.review.bot, zombie
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Patch barraclough: review+

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