| Index: src/objects-inl.h
|
| ===================================================================
|
| --- src/objects-inl.h (revision 1251)
|
| +++ src/objects-inl.h (working copy)
|
| @@ -1639,6 +1639,34 @@
|
| }
|
|
|
|
|
| +Map* ExternalAsciiString::StringMap(int length) {
|
| + Map* map;
|
| + // Number of characters: determines the map.
|
| + if (length <= String::kMaxShortStringSize) {
|
| + map = Heap::short_external_ascii_string_map();
|
| + } else if (length <= String::kMaxMediumStringSize) {
|
| + map = Heap::medium_external_ascii_string_map();
|
| + } else {
|
| + map = Heap::long_external_ascii_string_map();
|
| + }
|
| + return map;
|
| +}
|
| +
|
| +
|
| +Map* ExternalAsciiString::SymbolMap(int length) {
|
| + Map* map;
|
| + // Number of characters: determines the map.
|
| + if (length <= String::kMaxShortStringSize) {
|
| + map = Heap::short_external_ascii_symbol_map();
|
| + } else if (length <= String::kMaxMediumStringSize) {
|
| + map = Heap::medium_external_ascii_symbol_map();
|
| + } else {
|
| + map = Heap::long_external_ascii_symbol_map();
|
| + }
|
| + return map;
|
| +}
|
| +
|
| +
|
| ExternalTwoByteString::Resource* ExternalTwoByteString::resource() {
|
| return *reinterpret_cast<Resource**>(FIELD_ADDR(this, kResourceOffset));
|
| }
|
| @@ -1650,6 +1678,34 @@
|
| }
|
|
|
|
|
| +Map* ExternalTwoByteString::StringMap(int length) {
|
| + Map* map;
|
| + // Number of characters: determines the map.
|
| + if (length <= String::kMaxShortStringSize) {
|
| + map = Heap::short_external_string_map();
|
| + } else if (length <= String::kMaxMediumStringSize) {
|
| + map = Heap::medium_external_string_map();
|
| + } else {
|
| + map = Heap::long_external_string_map();
|
| + }
|
| + return map;
|
| +}
|
| +
|
| +
|
| +Map* ExternalTwoByteString::SymbolMap(int length) {
|
| + Map* map;
|
| + // Number of characters: determines the map.
|
| + if (length <= String::kMaxShortStringSize) {
|
| + map = Heap::short_external_symbol_map();
|
| + } else if (length <= String::kMaxMediumStringSize) {
|
| + map = Heap::medium_external_symbol_map();
|
| + } else {
|
| + map = Heap::long_external_symbol_map();
|
| + }
|
| + return map;
|
| +}
|
| +
|
| +
|
| byte ByteArray::get(int index) {
|
| ASSERT(index >= 0 && index < this->length());
|
| return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize);
|
|
|