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

Side by Side Diff: src/ia32/codegen-ia32.cc

Issue 2809012: Change hash computation for transcendental cache to use arithmetic... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 6 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/heap.h ('k') | src/x64/codegen-x64.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 10275 matching lines...) Expand 10 before | Expand all | Expand 10 after
10286 // Input is a HeapNumber. Push it on the FPU stack and load its 10286 // Input is a HeapNumber. Push it on the FPU stack and load its
10287 // low and high words into ebx, edx. 10287 // low and high words into ebx, edx.
10288 __ fld_d(FieldOperand(eax, HeapNumber::kValueOffset)); 10288 __ fld_d(FieldOperand(eax, HeapNumber::kValueOffset));
10289 __ mov(edx, FieldOperand(eax, HeapNumber::kExponentOffset)); 10289 __ mov(edx, FieldOperand(eax, HeapNumber::kExponentOffset));
10290 __ mov(ebx, FieldOperand(eax, HeapNumber::kMantissaOffset)); 10290 __ mov(ebx, FieldOperand(eax, HeapNumber::kMantissaOffset));
10291 10291
10292 __ bind(&loaded); 10292 __ bind(&loaded);
10293 // ST[0] == double value 10293 // ST[0] == double value
10294 // ebx = low 32 bits of double value 10294 // ebx = low 32 bits of double value
10295 // edx = high 32 bits of double value 10295 // edx = high 32 bits of double value
10296 // Compute hash: 10296 // Compute hash (the shifts are arithmetic):
10297 // h = (low ^ high); h ^= h >> 16; h ^= h >> 8; h = h & (cacheSize - 1); 10297 // h = (low ^ high); h ^= h >> 16; h ^= h >> 8; h = h & (cacheSize - 1);
10298 __ mov(ecx, ebx); 10298 __ mov(ecx, ebx);
10299 __ xor_(ecx, Operand(edx)); 10299 __ xor_(ecx, Operand(edx));
10300 __ mov(eax, ecx); 10300 __ mov(eax, ecx);
10301 __ shr(eax, 16); 10301 __ sar(eax, 16);
10302 __ xor_(ecx, Operand(eax)); 10302 __ xor_(ecx, Operand(eax));
10303 __ mov(eax, ecx); 10303 __ mov(eax, ecx);
10304 __ shr(eax, 8); 10304 __ sar(eax, 8);
10305 __ xor_(ecx, Operand(eax)); 10305 __ xor_(ecx, Operand(eax));
10306 ASSERT(IsPowerOf2(TranscendentalCache::kCacheSize)); 10306 ASSERT(IsPowerOf2(TranscendentalCache::kCacheSize));
10307 __ and_(Operand(ecx), Immediate(TranscendentalCache::kCacheSize - 1)); 10307 __ and_(Operand(ecx), Immediate(TranscendentalCache::kCacheSize - 1));
10308 10308
10309 // ST[0] == double value. 10309 // ST[0] == double value.
10310 // ebx = low 32 bits of double value. 10310 // ebx = low 32 bits of double value.
10311 // edx = high 32 bits of double value. 10311 // edx = high 32 bits of double value.
10312 // ecx = TranscendentalCache::hash(double value). 10312 // ecx = TranscendentalCache::hash(double value).
10313 __ mov(eax, 10313 __ mov(eax,
10314 Immediate(ExternalReference::transcendental_cache_array_address())); 10314 Immediate(ExternalReference::transcendental_cache_array_address()));
(...skipping 3394 matching lines...) Expand 10 before | Expand all | Expand 10 after
13709 masm.GetCode(&desc); 13709 masm.GetCode(&desc);
13710 // Call the function from C++. 13710 // Call the function from C++.
13711 return FUNCTION_CAST<MemCopyFunction>(buffer); 13711 return FUNCTION_CAST<MemCopyFunction>(buffer);
13712 } 13712 }
13713 13713
13714 #undef __ 13714 #undef __
13715 13715
13716 } } // namespace v8::internal 13716 } } // namespace v8::internal
13717 13717
13718 #endif // V8_TARGET_ARCH_IA32 13718 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698