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

Side by Side Diff: src/mips/code-stubs-mips.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 | « src/ia32/code-stubs-ia32.cc ('k') | src/objects.h » ('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 5936 matching lines...) Expand 10 before | Expand all | Expand 10 after
5947 // hash += hash << 10; 5947 // hash += hash << 10;
5948 __ sll(at, hash, 10); 5948 __ sll(at, hash, 10);
5949 __ addu(hash, hash, at); 5949 __ addu(hash, hash, at);
5950 // hash ^= hash >> 6; 5950 // hash ^= hash >> 6;
5951 __ srl(at, hash, 6); 5951 __ srl(at, hash, 6);
5952 __ xor_(hash, hash, at); 5952 __ xor_(hash, hash, at);
5953 } 5953 }
5954 5954
5955 5955
5956 void StringHelper::GenerateHashGetHash(MacroAssembler* masm, 5956 void StringHelper::GenerateHashGetHash(MacroAssembler* masm,
5957 Register hash) { 5957 Register hash) {
5958 // hash += hash << 3; 5958 // hash += hash << 3;
5959 __ sll(at, hash, 3); 5959 __ sll(at, hash, 3);
5960 __ addu(hash, hash, at); 5960 __ addu(hash, hash, at);
5961 // hash ^= hash >> 11; 5961 // hash ^= hash >> 11;
5962 __ srl(at, hash, 11); 5962 __ srl(at, hash, 11);
5963 __ xor_(hash, hash, at); 5963 __ xor_(hash, hash, at);
5964 // hash += hash << 15; 5964 // hash += hash << 15;
5965 __ sll(at, hash, 15); 5965 __ sll(at, hash, 15);
5966 __ addu(hash, hash, at); 5966 __ addu(hash, hash, at);
5967 5967
5968 uint32_t kHashShiftCutOffMask = (1 << (32 - String::kHashShift)) - 1; 5968 __ li(at, Operand(String::kHashBitMask));
5969 __ li(at, Operand(kHashShiftCutOffMask));
5970 __ and_(hash, hash, at); 5969 __ and_(hash, hash, at);
5971 5970
5972 // if (hash == 0) hash = 27; 5971 // if (hash == 0) hash = 27;
5973 __ ori(at, zero_reg, 27); 5972 __ ori(at, zero_reg, StringHasher::kZeroHash);
5974 __ movz(hash, at, hash); 5973 __ movz(hash, at, hash);
5975 } 5974 }
5976 5975
5977 5976
5978 void SubStringStub::Generate(MacroAssembler* masm) { 5977 void SubStringStub::Generate(MacroAssembler* masm) {
5979 Label runtime; 5978 Label runtime;
5980 // Stack frame on entry. 5979 // Stack frame on entry.
5981 // ra: return address 5980 // ra: return address
5982 // sp[0]: to 5981 // sp[0]: to
5983 // sp[4]: from 5982 // sp[4]: from
(...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after
7582 __ Ret(USE_DELAY_SLOT); 7581 __ Ret(USE_DELAY_SLOT);
7583 __ mov(v0, a0); 7582 __ mov(v0, a0);
7584 } 7583 }
7585 7584
7586 7585
7587 #undef __ 7586 #undef __
7588 7587
7589 } } // namespace v8::internal 7588 } } // namespace v8::internal
7590 7589
7591 #endif // V8_TARGET_ARCH_MIPS 7590 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698