Closed
Bug 795768
Opened 12 years ago
Closed 12 years ago
Clean up various JSContext uses
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla18
People
(Reporter: n.nethercote, Assigned: n.nethercote)
Details
(Whiteboard: [js:t])
Attachments
(2 files, 2 obsolete files)
38.75 KB,
patch
|
sfink
:
review+
|
Details | Diff | Splinter Review |
88.33 KB,
patch
|
sfink
:
review+
|
Details | Diff | Splinter Review |
I have found a bunch of simplifications involving JSContext, e.g. lots of dead parameters. Patches coming shortly.
Assignee | ||
Comment 1•12 years ago
|
||
This patch removes lots of dead JSContext* occurrences, mostly arguments. - I converted a few internal JS_free() calls to js_free(). I didn't remove JS_free()'s JSContext* argument even though it's not used, since it's an API function. - I also left JS_GetTypeName() untouched because it's an API function. - You should check the jsprobes changes more closely than the others, because that code isn't compiled by default and I haven't tested with the appropriate configuration(s).
Attachment #666401 -
Flags: review?(sphink)
Assignee | ||
Comment 2•12 years ago
|
||
This patch removes a loathesome and ancient (pre-Mercurial) macro that hides |cx| uses and caused me much grief while writing the previous patch. Good riddance.
Attachment #666402 -
Flags: review?(sphink)
Assignee | ||
Comment 3•12 years ago
|
||
I found another dead |cx| parameter.
Attachment #666423 -
Flags: review?(sphink)
Assignee | ||
Updated•12 years ago
|
Attachment #666401 -
Attachment is obsolete: true
Attachment #666401 -
Flags: review?(sphink)
Comment 4•12 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #1) > Created attachment 666401 [details] [diff] [review] > (part 1) - Remove lots of dead JSContext* occurrences. > > This patch removes lots of dead JSContext* occurrences, mostly arguments. > > - I converted a few internal JS_free() calls to js_free(). I didn't remove > JS_free()'s JSContext* argument even though it's not used, since it's an > API function. > > - I also left JS_GetTypeName() untouched because it's an API function. Feel free to remove a few useless |cx|s from the API, if you think it helps.
Comment 5•12 years ago
|
||
Comment on attachment 666402 [details] [diff] [review] (part 2) - De-macroize js_GetSrcNote(). Review of attachment 666402 [details] [diff] [review]: ----------------------------------------------------------------- Funny patch.
Attachment #666402 -
Flags: review?(sphink) → review+
Assignee | ||
Comment 6•12 years ago
|
||
This version removes the |cx| args from the JSAPI functions, as per dmandelin's suggestion.
Attachment #666767 -
Flags: review?(sphink)
Assignee | ||
Updated•12 years ago
|
Attachment #666423 -
Attachment is obsolete: true
Attachment #666423 -
Flags: review?(sphink)
Assignee | ||
Updated•12 years ago
|
Attachment #666423 -
Flags: review?(sphink)
Assignee | ||
Updated•12 years ago
|
Attachment #666423 -
Attachment is obsolete: false
Assignee | ||
Updated•12 years ago
|
Attachment #666767 -
Attachment is obsolete: true
Attachment #666767 -
Flags: review?(sphink)
Assignee | ||
Comment 7•12 years ago
|
||
> This version removes the |cx| args from the JSAPI functions, as per
> dmandelin's suggestion.
Actually, this patch breaks the browser because I didn't make the necessary changes, and I've now decided that it's not worth the trouble. Back to the previous patch, sorry for the noise.
Comment 8•12 years ago
|
||
Comment on attachment 666423 [details] [diff] [review] (part 1) - Remove lots of dead JSContext* occurrences. Review of attachment 666423 [details] [diff] [review]: ----------------------------------------------------------------- This patch seems great. I was surprised that several of these places don't need a cx (anymore?) I should really go through the probes stuff. I bet I could get rid of most of those cx's now.
Comment 9•12 years ago
|
||
Comment on attachment 666423 [details] [diff] [review] (part 1) - Remove lots of dead JSContext* occurrences. Whoops, forgot the r+ mark.
Attachment #666423 -
Flags: review?(sphink) → review+
Assignee | ||
Comment 10•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/9c656027f5c2 https://hg.mozilla.org/integration/mozilla-inbound/rev/c92d00f777de > I should really go through the probes stuff. I bet I could get rid of most > of those cx's now. I looked again and couldn't see any obviously dead ones.
Comment 11•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/9c656027f5c2 https://hg.mozilla.org/mozilla-central/rev/c92d00f777de
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in
before you can comment on or make changes to this bug.
Description
•