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 7368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7379 static void WriteToFlat(String* source, | 7379 static void WriteToFlat(String* source, |
7380 sinkchar* sink, | 7380 sinkchar* sink, |
7381 int from, | 7381 int from, |
7382 int to); | 7382 int to); |
7383 | 7383 |
7384 static inline bool IsAscii(const char* chars, int length) { | 7384 static inline bool IsAscii(const char* chars, int length) { |
7385 const char* limit = chars + length; | 7385 const char* limit = chars + length; |
7386 #ifdef V8_HOST_CAN_READ_UNALIGNED | 7386 #ifdef V8_HOST_CAN_READ_UNALIGNED |
7387 ASSERT(kMaxAsciiCharCode == 0x7F); | 7387 ASSERT(kMaxAsciiCharCode == 0x7F); |
7388 const uintptr_t non_ascii_mask = kUintptrAllBitsSet / 0xFF * 0x80; | 7388 const uintptr_t non_ascii_mask = kUintptrAllBitsSet / 0xFF * 0x80; |
7389 while (chars <= limit - sizeof(uintptr_t)) { | 7389 while (chars + sizeof(uintptr_t) <= limit) { |
7390 if (*reinterpret_cast<const uintptr_t*>(chars) & non_ascii_mask) { | 7390 if (*reinterpret_cast<const uintptr_t*>(chars) & non_ascii_mask) { |
7391 return false; | 7391 return false; |
7392 } | 7392 } |
7393 chars += sizeof(uintptr_t); | 7393 chars += sizeof(uintptr_t); |
7394 } | 7394 } |
7395 #endif | 7395 #endif |
7396 while (chars < limit) { | 7396 while (chars < limit) { |
7397 if (static_cast<uint8_t>(*chars) > kMaxAsciiCharCodeU) return false; | 7397 if (static_cast<uint8_t>(*chars) > kMaxAsciiCharCodeU) return false; |
7398 ++chars; | 7398 ++chars; |
7399 } | 7399 } |
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8952 } else { | 8952 } else { |
8953 value &= ~(1 << bit_position); | 8953 value &= ~(1 << bit_position); |
8954 } | 8954 } |
8955 return value; | 8955 return value; |
8956 } | 8956 } |
8957 }; | 8957 }; |
8958 | 8958 |
8959 } } // namespace v8::internal | 8959 } } // namespace v8::internal |
8960 | 8960 |
8961 #endif // V8_OBJECTS_H_ | 8961 #endif // V8_OBJECTS_H_ |
OLD | NEW |