| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Review notes: | 5 // Review notes: |
| 6 // | 6 // |
| 7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
| 8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
| 9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
| 10 // | 10 // |
| (...skipping 6810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6821 if (!hasher.has_trivial_hash()) hasher.AddCharacters(chars, length); | 6821 if (!hasher.has_trivial_hash()) hasher.AddCharacters(chars, length); |
| 6822 return hasher.GetHashField(); | 6822 return hasher.GetHashField(); |
| 6823 } | 6823 } |
| 6824 | 6824 |
| 6825 | 6825 |
| 6826 uint32_t IteratingStringHasher::Hash(String* string, uint32_t seed) { | 6826 uint32_t IteratingStringHasher::Hash(String* string, uint32_t seed) { |
| 6827 IteratingStringHasher hasher(string->length(), seed); | 6827 IteratingStringHasher hasher(string->length(), seed); |
| 6828 // Nothing to do. | 6828 // Nothing to do. |
| 6829 if (hasher.has_trivial_hash()) return hasher.GetHashField(); | 6829 if (hasher.has_trivial_hash()) return hasher.GetHashField(); |
| 6830 ConsString* cons_string = String::VisitFlat(&hasher, string); | 6830 ConsString* cons_string = String::VisitFlat(&hasher, string); |
| 6831 if (cons_string != nullptr) { | 6831 if (cons_string == nullptr) return hasher.GetHashField(); |
| 6832 hasher.VisitConsString(cons_string); | 6832 hasher.VisitConsString(cons_string); |
| 6833 } | |
| 6834 return hasher.GetHashField(); | 6833 return hasher.GetHashField(); |
| 6835 } | 6834 } |
| 6836 | 6835 |
| 6837 | 6836 |
| 6838 void IteratingStringHasher::VisitOneByteString(const uint8_t* chars, | 6837 void IteratingStringHasher::VisitOneByteString(const uint8_t* chars, |
| 6839 int length) { | 6838 int length) { |
| 6840 AddCharacters(chars, length); | 6839 AddCharacters(chars, length); |
| 6841 } | 6840 } |
| 6842 | 6841 |
| 6843 | 6842 |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7515 #undef READ_SHORT_FIELD | 7514 #undef READ_SHORT_FIELD |
| 7516 #undef WRITE_SHORT_FIELD | 7515 #undef WRITE_SHORT_FIELD |
| 7517 #undef READ_BYTE_FIELD | 7516 #undef READ_BYTE_FIELD |
| 7518 #undef WRITE_BYTE_FIELD | 7517 #undef WRITE_BYTE_FIELD |
| 7519 #undef NOBARRIER_READ_BYTE_FIELD | 7518 #undef NOBARRIER_READ_BYTE_FIELD |
| 7520 #undef NOBARRIER_WRITE_BYTE_FIELD | 7519 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7521 | 7520 |
| 7522 } } // namespace v8::internal | 7521 } } // namespace v8::internal |
| 7523 | 7522 |
| 7524 #endif // V8_OBJECTS_INL_H_ | 7523 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |