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 4291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4302 } | 4302 } |
4303 return str->HasOnlyOneByteChars(); | 4303 return str->HasOnlyOneByteChars(); |
4304 } | 4304 } |
4305 | 4305 |
4306 // Helpers for ContainsOnlyOneByteHelper | 4306 // Helpers for ContainsOnlyOneByteHelper |
4307 template<size_t size> struct OneByteMask; | 4307 template<size_t size> struct OneByteMask; |
4308 template<> struct OneByteMask<4> { | 4308 template<> struct OneByteMask<4> { |
4309 static const uint32_t value = 0xFF00FF00; | 4309 static const uint32_t value = 0xFF00FF00; |
4310 }; | 4310 }; |
4311 template<> struct OneByteMask<8> { | 4311 template<> struct OneByteMask<8> { |
4312 static const uint64_t value = 0xFF00FF00FF00FF00; | 4312 static const uint64_t value = V8_2PART_UINT64_C(0xFF00FF00, FF00FF00); |
4313 }; | 4313 }; |
4314 static const uintptr_t kOneByteMask = OneByteMask<sizeof(uintptr_t)>::value; | 4314 static const uintptr_t kOneByteMask = OneByteMask<sizeof(uintptr_t)>::value; |
4315 static const uintptr_t kAlignmentMask = sizeof(uintptr_t) - 1; | 4315 static const uintptr_t kAlignmentMask = sizeof(uintptr_t) - 1; |
4316 static inline bool Unaligned(const uint16_t* chars) { | 4316 static inline bool Unaligned(const uint16_t* chars) { |
4317 return reinterpret_cast<const uintptr_t>(chars) & kAlignmentMask; | 4317 return reinterpret_cast<const uintptr_t>(chars) & kAlignmentMask; |
4318 } | 4318 } |
4319 static inline const uint16_t* Align(const uint16_t* chars) { | 4319 static inline const uint16_t* Align(const uint16_t* chars) { |
4320 return reinterpret_cast<uint16_t*>( | 4320 return reinterpret_cast<uint16_t*>( |
4321 reinterpret_cast<uintptr_t>(chars) & ~kAlignmentMask); | 4321 reinterpret_cast<uintptr_t>(chars) & ~kAlignmentMask); |
4322 } | 4322 } |
(...skipping 3672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7995 | 7995 |
7996 v->VisitPointers(blocks_.first(), first_block_limit_); | 7996 v->VisitPointers(blocks_.first(), first_block_limit_); |
7997 | 7997 |
7998 for (int i = 1; i < blocks_.length(); i++) { | 7998 for (int i = 1; i < blocks_.length(); i++) { |
7999 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 7999 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
8000 } | 8000 } |
8001 } | 8001 } |
8002 | 8002 |
8003 | 8003 |
8004 } } // namespace v8::internal | 8004 } } // namespace v8::internal |
OLD | NEW |