OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 return (type_ & kStringSizeMask); | 256 return (type_ & kStringSizeMask); |
257 } | 257 } |
258 | 258 |
259 | 259 |
260 bool StringShape::IsSequentialAscii() { | 260 bool StringShape::IsSequentialAscii() { |
261 return full_representation_tag() == (kSeqStringTag | kAsciiStringTag); | 261 return full_representation_tag() == (kSeqStringTag | kAsciiStringTag); |
262 } | 262 } |
263 | 263 |
264 | 264 |
265 bool StringShape::IsSequentialTwoByte() { | 265 bool StringShape::IsSequentialTwoByte() { |
266 return (type_ & (kStringRepresentationMask | kStringEncodingMask)) == | 266 return full_representation_tag() == (kSeqStringTag | kTwoByteStringTag); |
267 (kSeqStringTag | kTwoByteStringTag); | |
268 } | 267 } |
269 | 268 |
270 | 269 |
271 bool StringShape::IsExternalAscii() { | 270 bool StringShape::IsExternalAscii() { |
272 return full_representation_tag() == (kExternalStringTag | kAsciiStringTag); | 271 return full_representation_tag() == (kExternalStringTag | kAsciiStringTag); |
273 } | 272 } |
274 | 273 |
275 | 274 |
276 bool StringShape::IsExternalTwoByte() { | 275 bool StringShape::IsExternalTwoByte() { |
277 return (type_ & (kStringRepresentationMask | kStringEncodingMask)) == | 276 return full_representation_tag() == (kExternalStringTag | kTwoByteStringTag); |
278 (kExternalStringTag | kTwoByteStringTag); | |
279 } | 277 } |
280 | 278 |
281 | 279 |
282 uc32 FlatStringReader::Get(int index) { | 280 uc32 FlatStringReader::Get(int index) { |
283 ASSERT(0 <= index && index <= length_); | 281 ASSERT(0 <= index && index <= length_); |
284 if (is_ascii_) { | 282 if (is_ascii_) { |
285 return static_cast<const byte*>(start_)[index]; | 283 return static_cast<const byte*>(start_)[index]; |
286 } else { | 284 } else { |
287 return static_cast<const uc16*>(start_)[index]; | 285 return static_cast<const uc16*>(start_)[index]; |
288 } | 286 } |
(...skipping 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2590 #undef WRITE_INT_FIELD | 2588 #undef WRITE_INT_FIELD |
2591 #undef READ_SHORT_FIELD | 2589 #undef READ_SHORT_FIELD |
2592 #undef WRITE_SHORT_FIELD | 2590 #undef WRITE_SHORT_FIELD |
2593 #undef READ_BYTE_FIELD | 2591 #undef READ_BYTE_FIELD |
2594 #undef WRITE_BYTE_FIELD | 2592 #undef WRITE_BYTE_FIELD |
2595 | 2593 |
2596 | 2594 |
2597 } } // namespace v8::internal | 2595 } } // namespace v8::internal |
2598 | 2596 |
2599 #endif // V8_OBJECTS_INL_H_ | 2597 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |