Bug 115594 - fourthTier: CodeBlock should be RefCounted
Summary: fourthTier: CodeBlock should be RefCounted
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks: 112839
  Show dependency treegraph
 
Reported: 2013-05-04 13:43 PDT by Filip Pizlo
Modified: 2013-05-09 19:44 PDT (History)
7 users (show)

See Also:


Attachments
the patch (33.02 KB, patch)
2013-05-09 18:28 PDT, Filip Pizlo
ggaren: 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 2013-05-04 13:43:53 PDT
This will get rid of a bunch of weird ownership rules, and make the implementation of concurrent compilation a heck of a lot easier.
Comment 1 Geoffrey Garen 2013-05-04 13:50:37 PDT
Can we use GC for this instead? Inside the GC heap, it's easier when GC objects point to other GC objects.
Comment 2 Filip Pizlo 2013-05-04 13:54:23 PDT
(In reply to comment #1)
> Can we use GC for this instead? Inside the GC heap, it's easier when GC objects point to other GC objects.

Probably, eventually.  But right now CodeBlock has a weird relationship with the GC - the GC does have a say in when a CodeBlock dies but not in the usual sense of tracing - so we'll have to be careful when we do that.  There's also the issue that how a CodeBlock is traced depends on who owns it (either Executable or the GC itself), so it's not like making it GC'd would simplify its visit methods.

For now, I don't see a clear benefit to making CodeBlock GC'd.  It's true that doing so would mean that Executable would not have to be destructible, but I think that's really the only benefit.

On the other hand, there is a clear benefit to making it ref-counted.
Comment 3 Filip Pizlo 2013-05-09 18:28:32 PDT
Created attachment 201308 [details]
the patch

Not setting r? yet because I'm still running tests.
Comment 4 Filip Pizlo 2013-05-09 18:44:19 PDT
(In reply to comment #3)
> Created an attachment (id=201308) [details]
> the patch
> 
> Not setting r? yet because I'm still running tests.

It's perf neutral.
Comment 5 Geoffrey Garen 2013-05-09 19:41:07 PDT
Comment on attachment 201308 [details]
the patch

r=me
Comment 6 Filip Pizlo 2013-05-09 19:44:45 PDT
Landed in http://trac.webkit.org/changeset/149860