| 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 2691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2702 int count() { return objects_.length(); } | 2702 int count() { return objects_.length(); } |
| 2703 Handle<JSGlobalObject>& at(int i) { return objects_[i]; } | 2703 Handle<JSGlobalObject>& at(int i) { return objects_[i]; } |
| 2704 | 2704 |
| 2705 private: | 2705 private: |
| 2706 List<Handle<JSGlobalObject> > objects_; | 2706 List<Handle<JSGlobalObject> > objects_; |
| 2707 }; | 2707 }; |
| 2708 | 2708 |
| 2709 | 2709 |
| 2710 // Modifies heap. Must not be run during heap traversal. | 2710 // Modifies heap. Must not be run during heap traversal. |
| 2711 void V8HeapExplorer::TagGlobalObjects() { | 2711 void V8HeapExplorer::TagGlobalObjects() { |
| 2712 HandleScope scope; | |
| 2713 Isolate* isolate = Isolate::Current(); | 2712 Isolate* isolate = Isolate::Current(); |
| 2713 HandleScope scope(isolate); |
| 2714 GlobalObjectsEnumerator enumerator; | 2714 GlobalObjectsEnumerator enumerator; |
| 2715 isolate->global_handles()->IterateAllRoots(&enumerator); | 2715 isolate->global_handles()->IterateAllRoots(&enumerator); |
| 2716 const char** urls = NewArray<const char*>(enumerator.count()); | 2716 const char** urls = NewArray<const char*>(enumerator.count()); |
| 2717 for (int i = 0, l = enumerator.count(); i < l; ++i) { | 2717 for (int i = 0, l = enumerator.count(); i < l; ++i) { |
| 2718 if (global_object_name_resolver_) { | 2718 if (global_object_name_resolver_) { |
| 2719 HandleScope scope; | 2719 HandleScope scope(isolate); |
| 2720 Handle<JSGlobalObject> global_obj = enumerator.at(i); | 2720 Handle<JSGlobalObject> global_obj = enumerator.at(i); |
| 2721 urls[i] = global_object_name_resolver_->GetName( | 2721 urls[i] = global_object_name_resolver_->GetName( |
| 2722 Utils::ToLocal(Handle<JSObject>::cast(global_obj))); | 2722 Utils::ToLocal(Handle<JSObject>::cast(global_obj))); |
| 2723 } else { | 2723 } else { |
| 2724 urls[i] = NULL; | 2724 urls[i] = NULL; |
| 2725 } | 2725 } |
| 2726 } | 2726 } |
| 2727 | 2727 |
| 2728 AssertNoAllocation no_allocation; | 2728 AssertNoAllocation no_allocation; |
| 2729 for (int i = 0, l = enumerator.count(); i < l; ++i) { | 2729 for (int i = 0, l = enumerator.count(); i < l; ++i) { |
| (...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3589 | 3589 |
| 3590 | 3590 |
| 3591 void HeapSnapshotJSONSerializer::SortHashMap( | 3591 void HeapSnapshotJSONSerializer::SortHashMap( |
| 3592 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 3592 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
| 3593 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 3593 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
| 3594 sorted_entries->Add(p); | 3594 sorted_entries->Add(p); |
| 3595 sorted_entries->Sort(SortUsingEntryValue); | 3595 sorted_entries->Sort(SortUsingEntryValue); |
| 3596 } | 3596 } |
| 3597 | 3597 |
| 3598 } } // namespace v8::internal | 3598 } } // namespace v8::internal |
| OLD | NEW |