Closed Bug 716042 Opened 12 years ago Closed 12 years ago

GC: missing barriers in TradeGuts

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: terrence, Assigned: terrence)

References

Details

Attachments

(1 file)

Trigger post barriers when we TradeGuts.  Pre barriers are taken care of already by manually marking.  We need similar treatment for post barriers, taking care to handle fixed slots correctly.
Attached patch v1Splinter Review
Attachment #586561 - Flags: review?(wmccloskey)
Status: NEW → ASSIGNED
Comment on attachment 586561 [details] [diff] [review]
v1

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

::: js/src/jsobj.cpp
@@ +3578,5 @@
> +         * below, in common with the other case.
> +         */
> +        for (size_t i = 0; i < a->numFixedSlots(); ++i) {
> +            Value *slotA = const_cast<Value *>(a->getFixedSlot(i));
> +            Value *slotB = const_cast<Value *>(b->getFixedSlot(i));

I think this would look better if you did:
    HeapValue *slotA = &a->getFixedSlotRef(i);

@@ +3642,5 @@
> +#ifdef JSGC_GENERATIONAL
> +    Shape::writeBarrierPost(a->shape_, (void *)&a->shape_);
> +    Shape::writeBarrierPost(b->shape_, (void *)&b->shape_);
> +    types::TypeObject::writeBarrierPost(a->type_, (void *)&a->type_);
> +    types::TypeObject::writeBarrierPost(b->type_, (void *)&b->type_);

I don't think you need these (void *) casts. I think they're used in gc/Barrier.h because some of the stuff is const.
Attachment #586561 - Flags: review?(wmccloskey) → review+
Also, please don't put two spaces after the period in the comment. See the SpiderMonkey style guide.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.