| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 #ifdef DEBUG | 887 #ifdef DEBUG |
| 888 | 888 |
| 889 void JSObject::IncrementSpillStatistics(SpillInformation* info) { | 889 void JSObject::IncrementSpillStatistics(SpillInformation* info) { |
| 890 info->number_of_objects_++; | 890 info->number_of_objects_++; |
| 891 // Named properties | 891 // Named properties |
| 892 if (HasFastProperties()) { | 892 if (HasFastProperties()) { |
| 893 info->number_of_objects_with_fast_properties_++; | 893 info->number_of_objects_with_fast_properties_++; |
| 894 info->number_of_fast_used_fields_ += map()->NextFreePropertyIndex(); | 894 info->number_of_fast_used_fields_ += map()->NextFreePropertyIndex(); |
| 895 info->number_of_fast_unused_fields_ += map()->unused_property_fields(); | 895 info->number_of_fast_unused_fields_ += map()->unused_property_fields(); |
| 896 } else { | 896 } else { |
| 897 StringDictionary* dict = property_dictionary(); | 897 NameDictionary* dict = property_dictionary(); |
| 898 info->number_of_slow_used_properties_ += dict->NumberOfElements(); | 898 info->number_of_slow_used_properties_ += dict->NumberOfElements(); |
| 899 info->number_of_slow_unused_properties_ += | 899 info->number_of_slow_unused_properties_ += |
| 900 dict->Capacity() - dict->NumberOfElements(); | 900 dict->Capacity() - dict->NumberOfElements(); |
| 901 } | 901 } |
| 902 // Indexed properties | 902 // Indexed properties |
| 903 switch (GetElementsKind()) { | 903 switch (GetElementsKind()) { |
| 904 case FAST_HOLEY_SMI_ELEMENTS: | 904 case FAST_HOLEY_SMI_ELEMENTS: |
| 905 case FAST_SMI_ELEMENTS: | 905 case FAST_SMI_ELEMENTS: |
| 906 case FAST_HOLEY_DOUBLE_ELEMENTS: | 906 case FAST_HOLEY_DOUBLE_ELEMENTS: |
| 907 case FAST_DOUBLE_ELEMENTS: | 907 case FAST_DOUBLE_ELEMENTS: |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 PrintF(" - slow elements (#%d): %d (used) %d (unused)\n", | 978 PrintF(" - slow elements (#%d): %d (used) %d (unused)\n", |
| 979 number_of_objects_ - number_of_objects_with_fast_elements_, | 979 number_of_objects_ - number_of_objects_with_fast_elements_, |
| 980 number_of_slow_used_elements_, number_of_slow_unused_elements_); | 980 number_of_slow_used_elements_, number_of_slow_unused_elements_); |
| 981 | 981 |
| 982 PrintF("\n"); | 982 PrintF("\n"); |
| 983 } | 983 } |
| 984 | 984 |
| 985 | 985 |
| 986 bool DescriptorArray::IsSortedNoDuplicates(int valid_entries) { | 986 bool DescriptorArray::IsSortedNoDuplicates(int valid_entries) { |
| 987 if (valid_entries == -1) valid_entries = number_of_descriptors(); | 987 if (valid_entries == -1) valid_entries = number_of_descriptors(); |
| 988 String* current_key = NULL; | 988 Name* current_key = NULL; |
| 989 uint32_t current = 0; | 989 uint32_t current = 0; |
| 990 for (int i = 0; i < number_of_descriptors(); i++) { | 990 for (int i = 0; i < number_of_descriptors(); i++) { |
| 991 String* key = GetSortedKey(i); | 991 Name* key = GetSortedKey(i); |
| 992 if (key == current_key) { | 992 if (key == current_key) { |
| 993 PrintDescriptors(); | 993 PrintDescriptors(); |
| 994 return false; | 994 return false; |
| 995 } | 995 } |
| 996 current_key = key; | 996 current_key = key; |
| 997 uint32_t hash = GetSortedKey(i)->Hash(); | 997 uint32_t hash = GetSortedKey(i)->Hash(); |
| 998 if (hash < current) { | 998 if (hash < current) { |
| 999 PrintDescriptors(); | 999 PrintDescriptors(); |
| 1000 return false; | 1000 return false; |
| 1001 } | 1001 } |
| 1002 current = hash; | 1002 current = hash; |
| 1003 } | 1003 } |
| 1004 return true; | 1004 return true; |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 | 1007 |
| 1008 bool TransitionArray::IsSortedNoDuplicates(int valid_entries) { | 1008 bool TransitionArray::IsSortedNoDuplicates(int valid_entries) { |
| 1009 ASSERT(valid_entries == -1); | 1009 ASSERT(valid_entries == -1); |
| 1010 String* current_key = NULL; | 1010 Name* current_key = NULL; |
| 1011 uint32_t current = 0; | 1011 uint32_t current = 0; |
| 1012 for (int i = 0; i < number_of_transitions(); i++) { | 1012 for (int i = 0; i < number_of_transitions(); i++) { |
| 1013 String* key = GetSortedKey(i); | 1013 Name* key = GetSortedKey(i); |
| 1014 if (key == current_key) { | 1014 if (key == current_key) { |
| 1015 PrintTransitions(); | 1015 PrintTransitions(); |
| 1016 return false; | 1016 return false; |
| 1017 } | 1017 } |
| 1018 current_key = key; | 1018 current_key = key; |
| 1019 uint32_t hash = GetSortedKey(i)->Hash(); | 1019 uint32_t hash = GetSortedKey(i)->Hash(); |
| 1020 if (hash < current) { | 1020 if (hash < current) { |
| 1021 PrintTransitions(); | 1021 PrintTransitions(); |
| 1022 return false; | 1022 return false; |
| 1023 } | 1023 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1040 for (int i = 0; i < number_of_transitions(); ++i) { | 1040 for (int i = 0; i < number_of_transitions(); ++i) { |
| 1041 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1041 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
| 1042 } | 1042 } |
| 1043 return true; | 1043 return true; |
| 1044 } | 1044 } |
| 1045 | 1045 |
| 1046 | 1046 |
| 1047 #endif // DEBUG | 1047 #endif // DEBUG |
| 1048 | 1048 |
| 1049 } } // namespace v8::internal | 1049 } } // namespace v8::internal |
| OLD | NEW |