remove IsOneByteConvertible

R=ulan@chromium.org
BUG=

Review URL: https://codereview.chromium.org/14298021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14461 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
dcarney@chromium.org 2013-04-26 14:08:18 +00:00
parent 84355ae411
commit c50304209a
4 changed files with 8 additions and 14 deletions

View File

@ -4061,7 +4061,7 @@ bool String::IsOneByte() const {
if (IsDeadCheck(str->GetIsolate(), "v8::String::IsOneByte()")) {
return false;
}
return str->IsOneByteConvertible();
return str->HasOnlyOneByteChars();
}

View File

@ -357,12 +357,8 @@ bool String::IsTwoByteRepresentationUnderneath() {
bool String::HasOnlyOneByteChars() {
uint32_t type = map()->instance_type();
return (type & kOneByteDataHintMask) == kOneByteDataHintTag;
}
bool String::IsOneByteConvertible() {
return HasOnlyOneByteChars() || IsOneByteRepresentation();
return (type & kOneByteDataHintMask) == kOneByteDataHintTag ||
IsOneByteRepresentation();
}

View File

@ -7638,8 +7638,6 @@ class String: public Name {
// 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

View File

@ -3347,8 +3347,8 @@ MUST_USE_RESULT static MaybeObject* StringReplaceGlobalRegExpWithString(
// 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 {
@ -3530,7 +3530,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringReplaceGlobalRegExpWithString) {
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 {
@ -6389,7 +6389,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringBuilderConcat) {
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;
@ -6430,7 +6430,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringBuilderConcat) {
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 {