Open Bug 1572562 Opened 5 years ago Updated 2 years ago

[jsdbg2] DebuggerWeakMap instances cost more in code size than they should.

Categories

(Core :: JavaScript Engine, defect, P2)

defect

Tracking

()

People

(Reporter: jimb, Unassigned)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

In Bug 1567245 patch D38539, I added a type parameter to DebuggerWeakMap for the value type. Unfortunately, this resulted in a ~60kiB increase in code size.

I think we could recover much of this by allowing the underlying WeakMap to always use JSObject* as its value type, as it did before the patch, and then having DebuggerWeakMap methods downcast as necessary.

Unfortunately, the patch won't be small in terms of lines changed: WeakMap uses a lot of member types in its API (Ptr, AddPtr, Enum) that will now need custom counterparts in DebuggerWeakMap. But I expect all these methods could be simple inline wrappers for calls to the more weakly typed methods on the WeakMap's types.

Type: task → defect
Regressed by: 1567245
Keywords: regression

Bug 1567245 patch D38543 also needs to be evaluated in this light.

Priority: -- → P2
Has Regression Range: --- → yes
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.