Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: src/profile-generator.cc

Issue 9605008: Merge 10601,10602,10616,10625,10647 from the bleeding edge to the 3.8 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.8/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mksnapshot.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 void HeapSnapshotsCollection::RemoveSnapshot(HeapSnapshot* snapshot) { 1570 void HeapSnapshotsCollection::RemoveSnapshot(HeapSnapshot* snapshot) {
1571 snapshots_.RemoveElement(snapshot); 1571 snapshots_.RemoveElement(snapshot);
1572 unsigned uid = snapshot->uid(); 1572 unsigned uid = snapshot->uid();
1573 snapshots_uids_.Remove(reinterpret_cast<void*>(uid), 1573 snapshots_uids_.Remove(reinterpret_cast<void*>(uid),
1574 static_cast<uint32_t>(uid)); 1574 static_cast<uint32_t>(uid));
1575 } 1575 }
1576 1576
1577 1577
1578 Handle<HeapObject> HeapSnapshotsCollection::FindHeapObjectById(uint64_t id) { 1578 Handle<HeapObject> HeapSnapshotsCollection::FindHeapObjectById(uint64_t id) {
1579 // First perform a full GC in order to avoid dead objects. 1579 // First perform a full GC in order to avoid dead objects.
1580 HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask); 1580 HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask,
1581 "HeapSnapshotsCollection::FindHeapObjectById");
1581 AssertNoAllocation no_allocation; 1582 AssertNoAllocation no_allocation;
1582 HeapObject* object = NULL; 1583 HeapObject* object = NULL;
1583 HeapIterator iterator(HeapIterator::kFilterUnreachable); 1584 HeapIterator iterator(HeapIterator::kFilterUnreachable);
1584 // Make sure that object with the given id is still reachable. 1585 // Make sure that object with the given id is still reachable.
1585 for (HeapObject* obj = iterator.next(); 1586 for (HeapObject* obj = iterator.next();
1586 obj != NULL; 1587 obj != NULL;
1587 obj = iterator.next()) { 1588 obj = iterator.next()) {
1588 if (ids_.FindObject(obj->address()) == id) { 1589 if (ids_.FindObject(obj->address()) == id) {
1589 ASSERT(object == NULL); 1590 ASSERT(object == NULL);
1590 object = obj; 1591 object = obj;
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after
3019 }; 3020 };
3020 3021
3021 3022
3022 bool HeapSnapshotGenerator::GenerateSnapshot() { 3023 bool HeapSnapshotGenerator::GenerateSnapshot() {
3023 v8_heap_explorer_.TagGlobalObjects(); 3024 v8_heap_explorer_.TagGlobalObjects();
3024 3025
3025 // TODO(1562) Profiler assumes that any object that is in the heap after 3026 // TODO(1562) Profiler assumes that any object that is in the heap after
3026 // full GC is reachable from the root when computing dominators. 3027 // full GC is reachable from the root when computing dominators.
3027 // This is not true for weakly reachable objects. 3028 // This is not true for weakly reachable objects.
3028 // As a temporary solution we call GC twice. 3029 // As a temporary solution we call GC twice.
3029 Isolate::Current()->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask); 3030 Isolate::Current()->heap()->CollectAllGarbage(
3030 Isolate::Current()->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask); 3031 Heap::kMakeHeapIterableMask,
3032 "HeapSnapshotGenerator::GenerateSnapshot");
3033 Isolate::Current()->heap()->CollectAllGarbage(
3034 Heap::kMakeHeapIterableMask,
3035 "HeapSnapshotGenerator::GenerateSnapshot");
3031 3036
3032 #ifdef DEBUG 3037 #ifdef DEBUG
3033 Heap* debug_heap = Isolate::Current()->heap(); 3038 Heap* debug_heap = Isolate::Current()->heap();
3034 ASSERT(!debug_heap->old_data_space()->was_swept_conservatively()); 3039 ASSERT(!debug_heap->old_data_space()->was_swept_conservatively());
3035 ASSERT(!debug_heap->old_pointer_space()->was_swept_conservatively()); 3040 ASSERT(!debug_heap->old_pointer_space()->was_swept_conservatively());
3036 ASSERT(!debug_heap->code_space()->was_swept_conservatively()); 3041 ASSERT(!debug_heap->code_space()->was_swept_conservatively());
3037 ASSERT(!debug_heap->cell_space()->was_swept_conservatively()); 3042 ASSERT(!debug_heap->cell_space()->was_swept_conservatively());
3038 ASSERT(!debug_heap->map_space()->was_swept_conservatively()); 3043 ASSERT(!debug_heap->map_space()->was_swept_conservatively());
3039 #endif 3044 #endif
3040 3045
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
3638 3643
3639 3644
3640 void HeapSnapshotJSONSerializer::SortHashMap( 3645 void HeapSnapshotJSONSerializer::SortHashMap(
3641 HashMap* map, List<HashMap::Entry*>* sorted_entries) { 3646 HashMap* map, List<HashMap::Entry*>* sorted_entries) {
3642 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) 3647 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p))
3643 sorted_entries->Add(p); 3648 sorted_entries->Add(p);
3644 sorted_entries->Sort(SortUsingEntryValue); 3649 sorted_entries->Sort(SortUsingEntryValue);
3645 } 3650 }
3646 3651
3647 } } // namespace v8::internal 3652 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mksnapshot.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698