GC: missing barriers in NewObjectCache::newObjectFromHit

RESOLVED FIXED in mozilla13

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: terrence, Assigned: terrence)

Tracking

Trunk
mozilla13
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
We should replace these tiny memcpys with direct assignment so that we trigger the barriers automatically through the operator= set in the HeapPtr<>.
(Assignee)

Comment 1

6 years ago
Created attachment 588142 [details] [diff] [review]
v0
Attachment #588142 - Flags: review?(wmccloskey)
(Assignee)

Comment 2

6 years ago
Created attachment 588283 [details] [diff] [review]
v1: a friendlier version

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

Comment 4

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/72c55496b6e9
https://hg.mozilla.org/mozilla-central/rev/72c55496b6e9
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.