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

Side by Side Diff: src/api.cc

Issue 13430003: Deprecate HeapSnapshot type (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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 | « include/v8-profiler.h ('k') | src/heap-profiler.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 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 6709 matching lines...) Expand 10 before | Expand all | Expand 10 after
6720 } else { 6720 } else {
6721 // If this is the last snapshot, clean up all accessory data as well. 6721 // If this is the last snapshot, clean up all accessory data as well.
6722 isolate->heap_profiler()->DeleteAllSnapshots(); 6722 isolate->heap_profiler()->DeleteAllSnapshots();
6723 } 6723 }
6724 } 6724 }
6725 6725
6726 6726
6727 HeapSnapshot::Type HeapSnapshot::GetType() const { 6727 HeapSnapshot::Type HeapSnapshot::GetType() const {
6728 i::Isolate* isolate = i::Isolate::Current(); 6728 i::Isolate* isolate = i::Isolate::Current();
6729 IsDeadCheck(isolate, "v8::HeapSnapshot::GetType"); 6729 IsDeadCheck(isolate, "v8::HeapSnapshot::GetType");
6730 return static_cast<HeapSnapshot::Type>(ToInternal(this)->type()); 6730 return kFull;
6731 } 6731 }
6732 6732
6733 6733
6734 unsigned HeapSnapshot::GetUid() const { 6734 unsigned HeapSnapshot::GetUid() const {
6735 i::Isolate* isolate = i::Isolate::Current(); 6735 i::Isolate* isolate = i::Isolate::Current();
6736 IsDeadCheck(isolate, "v8::HeapSnapshot::GetUid"); 6736 IsDeadCheck(isolate, "v8::HeapSnapshot::GetUid");
6737 return ToInternal(this)->uid(); 6737 return ToInternal(this)->uid();
6738 } 6738 }
6739 6739
6740 6740
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
6854 return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotObjectId(obj); 6854 return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotObjectId(obj);
6855 } 6855 }
6856 6856
6857 6857
6858 const HeapSnapshot* HeapProfiler::TakeSnapshot(Handle<String> title, 6858 const HeapSnapshot* HeapProfiler::TakeSnapshot(Handle<String> title,
6859 HeapSnapshot::Type type, 6859 HeapSnapshot::Type type,
6860 ActivityControl* control, 6860 ActivityControl* control,
6861 ObjectNameResolver* resolver) { 6861 ObjectNameResolver* resolver) {
6862 i::Isolate* isolate = i::Isolate::Current(); 6862 i::Isolate* isolate = i::Isolate::Current();
6863 IsDeadCheck(isolate, "v8::HeapProfiler::TakeSnapshot"); 6863 IsDeadCheck(isolate, "v8::HeapProfiler::TakeSnapshot");
6864 i::HeapSnapshot::Type internal_type = i::HeapSnapshot::kFull;
6865 switch (type) {
6866 case HeapSnapshot::kFull:
6867 internal_type = i::HeapSnapshot::kFull;
6868 break;
6869 default:
6870 UNREACHABLE();
6871 }
6872 return reinterpret_cast<const HeapSnapshot*>( 6864 return reinterpret_cast<const HeapSnapshot*>(
6873 isolate->heap_profiler()->TakeSnapshot( 6865 isolate->heap_profiler()->TakeSnapshot(
6874 *Utils::OpenHandle(*title), internal_type, control, resolver)); 6866 *Utils::OpenHandle(*title), control, resolver));
6875 } 6867 }
6876 6868
6877 6869
6878 const HeapSnapshot* HeapProfiler::TakeHeapSnapshot( 6870 const HeapSnapshot* HeapProfiler::TakeHeapSnapshot(
6879 Handle<String> title, 6871 Handle<String> title,
6880 ActivityControl* control, 6872 ActivityControl* control,
6881 ObjectNameResolver* resolver) { 6873 ObjectNameResolver* resolver) {
6882 return reinterpret_cast<const HeapSnapshot*>( 6874 return reinterpret_cast<const HeapSnapshot*>(
6883 reinterpret_cast<i::HeapProfiler*>(this)->TakeSnapshot( 6875 reinterpret_cast<i::HeapProfiler*>(this)->TakeSnapshot(
6884 *Utils::OpenHandle(*title), i::HeapSnapshot::kFull, 6876 *Utils::OpenHandle(*title), control, resolver));
6885 control, resolver));
6886 } 6877 }
6887 6878
6888 6879
6889 void HeapProfiler::StartHeapObjectsTracking() { 6880 void HeapProfiler::StartHeapObjectsTracking() {
6890 i::Isolate* isolate = i::Isolate::Current(); 6881 i::Isolate* isolate = i::Isolate::Current();
6891 IsDeadCheck(isolate, "v8::HeapProfiler::StartHeapObjectsTracking"); 6882 IsDeadCheck(isolate, "v8::HeapProfiler::StartHeapObjectsTracking");
6892 isolate->heap_profiler()->StartHeapObjectsTracking(); 6883 isolate->heap_profiler()->StartHeapObjectsTracking();
6893 } 6884 }
6894 6885
6895 6886
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
7172 7163
7173 v->VisitPointers(blocks_.first(), first_block_limit_); 7164 v->VisitPointers(blocks_.first(), first_block_limit_);
7174 7165
7175 for (int i = 1; i < blocks_.length(); i++) { 7166 for (int i = 1; i < blocks_.length(); i++) {
7176 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); 7167 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]);
7177 } 7168 }
7178 } 7169 }
7179 7170
7180 7171
7181 } } // namespace v8::internal 7172 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-profiler.h ('k') | src/heap-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698