From 547589e280abaf23584850d1b9ad1b97f1a94147 Mon Sep 17 00:00:00 2001 From: "weiliang.lin@intel.com" Date: Fri, 5 Sep 2014 07:29:08 +0000 Subject: [PATCH] X87: Remove dead code for inline string hashing. port r23689. original commit message: Remove dead code for inline string hashing. This has become obsolete since hydrogenized StringAdd. BUG= R=weiliang.lin@intel.com Review URL: https://codereview.chromium.org/545093002 Patch from Jing Bao . git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23714 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/x87/code-stubs-x87.cc | 68 --------------------------------------- src/x87/code-stubs-x87.h | 15 --------- 2 files changed, 83 deletions(-) diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc index a84438f43..0da86eb21 100644 --- a/src/x87/code-stubs-x87.cc +++ b/src/x87/code-stubs-x87.cc @@ -2570,74 +2570,6 @@ void StringHelper::GenerateCopyCharacters(MacroAssembler* masm, } -void StringHelper::GenerateHashInit(MacroAssembler* masm, - Register hash, - Register character, - Register scratch) { - // hash = (seed + character) + ((seed + character) << 10); - if (masm->serializer_enabled()) { - __ LoadRoot(scratch, Heap::kHashSeedRootIndex); - __ SmiUntag(scratch); - __ add(scratch, character); - __ mov(hash, scratch); - __ shl(scratch, 10); - __ add(hash, scratch); - } else { - int32_t seed = masm->isolate()->heap()->HashSeed(); - __ lea(scratch, Operand(character, seed)); - __ shl(scratch, 10); - __ lea(hash, Operand(scratch, character, times_1, seed)); - } - // hash ^= hash >> 6; - __ mov(scratch, hash); - __ shr(scratch, 6); - __ xor_(hash, scratch); -} - - -void StringHelper::GenerateHashAddCharacter(MacroAssembler* masm, - Register hash, - Register character, - Register scratch) { - // hash += character; - __ add(hash, character); - // hash += hash << 10; - __ mov(scratch, hash); - __ shl(scratch, 10); - __ add(hash, scratch); - // hash ^= hash >> 6; - __ mov(scratch, hash); - __ shr(scratch, 6); - __ xor_(hash, scratch); -} - - -void StringHelper::GenerateHashGetHash(MacroAssembler* masm, - Register hash, - Register scratch) { - // hash += hash << 3; - __ mov(scratch, hash); - __ shl(scratch, 3); - __ add(hash, scratch); - // hash ^= hash >> 11; - __ mov(scratch, hash); - __ shr(scratch, 11); - __ xor_(hash, scratch); - // hash += hash << 15; - __ mov(scratch, hash); - __ shl(scratch, 15); - __ add(hash, scratch); - - __ and_(hash, String::kHashBitMask); - - // if (hash == 0) hash = 27; - Label hash_not_zero; - __ j(not_zero, &hash_not_zero, Label::kNear); - __ mov(hash, Immediate(StringHasher::kZeroHash)); - __ bind(&hash_not_zero); -} - - void SubStringStub::Generate(MacroAssembler* masm) { Label runtime; diff --git a/src/x87/code-stubs-x87.h b/src/x87/code-stubs-x87.h index 67f229305..9939bab35 100644 --- a/src/x87/code-stubs-x87.h +++ b/src/x87/code-stubs-x87.h @@ -28,21 +28,6 @@ class StringHelper : public AllStatic { Register scratch, String::Encoding encoding); - // Generate string hash. - static void GenerateHashInit(MacroAssembler* masm, - Register hash, - Register character, - Register scratch); - - static void GenerateHashAddCharacter(MacroAssembler* masm, - Register hash, - Register character, - Register scratch); - - static void GenerateHashGetHash(MacroAssembler* masm, - Register hash, - Register scratch); - // Compares two flat ASCII strings and returns result in eax. static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, Register left, Register right, -- 2.34.1