Home | History | Annotate | Download | only in src

Lines Matching defs:String

108 //         - String
323 // The names of the string instance types are intended to systematically
329 // mentioned. Finally, the string is either a STRING_TYPE (if it is a normal
330 // string) or a INTERNALIZED_STRING_TYPE (if it is a internalized string).
332 // NOTE: The following things are some that depend on the string types having
444 // Since string types are not consecutive, this macro is used to
449 string, \
450 String) \
583 // string, and cleared if it is a string.
588 // Bit 6 indicates that the object is an internalized string (if set) or not.
594 // If bit 7 is clear then bit 2 indicates whether the string consists of
601 // of the string.
619 // sure that the string is one of the two (an indirect string).
624 // string actually contains one byte data.
628 // If bit 7 is clear and string representation indicates an external string,
634 // A ConsString with an empty string as the right side is a candidate
647 // String types.
698 // Non-string names
967 V(String) \
1122 "external string expected, but not found") \
1223 "oddball in string table is not undefined or the hole") \
1225 V(kOperandIsASmiAndNotAString, "Operand is a smi and not a string") \
1230 V(kOperandIsNotAString, "Operand is not a string") \
1284 "Unexpected fall-through from string comparison") \
1305 V(kUnexpectedStringFunction, "Unexpected String function") \
1306 V(kUnexpectedStringType, "Unexpected string type") \
1308 "Unexpected string wrapper instance size") \
1312 "Unexpected unused properties of string wrapper") \
1441 inline bool HasSpecificClassOf(String* name);
1531 // Returns true if this is a JSValue containing a string and the index is
1532 // < the length of the string. Used to implement [] on strings.
1990 String* class_name();
1994 String* constructor_name();
2181 static inline Handle<String> ExpectedTransitionKey(Handle<Map> map);
2305 // Returns true if the object has a property with the hidden string as name.
3715 // because only the string itself (the key) needs to be stored.
3718 // Find string in the string table. If it is not there yet, it is
3719 // added. The return value is the string table which might have
3720 // been enlarged. If the return value is not a failure, the string
3721 // pointer *s is set to the string found.
3736 MUST_USE_RESULT MaybeObject* LookupString(String* key, Object** s);
3738 // Looks up a string that is equal to the given string and returns
3739 // true if it is found, assigning the string to the given output
3741 bool LookupStringIfExists(String* str, String** result);
3742 bool LookupTwoCharsStringIfExists(uint16_t c1, uint16_t c2, String** result);
4279 String* FunctionName();
4282 String* ParameterName(int var);
4285 String* LocalName(int var);
4288 String* StackLocalName(int var);
4291 String* ContextLocalName(int var);
4302 // string.
4303 int StackSlotIndex(String* name);
4307 // returns a value < 0. The name must be an internalized string.
4310 int ContextSlotIndex(String* name,
4316 // otherwise returns a value < 0. The name must be an internalized string.
4317 int ParameterIndex(String* name);
4322 // must be an internalized string.
4323 int FunctionContextSlotIndex(String* name, VariableMode* mode);
5893 String* constructor_name();
6450 // If script source is an external string, check that the underlying
6498 V(String.prototype, charCodeAt, StringCharCodeAt) \
6499 V(String.prototype, charAt, StringCharAt) \
6500 V(String, fromCharCode, StringFromCharCode) \
6743 DECL_ACCESSORS(inferred_name, String)
6746 String* DebugName();
7352 void SetInstanceClassName(String* name);
7557 // Representation for JS Wrapper objects, String, Number, Boolean, etc.
7682 DECL_ACCESSORS(type, String)
7732 // - reference to the original source string
7733 // - reference to the original flag string
7735 // - a reference to a literal string to search for
7747 // ATOM: A simple string to match against using an indexOf operation.
7769 inline String* Pattern();
7893 // Find cached value for a string key, otherwise return null.
7894 Object* Lookup(String* src, Context* context);
7895 Object* LookupEval(String* src,
7899 Object* LookupRegExp(String* source, JSRegExp::Flags flags);
7900 MUST_USE_RESULT MaybeObject* Put(String* src,
7903 MUST_USE_RESULT MaybeObject* PutEval(String* src,
7907 MUST_USE_RESULT MaybeObject* PutRegExp(String* src,
8326 // Calculated hash value for a string consisting of 1 to
8327 // String::kMaxArrayIndexSize digits with no leading zeros (except "0").
8331 // No string is allowed to have a hash of zero. That value is reserved
8341 // Returns the value to store in the hash field of a string with
8344 // Returns true if the hash of this string can be computed without
8354 // Update index. Returns true if string is still an index.
8366 // The characteristics of a string are stored in its map. Retrieving these
8369 // the shape of the string is given its own class so that it can be retrieved
8370 // once and used for several string operations. A StringShape is small enough
8372 // string can potentially alter its shape. Also be aware that a GC caused by
8373 // something else can alter the shape of a string due to ConsString
8379 inline explicit StringShape(String* s);
8447 // and if it is a string that is an array index. The least significant bit
8449 // been computed the 2nd bit tells whether the string can be used as an
8465 // For strings which are array indexes the hash value has the string length
8467 // the case for the string '0'. 24 bits are used for the array index value.
8483 // could use a mask to test if the length of string is less than or equal to
8537 // The String abstract class captures JavaScript string values:
8540 // 4.3.16 String Value
8541 // A string value is a member of the type String and is a finite
8544 // All string values have a length field.
8545 class String: public Name {
8549 // Representation of the flat content of a String.
8550 // A non-flat string doesn't have flat content.
8551 // A flat string has content that's encoded as a sequence of either
8553 // Returned by String::GetFlatContent().
8556 // Returns true if the string is flat and this structure contains content.
8563 // Return the one byte content of the string. Only use if IsAscii() returns
8569 // Return the two-byte content of the string. Only use if IsTwoByte()
8579 // Constructors only used by String::GetFlatContent().
8591 friend class String;
8594 // Get and set the length of the string.
8598 // Returns whether this string has only ASCII chars, i.e. all of them can
8599 // be ASCII encoded. This might be the case even if the string is
8606 // encoding of the underlying string. This is taken into account here.
8615 // Get and set individual two byte chars in the string.
8617 // Get individual two byte char in the string. Repeated calls
8618 // to this method are not efficient unless the string is flat.
8621 // Try to flatten the string. Checks first inline to see if it is
8622 // necessary. Does nothing if the string is not a cons string.
8623 // Flattening allocates a sequential string with the same data as
8624 // the given string and mutates the cons string to a degenerate
8625 // form, where the first component is the new sequential string and
8626 // the second component is the empty string. If allocation fails,
8628 // function returns the sequential string that is now the first
8629 // component of the cons string.
8640 // string.
8641 inline String* TryFlattenGetString(PretenureFlag pretenure = NOT_TENURED);
8643 // Tries to return the content of a flat string as a structure holding either
8645 // If the string isn't flat, and therefore doesn't have flat content, the
8650 // Returns the parent of a sliced string or first part of a flat cons string.
8652 inline String* GetUnderlying();
8654 // Mark the string as an undetectable object. It only applies to
8655 // ASCII and two byte string types.
8663 // String equality operations.
8664 inline bool Equals(String* other);
8669 // Return a UTF8 representation of the string. The string is null
8671 // in length_output if length_output is not a null pointer The string
8687 // Return a 16 bit Unicode representation of the string.
8688 // The string should be nearly flat, otherwise the performance of
8699 bool MakeExternal(v8::String::ExternalStringResource* resource);
8700 bool MakeExternal(v8::String::ExternalAsciiStringResource* resource);
8706 static inline String* cast(Object* obj);
8718 DECLARE_PRINTER(String)
8719 DECLARE_VERIFIER(String)
8727 // Maximum number of characters to consider when trying to convert a string
8740 // Maximal string length.
8744 // string length is used as the hash value.
8755 static void WriteToFlat(String* source,
8762 // If the return value is >= the passed length, the entire string was ASCII.
8810 static inline void Visit(String* string,
8819 String* string,
8826 String* string,
8828 int32_t type = string->map()->instance_type();
8829 return VisitFlat(visitor, string, offset, string->length(), type);
8836 // string. This is a no-op unless the string is a ConsString. Flatten
8840 // Slow case of String::Equals. This implementation works on any strings
8842 bool SlowEquals(String* other);
8850 DISALLOW_IMPLICIT_CONSTRUCTORS(String);
8854 // The SeqString abstract class captures sequential string values.
8855 class SeqString: public String {
8861 static const int kHeaderSize = String::kSize;
8863 // Truncate the string in-place if possible and return the result.
8864 // In case of new_length == 0, the empty string is returned without
8865 // truncating the original string.
8866 MUST_USE_RESULT static Handle<String> Truncate(Handle<SeqString> string,
8873 // The AsciiString class captures sequential ASCII string objects.
8883 // Get the address of the characters in this string.
8901 // Maximal memory usage for a single sequential ASCII string.
8903 // Maximal length of a single sequential ASCII string.
8904 // Q.v. String::kMaxLength which is the maximal size of concatenated strings.
8912 // The TwoByteString class captures sequential unicode string objects.
8922 // Get the address of the characters in this string.
8943 // Maximal memory usage for a single sequential two-byte string.
8945 // Maximal length of a single sequential two-byte string.
8946 // Q.v. String::kMaxLength which is the maximal size of concatenated strings.
8954 // The ConsString class describes string values built by using the
8956 // first and second components are pointers to other string values.
8959 // are non-ConsString string values. The string value represented by
8960 // a ConsString can be obtained by concatenating the leaf string
8962 class ConsString: public String {
8964 // First string of the cons cell.
8965 inline String* first();
8966 // Doesn't check that the result is a string, even in debug mode. This is
8969 inline void set_first(String* first,
8972 // Second string of the cons cell.
8973 inline String* second();
8974 // Doesn't check that the result is a string, even in debug mode. This is
8977 inline void set_second(String* second,
8987 static const int kFirstOffset = POINTER_SIZE_ALIGN(String::kSize);
8991 // Minimum length for a cons string.
9004 // The Sliced String class describes strings that are substrings of another
9005 // sequential string. The motivation is to save time and memory when creating
9006 // a substring. A Sliced String is described as a pointer to the parent,
9007 // the offset from the start of the parent string and the length. Using
9008 // a Sliced String therefore requires unpacking of the parent string and
9009 // adding the offset to the start address. A substring of a Sliced String
9015 // - truncating sliced string to enable otherwise unneeded parent to be GC'ed.
9016 class SlicedString: public String {
9018 inline String* parent();
9019 inline void set_parent(String* parent,
9031 static const int kParentOffset = POINTER_SIZE_ALIGN(String::kSize);
9035 // Minimum length for a sliced string.
9049 // The ExternalString class describes string values that are backed by
9050 // a string resource that lies outside the V8 heap. ExternalStrings
9058 class ExternalString: public String {
9064 static const int kResourceOffset = POINTER_SIZE_ALIGN(String::kSize);
9072 // Return whether external string is short (data pointer is not cached).
9082 // The ExternalAsciiString class is an external string backed by an
9083 // ASCII string.
9088 typedef v8::String::ExternalAsciiStringResource Resource;
9119 // The ExternalTwoByteString class is an external string backed by a UTF-16
9120 // encoded string.
9125 typedef v8::String::ExternalStringResource Resource;
9127 // The underlying string resource.
9183 // A flat string reader provides random access to the contents of a
9184 // string independent of the character width of the string. The handle
9188 FlatStringReader(Isolate* isolate, Handle<String> str);
9194 String** str_;
9207 static inline String* Operate(String*, unsigned*, int32_t*, unsigned*);
9215 // traversal of the entire string
9220 String* Operate(String* string,
9224 inline String* ContinueOperation(int32_t* type_out, unsigned* length_out);
9236 inline void PushLeft(ConsString* string);
9237 inline void PushRight(ConsString* string);
9240 String* NextLeaf(bool* blew_stack, int32_t* type_out, unsigned* length_out);
9241 String* Search(unsigned* offset_out,
9259 inline StringCharacterStream(String* string,
9264 inline void Reset(String* string, unsigned offset = 0);
9297 DECL_ACCESSORS(to_string, String)
10511 V(kInternalizedString, "internalized_string", "(Internal string)") \
10565 // Visits the resource of an ASCII or two-byte string.
10567 v8::String::ExternalAsciiStringResource** resource) {}
10569 v8::String::ExternalStringResource** resource) {}