Use js::HashTable instead of JSDHashTable in XPConnect

RESOLVED FIXED in mozilla14

Status

()

Core
XPConnect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: terrence, Assigned: terrence)

Tracking

Trunk
mozilla14
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
Created attachment 608931 [details] [diff] [review]
v0: reimplement JSObject2JSObjectMap

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+
(Assignee)

Comment 2

5 years ago
Created attachment 609778 [details] [diff] [review]
v1: Updated with review feedback.

https://tbpl.mozilla.org/?tree=Try&rev=8945819e2b7a
Attachment #608931 - Attachment is obsolete: true
Attachment #609778 - Flags: review+
(Assignee)

Comment 3

5 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/61b214270824

Comment 4

5 years ago
https://hg.mozilla.org/mozilla-central/rev/61b214270824
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.