Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Issue 9235029: Flush number string cache on GC (bug 1605). Also start with a small (Closed)

Created:
8 years, 11 months ago by Erik Corry
Modified:
8 years, 11 months ago
CC:
v8-dev
Visibility:
Public.

Description

Flush number string cache on GC (bug 1605). Also start with a small number string cache and only grow it if needed, which will be useful for saving boot time memory use. Committed: https://code.google.com/p/v8/source/detail?r=10502

Patch Set 1 #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -13 lines) Patch
M src/heap.h View 2 chunks +6 lines, -1 line 2 comments Download
M src/heap.cc View 4 chunks +37 lines, -11 lines 8 comments Download
M test/cctest/test-mark-compact.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Erik Corry
8 years, 11 months ago (2012-01-25 10:11:08 UTC) #1
Michael Starzinger
LGTM. A few comments to address, but mainly nits. https://chromiumcodereview.appspot.com/9235029/diff/1/src/heap.cc File src/heap.cc (right): https://chromiumcodereview.appspot.com/9235029/diff/1/src/heap.cc#newcode899 src/heap.cc:899: ...
8 years, 11 months ago (2012-01-25 13:00:54 UTC) #2
Erik Corry
8 years, 11 months ago (2012-01-25 14:37:26 UTC) #3
https://chromiumcodereview.appspot.com/9235029/diff/1/src/heap.cc
File src/heap.cc (right):

https://chromiumcodereview.appspot.com/9235029/diff/1/src/heap.cc#newcode899
src/heap.cc:899: FlushNumberStringCache();
On 2012/01/25 13:00:56, Michael Starzinger wrote:
> If it's intentional that the new heuristic for flushing is "always flush",
then
> I am fine with that. Please document that in the issue tracker.

Done.

https://chromiumcodereview.appspot.com/9235029/diff/1/src/heap.cc#newcode2630
src/heap.cc:2630: // max_semispace_size_ == 512 KB => number_string_cache_size =
32.
On 2012/01/25 13:00:56, Michael Starzinger wrote:
> This comment no longer is on sync with the computation below.

Done.

https://chromiumcodereview.appspot.com/9235029/diff/1/src/heap.cc#newcode2633
src/heap.cc:2633: number_string_cache_size = Max(kInitialNumberStringCacheSize *
2,
On 2012/01/25 13:00:56, Michael Starzinger wrote:
> The constant is multiplied with 2 twice. I think we can drop this
> multiplication.

The first multiplication is there to ensure that the full size is always bigger
than the initial size.  The second is there because there is a string and a
number per entry so the length has to be twice the size (in entries).  Comments
have been updated.

https://chromiumcodereview.appspot.com/9235029/diff/1/src/heap.cc#newcode2647
src/heap.cc:2647: if (maybe_obj->ToObject(&new_cache)) {
On 2012/01/25 13:00:56, Michael Starzinger wrote:
> Can we add a comment that this is a best effort allocation and we ignore
> failures here?

Done.

https://chromiumcodereview.appspot.com/9235029/diff/1/src/heap.h
File src/heap.h (right):

https://chromiumcodereview.appspot.com/9235029/diff/1/src/heap.h#newcode1804
src/heap.h:1804: // Initializes the number to string cache based on the max
semispace size.
On 2012/01/25 13:00:56, Michael Starzinger wrote:
> This comment line should either be moved up two lines or be dropped
completely.

Done.

Powered by Google App Engine
This is Rietveld 408576698