Bug 160531 - Pass JSGlobalObject* to the generated finishCreation functions
Summary: Pass JSGlobalObject* to the generated finishCreation functions
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks: 117870
  Show dependency treegraph
 
Reported: 2016-08-03 15:56 PDT by Simon Fraser (smfr)
Modified: 2016-11-13 08:06 PST (History)
6 users (show)

See Also:


Attachments
Patch (43.13 KB, patch)
2016-08-03 15:57 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2016-08-03 15:56:15 PDT
Pass JSGlobalObject* to the generated finishCreation functions
Comment 1 Simon Fraser (smfr) 2016-08-03 15:57:54 PDT
Created attachment 285285 [details]
Patch
Comment 2 Daniel Bates 2016-08-03 16:15:27 PDT
Comment on attachment 285285 [details]
Patch

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

> Source/WebCore/bindings/scripts/test/TestObj.idl:49
> +    EnabledAtRuntime=EnableFeatureName,

Did you intend to make this change?
Comment 3 Darin Adler 2016-08-05 23:13:40 PDT
Comment on attachment 285285 [details]
Patch

Can we make this new argument be a reference instead of a pointer?
Comment 4 Simon Fraser (smfr) 2016-08-05 23:27:30 PDT
I would love to but some callers take a pointer. In general, it's confusing how we pass around both a VM& and a JSGlobalObject* all over, since we normally get the VM from the GO.
Comment 5 Darin Adler 2016-08-05 23:30:50 PDT
(In reply to comment #4)
> I would love to but some callers take a pointer.

Are you saying that the pointer can be null? Or that we can’t easily add the "*" that would turn those pointers into references? Or something else?
Comment 6 Simon Fraser (smfr) 2016-08-06 09:58:31 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > I would love to but some callers take a pointer.
> 
> Are you saying that the pointer can be null?

Unknown without digging into JSC, and I don't understand whether the VM and JSGO can come from different places.

I may need to revise this patch anyway so I'll hold off from checking it in.
Comment 7 Chris Dumez 2016-08-06 14:45:18 PDT
Comment on attachment 285285 [details]
Patch

This may be a silly question but what prevents you from calling globalObject() in finishCreation() instead of passing the globalObject in parameter? It looks like we already do this for RuntimeEnabled features.
Comment 8 Geoffrey Garen 2016-08-11 15:39:07 PDT
> This may be a silly question but what prevents you from calling
> globalObject() in finishCreation() instead of passing the globalObject in
> parameter? It looks like we already do this for RuntimeEnabled features.

Probably nothing prevents you from calling globalObject() -- but if you have the global object already, you save a few loads by passing it instead of calling globalObject().
Comment 9 Simon Fraser (smfr) 2016-11-13 08:06:40 PST
I don't need this (it was about getting to Settings from bindings, and our generator already supports that).