Closed Bug 738868 Opened 9 years ago Closed 9 years ago

Use js::HashTable instead of JSDHashTable in XPConnect

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: terrence, Assigned: terrence)

References

Details

Attachments

(1 file, 1 obsolete file)

The new JS HashTable is easier to use, easier to understand, and, most importantly, we are building tools to make the new hash tables work well with a moving GC. The JSDHashTables in XPConnect are the last in the tree and it's time for them to go.

This is my first patch against XPConnect, so I've limited myself ot a single table: the JSObject2JSObjectMap used for waivers.  The diffstat for this patch is:

4 files changed, 40 insertions(+), 103 deletions(-)

I think it's a good start.
Attachment #608931 - Flags: review?(mrbkap)
Comment on attachment 608931 [details] [diff] [review]
v0: reimplement JSObject2JSObjectMap

Review of attachment 608931 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/xpconnect/src/XPCMaps.h
@@ +786,5 @@
>  
> +    void Sweep() {
> +        for (Map::Enum e(mTable); !e.empty(); e.popFront())
> +            if (JS_IsAboutToBeFinalized(e.front().key) || JS_IsAboutToBeFinalized(e.front().value))
> +                e.popFront();

Nit: Braces around the for loop's body.

@@ +791,3 @@
>      }
>  
> +    void Reparent(JSContext *aCx, JSObject *aNewInner) {

This function lost a comment that should have moved with it.
Attachment #608931 - Flags: review?(mrbkap) → review+
https://hg.mozilla.org/mozilla-central/rev/61b214270824
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.