OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2278 int finger1 = i1, finger2 = i2; | 2278 int finger1 = i1, finger2 = i2; |
2279 while (finger1 != finger2) { | 2279 while (finger1 != finger2) { |
2280 while (finger1 < finger2) finger1 = dominators[finger1]->ordered_index(); | 2280 while (finger1 < finger2) finger1 = dominators[finger1]->ordered_index(); |
2281 while (finger2 < finger1) finger2 = dominators[finger2]->ordered_index(); | 2281 while (finger2 < finger1) finger2 = dominators[finger2]->ordered_index(); |
2282 } | 2282 } |
2283 return finger1; | 2283 return finger1; |
2284 } | 2284 } |
2285 | 2285 |
2286 // The algorithm is based on the article: | 2286 // The algorithm is based on the article: |
2287 // K. Cooper, T. Harvey and K. Kennedy "A Simple, Fast Dominance Algorithm" | 2287 // K. Cooper, T. Harvey and K. Kennedy "A Simple, Fast Dominance Algorithm" |
2288 // Softw. Pract. Exper. 4 (2001), pp. 1–10. | 2288 // Softw. Pract. Exper. 4 (2001), pp. 1-10. |
2289 bool HeapSnapshotGenerator::BuildDominatorTree( | 2289 bool HeapSnapshotGenerator::BuildDominatorTree( |
2290 const Vector<HeapEntry*>& entries, | 2290 const Vector<HeapEntry*>& entries, |
2291 Vector<HeapEntry*>* dominators) { | 2291 Vector<HeapEntry*>* dominators) { |
2292 if (entries.length() == 0) return true; | 2292 if (entries.length() == 0) return true; |
2293 const int entries_length = entries.length(), root_index = entries_length - 1; | 2293 const int entries_length = entries.length(), root_index = entries_length - 1; |
2294 for (int i = 0; i < root_index; ++i) (*dominators)[i] = NULL; | 2294 for (int i = 0; i < root_index; ++i) (*dominators)[i] = NULL; |
2295 (*dominators)[root_index] = entries[root_index]; | 2295 (*dominators)[root_index] = entries[root_index]; |
2296 int changed = 1; | 2296 int changed = 1; |
2297 const int base_progress_counter = progress_counter_; | 2297 const int base_progress_counter = progress_counter_; |
2298 while (changed != 0) { | 2298 while (changed != 0) { |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2833 | 2833 |
2834 | 2834 |
2835 String* GetConstructorNameForHeapProfile(JSObject* object) { | 2835 String* GetConstructorNameForHeapProfile(JSObject* object) { |
2836 if (object->IsJSFunction()) return Heap::closure_symbol(); | 2836 if (object->IsJSFunction()) return Heap::closure_symbol(); |
2837 return object->constructor_name(); | 2837 return object->constructor_name(); |
2838 } | 2838 } |
2839 | 2839 |
2840 } } // namespace v8::internal | 2840 } } // namespace v8::internal |
2841 | 2841 |
2842 #endif // ENABLE_LOGGING_AND_PROFILING | 2842 #endif // ENABLE_LOGGING_AND_PROFILING |
OLD | NEW |