GC: make moveDenseArrayElements trigger post write barriers always

RESOLVED FIXED in mozilla14

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: terrence, Assigned: terrence)

Tracking

Trunk
mozilla14
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Currently, we check compartment()->needsBarrier() before doing HeapSlot::set to move values and use memmove in most situations.  This will not trigger post write barriers in most cases.

Bill, I thought I had already fixed up this method when I was running my generational verifier: is there some benchmark where not doing the memmove is slow?  If so, I think it will be okay to replace the memmove with .init calls so that we only trigger the post barriers, since we've already ensured that pre barriers are not needed.
Sorry. I changed this because just doing the set calls was causing a big regression on Dromaeo. Anything is fine with me as long as it doesn't regress the benchmarks.
(Assignee)

Comment 2

5 years ago
Ah, thanks!  I'll try not to make it too ugly.
(Assignee)

Comment 3

5 years ago
A for loop that copies elements 1-by-1 is about half the performance of gcc's memmove.  This is not acceptable.  What we need to do here instead is have a write buffer for whole-object invalidation.
(Assignee)

Comment 4

5 years ago
Created attachment 612749 [details] [diff] [review]
v0

This is a bit silly, but it will serve to isolate the write buffer from the object internals and to make sure it doesn't get lost in rebasing if Waldo's refactoring touches moveDenseArrayElements.
Attachment #612749 - Flags: review?(wmccloskey)
Comment on attachment 612749 [details] [diff] [review]
v0

Please add to the comment saying that for now it's just a placeholder. Otherwise someone might delete it.
Attachment #612749 - Flags: review?(wmccloskey) → review+
(Assignee)

Comment 6

5 years ago
Good idea.  Although it's now occurred to me that this is true of the entire post-barrier infrastructure at the moment.  :-)

https://hg.mozilla.org/integration/mozilla-inbound/rev/e8fb716946e0
https://hg.mozilla.org/mozilla-central/rev/e8fb716946e0
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.