Closed Bug 1654058 Opened 6 years ago Closed 6 years ago

Apparently unused method `static MovableCellHasher<JS::Heap<T>>::rekey(Key&, const Key&)`

Categories

(Core :: JavaScript: GC, task)

task

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: jorendorff, Assigned: jonco)

Details

Attachments

(1 file)

template <typename T>
struct JS_PUBLIC_API MovableCellHasher<JS::Heap<T>> {
  ...
  static void rekey(Key& k, const Key& newKey) { k.unsafeSet(newKey); }
};

I don't think there is an unsafeSet method on JS::Heap<T> (as opposed to JS::HeapPtr<T>). There is an unbarrieredSet method.

I tried changing it from unsafeSet to glooooooorp, and the engine still built fine, so I think this method is unused. searchfox also does not find any callers, although it's not super reliable around templates.

This came up because an embedder mentioned in chat that it doesn't look like it should compile, there not being an unsafeSet method on any relevant class.

Originally we used to rekey our hash tables when GC things were moved but nowadays we generally use MovableCellHasher and key them on unique IDs that don't change when this happens.

Interestingly this exposed one place where the original rekeying strategy was still in use unnecessarily.

Assignee: nobody → jcoppeard
Status: NEW → ASSIGNED
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/39b6121c6943 Remove rekey methods for MovableCellHasher r=sfink
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: