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

Side by Side Diff: src/objects.h

Issue 11228004: Fix two-char hash to use correct fallback for zero hashes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 7362 matching lines...) Expand 10 before | Expand all | Expand 10 after
7373 7373
7374 static const int kContainsCachedArrayIndexMask = 7374 static const int kContainsCachedArrayIndexMask =
7375 (~kMaxCachedArrayIndexLength << kArrayIndexHashLengthShift) | 7375 (~kMaxCachedArrayIndexLength << kArrayIndexHashLengthShift) |
7376 kIsNotArrayIndexMask; 7376 kIsNotArrayIndexMask;
7377 7377
7378 // Value of empty hash field indicating that the hash is not computed. 7378 // Value of empty hash field indicating that the hash is not computed.
7379 static const int kEmptyHashField = 7379 static const int kEmptyHashField =
7380 kIsNotArrayIndexMask | kHashNotComputedMask; 7380 kIsNotArrayIndexMask | kHashNotComputedMask;
7381 7381
7382 // Value of hash field containing computed hash equal to zero. 7382 // Value of hash field containing computed hash equal to zero.
7383 static const int kZeroHash = kIsNotArrayIndexMask; 7383 static const int kEmptyStringHash = kIsNotArrayIndexMask;
7384 7384
7385 // Maximal string length. 7385 // Maximal string length.
7386 static const int kMaxLength = (1 << (32 - 2)) - 1; 7386 static const int kMaxLength = (1 << (32 - 2)) - 1;
7387 7387
7388 // Max length for computing hash. For strings longer than this limit the 7388 // Max length for computing hash. For strings longer than this limit the
7389 // string length is used as the hash value. 7389 // string length is used as the hash value.
7390 static const int kMaxHashCalcLength = 16383; 7390 static const int kMaxHashCalcLength = 16383;
7391 7391
7392 // Limit for truncation in short printing. 7392 // Limit for truncation in short printing.
7393 static const int kMaxShortPrintLength = 1024; 7393 static const int kMaxShortPrintLength = 1024;
(...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after
8955 } else { 8955 } else {
8956 value &= ~(1 << bit_position); 8956 value &= ~(1 << bit_position);
8957 } 8957 }
8958 return value; 8958 return value;
8959 } 8959 }
8960 }; 8960 };
8961 8961
8962 } } // namespace v8::internal 8962 } } // namespace v8::internal
8963 8963
8964 #endif // V8_OBJECTS_H_ 8964 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698