Closed Bug 1607596 Opened 4 years ago Closed 4 years ago

Don't fire onNativeCall when the current script is self hosted

Categories

(Core :: JavaScript Engine, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The debugger's onNativeCall hook fires when either a C++ native or a self-hosted function is called from script, so that users of this API don't need to care about whether a builtin function is implemented in JS or C++. This leads, however, to any calls within the self-hosted function to other self-hosted functions or to C++ natives (which will generally be an intrinsic only for use in self hosted code) will also be treated as native calls and fire the hook. This means that callers using the onNativeCall hook have to deal with a lot of functions they don't have any understanding of.

My original plan for dealing with this (bug 1576776 comment 8) was to require the devtools to use a whitelist of these internal methods, but this is pretty unsatisfactory. Looking again, it should be straightforward to avoid firing the onNativeCall hook when these internal methods are called: if the topmost script on the stack is self hosted, don't fire the onNativeCall hook. Making this change to the semantics will make it a lot easier to use this hook for supporting eager evaluation (bug 1460518).

Type: task → enhancement
Blocks: 1607608
Priority: -- → P2
Pushed by bhackett@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b3d4e8c45af2
Don't fire onNativeCall when the current script is self hosted, r=loganfsmyth.
Pushed by bhackett@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f35a1ad5b492
Don't fire onNativeCall when the current script is self hosted, r=loganfsmyth.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
Flags: needinfo?(bhackett1024)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: