| 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 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1994 isolate->global_handles()->representative_objects(); | 1994 isolate->global_handles()->representative_objects(); |
| 1995 | 1995 |
| 1996 if (ref_groups->length() == 0) | 1996 if (ref_groups->length() == 0) |
| 1997 return; | 1997 return; |
| 1998 | 1998 |
| 1999 ref_groups->Sort(); | 1999 ref_groups->Sort(); |
| 2000 representative_objects->Sort(); | 2000 representative_objects->Sort(); |
| 2001 | 2001 |
| 2002 int representative_objects_index = 0; | 2002 int representative_objects_index = 0; |
| 2003 UniqueId current_group_id(0); | 2003 UniqueId current_group_id(0); |
| 2004 size_t current_group_start = 0; | 2004 int current_group_start = 0; |
| 2005 for (int i = 0; i <= ref_groups->length(); ++i) { | 2005 for (int i = 0; i <= ref_groups->length(); ++i) { |
| 2006 if (i == 0) | 2006 if (i == 0) |
| 2007 current_group_id = ref_groups->at(i).id; | 2007 current_group_id = ref_groups->at(i).id; |
| 2008 if (i == ref_groups->length() || current_group_id != ref_groups->at(i).id) { | 2008 if (i == ref_groups->length() || current_group_id != ref_groups->at(i).id) { |
| 2009 // Group detected: objects in indices [current_group_start, i[. | 2009 // Group detected: objects in indices [current_group_start, i[. |
| 2010 | 2010 |
| 2011 // Find the representative object for this group. | 2011 // Find the representative object for this group. |
| 2012 while (representative_objects_index < representative_objects->length() && | 2012 while (representative_objects_index < representative_objects->length() && |
| 2013 representative_objects->at(representative_objects_index).id < | 2013 representative_objects->at(representative_objects_index).id < |
| 2014 current_group_id) | 2014 current_group_id) |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2757 | 2757 |
| 2758 | 2758 |
| 2759 void HeapSnapshotJSONSerializer::SortHashMap( | 2759 void HeapSnapshotJSONSerializer::SortHashMap( |
| 2760 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 2760 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
| 2761 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 2761 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
| 2762 sorted_entries->Add(p); | 2762 sorted_entries->Add(p); |
| 2763 sorted_entries->Sort(SortUsingEntryValue); | 2763 sorted_entries->Sort(SortUsingEntryValue); |
| 2764 } | 2764 } |
| 2765 | 2765 |
| 2766 } } // namespace v8::internal | 2766 } } // namespace v8::internal |
| OLD | NEW |