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

Issue 652119: Refactor the code cache to handle large number of properties on the global ob... (Closed)

Created:
10 years, 10 months ago by Søren Thygesen Gjesse
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Refactor the code cache to handle large number of properties on the global object. A separate object type for the code cache have been added. This object has two different code caches. The first one (default_cache) is a fixed array organized in the same way as the as the code cache was before. The second cache (global_access_cache) is for code stubs to access the global object. This cache is organized as a hash table taking the property name and code flags as the key. The reason for separating the global access stubs into a hash table representation is that the number of these is not bounded in the same was as the other types. BUG=613 Committed: http://code.google.com/p/v8/source/detail?r=3952

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 16

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+356 lines, -39 lines) Patch
M src/heap.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/heap.cc View 1 2 3 chunks +14 lines, -4 lines 0 comments Download
M src/objects.h View 1 2 9 chunks +100 lines, -2 lines 0 comments Download
M src/objects.cc View 1 2 4 chunks +209 lines, -30 lines 0 comments Download
M src/objects-debug.cc View 1 2 1 chunk +18 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 5 chunks +12 lines, -3 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Thygesen Gjesse
10 years, 10 months ago (2010-02-25 12:45:16 UTC) #1
Mads Ager (chromium)
LGTM http://codereview.chromium.org/652119/diff/2001/3002 File src/objects.cc (right): http://codereview.chromium.org/652119/diff/2001/3002#newcode3078 src/objects.cc:3078: if (code->type() == NORMAL) { It is not ...
10 years, 10 months ago (2010-02-25 13:26:24 UTC) #2
Søren Thygesen Gjesse
10 years, 10 months ago (2010-02-25 14:00:07 UTC) #3
http://codereview.chromium.org/652119/diff/2001/3002
File src/objects.cc (right):

http://codereview.chromium.org/652119/diff/2001/3002#newcode3078
src/objects.cc:3078: if (code->type() == NORMAL) {
On 2010/02/25 13:26:24, Mads Ager wrote:
> It is not completely trivial that MONOMORPHIC & NORMAL implies that the code
is
> for accessing a global property.  Could you add a comment just stating that
this
> is the case.  It is clear however, that MONOMORPHIC & NORMAL means that there
> can be an unbounded number of them and we therefore need a hash table.

Renamed GlobalAccess -> NormalType global_access -< normal_type, and added a
comment indicating that this is property cell access.

http://codereview.chromium.org/652119/diff/2001/3002#newcode3079
src/objects.cc:3079: // Make sure the a hash table is allocated got the global
access code cache.
On 2010/02/25 13:26:24, Mads Ager wrote:
> the -> that
> got -> for?

Done.

http://codereview.chromium.org/652119/diff/2001/3002#newcode3202
src/objects.cc:3202: // This is not used for global object IC's.
On 2010/02/25 13:26:24, Mads Ager wrote:
> Should we just assert that code->type() != NORMAL in that case?

Done.

http://codereview.chromium.org/652119/diff/2001/3002#newcode3228
src/objects.cc:3228: // code object. The actual match is on the name and the
code flags. If this key
On 2010/02/25 13:26:24, Mads Ager wrote:
> this -> a

Done.

http://codereview.chromium.org/652119/diff/2001/3002#newcode3229
src/objects.cc:3229: // is created using the flags in not a code object it can
only be used for
On 2010/02/25 13:26:24, Mads Ager wrote:
> in -> and

Done.

http://codereview.chromium.org/652119/diff/2001/3003
File src/objects.h (right):

http://codereview.chromium.org/652119/diff/2001/3003#newcode3733
src/objects.h:3733: // Lookup Code object in the cache. Returns code object if
found.
On 2010/02/25 13:26:24, Mads Ager wrote:
> Code -> code.
> 
> Document what it returns when not found?

Done.

http://codereview.chromium.org/652119/diff/2001/3003#newcode3737
src/objects.h:3737: // code object is not in that cache. This index can be ised
to later call
On 2010/02/25 13:26:24, Mads Ager wrote:
> ised -> used

Done.

http://codereview.chromium.org/652119/diff/2001/3003#newcode3763
src/objects.h:3763: // Code cache layout. The code cache is a fixed array where
the first element
On 2010/02/25 13:26:24, Mads Ager wrote:
> This comment looks wrong - left over from a previous version of this change?

Sorry about that, fixed.

Powered by Google App Engine
This is Rietveld 408576698