Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: src/objects-inl.h

Issue 11361171: Make kAsciiDataHintTag have correct semantics for all both 1 and 2 byte string types. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 case kTwoByteStringTag: 334 case kTwoByteStringTag:
335 return true; 335 return true;
336 default: // Cons or sliced string. Need to go deeper. 336 default: // Cons or sliced string. Need to go deeper.
337 return GetUnderlying()->IsTwoByteRepresentation(); 337 return GetUnderlying()->IsTwoByteRepresentation();
338 } 338 }
339 } 339 }
340 340
341 341
342 bool String::HasOnlyAsciiChars() { 342 bool String::HasOnlyAsciiChars() {
343 uint32_t type = map()->instance_type(); 343 uint32_t type = map()->instance_type();
344 return (type & kStringEncodingMask) == kOneByteStringTag || 344 return (type & kAsciiDataHintMask) == kAsciiDataHintTag;
345 (type & kAsciiDataHintMask) == kAsciiDataHintTag;
346 } 345 }
347 346
348 347
349 bool StringShape::IsCons() { 348 bool StringShape::IsCons() {
350 return (type_ & kStringRepresentationMask) == kConsStringTag; 349 return (type_ & kStringRepresentationMask) == kConsStringTag;
351 } 350 }
352 351
353 352
354 bool StringShape::IsSliced() { 353 bool StringShape::IsSliced() {
355 return (type_ & kStringRepresentationMask) == kSlicedStringTag; 354 return (type_ & kStringRepresentationMask) == kSlicedStringTag;
(...skipping 5205 matching lines...) Expand 10 before | Expand all | Expand 10 after
5561 #undef WRITE_UINT32_FIELD 5560 #undef WRITE_UINT32_FIELD
5562 #undef READ_SHORT_FIELD 5561 #undef READ_SHORT_FIELD
5563 #undef WRITE_SHORT_FIELD 5562 #undef WRITE_SHORT_FIELD
5564 #undef READ_BYTE_FIELD 5563 #undef READ_BYTE_FIELD
5565 #undef WRITE_BYTE_FIELD 5564 #undef WRITE_BYTE_FIELD
5566 5565
5567 5566
5568 } } // namespace v8::internal 5567 } } // namespace v8::internal
5569 5568
5570 #endif // V8_OBJECTS_INL_H_ 5569 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698