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

Side by Side Diff: src/arm/code-stubs-arm.cc

Issue 9169010: Fix zero hash handling on ARM. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5741 matching lines...) Expand 10 before | Expand all | Expand 10 after
5752 } 5752 }
5753 5753
5754 5754
5755 void StringHelper::GenerateHashGetHash(MacroAssembler* masm, 5755 void StringHelper::GenerateHashGetHash(MacroAssembler* masm,
5756 Register hash) { 5756 Register hash) {
5757 // hash += hash << 3; 5757 // hash += hash << 3;
5758 __ add(hash, hash, Operand(hash, LSL, 3)); 5758 __ add(hash, hash, Operand(hash, LSL, 3));
5759 // hash ^= hash >> 11; 5759 // hash ^= hash >> 11;
5760 __ eor(hash, hash, Operand(hash, LSR, 11)); 5760 __ eor(hash, hash, Operand(hash, LSR, 11));
5761 // hash += hash << 15; 5761 // hash += hash << 15;
5762 __ add(hash, hash, Operand(hash, LSL, 15), SetCC); 5762 __ add(hash, hash, Operand(hash, LSL, 15));
5763 5763
5764 uint32_t kHashShiftCutOffMask = (1 << (32 - String::kHashShift)) - 1; 5764 __ and_(hash, hash, Operand(String::kHashBitMask), SetCC);
5765 __ and_(hash, hash, Operand(kHashShiftCutOffMask));
5766 5765
5767 // if (hash == 0) hash = 27; 5766 // if (hash == 0) hash = 27;
5768 __ mov(hash, Operand(27), LeaveCC, eq); 5767 __ mov(hash, Operand(StringHasher::kZeroHash), LeaveCC, eq);
5769 } 5768 }
5770 5769
5771 5770
5772 void SubStringStub::Generate(MacroAssembler* masm) { 5771 void SubStringStub::Generate(MacroAssembler* masm) {
5773 Label runtime; 5772 Label runtime;
5774 5773
5775 // Stack frame on entry. 5774 // Stack frame on entry.
5776 // lr: return address 5775 // lr: return address
5777 // sp[0]: to 5776 // sp[0]: to
5778 // sp[4]: from 5777 // sp[4]: from
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after
7314 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r10, 7313 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r10,
7315 &slow_elements); 7314 &slow_elements);
7316 __ Ret(); 7315 __ Ret();
7317 } 7316 }
7318 7317
7319 #undef __ 7318 #undef __
7320 7319
7321 } } // namespace v8::internal 7320 } } // namespace v8::internal
7322 7321
7323 #endif // V8_TARGET_ARCH_ARM 7322 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698