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

Issue 140056: Add generations to the compilation cache for eval and regexp (Closed)

Created:
11 years, 6 months ago by Søren Thygesen Gjesse
Modified:
9 years, 7 months ago
Reviewers:
Kasper Lund
CC:
v8-dev
Visibility:
Public.

Description

Refactor the handling of generations in the compilation cache. Add generations to the compilation cache for eval and regexp. The number of generations for these are set to two. BUG=none TEST=none Committed: http://code.google.com/p/v8/source/detail?r=2233

Patch Set 1 #

Total comments: 22

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+265 lines, -117 lines) Patch
M src/compilation-cache.h View 1 3 chunks +3 lines, -14 lines 0 comments Download
M src/compilation-cache.cc View 1 9 chunks +260 lines, -98 lines 0 comments Download
M src/compiler.cc View 2 chunks +2 lines, -5 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Thygesen Gjesse
I totally reworked the compilation cache change, so no reference to the previous change (http://codereview.chromium.org/131100), ...
11 years, 6 months ago (2009-06-22 09:35:50 UTC) #1
Kasper Lund
LGTM with a few comments: http://codereview.chromium.org/140056/diff/1/4 File src/compilation-cache.cc (right): http://codereview.chromium.org/140056/diff/1/4#newcode37 Line 37: #define NUMBER_OF_SUB_CACHES 4 ...
11 years, 6 months ago (2009-06-22 09:49:39 UTC) #2
Søren Thygesen Gjesse
11 years, 6 months ago (2009-06-22 11:10:54 UTC) #3
http://codereview.chromium.org/140056/diff/1/4
File src/compilation-cache.cc (right):

http://codereview.chromium.org/140056/diff/1/4#newcode37
Line 37: #define NUMBER_OF_SUB_CACHES                   4
On 2009/06/22 09:49:39, Kasper Lund wrote:
> Why not use constants for this? I would definitely have something like enum {
> kNumberOfSubCaches = 4, ... } or static const ints.

Done.

http://codereview.chromium.org/140056/diff/1/4#newcode39
Line 39: // The number of generations for each sub cache.
On 2009/06/22 09:49:39, Kasper Lund wrote:
> This should probably also be constants.

Done.

http://codereview.chromium.org/140056/diff/1/4#newcode52
Line 52: static CompilationSubCache* entry[NUMBER_OF_SUB_CACHES] =
On 2009/06/22 09:49:39, Kasper Lund wrote:
> entry seems like a weird name. How about subcaches?

Done.

http://codereview.chromium.org/140056/diff/1/4#newcode73
Line 73: static const int kInitialCacheSize = 64;
On 2009/06/22 09:49:39, Kasper Lund wrote:
> Maybe move this constant out to the other constant definitions?

Done.

http://codereview.chromium.org/140056/diff/1/4#newcode87
Line 87: for (int generation = generations_ - 1;
On 2009/06/22 09:49:39, Kasper Lund wrote:
> I would probably rewrite this to use |i| as the counter (like it's done in
> CompilationSubCache::Clear).

Done.

http://codereview.chromium.org/140056/diff/1/4#newcode210
Line 210: Handle<CompilationCacheTable> table = GetTable(generation);
On 2009/06/22 09:49:39, Kasper Lund wrote:
> Weird indentation.

Done.

http://codereview.chromium.org/140056/diff/1/4#newcode249
Line 249: for (generation = 0; generation < generations(); generation++) {
On 2009/06/22 09:49:39, Kasper Lund wrote:
> Weird indentation.

Done.

http://codereview.chromium.org/140056/diff/1/2
File src/compilation-cache.h (right):

http://codereview.chromium.org/140056/diff/1/2#newcode96
Line 96: // The compilation cache consists of several generational sub-caches
which uses
On 2009/06/22 09:49:39, Kasper Lund wrote:
> Could all this CompilationSubCache stuff be moved to compilation-cache.cc? It
> seems like it's an implementation detail for the CompilationCache.

Done.

http://codereview.chromium.org/140056/diff/1/2#newcode103
Line 103: explicit CompilationSubCache(int generations):
generations_(generations) {
On 2009/06/22 09:49:39, Kasper Lund wrote:
> Space before :?

Done.

http://codereview.chromium.org/140056/diff/1/2#newcode104
Line 104: // tables_ = new Object*[generations];
On 2009/06/22 09:49:39, Kasper Lund wrote:
> Remove.

Done.

http://codereview.chromium.org/140056/diff/1/2#newcode107
Line 107: virtual ~CompilationSubCache() {
On 2009/06/22 09:49:39, Kasper Lund wrote:
> Why is this virtual? Is it ever called and needed?

It is never called with the current static allocation if the sub-caches -
removed.

Powered by Google App Engine
This is Rietveld 408576698