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

Unified Diff: src/heap.cc

Issue 501170: - Increased size of number string cache.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years 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 side-by-side diff with in-line comments
Download patch
Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 3513)
+++ src/heap.cc (working copy)
@@ -1612,17 +1612,18 @@
static inline int double_get_hash(double d) {
Kasper Lund 2009/12/22 11:25:58 This should really be DoubleGetHash (the same goes
DoubleRepresentation rep(d);
- return ((static_cast<int>(rep.bits) ^ static_cast<int>(rep.bits >> 32)) &
- (Heap::kNumberStringCacheSize - 1));
+ int value = (static_cast<int>(rep.bits) ^ static_cast<int>(rep.bits >> 32));
+ return (((value >> 16) ^ value))
Kasper Lund 2009/12/22 11:25:58 How about adding another helper function so you ca
+ & (Heap::kNumberStringCacheSize - 1);
}
static inline int smi_get_hash(Smi* smi) {
- return (smi->value() & (Heap::kNumberStringCacheSize - 1));
+ return ((smi->value() >> 16) ^ smi->value())
+ & (Heap::kNumberStringCacheSize - 1);
}
-
Object* Heap::GetNumberStringCache(Object* number) {
int hash;
if (number->IsSmi()) {

Powered by Google App Engine
This is Rietveld 408576698