Closed Bug 712488 Opened 13 years ago Closed 13 years ago

GC: missing barrier in JSFunction clone

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: terrence, Assigned: terrence)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch v1 (obsolete) — Splinter Review
When we clone a function, we need post barriers after assigning the internal JSScript and JSObject pointers into the new object.
Attachment #583328 - Flags: review?(wmccloskey)
Attached patch v2Splinter Review
Much more elegant with Bill's IRL feedback.
Assignee: general → terrence
Attachment #583328 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #583328 - Flags: review?(wmccloskey)
Attachment #583343 - Flags: review?(wmccloskey)
Comment on attachment 583343 [details] [diff] [review]
v2

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

::: js/src/jsfun.cpp
@@ +2199,5 @@
>  
>      clone->nargs = fun->nargs;
>      clone->flags = fun->flags & ~JSFUN_EXTENDED;
> +    if (fun->isInterpreted()) {
> +        clone->initScript(fun->u.i.script_);

Please change fun->u.i.script_ to fun->script(). Otherwise it looks good.
Attachment #583343 - Flags: review?(wmccloskey) → review+
https://hg.mozilla.org/mozilla-central/rev/a51c0f8b8be1
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: