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

Side by Side Diff: src/objects.h

Issue 527006: - Adjust the number to string cache based on the max semispace size.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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
« src/heap.cc ('K') | « src/heap.cc ('k') | src/objects.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 fast_set(this, kCapacityIndex, Smi::FromInt(capacity)); 1981 fast_set(this, kCapacityIndex, Smi::FromInt(capacity));
1982 } 1982 }
1983 1983
1984 1984
1985 // Returns probe entry. 1985 // Returns probe entry.
1986 static uint32_t GetProbe(uint32_t hash, uint32_t number, uint32_t size) { 1986 static uint32_t GetProbe(uint32_t hash, uint32_t number, uint32_t size) {
1987 ASSERT(IsPowerOf2(size)); 1987 ASSERT(IsPowerOf2(size));
1988 return (hash + GetProbeOffset(number)) & (size - 1); 1988 return (hash + GetProbeOffset(number)) & (size - 1);
1989 } 1989 }
1990 1990
1991 static uint32_t FirstProbe(uint32_t hash, uint32_t size) {
1992 return hash & (size - 1);
1993 }
1994
1995 static uint32_t NextProbe(uint32_t last, uint32_t number, uint32_t size) {
1996 return (last + number) & (size - 1);
1997 }
1998
1991 // Ensure enough space for n additional elements. 1999 // Ensure enough space for n additional elements.
1992 Object* EnsureCapacity(int n, Key key); 2000 Object* EnsureCapacity(int n, Key key);
1993 }; 2001 };
1994 2002
1995 2003
1996 2004
1997 // HashTableKey is an abstract superclass for virtual key behavior. 2005 // HashTableKey is an abstract superclass for virtual key behavior.
1998 class HashTableKey { 2006 class HashTableKey {
1999 public: 2007 public:
2000 // Returns whether the other object matches this key. 2008 // Returns whether the other object matches this key.
(...skipping 2899 matching lines...) Expand 10 before | Expand all | Expand 10 after
4900 } else { 4908 } else {
4901 value &= ~(1 << bit_position); 4909 value &= ~(1 << bit_position);
4902 } 4910 }
4903 return value; 4911 return value;
4904 } 4912 }
4905 }; 4913 };
4906 4914
4907 } } // namespace v8::internal 4915 } } // namespace v8::internal
4908 4916
4909 #endif // V8_OBJECTS_H_ 4917 #endif // V8_OBJECTS_H_
OLDNEW
« src/heap.cc ('K') | « src/heap.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698