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

Issue 3141022: Using array index hash code for string-to-number conversion. (Closed)

Created:
10 years, 4 months ago by SeRya
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Using array index hash code for string-to-number conversion. Committed: http://code.google.com/p/v8/source/detail?r=5362

Patch Set 1 : '' #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 36

Patch Set 7 : '' #

Total comments: 14

Patch Set 8 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+322 lines, -87 lines) Patch
M src/arm/codegen-arm.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M src/arm/codegen-arm.cc View 1 2 3 4 5 6 1 chunk +21 lines, -0 lines 0 comments Download
M src/arm/full-codegen-arm.cc View 1 2 3 4 5 6 1 chunk +29 lines, -0 lines 0 comments Download
M src/arm/ic-arm.cc View 7 3 chunks +2 lines, -28 lines 0 comments Download
M src/arm/macro-assembler-arm.h View 7 1 chunk +6 lines, -0 lines 0 comments Download
M src/arm/macro-assembler-arm.cc View 7 1 chunk +15 lines, -0 lines 0 comments Download
M src/codegen.h View 1 2 3 4 5 6 1 chunk +3 lines, -1 line 0 comments Download
M src/ia32/codegen-ia32.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 2 3 4 5 6 1 chunk +36 lines, -0 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 4 5 6 1 chunk +40 lines, -0 lines 0 comments Download
M src/ia32/ic-ia32.cc View 7 3 chunks +2 lines, -27 lines 0 comments Download
M src/ia32/macro-assembler-ia32.h View 7 2 chunks +9 lines, -0 lines 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 7 2 chunks +30 lines, -0 lines 0 comments Download
M src/runtime.cc View 1 2 3 4 5 6 7 1 chunk +13 lines, -0 lines 0 comments Download
M src/runtime.js View 1 2 3 4 5 6 1 chunk +4 lines, -1 line 0 comments Download
M src/v8natives.js View 6 1 chunk +9 lines, -2 lines 0 comments Download
M src/x64/codegen-x64.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M src/x64/codegen-x64.cc View 1 2 3 4 5 6 1 chunk +28 lines, -0 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 3 4 5 6 1 chunk +34 lines, -0 lines 0 comments Download
M src/x64/ic-x64.cc View 7 3 chunks +2 lines, -27 lines 0 comments Download
M src/x64/macro-assembler-x64.h View 7 1 chunk +6 lines, -0 lines 0 comments Download
M src/x64/macro-assembler-x64.cc View 7 1 chunk +19 lines, -0 lines 0 comments Download
M test/mjsunit/fuzz-natives.js View 1 chunk +5 lines, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
SeRya
10 years, 4 months ago (2010-08-23 09:26:08 UTC) #1
SeRya
The same optimization added to ParseInt and PartseFloat (v8natives.js).
10 years, 4 months ago (2010-08-24 09:53:30 UTC) #2
Vyacheslav Egorov (Chromium)
Here comes bunch of comments. http://codereview.chromium.org/3141022/diff/14003/53001 File src/arm/codegen-arm.cc (right): http://codereview.chromium.org/3141022/diff/14003/53001#newcode5635 src/arm/codegen-arm.cc:5635: Register tmp = frame_->scratch0(); ...
10 years, 4 months ago (2010-08-26 12:52:57 UTC) #3
SeRya
http://codereview.chromium.org/3141022/diff/14003/53001 File src/arm/codegen-arm.cc (right): http://codereview.chromium.org/3141022/diff/14003/53001#newcode5635 src/arm/codegen-arm.cc:5635: Register tmp = frame_->scratch0(); On 2010/08/26 12:52:57, Vyacheslav Egorov ...
10 years, 4 months ago (2010-08-26 17:42:26 UTC) #4
Vyacheslav Egorov (Chromium)
LGTM http://codereview.chromium.org/3141022/diff/28006/34008 File src/arm/macro-assembler-arm.cc (right): http://codereview.chromium.org/3141022/diff/28006/34008#newcode1340 src/arm/macro-assembler-arm.cc:1340: void MacroAssembler::IndexFromHash(Register key, Register hash) { makes sense ...
10 years, 4 months ago (2010-08-27 08:57:59 UTC) #5
SeRya
10 years, 4 months ago (2010-08-27 10:23:30 UTC) #6
http://codereview.chromium.org/3141022/diff/28006/34008
File src/arm/macro-assembler-arm.cc (right):

http://codereview.chromium.org/3141022/diff/28006/34008#newcode1340
src/arm/macro-assembler-arm.cc:1340: void MacroAssembler::IndexFromHash(Register
key, Register hash) {
On 2010/08/27 08:57:59, Vyacheslav Egorov wrote:
> makes sense to rename key to index and reorder arguments so that out reg goes
> last.

Done.

http://codereview.chromium.org/3141022/diff/28006/34008#newcode1343
src/arm/macro-assembler-arm.cc:1343: //   hash - holds the key's hash.
Clobbered.
On 2010/08/27 08:57:59, Vyacheslav Egorov wrote:
> Worth moving this comment to header file. It is important to state that hash
> will be clobbered.

Done.

http://codereview.chromium.org/3141022/diff/28006/34008#newcode1355
src/arm/macro-assembler-arm.cc:1355: // there is no difference in using either
key.
On 2010/08/27 08:57:59, Vyacheslav Egorov wrote:
> this comment about clobbering makes no sense after this function became public
> and generic.

The comment removed.

http://codereview.chromium.org/3141022/diff/28006/34008#newcode1356
src/arm/macro-assembler-arm.cc:1356: STATIC_ASSERT(String::kHashShift >=
kSmiTagSize);
On 2010/08/27 08:57:59, Vyacheslav Egorov wrote:
> This assert makes no sense (we do not use expression kHashShift - kSmiTagSize)
> 
> Better assert kSmiTag == 0

The comment replaced.

http://codereview.chromium.org/3141022/diff/28006/34015
File src/ia32/macro-assembler-ia32.cc (right):

http://codereview.chromium.org/3141022/diff/28006/34015#newcode1055
src/ia32/macro-assembler-ia32.cc:1055: // Register use:
On 2010/08/27 08:57:59, Vyacheslav Egorov wrote:
> see comments from arm macroassembler, all of them [except for comment about
> String::kHashShift >= kSmiTagSize assert] apply to this method.

Done.

http://codereview.chromium.org/3141022/diff/28006/34017
File src/runtime.cc (right):

http://codereview.chromium.org/3141022/diff/28006/34017#newcode4864
src/runtime.cc:4864: ASSERT_EQ((subject->Hash(),
static_cast<int>(subject->hash_field())),
On 2010/08/27 08:57:59, Vyacheslav Egorov wrote:
> This usage of comma-expression looks a bit hackerish to me. Can we avoid it?

Comma-expression well defined in the C++ Standard so I don't think i's
hackerish. However I moved subject->Hash() to a separate statement in "#ifdef
DEBUG" block.

http://codereview.chromium.org/3141022/diff/28006/34024
File src/x64/macro-assembler-x64.cc (right):

http://codereview.chromium.org/3141022/diff/28006/34024#newcode395
src/x64/macro-assembler-x64.cc:395: // Register use:
On 2010/08/27 08:57:59, Vyacheslav Egorov wrote:
> comments are same as for ia32 macroassembler

Done.

Powered by Google App Engine
This is Rietveld 408576698