Bug 162006 - There is no good reason for WeakBlock to care about newly allocated objects
Summary: There is no good reason for WeakBlock to care about newly allocated objects
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks: 149432
  Show dependency treegraph
 
Reported: 2016-09-14 19:45 PDT by Filip Pizlo
Modified: 2016-09-15 10:19 PDT (History)
12 users (show)

See Also:


Attachments
possibly the patch (4.90 KB, patch)
2016-09-14 19:48 PDT, Filip Pizlo
fpizlo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2016-09-14 19:45:51 PDT
WeakBlock scans itself in two modes:

visit: if a Weak in the block belongs to an unmarked object, ask the Weak to consider whether it should do things.
reap: if a Weak in a block belongs to an unmarked object, delete the Weak.

Except that "unmarked" has a peculiar meaning: WeakBlock defines it as !markedOrNewlyAllocated.  So, a newly allocated object will never be consulted about anything.  That sounds scary until you realize that newlyAllocated must have been cleared before we even got here.

So, we were paying the price of checking newlyAllocated for no reason.
Comment 1 Filip Pizlo 2016-09-14 19:48:35 PDT
Created attachment 288919 [details]
possibly the patch
Comment 2 Filip Pizlo 2016-09-15 10:17:45 PDT
Comment on attachment 288919 [details]
possibly the patch

r=ggaren in person
Comment 3 Filip Pizlo 2016-09-15 10:19:32 PDT
Landed in https://trac.webkit.org/changeset/205979