| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index 77aab244709a31870a5e36578f2631d78596cf07..6e1598d9b03dc62875b8223717d6c0dd97e5c6f4 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -79,13 +79,14 @@
|
| // - JSFunctionResultCache
|
| // - SerializedScopeInfo
|
| // - String
|
| -// - SeqString
|
| -// - SeqAsciiString
|
| -// - SeqTwoByteString
|
| // - ConsString
|
| -// - ExternalString
|
| -// - ExternalAsciiString
|
| -// - ExternalTwoByteString
|
| +// - FlatString
|
| +// - SeqString
|
| +// - SeqAsciiString
|
| +// - SeqTwoByteString
|
| +// - ExternalString
|
| +// - ExternalAsciiString
|
| +// - ExternalTwoByteString
|
| // - HeapNumber
|
| // - Code
|
| // - Map
|
| @@ -684,6 +685,7 @@ class MaybeObject BASE_EMBEDDED {
|
| V(HeapNumber) \
|
| V(String) \
|
| V(Symbol) \
|
| + V(FlatString) \
|
| V(SeqString) \
|
| V(ExternalString) \
|
| V(ConsString) \
|
| @@ -5356,6 +5358,10 @@ class String: public HeapObject {
|
| // to this method are not efficient unless the string is flat.
|
| inline uint16_t Get(int index);
|
|
|
| + // Try to get a character (smi encoded) from the string.
|
| + // The method may try to flatten the string, or part of the string.
|
| + inline MaybeObject* GetMayFlatten(int index);
|
| +
|
| // Try to flatten the string. Checks first inline to see if it is
|
| // necessary. Does nothing if the string is not a cons string.
|
| // Flattening allocates a sequential string with the same data as
|
| @@ -5643,10 +5649,22 @@ class String: public HeapObject {
|
| };
|
|
|
|
|
| -// The SeqString abstract class captures sequential string values.
|
| -class SeqString: public String {
|
| +class FlatString: public String {
|
| public:
|
| + // Casting.
|
| + static inline FlatString* cast(Object* obj);
|
| +
|
| + // Get a character from a flat string.
|
| + inline uint16_t FlatStringGet(int index);
|
| +
|
| + private:
|
| + DISALLOW_IMPLICIT_CONSTRUCTORS(FlatString);
|
| +};
|
| +
|
|
|
| +// The SeqString abstract class captures sequential string values.
|
| +class SeqString: public FlatString {
|
| + public:
|
| // Casting.
|
| static inline SeqString* cast(Object* obj);
|
|
|
| @@ -5785,6 +5803,7 @@ class ConsString: public String {
|
|
|
| // Dispatched behavior.
|
| uint16_t ConsStringGet(int index);
|
| + MaybeObject* ConsStringGetMayFlatten(int index);
|
|
|
| // Casting.
|
| static inline ConsString* cast(Object* obj);
|
| @@ -5822,7 +5841,7 @@ class ConsString: public String {
|
| //
|
| // The API expects that all ExternalStrings are created through the
|
| // API. Therefore, ExternalStrings should not be used internally.
|
| -class ExternalString: public String {
|
| +class ExternalString: public FlatString {
|
| public:
|
| // Casting
|
| static inline ExternalString* cast(Object* obj);
|
|
|