Closed Bug 559141 Opened 13 years ago Closed 13 years ago

replacing GC chunk doubly linked list with js::vector

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: igor, Assigned: igor)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 3 obsolete files)

+++ This bug was initially created as a clone of Bug #553812 +++

Currently the GC puts the CHUNKS with unused GC arenas into doubly linked list with a custom code managing the list. This is unnecessary since the requirements for the data structure holding chunks is to allow fast addition (chunk allocation) and bulk removal (the GC removes chunks without used GC arenas). 

Those requirements can be met in a straightforward way using js::Vector. So we should replace the custom linked list with the vector. The additional benefit of using the vector is that it does not need to dereference chunks avoiding loading new cachelines and TLB entries just to read/write link fields.
Attached patch v1 (obsolete) — Splinter Review
Here is untested patch. diffstats shows:

3 files changed, 42 insertions(+), 59 deletions(-)

So gal's idea from bug 553812 comment 38 was very fruitful.
Attached patch v2 (obsolete) — Splinter Review
Still untested patch that tries to take advantage of simpler datastructures to the max extend.
Attachment #438821 - Attachment is obsolete: true
Attached patch v3 (obsolete) — Splinter Review
The new version integrates the changes due to the bug 541140.
Attachment #438854 - Attachment is obsolete: true
Attachment #439208 - Flags: review?
Attachment #439208 - Flags: review? → review?(gal)
Comment on attachment 439208 [details] [diff] [review]
v3

cursor seems unused?
Attached patch v4Splinter Review
v3 has missed jsgc.cpp chnages. v4 is the full patch.
Attachment #439208 - Attachment is obsolete: true
Attachment #439503 - Flags: review?
Attachment #439208 - Flags: review?(gal)
Attachment #439503 - Flags: review? → review?(gal)
Comment on attachment 439503 [details] [diff] [review]
v4

Gregor knows the code that changes a bit better than me.
Attachment #439503 - Flags: review?(gal) → review?(anygregor)
Comment on attachment 439503 [details] [diff] [review]
v4

> 
>-namespace js {
>+/*
>+ * This function does not touches the arena or release its memory so code can
>+ * still refer into it.

nit: touch
Attachment #439503 - Flags: review?(anygregor) → review+
http://hg.mozilla.org/tracemonkey/rev/078c03c13b7f
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/078c03c13b7f
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.