Lines Matching defs:string
47 #include "string-stream.h"
128 String::cast(this)->length() != 0);
137 void Object::Lookup(String* name, LookupResult* result) {
157 String* name,
169 String* name) {
190 Handle<String> key(name);
224 String* name_raw) {
249 String* name;
251 if (!maybe->To<String>(&name)) return maybe;
259 String* name;
261 if (!maybe->To<String>(&name)) return maybe;
267 String* name;
269 if (!maybe->To<String>(&name)) return maybe;
302 String* name,
362 String* name,
448 Handle<String> key,
457 MaybeObject* JSObject::SetNormalizedProperty(String* name,
495 MaybeObject* JSObject::DeleteNormalizedProperty(String* name, DeleteMode mode) {
554 Handle<String> key,
568 String* name,
713 // The object is either a number, a string, a boolean,
736 // The object is either a number, a string, an odd-ball,
743 uint32_t hash = String::cast(this)->Hash();
763 // The object is either a number, a string, an odd-ball,
772 return String::cast(this)->Equals(String::cast(other));
822 static bool AnWord(String* str) {
841 MaybeObject* String::SlowTryFlatten(PretenureFlag pretenure) {
857 // There's little point in putting the flat string in new space if the
858 // cons string is in old space. It can never get GCed until there is
863 String* result;
868 result = String::cast(object);
869 String* first = cs->first();
873 String* second = cs->second();
883 result = String::cast(object);
885 String* first = cs->first();
888 String* second = cs->second();
904 bool String::MakeExternal(v8::String::ExternalStringResource* resource) {
910 // Assert that the resource and the string are equivalent.
913 String::WriteToFlat(this, smart_chars.start(), 0, this->length());
920 int size = this->Size(); // Byte size of the original string.
927 // Morph the object to an external string by adjusting the map and
948 // Fill the remainder of the string with dead wood.
949 int new_size = this->Size(); // Byte size of the external String object.
959 bool String::MakeExternal(v8::String::ExternalAsciiStringResource* resource) {
962 // Assert that the resource and the string are equivalent.
965 String::WriteToFlat(this, smart_chars.start(), 0, this->length());
972 int size = this->Size(); // Byte size of the original string.
978 // Morph the object to an external string by adjusting the map and
993 // Fill the remainder of the string with dead wood.
994 int new_size = this->Size(); // Byte size of the external String object.
1004 void String::StringShortPrint(StringStream* accumulator) {
1007 accumulator->Add("<Very long string[%u]>", len);
1012 accumulator->Add("<Invalid String>");
1033 accumulator->Add("<String[%u]: ", length());
1039 // Backslash indicates that the string contains control
1041 accumulator->Add("<String[%u]\\: ", length());
1086 String* str = String::cast(fun_name);
1118 String* str = String::cast(constructor_name);
1180 String::cast(this)->StringShortPrint(accumulator);
1440 // The Windows version of vsnprintf can allocate when printing a %g string
1452 String* JSReceiver::class_name() {
1458 return String::cast(constructor->shared()->instance_class_name());
1465 String* JSReceiver::constructor_name() {
1468 String* name = String::cast(constructor->shared()->name());
1470 String* inferred_name = constructor->shared()->inferred_name();
1482 String* name,
1516 MaybeObject* JSObject::AddFastProperty(String* name,
1521 // Normalize the object if the name is an actual string (not the
1613 String* name,
1672 MaybeObject* JSObject::AddSlowProperty(String* name,
1709 MaybeObject* JSObject::AddProperty(String* name,
1720 Handle<Object> args[1] = {Handle<String>(name)};
1752 String* name,
1777 MaybeObject* JSObject::ReplaceSlowProperty(String* name,
1795 String* name,
1830 MaybeObject* JSObject::ConvertDescriptorToField(String* name,
1894 String* name,
1901 Handle<String> name_handle(name);
1936 Handle<String> key,
1946 MaybeObject* JSReceiver::SetProperty(String* name,
1957 String* name,
1988 Handle<String> key(name);
2012 Handle<String> key(name);
2050 void JSObject::LookupCallbackSetterInPrototypes(String* name,
2080 String* name;
2082 if (!maybe->To<String>(&name)) {
2112 String* name,
2138 Handle<String> hname(name);
2154 void JSObject::LookupInDescriptor(String* name, LookupResult* result) {
2166 String* name,
2307 String* Map::elements_transition_sentinel_name() {
2312 Object* Map::GetDescriptorContents(String* sentinel_name,
2477 void JSObject::LocalLookupRealNamedProperty(String* name,
2526 void JSObject::LookupRealNamedProperty(String* name, LookupResult* result) {
2534 void JSObject::LookupRealNamedPropertyInPrototypes(String* name,
2550 String* name,
2605 String* key,
2619 bool JSProxy::HasPropertyWithHandler(String* name_raw) {
2635 String* name_raw,
2654 String* name_raw,
2663 Handle<String> name(name_raw);
2681 Handle<String> conf_name =
2686 Handle<String> trap =
2696 Handle<String> set_name = isolate->factory()->LookupAsciiSymbol("set_");
2705 Handle<String> get_name = isolate->factory()->LookupAsciiSymbol("get_");
2728 String* name_raw, DeleteMode mode) {
2741 Handle<String> trap_name = isolate->factory()->LookupAsciiSymbol("delete");
2757 Handle<String> name = isolate->factory()->Uint32ToString(index);
2764 String* name_raw) {
2787 Handle<String> enum_n = isolate->factory()->LookupAsciiSymbol("enumerable");
2790 Handle<String> conf_n = isolate->factory()->LookupAsciiSymbol("configurable");
2793 Handle<String> writ_n = isolate->factory()->LookupAsciiSymbol("writable");
2798 Handle<String> trap =
2820 Handle<String> name = isolate->factory()->Uint32ToString(index);
2857 Handle<String> trap_name = isolate->factory()->LookupAsciiSymbol(name);
2878 String* name,
2894 name = String::cast(symbol_version);
2936 Handle<String> hname(name);
3014 Handle<String> key,
3025 String* name,
3106 String* name,
3127 String* name,
3139 Handle<String> name_handle(name);
3178 String* key) {
3193 String* name,
3226 PropertyAttributes JSReceiver::GetLocalPropertyAttribute(String* name) {
3288 Handle<String> name,
3296 MaybeObject* JSObject::UpdateMapCodeCache(String* name, Code* code) {
3617 Object* JSObject::GetHiddenProperty(String* key) {
3641 Handle<String> key,
3649 MaybeObject* JSObject::SetHiddenProperty(String* key, Object* value) {
3687 void JSObject::DeleteHiddenProperty(String* key) {
3724 // hidden symbols hash code is zero (and no other string has hash
3773 // hidden symbols hash code is zero (and no other string has hash
3797 MaybeObject* JSObject::DeletePropertyPostInterceptor(String* name,
3814 MaybeObject* JSObject::DeletePropertyWithInterceptor(String* name) {
3818 Handle<String> name_handle(name);
3919 Handle<String> prop) {
3926 MaybeObject* JSObject::DeleteProperty(String* name, DeleteMode mode) {
3991 MaybeObject* JSReceiver::DeleteProperty(String* name, DeleteMode mode) {
4221 int Map::PropertyIndexFor(String* name) {
4245 AccessorDescriptor* Map::FindAccessor(String* name) {
4256 void JSReceiver::LocalLookup(String* name, LookupResult* result) {
4298 void JSReceiver::Lookup(String* name, LookupResult* result) {
4312 void JSObject::LookupCallback(String* name, LookupResult* result) {
4415 MaybeObject* JSObject::DefinePropertyAccessor(String* name,
4450 bool JSObject::CanSetCallback(String* name) {
4512 MaybeObject* JSObject::SetPropertyCallback(String* name,
4545 Handle<String> name,
4554 MaybeObject* JSObject::DefineAccessor(String* name,
4578 // Try to flatten before operating on the string.
4592 String* name = String::cast(info->name());
4611 // Try to flatten before operating on the string.
4672 Object* JSObject::LookupAccessor(String* name, AccessorComponent component) {
4841 Handle<String> name,
4848 MaybeObject* Map::UpdateCodeCache(String* name, Code* code) {
4863 Object* Map::FindInCodeCache(String* name, Code::Flags flags) {
4882 void Map::RemoveFromCodeCache(String* name, Code* code, int index) {
5107 MaybeObject* CodeCache::Update(String* name, Code* code) {
5129 MaybeObject* CodeCache::UpdateDefaultCache(String* name, Code* code) {
5152 if (name->Equals(String::cast(key))) {
5189 MaybeObject* CodeCache::UpdateNormalTypeCache(String* name, Code* code) {
5201 Object* CodeCache::Lookup(String* name, Code::Flags flags) {
5210 Object* CodeCache::LookupDefaultCache(String* name, Code::Flags flags) {
5218 if (name->Equals(String::cast(key))) {
5229 Object* CodeCache::LookupNormalTypeCache(String* name, Code::Flags flags) {
5243 return cache->GetIndex(String::cast(name), code->flags());
5259 ASSERT(cache->GetIndex(String::cast(name), code->flags()) == index);
5280 CodeCacheHashTableKey(String* name, Code::Flags flags)
5283 CodeCacheHashTableKey(String* name, Code* code)
5292 String* name = String::cast(pair->get(0));
5300 static uint32_t NameFlagsHashHelper(String* name, Code::Flags flags) {
5308 String* name = String::cast(pair->get(0));
5326 String* name_;
5333 Object* CodeCacheHashTable::Lookup(String* name, Code::Flags flags) {
5341 MaybeObject* CodeCacheHashTable::Put(String* name, Code* code) {
5364 int CodeCacheHashTable::GetIndex(String* name, Code::Flags flags) {
5681 static bool InsertionPointFound(String* key1, String* key2) {
5896 int DescriptorArray::BinarySearch(String* name, int low, int high) {
5901 String* mid_name = GetKey(mid);
5927 int DescriptorArray::LinearSearch(String* name, int len) {
5930 String* entry = GetKey(number);
5988 bool String::LooksValid() {
5994 String::FlatContent String::GetFlatContent() {
5997 String* string = this;
6000 ConsString* cons = ConsString::cast(string);
6004 string = cons->first();
6005 shape = StringShape(string);
6008 SlicedString* slice = SlicedString::cast(string);
6010 string = slice->parent();
6011 shape = StringShape(string);
6018 start = SeqAsciiString::cast(string)->GetChars();
6020 start = ExternalAsciiString::cast(string)->GetChars();
6027 start = SeqTwoByteString::cast(string)->GetChars();
6029 start = ExternalTwoByteString::cast(string)->GetChars();
6036 SmartArrayPointer<char> String::ToCString(AllowNullsFlag allow_nulls,
6046 // Negative length means the to the end of the string.
6049 // Compute the size of the UTF-8 string. Start at the specified offset.
6068 // Convert the UTF-16 string to a UTF-8 buffer. Start at the specified offset.
6088 SmartArrayPointer<char> String::ToCString(AllowNullsFlag allow_nulls,
6095 const uc16* String::GetTwoByteData() {
6100 const uc16* String::GetTwoByteData(unsigned start) {
6121 SmartArrayPointer<uc16> String::ToWideCString(RobustnessFlag robust_flag) {
6194 // This will iterate unless the block of string data spans two 'halves' of
6195 // a ConsString, in which case it will recurse. Since the block of string
6209 String* left = current->first();
6227 String::ReadBlock(left, rbb, &offset, max_chars);
6234 String* right = current->second();
6242 String::ReadBlock(right, rbb, &offset, max_chars);
6338 // This method determines the type of string involved and then copies
6342 const unibrow::byte* String::ReadBlock(String* input,
6448 FlatStringReader::FlatStringReader(Isolate* isolate, Handle<String> str)
6466 Handle<String> str(str_);
6468 String::FlatContent content = str->GetFlatContent();
6489 // This method determines the type of string involved and then copies
6493 void String::ReadBlockIntoBuffer(String* input,
6543 const unibrow::byte* String::ReadBlock(String* input,
6558 const unibrow::byte* String::ReadBlock(String** raw_input,
6563 Handle<String> input(raw_input);
6575 // This will iterate unless the block of string data spans two 'halves' of
6576 // a ConsString, in which case it will recurse. Since the block of string
6588 String* left = current->first();
6598 String::ReadBlockIntoBuffer(left, rbb, &offset, max_chars);
6607 String* right = current->second();
6612 String::ReadBlockIntoBuffer(right, rbb, &offset, max_chars);
6620 String::ReadBlockIntoBuffer(left, rbb, &offset, left_length - offset);
6625 String* right = String::cast(current->second());
6628 String::ReadBlockIntoBuffer(right, rbb, &offset, max_chars);
6640 // Check for a flattened cons string
6642 String* left = first();
6646 String* string = String::cast(this);
6649 if (StringShape(string).IsCons()) {
6650 ConsString* cons_string = ConsString::cast(string);
6651 String* left = cons_string->first();
6653 string = left;
6656 string = cons_string->second();
6659 return string->Get(index);
6677 const unibrow::byte* answer = String::ReadBlock(String::cast(parent()),
6688 String::ReadBlockIntoBuffer(String::cast(parent()),
6694 void String::WriteToFlat(String* src,
6698 String* source = src;
6733 String* first = cons_string->first();
6749 String* second = cons_string->second();
6750 // When repeatedly appending to a string, we get a cons string that
6819 // Compare blocks until we reach near the end of the string.
6843 String* b) {
6844 String::FlatContent content = b->GetFlatContent();
6861 bool String::SlowEquals(String* other) {
6891 String* lhs = this->TryFlattenGetString();
6892 String* rhs = other->TryFlattenGetString();
6903 String::FlatContent lhs_content = lhs->GetFlatContent();
6904 String::FlatContent rhs_content = rhs->GetFlatContent();
6949 bool String::MarkAsUndetectable() {
6966 bool String::IsEqualTo(Vector<const char> str) {
6987 bool String::IsAsciiEqualTo(Vector<const char> str) {
7002 bool String::IsTwoByteEqualTo(Vector<const uc16> str) {
7016 uint32_t String::ComputeAndSetHash() {
7048 bool String::ComputeArrayIndex(unibrow::CharacterStream* buffer,
7054 // If the string begins with a '0' character, it must only consist
7061 // Convert string to uint32 array index; character by character.
7078 bool String::SlowAsArrayIndex(uint32_t* index) {
7097 ASSERT(length <= String::kMaxArrayIndexSize);
7098 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) <
7099 (1 << String::kArrayIndexValueBits));
7101 value <<= String::kHashShift;
7102 value |= length << String::kArrayIndexHashLengthShift;
7104 ASSERT((value & String::kIsNotArrayIndexMask) == 0);
7105 ASSERT((length > String::kMaxCachedArrayIndexLength) ||
7106 (value & String::kContainsCachedArrayIndexMask) == 0);
7129 if (length_ <= String::kMaxHashCalcLength) {
7133 return (GetHash() << String::kHashShift) | String::kIsNotArrayIndexMask;
7135 return (length_ << String::kHashShift) | String::kIsNotArrayIndexMask;
7140 uint32_t String::ComputeHashField(unibrow::CharacterStream* buffer,
7146 // string contents.
7167 MaybeObject* String::SubString(int start, int end, PretenureFlag pretenure) {
7175 void String::PrintOn(FILE* file) {
7530 Object* JSFunction::SetInstanceClassName(String* name) {
7550 String* symbol;
7562 String* SharedFunctionInfo::DebugName() {
7564 if (!n->IsString() || String::cast(n)->length() == 0) return inferred_name();
7565 return String::cast(n);
7577 Handle<String> source(String::cast(Script::cast(script())->source()));
7627 String* name = GetThisPropertyAssignmentName(i);
7667 String* SharedFunctionInfo::GetThisPropertyAssignmentName(int index) {
7673 return String::cast(obj);
7713 // Don't use String::cast because we don't want more assertion errors while
7715 String* script_source =
7716 reinterpret_cast<String*>(Script::cast(script())->source());
7726 if (name->IsString() && String::cast(name)->length() > 0) {
8823 // Handle [] on String objects.
8926 // Handle [] on String objects.
8998 Handle<String> key = isolate->factory()->NumberToString(number);
9056 Handle<String> key(isolate->factory()->NumberToString(number));
9299 Handle<String> name = isolate->factory()->NumberToString(number);
9958 String::cast(k)->StringPrint(out);
10009 String* name,
10027 String* name,
10041 String* name,
10048 Handle<String> name_handle(name);
10079 bool JSObject::HasRealNamedProperty(String* key) {
10105 // Handle [] on String objects.
10156 bool JSObject::HasRealNamedCallbackProperty(String* key) {
10449 String* str = String::cast(val);
10469 // StringKey simply carries a string object as key.
10472 explicit StringKey(String* string) :
10473 string_(string),
10474 hash_(HashForObject(string)) { }
10476 bool IsMatch(Object* string) {
10479 if (hash_ != HashForObject(string)) {
10482 return string_->Equals(String::cast(string));
10487 uint32_t HashForObject(Object* other) { return String::cast(other)->Hash(); }
10491 String* string_;
10499 StringSharedKey(String* source,
10521 String* source = String::cast(other_array->get(1));
10525 static uint32_t StringSharedHashHelper(String* source,
10537 hash ^= String::cast(script->source())->Hash();
10553 String* source = String::cast(other_array->get(1));
10578 String* source_;
10588 RegExpKey(String* string, JSRegExp::Flags flags)
10589 : string_(string),
10598 return string_->Equals(String::cast(val->get(JSRegExp::kSourceIndex)))
10613 return RegExpHash(String::cast(val->get(JSRegExp::kSourceIndex)),
10617 static uint32_t RegExpHash(String* string, Smi* flags) {
10618 return string->Hash() + flags->value();
10621 String* string_;
10628 explicit Utf8SymbolKey(Vector<const char> string, uint32_t seed)
10629 : string_(string), hash_field_(0), seed_(seed) { }
10631 bool IsMatch(Object* string) {
10632 return String::cast(string)->IsEqualTo(string_);
10636 if (hash_field_ != 0) return hash_field_ >> String::kHashShift;
10640 hash_field_ = String::ComputeHashField(&buffer, chars_, seed_);
10641 uint32_t result = hash_field_ >> String::kHashShift;
10647 return String::cast(other)->Hash();
10666 explicit SequentialSymbolKey(Vector<const Char> string, uint32_t seed)
10667 : string_(string), hash_field_(0), seed_(seed) { }
10673 // string contents.
10694 uint32_t result = hash_field_ >> String::kHashShift;
10701 return String::cast(other)->Hash();
10716 bool IsMatch(Object* string) {
10717 return String::cast(string)->IsAsciiEqualTo(string_);
10729 explicit SubStringAsciiSymbolKey(Handle<SeqAsciiString> string,
10733 : string_(string), from_(from), length_(length), seed_(seed) { }
10741 // string contents.
10764 uint32_t result = hash_field_ >> String::kHashShift;
10771 return String::cast(other)->Hash();
10774 bool IsMatch(Object* string) {
10776 return String::cast(string)->IsAsciiEqualTo(chars);
10799 bool IsMatch(Object* string) {
10800 return String::cast(string)->IsTwoByteEqualTo(string_);
10810 // SymbolKey carries a string/symbol object as key.
10813 explicit SymbolKey(String* string)
10814 : string_(string) { }
10816 bool IsMatch(Object* string) {
10817 return String::cast(string)->Equals(string_);
10823 return String::cast(other)->Hash();
10827 // Attempt to flatten the string, so that symbols will most often
10831 // Transform string to symbol if possible.
10846 return String::cast(obj)->Hash();
10849 String* string_;
10888 int StringDictionary::FindEntry(String* key) {
10890 return HashTable<StringDictionaryShape, String*>::FindEntry(key);
10914 String::cast(element)->Equals(key)) {
10920 ASSERT(element->IsTheHole() || !String::cast(element)->Equals(key));
11068 template class Dictionary<StringDictionaryShape, String*>;
11080 template MaybeObject* Dictionary<StringDictionaryShape, String*>::Allocate(
11095 template Object* Dictionary<StringDictionaryShape, String*>::SlowReverseLookup(
11103 template Object* Dictionary<StringDictionaryShape, String*>::DeleteProperty(
11109 template MaybeObject* Dictionary<StringDictionaryShape, String*>::Shrink(
11110 String*);
11115 template void Dictionary<StringDictionaryShape, String*>::CopyKeysTo(
11118 Dictionary<StringDictionaryShape, String*>::SortMode);
11121 Dictionary<StringDictionaryShape, String*>::NumberOfElementsFilterAttributes(
11124 template MaybeObject* Dictionary<StringDictionaryShape, String*>::Add(
11125 String*, Object*, PropertyDetails);
11128 Dictionary<StringDictionaryShape, String*>::GenerateNewEnumerationIndices();
11146 template MaybeObject* Dictionary<StringDictionaryShape, String*>::
11147 EnsureCapacity(int, String*);
11155 template MaybeObject* Dictionary<StringDictionaryShape, String*>::AddEntry(
11156 String*, Object*, PropertyDetails, uint32_t);
11162 int Dictionary<StringDictionaryShape, String*>::NumberOfEnumElements();
11580 Handle<String> name) {
11588 MaybeObject* GlobalObject::EnsurePropertyCell(String* name) {
11615 MaybeObject* SymbolTable::LookupString(String* string, Object** s) {
11616 SymbolKey key(string);
11623 // string hash calculation loop here for speed. Doesn't work if the two
11643 if ((hash & String::kHashBitMask) == 0) hash = String::kZeroHash;
11649 // version of the string hashing algorithm above. One reason could be
11659 String* other = String::cast(o);
11668 return String::cast(key)->Hash();
11685 bool SymbolTable::LookupSymbolIfExists(String* string, String** symbol) {
11686 SymbolKey key(string);
11691 String* result = String::cast(KeyAt(entry));
11701 String** symbol) {
11707 String* result = String::cast(KeyAt(entry));
11779 Object* CompilationCacheTable::Lookup(String* src) {
11787 Object* CompilationCacheTable::LookupEval(String* src,
11801 Object* CompilationCacheTable::LookupRegExp(String* src,
11810 MaybeObject* CompilationCacheTable::Put(String* src, Object* value) {
11827 MaybeObject* CompilationCacheTable::PutEval(String* src,
11856 MaybeObject* CompilationCacheTable::PutRegExp(String* src,
11914 hash ^= String::cast(symbols->get(i))->Hash();
12415 { MaybeObject* maybe_key = heap->LookupSymbol(String::cast(k));
12422 ConstantFunctionDescriptor d(String::cast(key),
12436 FieldDescriptor d(String::cast(key),
12447 CallbacksDescriptor d(String::cast(key),