Closed
Bug 891585
Opened 12 years ago
Closed 12 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•12 years ago
|
||
Attachment #772901 -
Flags: review?(peterv)
Comment 2•12 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•12 years ago
|
||
> Can we assert that?
Yes.
![]() |
Assignee | |
Comment 4•12 years ago
|
||
Attachment #773283 -
Flags: review?(peterv)
![]() |
Assignee | |
Updated•12 years ago
|
Attachment #772901 -
Attachment is obsolete: true
Attachment #772901 -
Flags: review?(peterv)
Comment 5•12 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•12 years ago
|
||
> Isn't checking for JSCLASS_PRIVATE_IS_NSISUPPORTS enough?
Right you are.
![]() |
Assignee | |
Comment 7•12 years ago
|
||
Comment 8•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•