Closed Bug 714913 Opened 13 years ago Closed 13 years ago

GC: missing barriers in Generator's Stack Frame

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 714109

People

(Reporter: terrence, Assigned: terrence)

References

Details

Attachments

(1 file)

Typically the values in StackFrames live on the stack.  When we store them in a generator, however, we need to add all of the internal pointers into the Nursery to the remembered set.  Because of this dual use, we need to apply the barriers manually, but only when the StackFrame is stored inside of a generator.
Depends on: 714109
Attached patch V1Splinter Review
This looks like we discussed IRL.
Attachment #585613 - Flags: review?(wmccloskey)
Comment on attachment 585613 [details] [diff] [review]
V1

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

::: js/src/vm/Stack.cpp
@@ +192,5 @@
> +        }
> +    }
> +    if (hasReturnValue())
> +        HeapValue::writeBarrierPost(rval_, &rval_);
> +}

Instead of this function, would it be possible to write an operator= for StackFrame? It would have the same branch structure, but instead of the writeBarrierPost calls it would use assignment. If it could be made to work, it seems like it would be cleaner than this.
An intriguing thought.  How would we tell when the target is stored on the stack?  I think it would be okay to use an explicit memcpy in pushGeneratorFrame instead of explicitly barriering in js_NewGenerator and popGeneratorFrame.  Is this preferable?
Status: NEW → ASSIGNED
Comment on attachment 585613 [details] [diff] [review]
V1

On Luke's advise, I think I can make this much prettier with a template.  Cancelling review until I get a chance to rewrite this a bit.
Attachment #585613 - Flags: review?(wmccloskey)
Merged these changes into 714109 and 715943 to both get the important stuff in-tree faster and make reviewing the larger chunk easier.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: