Last Comment Bug 710950 - JSScript::function_ is not barriered
: JSScript::function_ is not barriered
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla11
Assigned To: Terrence Cole [:terrence]
: Jason Orendorff [:jorendorff]
Depends on:
Blocks: 673454
  Show dependency treegraph
Reported: 2011-12-14 18:09 PST by Terrence Cole [:terrence]
Modified: 2011-12-16 05:57 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

v1: barrier function_ (2.16 KB, patch)
2011-12-15 15:20 PST, Terrence Cole [:terrence]
wmccloskey: review+
Details | Diff | Splinter Review
v2: With review feedback. (2.15 KB, patch)
2011-12-15 17:34 PST, Terrence Cole [:terrence]
no flags Details | Diff | Splinter Review

Description User image Terrence Cole [:terrence] 2011-12-14 18:09:42 PST
This is immutable, but will need to be barriered for generational GC.  JSFunction is a JSObject, so this should not be difficult to add.
Comment 1 User image Terrence Cole [:terrence] 2011-12-15 15:20:48 PST
Created attachment 582124 [details] [diff] [review]
v1: barrier function_

The field is immutable, so we can return an unwrapped pointer and don't have to worry about it for incremental barriers.  We do need post barriers on it during init for detecting cross-generation pointers, however.  Just make it a normal HeapPtr.
Comment 2 User image Bill McCloskey (:billm) 2011-12-15 15:36:26 PST
Comment on attachment 582124 [details] [diff] [review]
v1: barrier function_

Review of attachment 582124 [details] [diff] [review]:

Good to see these getting fixed!

::: js/src/jsscript.h
@@ +528,5 @@
>      js::ScriptOpcodeCounts pcCounters;
>    private:
> +    js::DebugScript         *debug;
> +    js::HeapPtr<JSFunction> function_;

js::HeapPtrFunction is shorter.
Comment 3 User image Terrence Cole [:terrence] 2011-12-15 17:34:21 PST
Created attachment 582153 [details] [diff] [review]
v2: With review feedback.
Comment 4 User image Terrence Cole [:terrence] 2011-12-15 17:36:38 PST
Comment 5 User image Ed Morley [:emorley] 2011-12-16 05:57:42 PST

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