bool String::HasOnlyOneByteChars() {
uint32_t type = map()->instance_type();
- return (type & kOneByteDataHintMask) == kOneByteDataHintTag;
-}
-
-
-bool String::IsOneByteConvertible() {
- return HasOnlyOneByteChars() || IsOneByteRepresentation();
+ return (type & kOneByteDataHintMask) == kOneByteDataHintTag ||
+ IsOneByteRepresentation();
}
// possible.
inline bool HasOnlyOneByteChars();
- inline bool IsOneByteConvertible();
-
// Get and set individual two byte chars in the string.
inline void Set(int index, uint16_t value);
// Get individual two byte char in the string. Repeated calls
// Shortcut for simple non-regexp global replacements
if (regexp->TypeTag() == JSRegExp::ATOM && simple_replace) {
- if (subject->IsOneByteConvertible() &&
- replacement->IsOneByteConvertible()) {
+ if (subject->HasOnlyOneByteChars() &&
+ replacement->HasOnlyOneByteChars()) {
return StringReplaceGlobalAtomRegExpWithString<SeqOneByteString>(
isolate, subject, regexp, replacement, last_match_info);
} else {
if (!subject->IsFlat()) subject = FlattenGetString(subject);
if (replacement->length() == 0) {
- if (subject->IsOneByteConvertible()) {
+ if (subject->HasOnlyOneByteChars()) {
return StringReplaceGlobalRegExpWithEmptyString<SeqOneByteString>(
isolate, subject, regexp, last_match_info);
} else {
if (first->IsString()) return first;
}
- bool one_byte = special->IsOneByteConvertible();
+ bool one_byte = special->HasOnlyOneByteChars();
int position = 0;
for (int i = 0; i < array_length; i++) {
int increment = 0;
String* element = String::cast(elt);
int element_length = element->length();
increment = element_length;
- if (one_byte && !element->IsOneByteConvertible()) {
+ if (one_byte && !element->HasOnlyOneByteChars()) {
one_byte = false;
}
} else {