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 7734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7745 String::SubStringRange::iterator String::SubStringRange::begin() { | 7745 String::SubStringRange::iterator String::SubStringRange::begin() { |
7746 return String::SubStringRange::iterator(string_, first_); | 7746 return String::SubStringRange::iterator(string_, first_); |
7747 } | 7747 } |
7748 | 7748 |
7749 | 7749 |
7750 String::SubStringRange::iterator String::SubStringRange::end() { | 7750 String::SubStringRange::iterator String::SubStringRange::end() { |
7751 return String::SubStringRange::iterator(string_, first_ + length_); | 7751 return String::SubStringRange::iterator(string_, first_ + length_); |
7752 } | 7752 } |
7753 | 7753 |
7754 | 7754 |
| 7755 // Predictably converts HeapObject* or Address to uint32 by calculating |
| 7756 // offset of the address in respective MemoryChunk. |
| 7757 static inline uint32_t ObjectAddressForHashing(void* object) { |
| 7758 uint32_t value = static_cast<uint32_t>(reinterpret_cast<uintptr_t>(object)); |
| 7759 return value & MemoryChunk::kAlignmentMask; |
| 7760 } |
| 7761 |
| 7762 |
7755 #undef TYPE_CHECKER | 7763 #undef TYPE_CHECKER |
7756 #undef CAST_ACCESSOR | 7764 #undef CAST_ACCESSOR |
7757 #undef INT_ACCESSORS | 7765 #undef INT_ACCESSORS |
7758 #undef ACCESSORS | 7766 #undef ACCESSORS |
7759 #undef SMI_ACCESSORS | 7767 #undef SMI_ACCESSORS |
7760 #undef SYNCHRONIZED_SMI_ACCESSORS | 7768 #undef SYNCHRONIZED_SMI_ACCESSORS |
7761 #undef NOBARRIER_SMI_ACCESSORS | 7769 #undef NOBARRIER_SMI_ACCESSORS |
7762 #undef BOOL_GETTER | 7770 #undef BOOL_GETTER |
7763 #undef BOOL_ACCESSORS | 7771 #undef BOOL_ACCESSORS |
7764 #undef FIELD_ADDR | 7772 #undef FIELD_ADDR |
(...skipping 30 matching lines...) Expand all Loading... |
7795 #undef WRITE_INT64_FIELD | 7803 #undef WRITE_INT64_FIELD |
7796 #undef READ_BYTE_FIELD | 7804 #undef READ_BYTE_FIELD |
7797 #undef WRITE_BYTE_FIELD | 7805 #undef WRITE_BYTE_FIELD |
7798 #undef NOBARRIER_READ_BYTE_FIELD | 7806 #undef NOBARRIER_READ_BYTE_FIELD |
7799 #undef NOBARRIER_WRITE_BYTE_FIELD | 7807 #undef NOBARRIER_WRITE_BYTE_FIELD |
7800 | 7808 |
7801 } // namespace internal | 7809 } // namespace internal |
7802 } // namespace v8 | 7810 } // namespace v8 |
7803 | 7811 |
7804 #endif // V8_OBJECTS_INL_H_ | 7812 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |