Do not walk both ChunkSet and the internal chunk list

RESOLVED FIXED in mozilla11

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: terrence, Assigned: terrence)

Tracking

Trunk
mozilla11
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
In DecommitFreePages we iterate over the runtime's ChunkSet and inside that walk over the list in the chunk info header.  The chunk set contains all chunks, so we can ignore the internal list.
(Assignee)

Comment 1

6 years ago
Created attachment 574622 [details] [diff] [review]
v1: trivail

https://tbpl.mozilla.org/?tree=Try&rev=62c1ce1bb4f5
Attachment #574622 - Flags: review?(igor)
(Assignee)

Updated

6 years ago
Status: NEW → ASSIGNED

Comment 2

6 years ago
Comment on attachment 574622 [details] [diff] [review]
v1: trivail

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

r+ with the comments addressed.

::: js/src/jsgc.cpp
@@ +2399,5 @@
>      JSRuntime *rt = cx->runtime;
>  
>      for (GCChunkSet::Range r(rt->gcChunkSet.all()); !r.empty(); r.popFront()) {
>          Chunk *chunk = r.front();
> +        ArenaHeader *aheader = static_cast<ArenaHeader*>(chunk->info.freeArenasHead);

Drop the cast  - freeArenasHead is ArenaHeader *

@@ +2421,3 @@
>              }
>  
> +            size_t arenaOffset = Chunk::arenaIndex(reinterpret_cast<uintptr_t>(aheader));

Call the variable arenaIndex for consistency with the rest of code and use aheader->arenaAddress(), not the cast here.
Attachment #574622 - Flags: review?(igor) → review+
(Assignee)

Comment 3

6 years ago
Created attachment 574717 [details] [diff] [review]
v2: trivial
Attachment #574622 - Attachment is obsolete: true
(Assignee)

Comment 4

6 years ago
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=666ba50edd30

Comment 5

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