Closed
Bug 891585
Opened 11 years ago
Closed 11 years ago
Avoid unnecessary JS_WrapValue calls when returning typed arrays in WebIDL bindings
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla25
People
(Reporter: bzbarsky, Assigned: bzbarsky)
Details
(Keywords: perf)
Attachments
(2 files, 1 obsolete file)
376 bytes,
text/html
|
Details | |
9.03 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
The attached testcase gets >2x faster with the upcoming patch.
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #772901 -
Flags: review?(peterv)
Comment 2•11 years ago
|
||
Comment on attachment 772901 [details] [diff] [review] Don't JS_WrapValue same-compartment typed array return values in bindings code (e.g. ImageData.data). Review of attachment 772901 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bindings/BindingUtils.h @@ +576,5 @@ > + } > + return MaybeWrapObjectValue(cx, rval); > +} > + > +// Wrapping for objects that are known to not be DOM or XPConnect objects Can we assert that?
Assignee | ||
Comment 3•11 years ago
|
||
> Can we assert that?
Yes.
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #773283 -
Flags: review?(peterv)
Assignee | ||
Updated•11 years ago
|
Attachment #772901 -
Attachment is obsolete: true
Attachment #772901 -
Flags: review?(peterv)
Comment 5•11 years ago
|
||
Comment on attachment 773283 [details] [diff] [review] With more asserts Review of attachment 773283 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bindings/BindingUtils.h @@ +586,5 @@ > + MOZ_ASSERT(!GetDOMClass(&rval.toObject())); > +#ifdef DEBUG > + js::Class* clasp = js::GetObjectClass(&rval.toObject()); > + MOZ_ASSERT(!(clasp->flags & JSCLASS_HAS_PRIVATE) || > + !(clasp->flags & JSCLASS_PRIVATE_IS_NSISUPPORTS)); Isn't checking for JSCLASS_PRIVATE_IS_NSISUPPORTS enough?
Attachment #773283 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 6•11 years ago
|
||
> Isn't checking for JSCLASS_PRIVATE_IS_NSISUPPORTS enough?
Right you are.
Assignee | ||
Comment 7•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/88d451420219
Comment 8•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/88d451420219
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•