Closed
Bug 1399141
Opened 7 years ago
Closed 7 years ago
Tell JS engine about malloc memory when binding object created
Categories
(Core :: DOM: Core & HTML, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
14.47 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
Following on from bug 1301863 we should inform the JS engine about malloc memory when binding objects are created for the other cases where we currently call JS_updateMallocMemory(). This should give the JS engine a better idea of how much malloc memory is tied to JS objects and allow for better GC scheduling decisions.
Assignee | ||
Comment 1•7 years ago
|
||
The patch does this for the classes CanvasRenderingContext2D and ImageBitmap. I also changed the return type of BindingJSObjectMallocBytes() to size_t.
Attachment #8907110 -
Flags: review?(amarchesini)
Comment 2•7 years ago
|
||
Comment on attachment 8907110 [details] [diff] [review] bug1399141-update-malloc-count-on-binding Review of attachment 8907110 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/canvas/ImageBitmap.cpp @@ +2123,5 @@ > + > + // Calculate how many bytes are used. > + if (mData->GetFormat() == mozilla::ImageFormat::PLANAR_YCBCR) { > + return mData->AsPlanarYCbCrImage()->GetDataSize(); > + } else if (mData->GetFormat() == mozilla::ImageFormat::NV_IMAGE) { I know that this is old code, but, no "} else {" after a return. Just do: if (mData->GetFormat() == mozilla::ImageFormat::PLANAR_YCBCR) { return mData->AsPlanarYCbCrImage()->GetDataSize(); } if (mData->GetFormat() == mozilla::ImageFormat::NV_IMAGE) { return mData->AsNVImage()->GetBufferSize(); } RefPtr<SourceSurface> surface = mData->GetAsSourceSurface(); const int bytesPerPixel = BytesPerPixel(surface->GetFormat()); return surface->GetSize().height * surface->GetSize().width * bytesPerPixel;
Attachment #8907110 -
Flags: review?(amarchesini) → review+
Comment 3•7 years ago
|
||
Should we take it for FF57? Is it pretty safe? What is the perf impact?
Flags: needinfo?(jcoppeard)
Assignee | ||
Comment 4•7 years ago
|
||
No perf impact. I think this is safe to take.
Flags: needinfo?(jcoppeard)
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/ff90282974ce Attribute malloc memory when creating reflector object r=baku
Comment 6•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ff90282974ce
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
Updated•2 years ago
|
Performance Impact: --- → ?
Whiteboard: [qf]
You need to log in
before you can comment on or make changes to this bug.
Description
•