Reviewers: Sven,

Message:
This fixes several problems at once:

In StringHelper::GenerateHash*

1) Runtime hashing uses logical right shifts, generated code hashing used to use
arithmetical right shifts. This can lead to wrong hashes.

2) Hashes are stored after shifted up by two bits. When used, the stored value is shifted down. This means that the two highest two bits are always zero. This
has not been done in generated code.

3) ARM version of hash in generated code would always return 0x1b (= 27) due to
wrong condition code.

In StringHelper::GenerateTwoCharacterSymbolTableProbe:

4) ARM version returns garbage value from a scratch register instead of found
entry. This does not cause a crash due to (3) since probing always failed on
ARM.

5) In GenerateTwoCharacterSymbolTableProbe, a deleted table entry is assumed to
be a null value, it should be the hole.

Description:
Fixing generated hash function on all platforms.

BUG=v8:1808
TEST=cctest/test-hashing.cc


Please review this at http://codereview.chromium.org/8512004/

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

Affected files:
  M src/arm/code-stubs-arm.h
  M src/arm/code-stubs-arm.cc
  M src/ia32/code-stubs-ia32.cc
  M src/ia32/macro-assembler-ia32.cc
  M src/mips/code-stubs-mips.h
  M src/mips/code-stubs-mips.cc
  M src/x64/code-stubs-x64.cc
  M test/cctest/cctest.gyp
  A test/cctest/test-hashing.cc


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to