Allow property indexes to refer to slots inside the object header. (issue 11365221)

3 views
Skip to first unread message

mma...@chromium.org

unread,
Nov 13, 2012, 5:15:20 AM11/13/12
to mma...@chromium.org, v8-...@googlegroups.com
Reviewers: ,

Message:
This small refactory is needed to make so that array length access ICs can
use
the same stub compiler used for property access ICs (it will be done in a
separate CL).

Description:
Allow property indexes to refer to slots inside the object header.

BUG=


Please review this at https://chromiumcodereview.appspot.com/11365221/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
M src/arm/stub-cache-arm.cc
M src/bootstrapper.cc
M src/ia32/stub-cache-ia32.cc
M src/ic.cc
M src/json-stringifier.h
M src/mips/stub-cache-mips.cc
M src/objects.cc
M src/property.h
M src/property.cc
M src/runtime.cc
M src/stub-cache.h
M src/stub-cache.cc
M src/x64/stub-cache-x64.cc


jkum...@chromium.org

unread,
Nov 13, 2012, 5:44:43 AM11/13/12
to mma...@chromium.org, v8-...@googlegroups.com
LGTM with a bunch of nits.


https://chromiumcodereview.appspot.com/11365221/diff/1/src/property.h
File src/property.h (right):

https://chromiumcodereview.appspot.com/11365221/diff/1/src/property.h#newcode135
src/property.h:135: // Hold a property index value distinguishing if it
is a field index or an
nit: s/Hold/Holds/

https://chromiumcodereview.appspot.com/11365221/diff/1/src/property.h#newcode146
src/property.h:146: bool IsFieldIndex() { return (index_ &
kHeaderIndexBit) == 0; }
nit: I think for this and the next three methods, unix_hacker_style
names would be appropriate, as they're essentially simple getters.

https://chromiumcodereview.appspot.com/11365221/diff/1/src/property.h#newcode158
src/property.h:158: int RawIndex() { return index_; }
I don't see this ever getting called.

https://chromiumcodereview.appspot.com/11365221/diff/1/src/property.h#newcode167
src/property.h:167: PropertyIndex(int index, bool isHeaderBased) :
nit1: ':' should be on the second line (see e.g. the LookupResult
constructor right below).

nit2: is_header_based. (Usually, we also prefer enums over bools, but
since this method is local to the class, using a bool is OK.)

nit3: within the "private:" section, please adhere to the ordering
statics -> methods -> fields.

https://chromiumcodereview.appspot.com/11365221/diff/1/src/property.h#newcode172
src/property.h:172:
nit: two lines of whitespace between top-level definitions

https://chromiumcodereview.appspot.com/11365221/
Reply all
Reply to author
Forward
0 new messages