GC: expose BufferableRef API

RESOLVED INVALID

Status

()

Core
JavaScript Engine
RESOLVED INVALID
6 years ago
6 years ago

People

(Reporter: terrence, Assigned: terrence)

Tracking

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
There are 4 write buffers with known types: pointer-to-id, pointer-to-value, pointer-to-object, and reference-to-slot.  The GC will know the internal details of these and make them fast, because they are the common cases.  There is also a 5th, catch-all "general" write buffer that stores the long-tail in a slower, GC-opaque format.  Items storable in the generic write buffer need to derive from the pure-virtual class BufferableRef.

Even though we won't have a real writebuffer implementation in-tree for awhile yet, it would be very nice to have the places where we need manual post barriers in-tree because:
  - They won't get broken or lost.
  - In many cases I'm going to be removing automatic post barriers when I add manual post barriers: this way the reviews can cover both changes at once.
  - It will be possible for SpiderMonkey features developed in the next few months to be "generational-ready" (I'll skip the logo requirements) without coordinating with me specifically.
(Assignee)

Updated

6 years ago
Blocks: 744612
(Assignee)

Updated

6 years ago
Blocks: 744615
(Assignee)

Comment 1

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

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

Could you add something to the comment so people know that it's for generational GC?

::: js/src/gc/StoreBuffer.h
@@ +16,5 @@
> +namespace js {
> +namespace gc {
> +
> +/*
> + * Represents an abstract reference.  Entries in the store buffer that cannot be

One space after the period.

@@ +17,5 @@
> +namespace gc {
> +
> +/*
> + * Represents an abstract reference.  Entries in the store buffer that cannot be
> + * represented with the simple pointer-to-a-pointer scheme, must derive from

No comma here.
Attachment #614479 - Flags: review?(wmccloskey)
(Assignee)

Comment 3

6 years ago
Thanks for taking a look at this! I've updated my atrocious grammar. I see a way now where we won't need to expose BufferableRef outside of #ifdef JSGC_GENERATIONAL, so I'm going to fold this into the generational mega-patch.
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.