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

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

Issue 9254027: Add missing SmiUntag for string hash calculation in (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 | no next file » | 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 6024 matching lines...) Expand 10 before | Expand all | Expand 10 after
6035 Register character, 6035 Register character,
6036 Register scratch) { 6036 Register scratch) {
6037 // hash = (seed + character) + ((seed + character) << 10); 6037 // hash = (seed + character) + ((seed + character) << 10);
6038 if (Serializer::enabled()) { 6038 if (Serializer::enabled()) {
6039 ExternalReference roots_array_start = 6039 ExternalReference roots_array_start =
6040 ExternalReference::roots_array_start(masm->isolate()); 6040 ExternalReference::roots_array_start(masm->isolate());
6041 __ mov(scratch, Immediate(Heap::kHashSeedRootIndex)); 6041 __ mov(scratch, Immediate(Heap::kHashSeedRootIndex));
6042 __ mov(scratch, Operand::StaticArray(scratch, 6042 __ mov(scratch, Operand::StaticArray(scratch,
6043 times_pointer_size, 6043 times_pointer_size,
6044 roots_array_start)); 6044 roots_array_start));
6045 __ SmiUntag(scratch);
6045 __ add(scratch, character); 6046 __ add(scratch, character);
6046 __ mov(hash, scratch); 6047 __ mov(hash, scratch);
6047 __ shl(scratch, 10); 6048 __ shl(scratch, 10);
6048 __ add(hash, scratch); 6049 __ add(hash, scratch);
6049 } else { 6050 } else {
6050 int32_t seed = masm->isolate()->heap()->HashSeed(); 6051 int32_t seed = masm->isolate()->heap()->HashSeed();
6051 __ lea(scratch, Operand(character, seed)); 6052 __ lea(scratch, Operand(character, seed));
6052 __ shl(scratch, 10); 6053 __ shl(scratch, 10);
6053 __ lea(hash, Operand(scratch, character, times_1, seed)); 6054 __ lea(hash, Operand(scratch, character, times_1, seed));
6054 } 6055 }
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after
7345 false); 7346 false);
7346 __ pop(edx); 7347 __ pop(edx);
7347 __ ret(0); 7348 __ ret(0);
7348 } 7349 }
7349 7350
7350 #undef __ 7351 #undef __
7351 7352
7352 } } // namespace v8::internal 7353 } } // namespace v8::internal
7353 7354
7354 #endif // V8_TARGET_ARCH_IA32 7355 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698