Closed Bug 1590881 Opened 5 years ago Closed 5 years ago

[jsdbg2] `BreakpointSite::type`, `asJS` and `asWasm` are a poor fit for the abstract base class concept

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: jimb, Assigned: loganfsmyth)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The BreakpointSite abstract base class has a Type enum and a type method, which is inconsistent with the idea of an abstract base class, since it forces the base class to enumerate all the concrete classes. The reader cannot assume that logic specific to each concrete class is actually localized in that class's implementation, since any user of a BreakpointSite can downcast it.

It would be easy enough to replace uses of type, isJS and isWasm with virtual methods that serve the same purposes they're put to:

  • retrieving the owning cell, for memory use tracking
  • retrieving the code's realm, for use in debuggee removal

Then Type, type, asWasm, and asJS could be removed.

Priority: -- → P3
Assignee: nobody → loganfsmyth
Blocks: dbg-72
Status: NEW → ASSIGNED
Pushed by loganfsmyth@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/aad72f40920e
Remove BreakpointSite .type/asWasm()/asJS() to simplify interface. r=jimb
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: