Last Comment Bug 702681 - Do not walk both ChunkSet and the internal chunk list
: Do not walk both ChunkSet and the internal chunk list
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla11
Assigned To: Terrence Cole [:terrence]
:
: Jason Orendorff [:jorendorff]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-15 10:28 PST by Terrence Cole [:terrence]
Modified: 2012-02-01 14:00 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1: trivail (3.07 KB, patch)
2011-11-15 10:37 PST, Terrence Cole [:terrence]
igor: review+
Details | Diff | Splinter Review
v2: trivial (3.03 KB, patch)
2011-11-15 16:03 PST, Terrence Cole [:terrence]
no flags Details | Diff | Splinter Review

Description Terrence Cole [:terrence] 2011-11-15 10:28:34 PST
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.
Comment 1 Terrence Cole [:terrence] 2011-11-15 10:37:13 PST
Created attachment 574622 [details] [diff] [review]
v1: trivail

https://tbpl.mozilla.org/?tree=Try&rev=62c1ce1bb4f5
Comment 2 Igor Bukanov 2011-11-15 13:05:05 PST
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.
Comment 3 Terrence Cole [:terrence] 2011-11-15 16:03:21 PST
Created attachment 574717 [details] [diff] [review]
v2: trivial
Comment 4 Terrence Cole [:terrence] 2011-11-15 16:14:01 PST
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=666ba50edd30
Comment 5 Ed Morley [:emorley] 2011-11-16 03:10:55 PST
https://hg.mozilla.org/mozilla-central/rev/666ba50edd30

Note You need to log in before you can comment on or make changes to this bug.