Bug 168137 - StructureStubInfo::considerCaching() should write barrier its owner CodeBlock when buffering a new Structure.
Summary: StructureStubInfo::considerCaching() should write barrier its owner CodeBlock...
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-02-10 11:12 PST by Mark Lam
Modified: 2017-02-10 13:36 PST (History)
7 users (show)

See Also:


Attachments
proposed patch. (9.43 KB, patch)
2017-02-10 11:24 PST, Mark Lam
fpizlo: review+
Details | Formatted Diff | Diff
patch for landing + build fix. (9.56 KB, patch)
2017-02-10 11:48 PST, Mark Lam
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2017-02-10 11:12:47 PST
If we're adding a new structure to StructureStubInfo's bufferedStructures, we should write barrier the StubInfo's owner CodeBlock because that structure may be collected during the next GC.  Write barrier-ing the owner CodeBlock ensures that CodeBlock::finalizeBaselineJITInlineCaches() is called on it during the GC, which, in turn, gives the StructureStubInfo the opportunity to filter out the dead structure.
Comment 1 Mark Lam 2017-02-10 11:13:07 PST
<rdar://problem/28656664>
Comment 2 Mark Lam 2017-02-10 11:24:10 PST
Created attachment 301182 [details]
proposed patch.
Comment 3 Filip Pizlo 2017-02-10 11:26:00 PST
Comment on attachment 301182 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=301182&action=review

Nice.

> Source/JavaScriptCore/bytecode/StructureStubInfo.h:2
> - * Copyright (C) 2008, 2012-2016 Apple Inc. All rights reserved.
> + * Copyright (C) 2008, 2012-2017 Apple Inc. All rights reserved.

I think that we're supposed to write this as "2008-2017".
Comment 4 Mark Lam 2017-02-10 11:48:13 PST
Created attachment 301188 [details]
patch for landing + build fix.
Comment 5 Mark Lam 2017-02-10 13:36:43 PST
Thanks for the review.  Landed in r212146: <http://trac.webkit.org/r212146>.