Closed
Bug 1379461
Opened 8 years ago
Closed 8 years ago
Return RegExpShared* instead of using bool + outparam
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla56
| Tracking | Status | |
|---|---|---|
| firefox56 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
Details
Attachments
(2 files)
|
51.49 KB,
patch
|
evilpies
:
review+
|
Details | Diff | Splinter Review |
|
723 bytes,
patch
|
sfink
:
review+
|
Details | Diff | Splinter Review |
There are a lot of places where we can return RegExpShared* instead of returning bool and using a RegExpShared outparam. This is cleaner and lets us eliminate a bunch of unnecessary roots.
This is a very mechanical patch. I did have to beef up the FORWARD macro in the js/ipc CPOW code to let us return nullptr on failure instead of false.
Attachment #8884624 -
Flags: review?(evilpies)
Updated•8 years ago
|
Attachment #8884624 -
Flags: review?(evilpies) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3a0a2ffe803b
Refactor code to return RegExpShared* directly instead of using bool + outparam. r=evilpie
Comment 2•8 years ago
|
||
backed out for hazard failure like https://treeherder.mozilla.org/logviewer.html#?job_id=113286186&repo=mozilla-inbound
Flags: needinfo?(jdemooij)
Backout by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8dad48102b13
Backed out changeset 3a0a2ffe803b for hazard failure
| Assignee | ||
Comment 4•8 years ago
|
||
We use the macro below in the CPOW code.
The analysis thinks that when the return value is a RegExpShared*, it's live across a GC call: AUTO_PROFILER_LABEL macro -> ~AutoProfilerLabel destructor.
This is bogus because ~AutoProfilerLabel has an indirect call but definitely can't GC.
I think the easiest fix is to teach the analysis that ~AutoProfilerLabel cannot GC. Unfortunately this code is in mozglue so I don't think we can use our SuppressGCAnalysis class for this.
This patch adds an annotation and I get a green analysis build with this on Try.
#define FORWARD(call, args, failRetVal) \
AUTO_PROFILER_LABEL(__func__, JS); \
WrapperOwner* owner = OwnerOf(proxy); \
if (!owner->active()) { \
JS_ReportErrorASCII(cx, "cannot use a CPOW whose process is gone"); \
return failRetVal; \
} \
if (!owner->allowMessage(cx)) { \
return failRetVal; \
} \
{ \
CPOWTimer timer(cx); \
return owner->call args; \
}
Flags: needinfo?(jdemooij)
Attachment #8885247 -
Flags: review?(sphink)
Updated•8 years ago
|
Attachment #8885247 -
Flags: review?(sphink) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/707b8c089de2
Refactor code to return RegExpShared* directly instead of using bool + outparam. r=evilpie,sfink
Comment 6•8 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in
before you can comment on or make changes to this bug.
Description
•