Last Comment Bug 712488 - GC: missing barrier in JSFunction clone
: GC: missing barrier in JSFunction clone
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla12
Assigned To: Terrence Cole [:terrence]
:
: Jason Orendorff [:jorendorff]
Mentors:
Depends on:
Blocks: 673454
  Show dependency treegraph
 
Reported: 2011-12-20 16:01 PST by Terrence Cole [:terrence]
Modified: 2011-12-22 03:47 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (1.25 KB, patch)
2011-12-20 16:01 PST, Terrence Cole [:terrence]
no flags Details | Diff | Splinter Review
v2 (1.69 KB, patch)
2011-12-20 16:56 PST, Terrence Cole [:terrence]
wmccloskey: review+
Details | Diff | Splinter Review

Description Terrence Cole [:terrence] 2011-12-20 16:01:52 PST
Created attachment 583328 [details] [diff] [review]
v1

When we clone a function, we need post barriers after assigning the internal JSScript and JSObject pointers into the new object.
Comment 1 Terrence Cole [:terrence] 2011-12-20 16:56:31 PST
Created attachment 583343 [details] [diff] [review]
v2

Much more elegant with Bill's IRL feedback.
Comment 2 [PTO to Dec5] Bill McCloskey (:billm) 2011-12-21 16:57:32 PST
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.
Comment 3 Terrence Cole [:terrence] 2011-12-21 17:25:51 PST
http://hg.mozilla.org/integration/mozilla-inbound/rev/a51c0f8b8be1
Comment 4 Ed Morley [:emorley] 2011-12-22 03:47:19 PST
https://hg.mozilla.org/mozilla-central/rev/a51c0f8b8be1

Note You need to log in before you can comment on or make changes to this bug.