OLD | NEW |
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 11559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11570 hash += hash << 10; | 11570 hash += hash << 10; |
11571 hash ^= hash >> 6; | 11571 hash ^= hash >> 6; |
11572 // Char 2. | 11572 // Char 2. |
11573 hash += c2; | 11573 hash += c2; |
11574 hash += hash << 10; | 11574 hash += hash << 10; |
11575 hash ^= hash >> 6; | 11575 hash ^= hash >> 6; |
11576 // GetHash. | 11576 // GetHash. |
11577 hash += hash << 3; | 11577 hash += hash << 3; |
11578 hash ^= hash >> 11; | 11578 hash ^= hash >> 11; |
11579 hash += hash << 15; | 11579 hash += hash << 15; |
11580 if ((hash & String::kHashBitMask) == 0) hash = 27; | 11580 if ((hash & String::kHashBitMask) == 0) hash = String::kZeroHash; |
11581 #ifdef DEBUG | 11581 #ifdef DEBUG |
11582 StringHasher hasher(2, seed); | 11582 StringHasher hasher(2, seed); |
11583 hasher.AddCharacter(c1); | 11583 hasher.AddCharacter(c1); |
11584 hasher.AddCharacter(c2); | 11584 hasher.AddCharacter(c2); |
11585 // If this assert fails then we failed to reproduce the two-character | 11585 // If this assert fails then we failed to reproduce the two-character |
11586 // version of the string hashing algorithm above. One reason could be | 11586 // version of the string hashing algorithm above. One reason could be |
11587 // that we were passed two digits as characters, since the hash | 11587 // that we were passed two digits as characters, since the hash |
11588 // algorithm is different in that case. | 11588 // algorithm is different in that case. |
11589 ASSERT_EQ(static_cast<int>(hasher.GetHash()), static_cast<int>(hash)); | 11589 ASSERT_EQ(static_cast<int>(hasher.GetHash()), static_cast<int>(hash)); |
11590 #endif | 11590 #endif |
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12742 if (break_point_objects()->IsUndefined()) return 0; | 12742 if (break_point_objects()->IsUndefined()) return 0; |
12743 // Single break point. | 12743 // Single break point. |
12744 if (!break_point_objects()->IsFixedArray()) return 1; | 12744 if (!break_point_objects()->IsFixedArray()) return 1; |
12745 // Multiple break points. | 12745 // Multiple break points. |
12746 return FixedArray::cast(break_point_objects())->length(); | 12746 return FixedArray::cast(break_point_objects())->length(); |
12747 } | 12747 } |
12748 #endif // ENABLE_DEBUGGER_SUPPORT | 12748 #endif // ENABLE_DEBUGGER_SUPPORT |
12749 | 12749 |
12750 | 12750 |
12751 } } // namespace v8::internal | 12751 } } // namespace v8::internal |
OLD | NEW |