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

Side by Side Diff: src/api.cc

Issue 8046006: Add v8::HeapGraphNode::GetHeapValue method. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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
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 5793 matching lines...) Expand 10 before | Expand all | Expand 10 after
5804 } 5804 }
5805 5805
5806 5806
5807 const HeapGraphNode* HeapGraphNode::GetDominatorNode() const { 5807 const HeapGraphNode* HeapGraphNode::GetDominatorNode() const {
5808 i::Isolate* isolate = i::Isolate::Current(); 5808 i::Isolate* isolate = i::Isolate::Current();
5809 IsDeadCheck(isolate, "v8::HeapSnapshot::GetDominatorNode"); 5809 IsDeadCheck(isolate, "v8::HeapSnapshot::GetDominatorNode");
5810 return reinterpret_cast<const HeapGraphNode*>(ToInternal(this)->dominator()); 5810 return reinterpret_cast<const HeapGraphNode*>(ToInternal(this)->dominator());
5811 } 5811 }
5812 5812
5813 5813
5814 v8::Handle<v8::Value> HeapGraphNode::GetHeapValue() const {
5815 i::Isolate* isolate = i::Isolate::Current();
5816 IsDeadCheck(isolate, "v8::HeapGraphNode::GetHeapValue");
5817 i::Handle<i::HeapObject> object = ToInternal(this)->GetHeapObject();
5818 return v8::Handle<Value>(!object.is_null() ?
5819 ToApi<Value>(object) : ToApi<Value>(
5820 isolate->factory()->undefined_value()));
5821 }
5822
5823
5814 static i::HeapSnapshot* ToInternal(const HeapSnapshot* snapshot) { 5824 static i::HeapSnapshot* ToInternal(const HeapSnapshot* snapshot) {
5815 return const_cast<i::HeapSnapshot*>( 5825 return const_cast<i::HeapSnapshot*>(
5816 reinterpret_cast<const i::HeapSnapshot*>(snapshot)); 5826 reinterpret_cast<const i::HeapSnapshot*>(snapshot));
5817 } 5827 }
5818 5828
5819 5829
5820 void HeapSnapshot::Delete() { 5830 void HeapSnapshot::Delete() {
5821 i::Isolate* isolate = i::Isolate::Current(); 5831 i::Isolate* isolate = i::Isolate::Current();
5822 IsDeadCheck(isolate, "v8::HeapSnapshot::Delete"); 5832 IsDeadCheck(isolate, "v8::HeapSnapshot::Delete");
5823 if (i::HeapProfiler::GetSnapshotsCount() > 1) { 5833 if (i::HeapProfiler::GetSnapshotsCount() > 1) {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
6083 6093
6084 6094
6085 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 6095 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
6086 HandleScopeImplementer* scope_implementer = 6096 HandleScopeImplementer* scope_implementer =
6087 reinterpret_cast<HandleScopeImplementer*>(storage); 6097 reinterpret_cast<HandleScopeImplementer*>(storage);
6088 scope_implementer->IterateThis(v); 6098 scope_implementer->IterateThis(v);
6089 return storage + ArchiveSpacePerThread(); 6099 return storage + ArchiveSpacePerThread();
6090 } 6100 }
6091 6101
6092 } } // namespace v8::internal 6102 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-profiler.h ('k') | src/profile-generator.h » ('j') | src/profile-generator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698