Closed Bug 716069 Opened 12 years ago Closed 12 years ago

GC: missing barriers in NewObjectCache::newObjectFromHit

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: terrence, Assigned: terrence)

Details

Attachments

(1 file, 1 obsolete file)

We should replace these tiny memcpys with direct assignment so that we trigger the barriers automatically through the operator= set in the HeapPtr<>.
Attached patch v0 (obsolete) — Splinter Review
Attachment #588142 - Flags: review?(wmccloskey)
I had forgotten that I haven't landed the patch to put JSGC_GENERATIONAL in tree yet, so I missed the need to friend JSObject and NewObjectCache.
Attachment #588142 - Attachment is obsolete: true
Attachment #588142 - Flags: review?(wmccloskey)
Attachment #588283 - Flags: review?(wmccloskey)
Comment on attachment 588283 [details] [diff] [review]
v1: a friendlier version

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

::: js/src/jsobj.h
@@ +1677,5 @@
>  
>    private:
>      inline bool lookup(Class *clasp, gc::Cell *key, gc::AllocKind kind, EntryIndex *pentry);
>      inline void fill(EntryIndex entry, Class *clasp, gc::Cell *key, gc::AllocKind kind, JSObject *obj);
> +    static inline void copyCachedToObject(JSObject *tgt, JSObject *src);

Please use dst for the name. It's more standard.

::: js/src/jsobjinlines.h
@@ +1590,5 @@
>      return fill(entry, clasp, type, kind, obj);
>  }
>  
> +inline void
> +NewObjectCache::copyCachedToObject(JSObject *tgt, JSObject *src) {

Use dst here too. Also, the { brace goes on its own line.
Attachment #588283 - Flags: review?(wmccloskey) → review+
https://hg.mozilla.org/mozilla-central/rev/72c55496b6e9
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.