Bug 156764 - Consider gathering backtraces at allocation sites to show in the web inspector
Summary: Consider gathering backtraces at allocation sites to show in the web inspector
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-04-19 15:35 PDT by Saam Barati
Modified: 2017-01-18 23:39 PST (History)
15 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2016-04-19 15:35:13 PDT
A possible implementation could be done purely at the byte code level.
Store a private property on the object that was just allocated which contains
whatever meta information you want. It could be a backtrace. It could be a
code location.
Comment 1 Oliver Hunt 2016-04-19 15:39:56 PDT
Maybe we could even just limit it to larger (for some clarification of what that means) allocations so it could be almost(?) always-on?
Comment 2 Saam Barati 2016-04-19 21:33:48 PDT
(In reply to comment #1)
> Maybe we could even just limit it to larger (for some clarification of what
> that means) allocations so it could be almost(?) always-on?

I'm not sure how you could easily do such a thing easily. Object size
grows as the object lives longer. I guess you could have some kind
of a system that starts by profiling everything and then backs off
slowly to only profile some things as it figures out the tendency
of the program's allocations. That seems hard and I'm not even
sure it would work. 

Were you thinking of a particular mechanism when you suggested this?
Comment 3 Radar WebKit Bug Importer 2016-04-28 17:20:33 PDT
<rdar://problem/25994092>