OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 Handle<Object> value, | 653 Handle<Object> value, |
654 PropertyDetails details) { | 654 PropertyDetails details) { |
655 ASSERT(!object->HasFastProperties()); | 655 ASSERT(!object->HasFastProperties()); |
656 Handle<NameDictionary> property_dictionary(object->property_dictionary()); | 656 Handle<NameDictionary> property_dictionary(object->property_dictionary()); |
657 | 657 |
658 if (!name->IsUniqueName()) { | 658 if (!name->IsUniqueName()) { |
659 name = object->GetIsolate()->factory()->InternalizeString( | 659 name = object->GetIsolate()->factory()->InternalizeString( |
660 Handle<String>::cast(name)); | 660 Handle<String>::cast(name)); |
661 } | 661 } |
662 | 662 |
663 int entry = property_dictionary->FindEntry(*name); | 663 int entry = property_dictionary->FindEntry(name); |
664 if (entry == NameDictionary::kNotFound) { | 664 if (entry == NameDictionary::kNotFound) { |
665 Handle<Object> store_value = value; | 665 Handle<Object> store_value = value; |
666 if (object->IsGlobalObject()) { | 666 if (object->IsGlobalObject()) { |
667 store_value = object->GetIsolate()->factory()->NewPropertyCell(value); | 667 store_value = object->GetIsolate()->factory()->NewPropertyCell(value); |
668 } | 668 } |
669 | 669 |
670 property_dictionary = NameDictionary::AddNameEntry( | 670 property_dictionary = NameDictionary::AddNameEntry( |
671 property_dictionary, name, store_value, details); | 671 property_dictionary, name, store_value, details); |
672 object->set_properties(*property_dictionary); | 672 object->set_properties(*property_dictionary); |
673 return; | 673 return; |
(...skipping 24 matching lines...) Expand all Loading... |
698 } | 698 } |
699 } | 699 } |
700 | 700 |
701 | 701 |
702 Handle<Object> JSObject::DeleteNormalizedProperty(Handle<JSObject> object, | 702 Handle<Object> JSObject::DeleteNormalizedProperty(Handle<JSObject> object, |
703 Handle<Name> name, | 703 Handle<Name> name, |
704 DeleteMode mode) { | 704 DeleteMode mode) { |
705 ASSERT(!object->HasFastProperties()); | 705 ASSERT(!object->HasFastProperties()); |
706 Isolate* isolate = object->GetIsolate(); | 706 Isolate* isolate = object->GetIsolate(); |
707 Handle<NameDictionary> dictionary(object->property_dictionary()); | 707 Handle<NameDictionary> dictionary(object->property_dictionary()); |
708 int entry = dictionary->FindEntry(*name); | 708 int entry = dictionary->FindEntry(name); |
709 if (entry != NameDictionary::kNotFound) { | 709 if (entry != NameDictionary::kNotFound) { |
710 // If we have a global object set the cell to the hole. | 710 // If we have a global object set the cell to the hole. |
711 if (object->IsGlobalObject()) { | 711 if (object->IsGlobalObject()) { |
712 PropertyDetails details = dictionary->DetailsAt(entry); | 712 PropertyDetails details = dictionary->DetailsAt(entry); |
713 if (details.IsDontDelete()) { | 713 if (details.IsDontDelete()) { |
714 if (mode != FORCE_DELETION) return isolate->factory()->false_value(); | 714 if (mode != FORCE_DELETION) return isolate->factory()->false_value(); |
715 // When forced to delete global properties, we have to make a | 715 // When forced to delete global properties, we have to make a |
716 // map change to invalidate any ICs that think they can load | 716 // map change to invalidate any ICs that think they can load |
717 // from the DontDelete cell without checking if it contains | 717 // from the DontDelete cell without checking if it contains |
718 // the hole value. | 718 // the hole value. |
719 Handle<Map> new_map = Map::CopyDropDescriptors(handle(object->map())); | 719 Handle<Map> new_map = Map::CopyDropDescriptors(handle(object->map())); |
720 ASSERT(new_map->is_dictionary_map()); | 720 ASSERT(new_map->is_dictionary_map()); |
721 object->set_map(*new_map); | 721 object->set_map(*new_map); |
722 } | 722 } |
723 Handle<PropertyCell> cell(PropertyCell::cast(dictionary->ValueAt(entry))); | 723 Handle<PropertyCell> cell(PropertyCell::cast(dictionary->ValueAt(entry))); |
724 Handle<Object> value = isolate->factory()->the_hole_value(); | 724 Handle<Object> value = isolate->factory()->the_hole_value(); |
725 PropertyCell::SetValueInferType(cell, value); | 725 PropertyCell::SetValueInferType(cell, value); |
726 dictionary->DetailsAtPut(entry, details.AsDeleted()); | 726 dictionary->DetailsAtPut(entry, details.AsDeleted()); |
727 } else { | 727 } else { |
728 Handle<Object> deleted(dictionary->DeleteProperty(entry, mode), isolate); | 728 Handle<Object> deleted(dictionary->DeleteProperty(entry, mode), isolate); |
729 if (*deleted == isolate->heap()->true_value()) { | 729 if (*deleted == isolate->heap()->true_value()) { |
730 Handle<NameDictionary> new_properties = | 730 Handle<NameDictionary> new_properties = |
731 NameDictionary::Shrink(dictionary, *name); | 731 NameDictionary::Shrink(dictionary, name); |
732 object->set_properties(*new_properties); | 732 object->set_properties(*new_properties); |
733 } | 733 } |
734 return deleted; | 734 return deleted; |
735 } | 735 } |
736 } | 736 } |
737 return isolate->factory()->true_value(); | 737 return isolate->factory()->true_value(); |
738 } | 738 } |
739 | 739 |
740 | 740 |
741 bool JSObject::IsDirty() { | 741 bool JSObject::IsDirty() { |
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1917 | 1917 |
1918 void JSObject::AddSlowProperty(Handle<JSObject> object, | 1918 void JSObject::AddSlowProperty(Handle<JSObject> object, |
1919 Handle<Name> name, | 1919 Handle<Name> name, |
1920 Handle<Object> value, | 1920 Handle<Object> value, |
1921 PropertyAttributes attributes) { | 1921 PropertyAttributes attributes) { |
1922 ASSERT(!object->HasFastProperties()); | 1922 ASSERT(!object->HasFastProperties()); |
1923 Isolate* isolate = object->GetIsolate(); | 1923 Isolate* isolate = object->GetIsolate(); |
1924 Handle<NameDictionary> dict(object->property_dictionary()); | 1924 Handle<NameDictionary> dict(object->property_dictionary()); |
1925 if (object->IsGlobalObject()) { | 1925 if (object->IsGlobalObject()) { |
1926 // In case name is an orphaned property reuse the cell. | 1926 // In case name is an orphaned property reuse the cell. |
1927 int entry = dict->FindEntry(*name); | 1927 int entry = dict->FindEntry(name); |
1928 if (entry != NameDictionary::kNotFound) { | 1928 if (entry != NameDictionary::kNotFound) { |
1929 Handle<PropertyCell> cell(PropertyCell::cast(dict->ValueAt(entry))); | 1929 Handle<PropertyCell> cell(PropertyCell::cast(dict->ValueAt(entry))); |
1930 PropertyCell::SetValueInferType(cell, value); | 1930 PropertyCell::SetValueInferType(cell, value); |
1931 // Assign an enumeration index to the property and update | 1931 // Assign an enumeration index to the property and update |
1932 // SetNextEnumerationIndex. | 1932 // SetNextEnumerationIndex. |
1933 int index = dict->NextEnumerationIndex(); | 1933 int index = dict->NextEnumerationIndex(); |
1934 PropertyDetails details = PropertyDetails(attributes, NORMAL, index); | 1934 PropertyDetails details = PropertyDetails(attributes, NORMAL, index); |
1935 dict->SetNextEnumerationIndex(index + 1); | 1935 dict->SetNextEnumerationIndex(index + 1); |
1936 dict->SetEntry(entry, *name, *cell, details); | 1936 dict->SetEntry(entry, *name, *cell, details); |
1937 return; | 1937 return; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2047 // Add a new real property. | 2047 // Add a new real property. |
2048 return AddProperty(object, name, value, attributes, strict_mode); | 2048 return AddProperty(object, name, value, attributes, strict_mode); |
2049 } | 2049 } |
2050 | 2050 |
2051 | 2051 |
2052 static void ReplaceSlowProperty(Handle<JSObject> object, | 2052 static void ReplaceSlowProperty(Handle<JSObject> object, |
2053 Handle<Name> name, | 2053 Handle<Name> name, |
2054 Handle<Object> value, | 2054 Handle<Object> value, |
2055 PropertyAttributes attributes) { | 2055 PropertyAttributes attributes) { |
2056 NameDictionary* dictionary = object->property_dictionary(); | 2056 NameDictionary* dictionary = object->property_dictionary(); |
2057 int old_index = dictionary->FindEntry(*name); | 2057 int old_index = dictionary->FindEntry(name); |
2058 int new_enumeration_index = 0; // 0 means "Use the next available index." | 2058 int new_enumeration_index = 0; // 0 means "Use the next available index." |
2059 if (old_index != -1) { | 2059 if (old_index != -1) { |
2060 // All calls to ReplaceSlowProperty have had all transitions removed. | 2060 // All calls to ReplaceSlowProperty have had all transitions removed. |
2061 new_enumeration_index = dictionary->DetailsAt(old_index).dictionary_index(); | 2061 new_enumeration_index = dictionary->DetailsAt(old_index).dictionary_index(); |
2062 } | 2062 } |
2063 | 2063 |
2064 PropertyDetails new_details(attributes, NORMAL, new_enumeration_index); | 2064 PropertyDetails new_details(attributes, NORMAL, new_enumeration_index); |
2065 JSObject::SetNormalizedProperty(object, name, value, new_details); | 2065 JSObject::SetNormalizedProperty(object, name, value, new_details); |
2066 } | 2066 } |
2067 | 2067 |
(...skipping 12552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14620 int at_least_space_for, | 14620 int at_least_space_for, |
14621 MinimumCapacity capacity_option, | 14621 MinimumCapacity capacity_option, |
14622 PretenureFlag pretenure) { | 14622 PretenureFlag pretenure) { |
14623 CALL_HEAP_FUNCTION( | 14623 CALL_HEAP_FUNCTION( |
14624 isolate, | 14624 isolate, |
14625 Allocate(isolate->heap(), at_least_space_for, capacity_option, pretenure), | 14625 Allocate(isolate->heap(), at_least_space_for, capacity_option, pretenure), |
14626 Derived); | 14626 Derived); |
14627 } | 14627 } |
14628 | 14628 |
14629 | 14629 |
| 14630 // TODO(ishell): Remove this when all the callers are handlified. |
| 14631 int NameDictionary::FindEntry(Name* key) { |
| 14632 DisallowHeapAllocation no_allocation; |
| 14633 Isolate* isolate = key->GetIsolate(); |
| 14634 HandleScope scope(isolate); |
| 14635 return FindEntry(handle(key, isolate)); |
| 14636 } |
| 14637 |
| 14638 |
14630 // Find entry for key otherwise return kNotFound. | 14639 // Find entry for key otherwise return kNotFound. |
14631 int NameDictionary::FindEntry(Name* key) { | 14640 int NameDictionary::FindEntry(Handle<Name> key) { |
14632 if (!key->IsUniqueName()) { | 14641 if (!key->IsUniqueName()) { |
14633 return DerivedHashTable::FindEntry(key); | 14642 return DerivedHashTable::FindEntry(key); |
14634 } | 14643 } |
14635 | 14644 |
14636 // Optimized for unique names. Knowledge of the key type allows: | 14645 // Optimized for unique names. Knowledge of the key type allows: |
14637 // 1. Move the check if the key is unique out of the loop. | 14646 // 1. Move the check if the key is unique out of the loop. |
14638 // 2. Avoid comparing hash codes in unique-to-unique comparison. | 14647 // 2. Avoid comparing hash codes in unique-to-unique comparison. |
14639 // 3. Detect a case when a dictionary key is not unique but the key is. | 14648 // 3. Detect a case when a dictionary key is not unique but the key is. |
14640 // In case of positive result the dictionary key may be replaced by the | 14649 // In case of positive result the dictionary key may be replaced by the |
14641 // internalized string with minimal performance penalty. It gives a chance | 14650 // internalized string with minimal performance penalty. It gives a chance |
14642 // to perform further lookups in code stubs (and significant performance | 14651 // to perform further lookups in code stubs (and significant performance |
14643 // boost a certain style of code). | 14652 // boost a certain style of code). |
14644 | 14653 |
14645 // EnsureCapacity will guarantee the hash table is never full. | 14654 // EnsureCapacity will guarantee the hash table is never full. |
14646 uint32_t capacity = Capacity(); | 14655 uint32_t capacity = Capacity(); |
14647 uint32_t entry = FirstProbe(key->Hash(), capacity); | 14656 uint32_t entry = FirstProbe(key->Hash(), capacity); |
14648 uint32_t count = 1; | 14657 uint32_t count = 1; |
14649 | 14658 |
14650 while (true) { | 14659 while (true) { |
14651 int index = EntryToIndex(entry); | 14660 int index = EntryToIndex(entry); |
14652 Object* element = get(index); | 14661 Object* element = get(index); |
14653 if (element->IsUndefined()) break; // Empty entry. | 14662 if (element->IsUndefined()) break; // Empty entry. |
14654 if (key == element) return entry; | 14663 if (*key == element) return entry; |
14655 if (!element->IsUniqueName() && | 14664 if (!element->IsUniqueName() && |
14656 !element->IsTheHole() && | 14665 !element->IsTheHole() && |
14657 Name::cast(element)->Equals(key)) { | 14666 Name::cast(element)->Equals(*key)) { |
14658 // Replace a key that is a non-internalized string by the equivalent | 14667 // Replace a key that is a non-internalized string by the equivalent |
14659 // internalized string for faster further lookups. | 14668 // internalized string for faster further lookups. |
14660 set(index, key); | 14669 set(index, *key); |
14661 return entry; | 14670 return entry; |
14662 } | 14671 } |
14663 ASSERT(element->IsTheHole() || !Name::cast(element)->Equals(key)); | 14672 ASSERT(element->IsTheHole() || !Name::cast(element)->Equals(*key)); |
14664 entry = NextProbe(entry, count++, capacity); | 14673 entry = NextProbe(entry, count++, capacity); |
14665 } | 14674 } |
14666 return kNotFound; | 14675 return kNotFound; |
14667 } | 14676 } |
14668 | 14677 |
14669 | 14678 |
14670 template<typename Derived, typename Shape, typename Key> | 14679 template<typename Derived, typename Shape, typename Key> |
14671 void HashTable<Derived, Shape, Key>::Rehash(Derived* new_table, Key key) { | 14680 void HashTable<Derived, Shape, Key>::Rehash(Derived* new_table, Key key) { |
14672 ASSERT(NumberOfElements() < new_table->Capacity()); | 14681 ASSERT(NumberOfElements() < new_table->Capacity()); |
14673 | 14682 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14870 template class HashTable<CompilationCacheTable, | 14879 template class HashTable<CompilationCacheTable, |
14871 CompilationCacheShape, | 14880 CompilationCacheShape, |
14872 HashTableKey*>; | 14881 HashTableKey*>; |
14873 | 14882 |
14874 template class HashTable<MapCache, MapCacheShape, HashTableKey*>; | 14883 template class HashTable<MapCache, MapCacheShape, HashTableKey*>; |
14875 | 14884 |
14876 template class HashTable<ObjectHashTable, ObjectHashTableShape, Object*>; | 14885 template class HashTable<ObjectHashTable, ObjectHashTableShape, Object*>; |
14877 | 14886 |
14878 template class HashTable<WeakHashTable, WeakHashTableShape<2>, Object*>; | 14887 template class HashTable<WeakHashTable, WeakHashTableShape<2>, Object*>; |
14879 | 14888 |
14880 template class Dictionary<NameDictionary, NameDictionaryShape, Name*>; | 14889 template class Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >; |
14881 | 14890 |
14882 template class Dictionary<SeededNumberDictionary, | 14891 template class Dictionary<SeededNumberDictionary, |
14883 SeededNumberDictionaryShape, | 14892 SeededNumberDictionaryShape, |
14884 uint32_t>; | 14893 uint32_t>; |
14885 | 14894 |
14886 template class Dictionary<UnseededNumberDictionary, | 14895 template class Dictionary<UnseededNumberDictionary, |
14887 UnseededNumberDictionaryShape, | 14896 UnseededNumberDictionaryShape, |
14888 uint32_t>; | 14897 uint32_t>; |
14889 | 14898 |
14890 template MaybeObject* | 14899 template MaybeObject* |
14891 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: | 14900 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: |
14892 Allocate(Heap* heap, int at_least_space_for, PretenureFlag pretenure); | 14901 Allocate(Heap* heap, int at_least_space_for, PretenureFlag pretenure); |
14893 | 14902 |
14894 template MaybeObject* | 14903 template MaybeObject* |
14895 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>:: | 14904 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>:: |
14896 Allocate(Heap* heap, int at_least_space_for, PretenureFlag pretenure); | 14905 Allocate(Heap* heap, int at_least_space_for, PretenureFlag pretenure); |
14897 | 14906 |
14898 template MaybeObject* Dictionary<NameDictionary, NameDictionaryShape, Name*>:: | 14907 template MaybeObject* |
| 14908 Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >:: |
14899 Allocate(Heap* heap, int n, PretenureFlag pretenure); | 14909 Allocate(Heap* heap, int n, PretenureFlag pretenure); |
14900 | 14910 |
14901 template Handle<NameDictionary> | 14911 template Handle<NameDictionary> |
14902 Dictionary<NameDictionary, NameDictionaryShape, Name*>:: | 14912 Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >:: |
14903 New(Isolate* isolate, int n, PretenureFlag pretenure); | 14913 New(Isolate* isolate, int n, PretenureFlag pretenure); |
14904 | 14914 |
14905 template Handle<SeededNumberDictionary> | 14915 template Handle<SeededNumberDictionary> |
14906 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: | 14916 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: |
14907 AtPut(Handle<SeededNumberDictionary>, uint32_t, Handle<Object>); | 14917 AtPut(Handle<SeededNumberDictionary>, uint32_t, Handle<Object>); |
14908 | 14918 |
14909 template Handle<UnseededNumberDictionary> | 14919 template Handle<UnseededNumberDictionary> |
14910 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>:: | 14920 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>:: |
14911 AtPut(Handle<UnseededNumberDictionary>, uint32_t, Handle<Object>); | 14921 AtPut(Handle<UnseededNumberDictionary>, uint32_t, Handle<Object>); |
14912 | 14922 |
14913 template Object* | 14923 template Object* |
14914 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: | 14924 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: |
14915 SlowReverseLookup(Object* value); | 14925 SlowReverseLookup(Object* value); |
14916 | 14926 |
14917 template Object* | 14927 template Object* |
14918 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>:: | 14928 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>:: |
14919 SlowReverseLookup(Object* value); | 14929 SlowReverseLookup(Object* value); |
14920 | 14930 |
14921 template Object* | 14931 template Object* |
14922 Dictionary<NameDictionary, NameDictionaryShape, Name*>::SlowReverseLookup( | 14932 Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >:: |
14923 Object*); | 14933 SlowReverseLookup(Object* value); |
14924 | 14934 |
14925 template void | 14935 template void |
14926 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: | 14936 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: |
14927 CopyKeysTo( | 14937 CopyKeysTo( |
14928 FixedArray*, | 14938 FixedArray*, |
14929 PropertyAttributes, | 14939 PropertyAttributes, |
14930 Dictionary<SeededNumberDictionary, | 14940 Dictionary<SeededNumberDictionary, |
14931 SeededNumberDictionaryShape, | 14941 SeededNumberDictionaryShape, |
14932 uint32_t>::SortMode); | 14942 uint32_t>::SortMode); |
14933 | 14943 |
14934 template Object* | 14944 template Object* |
14935 Dictionary<NameDictionary, NameDictionaryShape, Name*>::DeleteProperty( | 14945 Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >::DeleteProperty( |
14936 int, JSObject::DeleteMode); | 14946 int, JSObject::DeleteMode); |
14937 | 14947 |
14938 template Handle<Object> | 14948 template Handle<Object> |
14939 Dictionary<NameDictionary, NameDictionaryShape, Name*>::DeleteProperty( | 14949 Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >::DeleteProperty( |
14940 Handle<Dictionary<NameDictionary, NameDictionaryShape, Name*> >, | 14950 Handle<Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> > >, |
14941 int, | 14951 int, |
14942 JSObject::DeleteMode); | 14952 JSObject::DeleteMode); |
14943 | 14953 |
14944 template Object* | 14954 template Object* |
14945 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: | 14955 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: |
14946 DeleteProperty(int, JSObject::DeleteMode); | 14956 DeleteProperty(int, JSObject::DeleteMode); |
14947 | 14957 |
14948 template Handle<Object> | 14958 template Handle<Object> |
14949 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: | 14959 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: |
14950 DeleteProperty( | 14960 DeleteProperty( |
14951 Handle<Dictionary<SeededNumberDictionary, | 14961 Handle<Dictionary<SeededNumberDictionary, |
14952 SeededNumberDictionaryShape, | 14962 SeededNumberDictionaryShape, |
14953 uint32_t> >, | 14963 uint32_t> >, |
14954 int, | 14964 int, |
14955 JSObject::DeleteMode); | 14965 JSObject::DeleteMode); |
14956 | 14966 |
14957 template Handle<NameDictionary> | 14967 template Handle<NameDictionary> |
14958 HashTable<NameDictionary, NameDictionaryShape, Name*>:: | 14968 HashTable<NameDictionary, NameDictionaryShape, Handle<Name> >:: |
14959 New(Isolate*, int, MinimumCapacity, PretenureFlag); | 14969 New(Isolate*, int, MinimumCapacity, PretenureFlag); |
14960 | 14970 |
14961 template Handle<NameDictionary> | 14971 template Handle<NameDictionary> |
14962 HashTable<NameDictionary, NameDictionaryShape, Name*>:: | 14972 HashTable<NameDictionary, NameDictionaryShape, Handle<Name> >:: |
14963 Shrink(Handle<NameDictionary>, Name* n); | 14973 Shrink(Handle<NameDictionary>, Handle<Name>); |
14964 | 14974 |
14965 template Handle<SeededNumberDictionary> | 14975 template Handle<SeededNumberDictionary> |
14966 HashTable<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: | 14976 HashTable<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: |
14967 Shrink(Handle<SeededNumberDictionary>, uint32_t); | 14977 Shrink(Handle<SeededNumberDictionary>, uint32_t); |
14968 | 14978 |
14969 template void Dictionary<NameDictionary, NameDictionaryShape, Name*>:: | 14979 template void Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >:: |
14970 CopyKeysTo( | 14980 CopyKeysTo( |
14971 FixedArray*, | 14981 FixedArray*, |
14972 int, | 14982 int, |
14973 PropertyAttributes, | 14983 PropertyAttributes, |
14974 Dictionary<NameDictionary, NameDictionaryShape, Name*>::SortMode); | 14984 Dictionary< |
| 14985 NameDictionary, NameDictionaryShape, Handle<Name> >::SortMode); |
14975 | 14986 |
14976 template int | 14987 template int |
14977 Dictionary<NameDictionary, NameDictionaryShape, Name*>:: | 14988 Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >:: |
14978 NumberOfElementsFilterAttributes(PropertyAttributes); | 14989 NumberOfElementsFilterAttributes(PropertyAttributes); |
14979 | 14990 |
14980 template MaybeObject* | 14991 template MaybeObject* |
14981 Dictionary<NameDictionary, NameDictionaryShape, Name*>::Add( | 14992 Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >::Add( |
14982 Name*, Object*, PropertyDetails); | 14993 Handle<Name>, Object*, PropertyDetails); |
14983 | 14994 |
14984 template MaybeObject* | 14995 template MaybeObject* |
14985 Dictionary<NameDictionary, NameDictionaryShape, Name*>:: | 14996 Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >:: |
14986 GenerateNewEnumerationIndices(); | 14997 GenerateNewEnumerationIndices(); |
14987 | 14998 |
14988 template int | 14999 template int |
14989 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: | 15000 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: |
14990 NumberOfElementsFilterAttributes(PropertyAttributes); | 15001 NumberOfElementsFilterAttributes(PropertyAttributes); |
14991 | 15002 |
14992 template MaybeObject* | 15003 template MaybeObject* |
14993 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>::Add( | 15004 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>::Add( |
14994 uint32_t, Object*, PropertyDetails); | 15005 uint32_t, Object*, PropertyDetails); |
14995 | 15006 |
14996 template MaybeObject* | 15007 template MaybeObject* |
14997 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>:: | 15008 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>:: |
14998 Add(uint32_t, Object*, PropertyDetails); | 15009 Add(uint32_t, Object*, PropertyDetails); |
14999 | 15010 |
15000 template MaybeObject* | 15011 template MaybeObject* |
15001 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: | 15012 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: |
15002 EnsureCapacity(int, uint32_t); | 15013 EnsureCapacity(int, uint32_t); |
15003 | 15014 |
15004 template MaybeObject* | 15015 template MaybeObject* |
15005 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>:: | 15016 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>:: |
15006 EnsureCapacity(int, uint32_t); | 15017 EnsureCapacity(int, uint32_t); |
15007 | 15018 |
15008 template MaybeObject* | 15019 template MaybeObject* |
15009 Dictionary<NameDictionary, NameDictionaryShape, Name*>:: | 15020 Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >:: |
15010 EnsureCapacity(int, Name*); | 15021 EnsureCapacity(int, Handle<Name>); |
15011 | 15022 |
15012 template MaybeObject* | 15023 template MaybeObject* |
15013 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: | 15024 Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: |
15014 AddEntry(uint32_t, Object*, PropertyDetails, uint32_t); | 15025 AddEntry(uint32_t, Object*, PropertyDetails, uint32_t); |
15015 | 15026 |
15016 template MaybeObject* | 15027 template MaybeObject* |
15017 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>:: | 15028 Dictionary<UnseededNumberDictionary, UnseededNumberDictionaryShape, uint32_t>:: |
15018 AddEntry(uint32_t, Object*, PropertyDetails, uint32_t); | 15029 AddEntry(uint32_t, Object*, PropertyDetails, uint32_t); |
15019 | 15030 |
15020 template MaybeObject* | 15031 template MaybeObject* |
15021 Dictionary<NameDictionary, NameDictionaryShape, Name*>::AddEntry( | 15032 Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >::AddEntry( |
15022 Name*, Object*, PropertyDetails, uint32_t); | 15033 Handle<Name>, Object*, PropertyDetails, uint32_t); |
15023 | 15034 |
15024 template | 15035 template |
15025 int Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: | 15036 int Dictionary<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: |
15026 NumberOfEnumElements(); | 15037 NumberOfEnumElements(); |
15027 | 15038 |
15028 template | 15039 template |
15029 int Dictionary<NameDictionary, NameDictionaryShape, Name*>:: | 15040 int Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >:: |
15030 NumberOfEnumElements(); | 15041 NumberOfEnumElements(); |
15031 | 15042 |
15032 template | 15043 template |
15033 int HashTable<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: | 15044 int HashTable<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>:: |
15034 FindEntry(uint32_t); | 15045 FindEntry(uint32_t); |
15035 | 15046 |
15036 | 15047 |
15037 Handle<NameDictionary> NameDictionary::AddNameEntry(Handle<NameDictionary> dict, | 15048 Handle<NameDictionary> NameDictionary::AddNameEntry(Handle<NameDictionary> dict, |
15038 Handle<Name> name, | 15049 Handle<Name> name, |
15039 Handle<Object> value, | 15050 Handle<Object> value, |
15040 PropertyDetails details) { | 15051 PropertyDetails details) { |
15041 CALL_HEAP_FUNCTION(dict->GetIsolate(), | 15052 CALL_HEAP_FUNCTION(dict->GetIsolate(), |
15042 dict->Add(*name, *value, details), | 15053 dict->Add(name, *value, details), |
15043 NameDictionary); | 15054 NameDictionary); |
15044 } | 15055 } |
15045 | 15056 |
15046 | 15057 |
15047 Handle<Object> JSObject::PrepareSlowElementsForSort( | 15058 Handle<Object> JSObject::PrepareSlowElementsForSort( |
15048 Handle<JSObject> object, uint32_t limit) { | 15059 Handle<JSObject> object, uint32_t limit) { |
15049 ASSERT(object->HasDictionaryElements()); | 15060 ASSERT(object->HasDictionaryElements()); |
15050 Isolate* isolate = object->GetIsolate(); | 15061 Isolate* isolate = object->GetIsolate(); |
15051 // Must stay in dictionary mode, either because of requires_slow_elements, | 15062 // Must stay in dictionary mode, either because of requires_slow_elements, |
15052 // or because we are not going to sort (and therefore compact) all of the | 15063 // or because we are not going to sort (and therefore compact) all of the |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15470 ASSERT(!HasFastProperties()); | 15481 ASSERT(!HasFastProperties()); |
15471 Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry()); | 15482 Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry()); |
15472 return PropertyCell::cast(value); | 15483 return PropertyCell::cast(value); |
15473 } | 15484 } |
15474 | 15485 |
15475 | 15486 |
15476 Handle<PropertyCell> JSGlobalObject::EnsurePropertyCell( | 15487 Handle<PropertyCell> JSGlobalObject::EnsurePropertyCell( |
15477 Handle<JSGlobalObject> global, | 15488 Handle<JSGlobalObject> global, |
15478 Handle<Name> name) { | 15489 Handle<Name> name) { |
15479 ASSERT(!global->HasFastProperties()); | 15490 ASSERT(!global->HasFastProperties()); |
15480 int entry = global->property_dictionary()->FindEntry(*name); | 15491 int entry = global->property_dictionary()->FindEntry(name); |
15481 if (entry == NameDictionary::kNotFound) { | 15492 if (entry == NameDictionary::kNotFound) { |
15482 Isolate* isolate = global->GetIsolate(); | 15493 Isolate* isolate = global->GetIsolate(); |
15483 Handle<PropertyCell> cell = isolate->factory()->NewPropertyCell( | 15494 Handle<PropertyCell> cell = isolate->factory()->NewPropertyCell( |
15484 isolate->factory()->the_hole_value()); | 15495 isolate->factory()->the_hole_value()); |
15485 PropertyDetails details(NONE, NORMAL, 0); | 15496 PropertyDetails details(NONE, NORMAL, 0); |
15486 details = details.AsDeleted(); | 15497 details = details.AsDeleted(); |
15487 Handle<NameDictionary> dictionary = NameDictionary::AddNameEntry( | 15498 Handle<NameDictionary> dictionary = NameDictionary::AddNameEntry( |
15488 handle(global->property_dictionary()), name, cell, details); | 15499 handle(global->property_dictionary()), name, cell, details); |
15489 global->set_properties(*dictionary); | 15500 global->set_properties(*dictionary); |
15490 return cell; | 15501 return cell; |
(...skipping 1937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17428 #define ERROR_MESSAGES_TEXTS(C, T) T, | 17439 #define ERROR_MESSAGES_TEXTS(C, T) T, |
17429 static const char* error_messages_[] = { | 17440 static const char* error_messages_[] = { |
17430 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 17441 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
17431 }; | 17442 }; |
17432 #undef ERROR_MESSAGES_TEXTS | 17443 #undef ERROR_MESSAGES_TEXTS |
17433 return error_messages_[reason]; | 17444 return error_messages_[reason]; |
17434 } | 17445 } |
17435 | 17446 |
17436 | 17447 |
17437 } } // namespace v8::internal | 17448 } } // namespace v8::internal |
OLD | NEW |