Add description of post-barriers

RESOLVED FIXED in mozilla29

Status

()

--
enhancement
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: evilpie, Assigned: jonco)

Tracking

unspecified
mozilla29
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qa-])

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
There is very interesting description of per-barriers, but no detailed description of post-barriers. I would be interested in reading that. http://mxr.mozilla.org/mozilla-central/source/js/src/gc/Barrier.h?force=1#98
(Reporter)

Updated

5 years ago
Severity: normal → enhancement
OS: Linux → All
Hardware: x86_64 → All
(Reporter)

Updated

5 years ago
Blocks: 673454
Not a JIT bug, but I agree a comment would be nice.
Component: JavaScript Engine: JIT → JavaScript Engine
(Assignee)

Comment 2

5 years ago
Created attachment 8348092 [details] [diff] [review]
postbarrier-doc

I added some comments for this.

I could expand this further so let me know if you have any suggestions.
Assignee: nobody → jcoppeard
Attachment #8348092 - Flags: review?(wmccloskey)
Comment on attachment 8348092 [details] [diff] [review]
postbarrier-doc

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

Thanks for writing this.

::: js/src/gc/Barrier.h
@@ +96,5 @@
>   *
>   *                                POST-BARRIER
>   *
> + * For generational GC, we want to be able to quickly collect the nursery in a
> + * minor collection.  Part of the way this is acheived is to only mark the

achieved

@@ +97,5 @@
>   *                                POST-BARRIER
>   *
> + * For generational GC, we want to be able to quickly collect the nursery in a
> + * minor collection.  Part of the way this is acheived is to only mark the
> + * nursery itself - tenured things, which may form the majority of the heap, are

I'm used to seeing two or three dash characters instead of one (maybe that's because I'm American though?). A semicolon would probably make sense also.

@@ +99,5 @@
> + * For generational GC, we want to be able to quickly collect the nursery in a
> + * minor collection.  Part of the way this is acheived is to only mark the
> + * nursery itself - tenured things, which may form the majority of the heap, are
> + * not traced through or marked.  This leads to the problem of what to do about
> + * tenured objects that have pointers into the nursery -- if such things are not

I would use a period or colon here instead of the dash.

@@ +106,5 @@
> + * and mark their targets when we start a minor collection.
> + *
> + * The pointers can be thoughs of as edges in object graph, and the set of edges
> + * from the tenured generation into the nursery is know as the remembered set.
> + * Post barriers are used to discover this remembered set.

Perhaps "record" or "track" instead of "discover"?

@@ +110,5 @@
> + * Post barriers are used to discover this remembered set.
> + *
> + * Whenever a slot which could contain such a pointer is written, we use a write
> + * barrier to check if the edge created is in the remembered set, and if so we
> + * insert it into the store buffer.  This means than when we come to do a minor

It might make sense to say something about how the store buffer is just the machine representation of the remembered set.

@@ +132,5 @@
>   * the "obj->field.init(value)" method instead of "obj->field = value". We use
>   * the init naming idiom in many places to signify that a field is being
>   * assigned for the first time.
> + *
> + * For each of pointers, Values and jsids this file implements three classes,

four classes?
Attachment #8348092 - Flags: review?(wmccloskey) → review+
https://hg.mozilla.org/mozilla-central/rev/92772cf08f61
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29

Updated

5 years ago
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.