Skip to content
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.

Implementation idea to get where a given object has been allocated #10

Open
DavidBruant opened this issue Aug 30, 2013 · 0 comments
Open
Milestone

Comments

@DavidBruant
Copy link
Owner

Relevant low-level primitive

SetObjectMetadataCallback allows to set a per-compartment callback (and metadata returned by the callback (reuse the same object if it represents the same value for shape sharing reasons)) that is called right before an object is allocated for this compartment.

Using this primitive

One idea is to set a callback that is called when an object is about to be allocated and looks what the latest frame is and where we're stopped (and line/col source position).

Missing parts

This API is C++ and can't interact with an addon written in JS. After discussion with JimB, exposing this API goes as follow:

  • expose a function to JSDebugger
  • implement it in the cpp file (look at this for an example of implementation of exposing this cap to the JS shell)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant