Revision: 13023
Author:   [email protected]
Date:     Wed Nov 21 02:01:05 2012
Log:      Rename IsAsciiRepresentation

This is a straight rename:

IsAsciiRepresentation -> IsOneByteRepresentation
IsAsciiRepresentationUnderneath -> IsOneByteRepresentationUnderneath
AllocateRawAsciiString -> AllocateRawOneByteString
AllocateStringFromAscii -> AllocateStringFromOneByte

[email protected],
BUG=

Review URL: https://chromiumcodereview.appspot.com/11308066
Patch from Dan Carney <[email protected]>.
http://code.google.com/p/v8/source/detail?r=13023

Modified:
 /branches/bleeding_edge/src/api.cc
 /branches/bleeding_edge/src/arm/regexp-macro-assembler-arm.cc
 /branches/bleeding_edge/src/bootstrapper.cc
 /branches/bleeding_edge/src/extensions/externalize-string-extension.cc
 /branches/bleeding_edge/src/factory.cc
 /branches/bleeding_edge/src/handles.cc
 /branches/bleeding_edge/src/heap-inl.h
 /branches/bleeding_edge/src/heap.cc
 /branches/bleeding_edge/src/heap.h
 /branches/bleeding_edge/src/ia32/regexp-macro-assembler-ia32.cc
 /branches/bleeding_edge/src/jsregexp.cc
 /branches/bleeding_edge/src/log-utils.cc
 /branches/bleeding_edge/src/mips/regexp-macro-assembler-mips.cc
 /branches/bleeding_edge/src/objects-inl.h
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/src/objects.h
 /branches/bleeding_edge/src/regexp-macro-assembler.cc
 /branches/bleeding_edge/src/runtime.cc
 /branches/bleeding_edge/src/x64/regexp-macro-assembler-x64.cc
 /branches/bleeding_edge/test/cctest/test-alloc.cc
 /branches/bleeding_edge/test/cctest/test-api.cc

=======================================
--- /branches/bleeding_edge/src/api.cc  Fri Nov 16 00:38:11 2012
+++ /branches/bleeding_edge/src/api.cc  Wed Nov 21 02:01:05 2012
@@ -3850,7 +3850,7 @@
                                       int32_t* last_character) {
   int utf8_bytes = 0;
   while (true) {
-    if (string->IsAsciiRepresentation()) {
+    if (string->IsOneByteRepresentation()) {
       i::String::WriteToFlat(string, buffer, start, end);
       *last_character = unibrow::Utf16::kNoPreviousCharacter;
       return utf8_bytes + end - start;
@@ -3950,7 +3950,7 @@
     FlattenString(str);  // Flatten the string for efficiency.
   }
   int string_length = str->length();
-  if (str->IsAsciiRepresentation()) {
+  if (str->IsOneByteRepresentation()) {
     int len;
     if (capacity == -1) {
       capacity = str->length() + 1;
@@ -4084,7 +4084,7 @@
     FlattenString(str);  // Flatten the string for efficiency.
   }

-  if (str->IsAsciiRepresentation()) {
+  if (str->IsOneByteRepresentation()) {
     // WriteToFlat is faster than using the StringInputBuffer.
     if (length == -1) length = str->length() + 1;
     int len = i::Min(length, str->length() - start);
@@ -4199,7 +4199,7 @@
     expectedEncoding = TWO_BYTE_ENCODING;
   } else {
     expected = NULL;
-    expectedEncoding = str->IsAsciiRepresentation() ? ASCII_ENCODING
+    expectedEncoding = str->IsOneByteRepresentation() ? ASCII_ENCODING
                                                     : TWO_BYTE_ENCODING;
   }
   CHECK_EQ(expected, value);
=======================================
--- /branches/bleeding_edge/src/arm/regexp-macro-assembler-arm.cc Mon Oct 15 08:19:36 2012 +++ /branches/bleeding_edge/src/arm/regexp-macro-assembler-arm.cc Wed Nov 21 02:01:05 2012
@@ -1150,7 +1150,7 @@
   Handle<String> subject(frame_entry<String*>(re_frame, kInputString));

   // Current string.
-  bool is_ascii = subject->IsAsciiRepresentationUnderneath();
+  bool is_ascii = subject->IsOneByteRepresentationUnderneath();

   ASSERT(re_code->instruction_start() <= *return_address);
   ASSERT(*return_address <=
@@ -1181,7 +1181,7 @@
   }

   // String might have changed.
-  if (subject_tmp->IsAsciiRepresentation() != is_ascii) {
+  if (subject_tmp->IsOneByteRepresentation() != is_ascii) {
     // If we changed between an ASCII and an UC16 string, the specialized
     // code cannot be used, and we need to restart regexp matching from
// scratch (including, potentially, compiling a new version of the code).
=======================================
--- /branches/bleeding_edge/src/bootstrapper.cc Tue Nov 13 04:27:03 2012
+++ /branches/bleeding_edge/src/bootstrapper.cc Wed Nov 21 02:01:05 2012
@@ -1341,7 +1341,7 @@
   // If we can't find the function in the cache, we compile a new
   // function and insert it into the cache.
   if (cache == NULL || !cache->Lookup(name, &function_info)) {
-    ASSERT(source->IsAsciiRepresentation());
+    ASSERT(source->IsOneByteRepresentation());
     Handle<String> script_name = factory->NewStringFromUtf8(name);
     function_info = Compiler::Compile(
         source,
=======================================
--- /branches/bleeding_edge/src/extensions/externalize-string-extension.cc Thu Mar 29 02:45:46 2012 +++ /branches/bleeding_edge/src/extensions/externalize-string-extension.cc Wed Nov 21 02:01:05 2012
@@ -93,7 +93,7 @@
     return v8::ThrowException(v8::String::New(
         "externalizeString() can't externalize twice."));
   }
-  if (string->IsAsciiRepresentation() && !force_two_byte) {
+  if (string->IsOneByteRepresentation() && !force_two_byte) {
     char* data = new char[string->length()];
     String::WriteToFlat(*string, data, 0, string->length());
     SimpleAsciiStringResource* resource = new SimpleAsciiStringResource(
@@ -127,7 +127,8 @@
     return v8::ThrowException(v8::String::New(
         "isAsciiString() requires a single string argument."));
   }
- return Utils::OpenHandle(*args[0].As<v8::String>())->IsAsciiRepresentation() ?
+  return
+ Utils::OpenHandle(*args[0].As<v8::String>())->IsOneByteRepresentation() ?
       v8::True() : v8::False();
 }

=======================================
--- /branches/bleeding_edge/src/factory.cc      Fri Nov 16 00:38:11 2012
+++ /branches/bleeding_edge/src/factory.cc      Wed Nov 21 02:01:05 2012
@@ -200,7 +200,7 @@
                                            PretenureFlag pretenure) {
   CALL_HEAP_FUNCTION(
       isolate(),
-      isolate()->heap()->AllocateStringFromAscii(string, pretenure),
+      isolate()->heap()->AllocateStringFromOneByte(string, pretenure),
       String);
 }

@@ -226,7 +226,7 @@
PretenureFlag pretenure) {
   CALL_HEAP_FUNCTION(
       isolate(),
-      isolate()->heap()->AllocateRawAsciiString(length, pretenure),
+      isolate()->heap()->AllocateRawOneByteString(length, pretenure),
       SeqOneByteString);
 }

=======================================
--- /branches/bleeding_edge/src/handles.cc      Mon Nov 12 04:34:18 2012
+++ /branches/bleeding_edge/src/handles.cc      Wed Nov 21 02:01:05 2012
@@ -915,7 +915,7 @@
   int total = 0;
   bool dummy;
   while (true) {
-    if (input->IsAsciiRepresentation()) {
+    if (input->IsOneByteRepresentation()) {
       *starts_with_surrogate = false;
       return total + to - from;
     }
@@ -948,14 +948,14 @@
         } else {
           if (first_length > from) {
             // Left hand side is shorter.
-            if (first->IsAsciiRepresentation()) {
+            if (first->IsOneByteRepresentation()) {
               total += first_length - from;
               *starts_with_surrogate = false;
               starts_with_surrogate = &dummy;
               input = second;
               from = 0;
               to -= first_length;
-            } else if (second->IsAsciiRepresentation()) {
+            } else if (second->IsOneByteRepresentation()) {
               followed_by_surrogate = false;
               total += to - first_length;
               input = first;
=======================================
--- /branches/bleeding_edge/src/heap-inl.h      Thu Nov 15 05:31:27 2012
+++ /branches/bleeding_edge/src/heap-inl.h      Wed Nov 21 02:01:05 2012
@@ -91,7 +91,7 @@
   if (non_ascii_start >= length) {
     // If the string is ASCII, we do not need to convert the characters
     // since UTF8 is backwards compatible with ASCII.
-    return AllocateStringFromAscii(str, pretenure);
+    return AllocateStringFromOneByte(str, pretenure);
   }
   // Non-ASCII and we need to decode.
   return AllocateStringFromUtf8Slow(str, non_ascii_start, pretenure);
=======================================
--- /branches/bleeding_edge/src/heap.cc Thu Nov 15 05:31:27 2012
+++ /branches/bleeding_edge/src/heap.cc Wed Nov 21 02:01:05 2012
@@ -2805,7 +2805,7 @@
   set_termination_exception(obj);

   // Allocate the empty string.
-  { MaybeObject* maybe_obj = AllocateRawAsciiString(0, TENURED);
+  { MaybeObject* maybe_obj = AllocateRawOneByteString(0, TENURED);
     if (!maybe_obj->ToObject(&obj)) return false;
   }
   set_empty_string(String::cast(obj));
@@ -3177,7 +3177,7 @@
   }

   Object* js_string;
-  MaybeObject* maybe_js_string = AllocateStringFromAscii(CStrVector(str));
+ MaybeObject* maybe_js_string = AllocateStringFromOneByte(CStrVector(str));
   if (maybe_js_string->ToObject(&js_string)) {
     SetNumberStringCache(number, String::cast(js_string));
   }
@@ -3351,7 +3351,7 @@
   } else if ((c1 | c2) <= String::kMaxAsciiCharCodeU) {  // We can do this
ASSERT(IsPowerOf2(String::kMaxAsciiCharCodeU + 1)); // because of this.
     Object* result;
-    { MaybeObject* maybe_result = heap->AllocateRawAsciiString(2);
+    { MaybeObject* maybe_result = heap->AllocateRawOneByteString(2);
       if (!maybe_result->ToObject(&result)) return maybe_result;
     }
     char* dest = SeqOneByteString::cast(result)->GetChars();
@@ -3393,8 +3393,8 @@
     return MakeOrFindTwoCharacterString(this, c1, c2);
   }

-  bool first_is_ascii = first->IsAsciiRepresentation();
-  bool second_is_ascii = second->IsAsciiRepresentation();
+  bool first_is_ascii = first->IsOneByteRepresentation();
+  bool second_is_ascii = second->IsOneByteRepresentation();
   bool is_ascii = first_is_ascii && second_is_ascii;

   // Make sure that an out of memory exception is thrown if the length
@@ -3424,7 +3424,7 @@
     ASSERT(second->IsFlat());
     if (is_ascii) {
       Object* result;
-      { MaybeObject* maybe_result = AllocateRawAsciiString(length);
+      { MaybeObject* maybe_result = AllocateRawOneByteString(length);
         if (!maybe_result->ToObject(&result)) return maybe_result;
       }
       // Copy the characters into the new object.
@@ -3448,7 +3448,7 @@
     } else {
       if (is_ascii_data_in_two_byte_string) {
         Object* result;
-        { MaybeObject* maybe_result = AllocateRawAsciiString(length);
+        { MaybeObject* maybe_result = AllocateRawOneByteString(length);
           if (!maybe_result->ToObject(&result)) return maybe_result;
         }
         // Copy the characters into the new object.
@@ -3519,16 +3519,16 @@
     // WriteToFlat takes care of the case when an indirect string has a
     // different encoding from its underlying string.  These encodings may
     // differ because of externalization.
-    bool is_ascii = buffer->IsAsciiRepresentation();
+    bool is_ascii = buffer->IsOneByteRepresentation();
     { MaybeObject* maybe_result = is_ascii
- ? AllocateRawAsciiString(length, pretenure) + ? AllocateRawOneByteString(length, pretenure) : AllocateRawTwoByteString(length, pretenure);
       if (!maybe_result->ToObject(&result)) return maybe_result;
     }
     String* string_result = String::cast(result);
     // Copy the characters into the new object.
     if (is_ascii) {
-      ASSERT(string_result->IsAsciiRepresentation());
+      ASSERT(string_result->IsOneByteRepresentation());
       char* dest = SeqOneByteString::cast(string_result)->GetChars();
       String::WriteToFlat(buffer, dest, start, end);
     } else {
@@ -3553,7 +3553,7 @@
// indirect ASCII string is pointing to a two-byte string, the two-byte char
   // codes of the underlying string must still fit into ASCII (because
   // externalization must not change char codes).
-  { Map* map = buffer->IsAsciiRepresentation()
+  { Map* map = buffer->IsOneByteRepresentation()
                  ? sliced_ascii_string_map()
                  : sliced_string_map();
     MaybeObject* maybe_result = Allocate(map, NEW_SPACE);
@@ -4559,7 +4559,7 @@
 }


-MaybeObject* Heap::AllocateStringFromAscii(Vector<const char> string,
+MaybeObject* Heap::AllocateStringFromOneByte(Vector<const char> string,
                                            PretenureFlag pretenure) {
   int length = string.length();
   if (length == 1) {
@@ -4567,7 +4567,7 @@
   }
   Object* result;
   { MaybeObject* maybe_result =
-        AllocateRawAsciiString(string.length(), pretenure);
+        AllocateRawOneByteString(string.length(), pretenure);
     if (!maybe_result->ToObject(&result)) return maybe_result;
   }

@@ -4625,7 +4625,7 @@
   const uc16* start = string.start();

   if (String::IsAscii(start, length)) {
-    MaybeObject* maybe_result = AllocateRawAsciiString(length, pretenure);
+ MaybeObject* maybe_result = AllocateRawOneByteString(length, pretenure);
     if (!maybe_result->ToObject(&result)) return maybe_result;
     CopyChars(SeqOneByteString::cast(result)->GetChars(), start, length);
   } else {  // It's not an ASCII string.
@@ -4726,7 +4726,8 @@
 }


-MaybeObject* Heap::AllocateRawAsciiString(int length, PretenureFlag pretenure) {
+MaybeObject* Heap::AllocateRawOneByteString(int length,
+                                            PretenureFlag pretenure) {
   if (length < 0 || length > SeqOneByteString::kMaxLength) {
     return Failure::OutOfMemoryException();
   }
=======================================
--- /branches/bleeding_edge/src/heap.h  Thu Nov 15 05:31:27 2012
+++ /branches/bleeding_edge/src/heap.h  Wed Nov 21 02:01:05 2012
@@ -706,7 +706,7 @@
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT MaybeObject* AllocateStringFromAscii(
+  MUST_USE_RESULT MaybeObject* AllocateStringFromOneByte(
       Vector<const char> str,
       PretenureFlag pretenure = NOT_TENURED);
   MUST_USE_RESULT inline MaybeObject* AllocateStringFromUtf8(
@@ -750,7 +750,7 @@
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
   // failed.
   // Please note this does not perform a garbage collection.
-  MUST_USE_RESULT MaybeObject* AllocateRawAsciiString(
+  MUST_USE_RESULT MaybeObject* AllocateRawOneByteString(
       int length,
       PretenureFlag pretenure = NOT_TENURED);
   MUST_USE_RESULT MaybeObject* AllocateRawTwoByteString(
=======================================
--- /branches/bleeding_edge/src/ia32/regexp-macro-assembler-ia32.cc Thu Jun 14 06:59:48 2012 +++ /branches/bleeding_edge/src/ia32/regexp-macro-assembler-ia32.cc Wed Nov 21 02:01:05 2012
@@ -1197,7 +1197,7 @@
   Handle<String> subject(frame_entry<String*>(re_frame, kInputString));

   // Current string.
-  bool is_ascii = subject->IsAsciiRepresentationUnderneath();
+  bool is_ascii = subject->IsOneByteRepresentationUnderneath();

   ASSERT(re_code->instruction_start() <= *return_address);
   ASSERT(*return_address <=
@@ -1228,7 +1228,7 @@
   }

   // String might have changed.
-  if (subject_tmp->IsAsciiRepresentation() != is_ascii) {
+  if (subject_tmp->IsOneByteRepresentation() != is_ascii) {
     // If we changed between an ASCII and an UC16 string, the specialized
     // code cannot be used, and we need to restart regexp matching from
// scratch (including, potentially, compiling a new version of the code).
=======================================
--- /branches/bleeding_edge/src/jsregexp.cc     Wed Sep 12 08:26:43 2012
+++ /branches/bleeding_edge/src/jsregexp.cc     Wed Nov 21 02:01:05 2012
@@ -529,7 +529,7 @@
   if (!subject->IsFlat()) FlattenString(subject);

   // Check the asciiness of the underlying storage.
-  bool is_ascii = subject->IsAsciiRepresentationUnderneath();
+  bool is_ascii = subject->IsOneByteRepresentationUnderneath();
   if (!EnsureCompiledIrregexp(regexp, subject, is_ascii)) return -1;

 #ifdef V8_INTERPRETED_REGEXP
@@ -560,7 +560,7 @@
   ASSERT(index <= subject->length());
   ASSERT(subject->IsFlat());

-  bool is_ascii = subject->IsAsciiRepresentationUnderneath();
+  bool is_ascii = subject->IsOneByteRepresentationUnderneath();

 #ifndef V8_INTERPRETED_REGEXP
   ASSERT(output_size >= (IrregexpNumberOfCaptures(*irregexp) + 1) * 2);
@@ -596,7 +596,7 @@
     // being internal and external, and even between being ASCII and UC16,
     // but the characters are always the same).
     IrregexpPrepare(regexp, subject);
-    is_ascii = subject->IsAsciiRepresentationUnderneath();
+    is_ascii = subject->IsOneByteRepresentationUnderneath();
   } while (true);
   UNREACHABLE();
   return RE_EXCEPTION;
=======================================
--- /branches/bleeding_edge/src/log-utils.cc    Fri Sep  9 15:39:47 2011
+++ /branches/bleeding_edge/src/log-utils.cc    Wed Nov 21 02:01:05 2012
@@ -257,7 +257,7 @@
   if (len > 0x1000)
     len = 0x1000;
   if (show_impl_info) {
-    Append(str->IsAsciiRepresentation() ? 'a' : '2');
+    Append(str->IsOneByteRepresentation() ? 'a' : '2');
     if (StringShape(str).IsExternal())
       Append('e');
     if (StringShape(str).IsSymbol())
=======================================
--- /branches/bleeding_edge/src/mips/regexp-macro-assembler-mips.cc Tue Oct 16 01:23:15 2012 +++ /branches/bleeding_edge/src/mips/regexp-macro-assembler-mips.cc Wed Nov 21 02:01:05 2012
@@ -1155,7 +1155,7 @@

   Handle<String> subject(frame_entry<String*>(re_frame, kInputString));
   // Current string.
-  bool is_ascii = subject->IsAsciiRepresentationUnderneath();
+  bool is_ascii = subject->IsOneByteRepresentationUnderneath();

   ASSERT(re_code->instruction_start() <= *return_address);
   ASSERT(*return_address <=
@@ -1186,7 +1186,7 @@
   }

   // String might have changed.
-  if (subject_tmp->IsAsciiRepresentation() != is_ascii) {
+  if (subject_tmp->IsOneByteRepresentation() != is_ascii) {
     // If we changed between an ASCII and an UC16 string, the specialized
     // code cannot be used, and we need to restart regexp matching from
// scratch (including, potentially, compiling a new version of the code).
=======================================
--- /branches/bleeding_edge/src/objects-inl.h   Wed Nov 21 01:54:53 2012
+++ /branches/bleeding_edge/src/objects-inl.h   Wed Nov 21 02:01:05 2012
@@ -232,7 +232,7 @@
 bool Object::IsSeqOneByteString() {
   if (!IsString()) return false;
   return StringShape(String::cast(this)).IsSequential() &&
-         String::cast(this)->IsAsciiRepresentation();
+         String::cast(this)->IsOneByteRepresentation();
 }


@@ -252,7 +252,7 @@
 bool Object::IsExternalAsciiString() {
   if (!IsString()) return false;
   return StringShape(String::cast(this)).IsExternal() &&
-         String::cast(this)->IsAsciiRepresentation();
+         String::cast(this)->IsOneByteRepresentation();
 }


@@ -295,7 +295,7 @@
 }


-bool String::IsAsciiRepresentation() {
+bool String::IsOneByteRepresentation() {
   uint32_t type = map()->instance_type();
   return (type & kStringEncodingMask) == kOneByteStringTag;
 }
@@ -307,7 +307,7 @@
 }


-bool String::IsAsciiRepresentationUnderneath() {
+bool String::IsOneByteRepresentationUnderneath() {
   uint32_t type = map()->instance_type();
   STATIC_ASSERT(kIsIndirectStringTag != 0);
   STATIC_ASSERT((kIsIndirectStringMask & kStringEncodingMask) == 0);
@@ -318,7 +318,7 @@
     case kTwoByteStringTag:
       return false;
     default:  // Cons or sliced string.  Need to go deeper.
-      return GetUnderlying()->IsAsciiRepresentation();
+      return GetUnderlying()->IsOneByteRepresentation();
   }
 }

@@ -2496,7 +2496,7 @@
   ASSERT(index >= 0 && index < length());
   ASSERT(StringShape(this).IsSequential());

-  return this->IsAsciiRepresentation()
+  return this->IsOneByteRepresentation()
       ? SeqOneByteString::cast(this)->SeqOneByteStringSet(index, value)
       : SeqTwoByteString::cast(this)->SeqTwoByteStringSet(index, value);
 }
@@ -4119,7 +4119,7 @@
   if (!src->IsString()) return true;
   String* src_str = String::cast(src);
   if (!StringShape(src_str).IsExternal()) return true;
-  if (src_str->IsAsciiRepresentation()) {
+  if (src_str->IsOneByteRepresentation()) {
     return ExternalAsciiString::cast(src)->resource() != NULL;
   } else if (src_str->IsTwoByteRepresentation()) {
     return ExternalTwoByteString::cast(src)->resource() != NULL;
=======================================
--- /branches/bleeding_edge/src/objects.cc      Tue Nov 20 04:32:29 2012
+++ /branches/bleeding_edge/src/objects.cc      Wed Nov 21 02:01:05 2012
@@ -894,8 +894,9 @@
       int len = length();
       Object* object;
       String* result;
-      if (IsAsciiRepresentation()) {
- { MaybeObject* maybe_object = heap->AllocateRawAsciiString(len, tenure);
+      if (IsOneByteRepresentation()) {
+        { MaybeObject* maybe_object =
+              heap->AllocateRawOneByteString(len, tenure);
           if (!maybe_object->ToObject(&object)) return maybe_object;
         }
         result = String::cast(object);
@@ -954,7 +955,7 @@
   if (size < ExternalString::kShortSize) {
     return false;
   }
-  bool is_ascii = this->IsAsciiRepresentation();
+  bool is_ascii = this->IsOneByteRepresentation();
   bool is_symbol = this->IsSymbol();

   // Morph the object to an external string by adjusting the map and
@@ -6626,7 +6627,7 @@


 const uc16* String::GetTwoByteData(unsigned start) {
-  ASSERT(!IsAsciiRepresentationUnderneath());
+  ASSERT(!IsOneByteRepresentationUnderneath());
   switch (StringShape(this).representation_tag()) {
     case kSeqStringTag:
       return SeqTwoByteString::cast(this)->SeqTwoByteStringGetData(start);
@@ -6878,7 +6879,7 @@
   }
   switch (StringShape(input).representation_tag()) {
     case kSeqStringTag:
-      if (input->IsAsciiRepresentation()) {
+      if (input->IsOneByteRepresentation()) {
         SeqOneByteString* str = SeqOneByteString::cast(input);
         return str->SeqOneByteStringReadBlock(&rbb->remaining,
                                             offset_ptr,
@@ -6895,7 +6896,7 @@
                                                           offset_ptr,
                                                           max_chars);
     case kExternalStringTag:
-      if (input->IsAsciiRepresentation()) {
+      if (input->IsOneByteRepresentation()) {
return ExternalAsciiString::cast(input)->ExternalAsciiStringReadBlock(
             &rbb->remaining,
             offset_ptr,
@@ -7027,7 +7028,7 @@

   switch (StringShape(input).representation_tag()) {
     case kSeqStringTag:
-      if (input->IsAsciiRepresentation()) {
+      if (input->IsOneByteRepresentation()) {
SeqOneByteString::cast(input)->SeqOneByteStringReadBlockIntoBuffer(rbb, offset_ptr, max_chars);
@@ -7044,7 +7045,7 @@
                                                              max_chars);
       return;
     case kExternalStringTag:
-      if (input->IsAsciiRepresentation()) {
+      if (input->IsOneByteRepresentation()) {
         ExternalAsciiString::cast(input)->
ExternalAsciiStringReadBlockIntoBuffer(rbb, offset_ptr, max_chars);
       } else {
=======================================
--- /branches/bleeding_edge/src/objects.h       Tue Nov 20 04:32:29 2012
+++ /branches/bleeding_edge/src/objects.h       Wed Nov 21 02:01:05 2012
@@ -7220,13 +7220,13 @@
   // be ASCII encoded.  This might be the case even if the string is
   // two-byte.  Such strings may appear when the embedder prefers
   // two-byte external representations even for ASCII data.
-  inline bool IsAsciiRepresentation();
+  inline bool IsOneByteRepresentation();
   inline bool IsTwoByteRepresentation();

// Cons and slices have an encoding flag that may not represent the actual
   // encoding of the underlying string.  This is taken into account here.
   // Requires: this->IsFlat()
-  inline bool IsAsciiRepresentationUnderneath();
+  inline bool IsOneByteRepresentationUnderneath();
   inline bool IsTwoByteRepresentationUnderneath();

   // NOTE: this should be considered only a hint.  False negatives are
=======================================
--- /branches/bleeding_edge/src/regexp-macro-assembler.cc Thu Nov 15 05:31:27 2012 +++ /branches/bleeding_edge/src/regexp-macro-assembler.cc Wed Nov 21 02:01:05 2012
@@ -77,7 +77,7 @@
   ASSERT(subject->IsExternalString() || subject->IsSeqString());
   ASSERT(start_index >= 0);
   ASSERT(start_index <= subject->length());
-  if (subject->IsAsciiRepresentation()) {
+  if (subject->IsOneByteRepresentation()) {
     const byte* address;
     if (StringShape(subject).IsExternal()) {
       const char* data = ExternalAsciiString::cast(subject)->GetChars();
@@ -133,7 +133,7 @@
     slice_offset = slice->offset();
   }
   // Ensure that an underlying string has the same ASCII-ness.
-  bool is_ascii = subject_ptr->IsAsciiRepresentation();
+  bool is_ascii = subject_ptr->IsOneByteRepresentation();
   ASSERT(subject_ptr->IsExternalString() || subject_ptr->IsSeqString());
   // String is now either Sequential or External
   int char_size_shift = is_ascii ? 0 : 1;
=======================================
--- /branches/bleeding_edge/src/runtime.cc      Tue Nov 20 06:41:20 2012
+++ /branches/bleeding_edge/src/runtime.cc      Wed Nov 21 02:01:05 2012
@@ -2353,7 +2353,7 @@
         array_builder_(heap->isolate(), estimated_part_count),
         subject_(subject),
         character_count_(0),
-        is_ascii_(subject->IsAsciiRepresentation()) {
+        is_ascii_(subject->IsOneByteRepresentation()) {
     // Require a non-zero initial size. Ensures that doubling the size to
     // extend the array will work.
     ASSERT(estimated_part_count > 0);
@@ -2393,7 +2393,7 @@
     int length = string->length();
     ASSERT(length > 0);
     AddElement(*string);
-    if (!string->IsAsciiRepresentation()) {
+    if (!string->IsOneByteRepresentation()) {
       is_ascii_ = false;
     }
     IncrementCharacterCount(length);
@@ -3760,7 +3760,7 @@
   }
   char* str = DoubleToRadixCString(value, radix);
   MaybeObject* result =
-      isolate->heap()->AllocateStringFromAscii(CStrVector(str));
+      isolate->heap()->AllocateStringFromOneByte(CStrVector(str));
   DeleteArray(str);
   return result;
 }
@@ -3785,7 +3785,7 @@
   RUNTIME_ASSERT(f >= 0);
   char* str = DoubleToFixedCString(value, f);
   MaybeObject* res =
-      isolate->heap()->AllocateStringFromAscii(CStrVector(str));
+      isolate->heap()->AllocateStringFromOneByte(CStrVector(str));
   DeleteArray(str);
   return res;
 }
@@ -3810,7 +3810,7 @@
   RUNTIME_ASSERT(f >= -1 && f <= 20);
   char* str = DoubleToExponentialCString(value, f);
   MaybeObject* res =
-      isolate->heap()->AllocateStringFromAscii(CStrVector(str));
+      isolate->heap()->AllocateStringFromOneByte(CStrVector(str));
   DeleteArray(str);
   return res;
 }
@@ -3835,7 +3835,7 @@
   RUNTIME_ASSERT(f >= 1 && f <= 21);
   char* str = DoubleToPrecisionCString(value, f);
   MaybeObject* res =
-      isolate->heap()->AllocateStringFromAscii(CStrVector(str));
+      isolate->heap()->AllocateStringFromOneByte(CStrVector(str));
   DeleteArray(str);
   return res;
 }
@@ -5088,7 +5088,7 @@

   MaybeObject* maybe_object = NULL;
   if (i == length) {  // The string is ASCII.
-    maybe_object = isolate->heap()->AllocateRawAsciiString(length);
+    maybe_object = isolate->heap()->AllocateRawOneByteString(length);
   } else {  // The string is not ASCII.
     maybe_object = isolate->heap()->AllocateRawTwoByteString(length);
   }
@@ -5182,7 +5182,7 @@
   }
   Object* o;
   { MaybeObject* maybe_o =
-        isolate->heap()->AllocateRawAsciiString(escaped_length);
+        isolate->heap()->AllocateRawOneByteString(escaped_length);
     if (!maybe_o->ToObject(&o)) return maybe_o;
   }
   String* destination = String::cast(o);
@@ -5290,7 +5290,7 @@
   Object* o;
   { MaybeObject* maybe_o =
         ascii ?
-        isolate->heap()->AllocateRawAsciiString(unescaped_length) :
+        isolate->heap()->AllocateRawOneByteString(unescaped_length) :
         isolate->heap()->AllocateRawTwoByteString(unescaped_length);
     if (!maybe_o->ToObject(&o)) return maybe_o;
   }
@@ -5389,7 +5389,7 @@

 template <>
MaybeObject* AllocateRawString<SeqOneByteString>(Isolate* isolate, int length) {
-  return isolate->heap()->AllocateRawAsciiString(length);
+  return isolate->heap()->AllocateRawOneByteString(length);
 }


@@ -5720,8 +5720,8 @@
   // might break in the future if we implement more context and locale
   // dependent upper/lower conversions.
   Object* o;
-  { MaybeObject* maybe_o = s->IsAsciiRepresentation()
-        ? isolate->heap()->AllocateRawAsciiString(length)
+  { MaybeObject* maybe_o = s->IsOneByteRepresentation()
+        ? isolate->heap()->AllocateRawOneByteString(length)
         : isolate->heap()->AllocateRawTwoByteString(length);
     if (!maybe_o->ToObject(&o)) return maybe_o;
   }
@@ -5954,7 +5954,7 @@
   // dependent upper/lower conversions.
   if (s->IsSeqOneByteString()) {
     Object* o;
- { MaybeObject* maybe_o = isolate->heap()->AllocateRawAsciiString(length); + { MaybeObject* maybe_o = isolate->heap()->AllocateRawOneByteString(length);
       if (!maybe_o->ToObject(&o)) return maybe_o;
     }
     SeqOneByteString* result = SeqOneByteString::cast(o);
@@ -6161,7 +6161,7 @@

   Handle<FixedArray> elements;
   int position = 0;
-  if (s->IsFlat() && s->IsAsciiRepresentation()) {
+  if (s->IsFlat() && s->IsOneByteRepresentation()) {
     // Try using cached chars where possible.
     Object* obj;
     { MaybeObject* maybe_obj =
@@ -6534,7 +6534,7 @@

   if (ascii) {
     { MaybeObject* maybe_object =
-          isolate->heap()->AllocateRawAsciiString(length);
+          isolate->heap()->AllocateRawOneByteString(length);
       if (!maybe_object->ToObject(&object)) return maybe_object;
     }
     SeqOneByteString* answer = SeqOneByteString::cast(object);
@@ -6696,7 +6696,7 @@

   // Find total length of join result.
   int string_length = 0;
-  bool is_ascii = separator->IsAsciiRepresentation();
+  bool is_ascii = separator->IsOneByteRepresentation();
   int max_string_length;
   if (is_ascii) {
     max_string_length = SeqOneByteString::kMaxLength;
@@ -6713,7 +6713,7 @@
     RUNTIME_ASSERT(elements->get(i + 1)->IsString());
     String* string = String::cast(elements->get(i + 1));
     int length = string->length();
-    if (is_ascii && !string->IsAsciiRepresentation()) {
+    if (is_ascii && !string->IsOneByteRepresentation()) {
       is_ascii = false;
       max_string_length = SeqTwoByteString::kMaxLength;
     }
@@ -6749,7 +6749,7 @@

   if (is_ascii) {
     MaybeObject* result_allocation =
-        isolate->heap()->AllocateRawAsciiString(string_length);
+        isolate->heap()->AllocateRawOneByteString(string_length);
     if (result_allocation->IsFailure()) return result_allocation;
     SeqOneByteString* result_string =
         SeqOneByteString::cast(result_allocation->ToObjectUnchecked());
@@ -12930,7 +12930,7 @@

   const char* version_string = v8::V8::GetVersion();

- return isolate->heap()->AllocateStringFromAscii(CStrVector(version_string), + return isolate->heap()->AllocateStringFromOneByte(CStrVector(version_string),
                                                   NOT_TENURED);
 }

=======================================
--- /branches/bleeding_edge/src/x64/regexp-macro-assembler-x64.cc Thu Jun 14 06:59:48 2012 +++ /branches/bleeding_edge/src/x64/regexp-macro-assembler-x64.cc Wed Nov 21 02:01:05 2012
@@ -1305,7 +1305,7 @@
   Handle<String> subject(frame_entry<String*>(re_frame, kInputString));

   // Current string.
-  bool is_ascii = subject->IsAsciiRepresentationUnderneath();
+  bool is_ascii = subject->IsOneByteRepresentationUnderneath();

   ASSERT(re_code->instruction_start() <= *return_address);
   ASSERT(*return_address <=
@@ -1336,7 +1336,7 @@
   }

   // String might have changed.
-  if (subject_tmp->IsAsciiRepresentation() != is_ascii) {
+  if (subject_tmp->IsOneByteRepresentation() != is_ascii) {
     // If we changed between an ASCII and an UC16 string, the specialized
     // code cannot be used, and we need to restart regexp matching from
// scratch (including, potentially, compiling a new version of the code).
=======================================
--- /branches/bleeding_edge/test/cctest/test-alloc.cc Tue Nov 20 02:47:31 2012 +++ /branches/bleeding_edge/test/cctest/test-alloc.cc Wed Nov 21 02:01:05 2012
@@ -66,7 +66,7 @@

   // Old data space.
   SimulateFullSpace(heap->old_data_space());
-  CHECK(!heap->AllocateRawAsciiString(100, TENURED)->IsFailure());
+  CHECK(!heap->AllocateRawOneByteString(100, TENURED)->IsFailure());

   // Old pointer space.
   SimulateFullSpace(heap->old_pointer_space());
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc     Tue Nov 20 02:47:31 2012
+++ /branches/bleeding_edge/test/cctest/test-api.cc     Wed Nov 21 02:01:05 2012
@@ -12626,7 +12626,7 @@
                          AsciiVectorResource* ascii_resource,
                          UC16VectorResource* uc16_resource) {
   CHECK(i::StringShape(string).IsExternal());
-  if (string->IsAsciiRepresentation()) {
+  if (string->IsOneByteRepresentation()) {
     // Check old map is not symbol or long.
     CHECK(string->map() == HEAP->external_ascii_string_map());
     // Morph external string to be TwoByte string.
@@ -15785,13 +15785,13 @@
   CHECK(result->IsString());
i::Handle<i::String> string = v8::Utils::OpenHandle(String::Cast(*result));
   int length = string->length();
-  CHECK(string->IsAsciiRepresentation());
+  CHECK(string->IsOneByteRepresentation());

   FlattenString(string);
   i::Handle<i::String> flat_string = FlattenGetString(string);

-  CHECK(string->IsAsciiRepresentation());
-  CHECK(flat_string->IsAsciiRepresentation());
+  CHECK(string->IsOneByteRepresentation());
+  CHECK(flat_string->IsOneByteRepresentation());

   // Create external resource.
   uint16_t* uc16_buffer = new uint16_t[length + 1];
@@ -15810,7 +15810,7 @@
// ASCII characters). This is a valid sequence of steps, and it can happen
   // in real pages.

-  CHECK(string->IsAsciiRepresentation());
+  CHECK(string->IsOneByteRepresentation());
   i::ConsString* cons = i::ConsString::cast(*string);
   CHECK_EQ(0, cons->second()->length());
   CHECK(cons->first()->IsTwoByteRepresentation());

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to