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

Side by Side Diff: src/api.cc

Issue 3020002: Heap profiler: implement diffing of snapshots. (Closed)
Patch Set: Comments addressed Created 10 years, 5 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
« no previous file with comments | « include/v8-profiler.h ('k') | src/checks.h » ('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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 4543 matching lines...) Expand 10 before | Expand all | Expand 10 after
4554 } 4554 }
4555 4555
4556 4556
4557 Handle<String> HeapGraphNode::GetName() const { 4557 Handle<String> HeapGraphNode::GetName() const {
4558 IsDeadCheck("v8::HeapGraphNode::GetName"); 4558 IsDeadCheck("v8::HeapGraphNode::GetName");
4559 return Handle<String>(ToApi<String>(i::Factory::LookupAsciiSymbol( 4559 return Handle<String>(ToApi<String>(i::Factory::LookupAsciiSymbol(
4560 reinterpret_cast<const i::HeapEntry*>(this)->name()))); 4560 reinterpret_cast<const i::HeapEntry*>(this)->name())));
4561 } 4561 }
4562 4562
4563 4563
4564 uint64_t HeapGraphNode::GetId() const {
4565 IsDeadCheck("v8::HeapGraphNode::GetId");
4566 return reinterpret_cast<const i::HeapEntry*>(this)->id();
4567 }
4568
4569
4564 int HeapGraphNode::GetSelfSize() const { 4570 int HeapGraphNode::GetSelfSize() const {
4565 IsDeadCheck("v8::HeapGraphNode::GetSelfSize"); 4571 IsDeadCheck("v8::HeapGraphNode::GetSelfSize");
4566 return reinterpret_cast<const i::HeapEntry*>(this)->self_size(); 4572 return reinterpret_cast<const i::HeapEntry*>(this)->self_size();
4567 } 4573 }
4568 4574
4569 4575
4570 int HeapGraphNode::GetTotalSize() const { 4576 int HeapGraphNode::GetTotalSize() const {
4571 IsDeadCheck("v8::HeapSnapshot::GetHead"); 4577 IsDeadCheck("v8::HeapSnapshot::GetHead");
4572 return const_cast<i::HeapEntry*>( 4578 return const_cast<i::HeapEntry*>(
4573 reinterpret_cast<const i::HeapEntry*>(this))->TotalSize(); 4579 reinterpret_cast<const i::HeapEntry*>(this))->TotalSize();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
4617 4623
4618 const HeapGraphPath* HeapGraphNode::GetRetainingPath(int index) const { 4624 const HeapGraphPath* HeapGraphNode::GetRetainingPath(int index) const {
4619 IsDeadCheck("v8::HeapSnapshot::GetRetainingPath"); 4625 IsDeadCheck("v8::HeapSnapshot::GetRetainingPath");
4620 return reinterpret_cast<const HeapGraphPath*>( 4626 return reinterpret_cast<const HeapGraphPath*>(
4621 const_cast<i::HeapEntry*>( 4627 const_cast<i::HeapEntry*>(
4622 reinterpret_cast<const i::HeapEntry*>( 4628 reinterpret_cast<const i::HeapEntry*>(
4623 this))->GetRetainingPaths()->at(index)); 4629 this))->GetRetainingPaths()->at(index));
4624 } 4630 }
4625 4631
4626 4632
4633 const HeapGraphNode* HeapSnapshotsDiff::GetAdditionsRoot() const {
4634 IsDeadCheck("v8::HeapSnapshotsDiff::GetAdditionsRoot");
4635 const i::HeapSnapshotsDiff* diff =
4636 reinterpret_cast<const i::HeapSnapshotsDiff*>(this);
4637 return reinterpret_cast<const HeapGraphNode*>(diff->additions_root());
4638 }
4639
4640
4641 const HeapGraphNode* HeapSnapshotsDiff::GetDeletionsRoot() const {
4642 IsDeadCheck("v8::HeapSnapshotsDiff::GetDeletionsRoot");
4643 const i::HeapSnapshotsDiff* diff =
4644 reinterpret_cast<const i::HeapSnapshotsDiff*>(this);
4645 return reinterpret_cast<const HeapGraphNode*>(diff->deletions_root());
4646 }
4647
4648
4627 unsigned HeapSnapshot::GetUid() const { 4649 unsigned HeapSnapshot::GetUid() const {
4628 IsDeadCheck("v8::HeapSnapshot::GetUid"); 4650 IsDeadCheck("v8::HeapSnapshot::GetUid");
4629 return reinterpret_cast<const i::HeapSnapshot*>(this)->uid(); 4651 return reinterpret_cast<const i::HeapSnapshot*>(this)->uid();
4630 } 4652 }
4631 4653
4632 4654
4633 Handle<String> HeapSnapshot::GetTitle() const { 4655 Handle<String> HeapSnapshot::GetTitle() const {
4634 IsDeadCheck("v8::HeapSnapshot::GetTitle"); 4656 IsDeadCheck("v8::HeapSnapshot::GetTitle");
4635 const i::HeapSnapshot* snapshot = 4657 const i::HeapSnapshot* snapshot =
4636 reinterpret_cast<const i::HeapSnapshot*>(this); 4658 reinterpret_cast<const i::HeapSnapshot*>(this);
4637 return Handle<String>(ToApi<String>(i::Factory::LookupAsciiSymbol( 4659 return Handle<String>(ToApi<String>(i::Factory::LookupAsciiSymbol(
4638 snapshot->title()))); 4660 snapshot->title())));
4639 } 4661 }
4640 4662
4641 4663
4642 const HeapGraphNode* HeapSnapshot::GetHead() const { 4664 const HeapGraphNode* HeapSnapshot::GetRoot() const {
4643 IsDeadCheck("v8::HeapSnapshot::GetHead"); 4665 IsDeadCheck("v8::HeapSnapshot::GetHead");
4644 const i::HeapSnapshot* snapshot = 4666 const i::HeapSnapshot* snapshot =
4645 reinterpret_cast<const i::HeapSnapshot*>(this); 4667 reinterpret_cast<const i::HeapSnapshot*>(this);
4646 return reinterpret_cast<const HeapGraphNode*>(snapshot->const_root()); 4668 return reinterpret_cast<const HeapGraphNode*>(snapshot->const_root());
4647 } 4669 }
4648 4670
4649 4671
4672 const HeapSnapshotsDiff* HeapSnapshot::CompareWith(
4673 const HeapSnapshot* snapshot) const {
4674 IsDeadCheck("v8::HeapSnapshot::CompareWith");
4675 i::HeapSnapshot* snapshot1 = const_cast<i::HeapSnapshot*>(
4676 reinterpret_cast<const i::HeapSnapshot*>(this));
4677 i::HeapSnapshot* snapshot2 = const_cast<i::HeapSnapshot*>(
4678 reinterpret_cast<const i::HeapSnapshot*>(snapshot));
4679 return reinterpret_cast<const HeapSnapshotsDiff*>(
4680 snapshot1->CompareWith(snapshot2));
4681 }
4682
4683
4650 int HeapProfiler::GetSnapshotsCount() { 4684 int HeapProfiler::GetSnapshotsCount() {
4651 IsDeadCheck("v8::HeapProfiler::GetSnapshotsCount"); 4685 IsDeadCheck("v8::HeapProfiler::GetSnapshotsCount");
4652 return i::HeapProfiler::GetSnapshotsCount(); 4686 return i::HeapProfiler::GetSnapshotsCount();
4653 } 4687 }
4654 4688
4655 4689
4656 const HeapSnapshot* HeapProfiler::GetSnapshot(int index) { 4690 const HeapSnapshot* HeapProfiler::GetSnapshot(int index) {
4657 IsDeadCheck("v8::HeapProfiler::GetSnapshot"); 4691 IsDeadCheck("v8::HeapProfiler::GetSnapshot");
4658 return reinterpret_cast<const HeapSnapshot*>( 4692 return reinterpret_cast<const HeapSnapshot*>(
4659 i::HeapProfiler::GetSnapshot(index)); 4693 i::HeapProfiler::GetSnapshot(index));
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
4752 4786
4753 4787
4754 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 4788 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
4755 HandleScopeImplementer* thread_local = 4789 HandleScopeImplementer* thread_local =
4756 reinterpret_cast<HandleScopeImplementer*>(storage); 4790 reinterpret_cast<HandleScopeImplementer*>(storage);
4757 thread_local->IterateThis(v); 4791 thread_local->IterateThis(v);
4758 return storage + ArchiveSpacePerThread(); 4792 return storage + ArchiveSpacePerThread();
4759 } 4793 }
4760 4794
4761 } } // namespace v8::internal 4795 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-profiler.h ('k') | src/checks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698