From 6f09cb471b194dbdedfbe96b4f3e3eb94e98331d Mon Sep 17 00:00:00 2001 From: "yurys@chromium.org" Date: Fri, 21 Jun 2013 07:56:22 +0000 Subject: [PATCH] Delete deprecated methods from v8-profiler.h All these methods were already marked as V8_DEPRECATED in V8 Version 3.18.0 (see https://code.google.com/p/v8/source/browse/trunk/include/v8-profiler.h?r=14304) so it is time to delete them. BUG=None R=loislo@chromium.org, svenpanne@chromium.org Review URL: https://codereview.chromium.org/17524007 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15260 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- include/v8-profiler.h | 63 +------------------ src/api.cc | 162 ------------------------------------------------ src/global-handles.h | 2 +- test/cctest/test-api.cc | 18 +++--- 4 files changed, 11 insertions(+), 234 deletions(-) diff --git a/include/v8-profiler.h b/include/v8-profiler.h index d740df3..5338fcd 100644 --- a/include/v8-profiler.h +++ b/include/v8-profiler.h @@ -172,18 +172,12 @@ class V8EXPORT CpuProfiler { * obtaining profiling results. */ - /** Deprecated. Use GetProfileCount instead. */ - V8_DEPRECATED(static int GetProfilesCount()); /** * Returns the number of profiles collected (doesn't include * profiles that are being collected at the moment of call.) */ int GetProfileCount(); - /** Deprecated. Use GetCpuProfile instead. */ - V8_DEPRECATED(static const CpuProfile* GetProfile( - int index, - Handle security_token = Handle())); /** Deprecated. Use GetCpuProfile with single parameter. */ V8_DEPRECATED(const CpuProfile* GetCpuProfile( int index, @@ -191,18 +185,11 @@ class V8EXPORT CpuProfiler { /** Returns a profile by index. */ const CpuProfile* GetCpuProfile(int index); - /** Deprecated. Use FindProfile instead. */ - V8_DEPRECATED(static const CpuProfile* FindProfile( - unsigned uid, - Handle security_token = Handle())); /** Returns a profile by uid. */ V8_DEPRECATED(const CpuProfile* FindCpuProfile( unsigned uid, Handle security_token = Handle())); - /** Deprecated. Use StartCpuProfiling instead. */ - V8_DEPRECATED(static void StartProfiling(Handle title, - bool record_samples = false)); /** * Starts collecting CPU profile. Title may be an empty string. It * is allowed to have several profiles being collected at @@ -216,10 +203,6 @@ class V8EXPORT CpuProfiler { */ void StartCpuProfiling(Handle title, bool record_samples = false); - /** Deprecated. Use StopCpuProfiling instead. */ - V8_DEPRECATED(static const CpuProfile* StopProfiling( - Handle title, - Handle security_token = Handle())); /** * Deprecated. Use StopCpuProfiling with one parameter instead. */ @@ -232,8 +215,6 @@ class V8EXPORT CpuProfiler { */ const CpuProfile* StopCpuProfiling(Handle title); - /** Deprecated. Use DeleteAllCpuProfiles instead. */ - V8_DEPRECATED(static void DeleteAllProfiles()); /** * Deletes all existing profiles, also cancelling all profiling * activity. All previously returned pointers to profiles and their @@ -346,16 +327,10 @@ class V8EXPORT HeapGraphNode { */ class V8EXPORT HeapSnapshot { public: - enum Type { - kFull = 0 // Heap snapshot with all instances and references. - }; enum SerializationFormat { kJSON = 0 // See format description near 'Serialize' method. }; - /** Deprecated. Returns kFull. */ - V8_DEPRECATED(Type GetType() const); - /** Returns heap snapshot UID (assigned by the profiler.) */ unsigned GetUid() const; @@ -431,24 +406,15 @@ class V8EXPORT HeapProfiler { typedef RetainedObjectInfo* (*WrapperInfoCallback) (uint16_t class_id, Handle wrapper); - /** Deprecated. Use GetSnapshotCount instead. */ - V8_DEPRECATED(static int GetSnapshotsCount()); /** Returns the number of snapshots taken. */ int GetSnapshotCount(); - /** Deprecated. Use GetHeapSnapshot instead. */ - V8_DEPRECATED(static const HeapSnapshot* GetSnapshot(int index)); /** Returns a snapshot by index. */ const HeapSnapshot* GetHeapSnapshot(int index); - /** Deprecated. Use FindHeapSnapshot instead. */ - V8_DEPRECATED(static const HeapSnapshot* FindSnapshot(unsigned uid)); /** Returns a profile by uid. */ V8_DEPRECATED(const HeapSnapshot* FindHeapSnapshot(unsigned uid)); - /** Deprecated. Use GetObjectId instead. */ - V8_DEPRECATED(static SnapshotObjectId GetSnapshotObjectId( - Handle value)); /** * Returns SnapshotObjectId for a heap object referenced by |value| if * it has been seen by the heap profiler, kUnknownObjectId otherwise. @@ -476,12 +442,6 @@ class V8EXPORT HeapProfiler { virtual ~ObjectNameResolver() {} }; - /** Deprecated. Use TakeHeapSnapshot instead. */ - V8_DEPRECATED(static const HeapSnapshot* TakeSnapshot( - Handle title, - HeapSnapshot::Type type = HeapSnapshot::kFull, - ActivityControl* control = NULL, - ObjectNameResolver* global_object_name_resolver = NULL)); /** * Takes a heap snapshot and returns it. Title may be an empty string. */ @@ -490,9 +450,6 @@ class V8EXPORT HeapProfiler { ActivityControl* control = NULL, ObjectNameResolver* global_object_name_resolver = NULL); - - /** Deprecated. Use StartTrackingHeapObjects instead. */ - V8_DEPRECATED(static void StartHeapObjectsTracking()); /** * Starts tracking of heap objects population statistics. After calling * this method, all heap objects relocations done by the garbage collector @@ -500,9 +457,6 @@ class V8EXPORT HeapProfiler { */ void StartTrackingHeapObjects(); - /** Deprecated. Use GetHeapStats instead. */ - V8_DEPRECATED(static SnapshotObjectId PushHeapObjectsStats( - OutputStream* stream)); /** * Adds a new time interval entry to the aggregated statistics array. The * time interval entry contains information on the current heap objects @@ -517,8 +471,6 @@ class V8EXPORT HeapProfiler { */ SnapshotObjectId GetHeapStats(OutputStream* stream); - /** Deprecated. Use StopTrackingHeapObjects instead. */ - V8_DEPRECATED(static void StopHeapObjectsTracking()); /** * Stops tracking of heap objects population statistics, cleans up all * collected data. StartHeapObjectsTracking must be called again prior to @@ -526,18 +478,12 @@ class V8EXPORT HeapProfiler { */ void StopTrackingHeapObjects(); - /** Deprecated. Use DeleteAllHeapSnapshots instead. */ - V8_DEPRECATED(static void DeleteAllSnapshots()); /** * Deletes all snapshots taken. All previously returned pointers to * snapshots and their contents become invalid after this call. */ void DeleteAllHeapSnapshots(); - /** Deprecated. Use SetWrapperClassInfoProvider instead. */ - V8_DEPRECATED(static void DefineWrapperClass( - uint16_t class_id, - WrapperInfoCallback callback)); /** Binds a callback to embedder's class ID. */ void SetWrapperClassInfoProvider( uint16_t class_id, @@ -550,13 +496,6 @@ class V8EXPORT HeapProfiler { */ static const uint16_t kPersistentHandleNoClassId = 0; - /** - * Deprecated. Returns the number of currently existing persistent handles. - */ - V8_DEPRECATED(static int GetPersistentHandleCount()); - - /** Deprecated. Use GetHeapProfilerMemorySize instead. */ - V8_DEPRECATED(static size_t GetMemorySizeUsedByProfiler()); /** Returns memory used for profiler internal data and snapshots. */ size_t GetProfilerMemorySize(); @@ -590,7 +529,7 @@ class V8EXPORT HeapProfiler { * objects for heap snapshots, he can do it in a GC prologue * handler, and / or by assigning wrapper class ids in the following way: * - * 1. Bind a callback to class id by calling DefineWrapperClass. + * 1. Bind a callback to class id by calling SetWrapperClassInfoProvider. * 2. Call SetWrapperClassId on certain persistent handles. * * V8 takes ownership of RetainedObjectInfo instances passed to it and diff --git a/src/api.cc b/src/api.cc index 579af7a..ee9e03f 100644 --- a/src/api.cc +++ b/src/api.cc @@ -7325,33 +7325,11 @@ int CpuProfile::GetSamplesCount() const { } -int CpuProfiler::GetProfilesCount() { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::CpuProfiler::GetProfilesCount"); - i::CpuProfiler* profiler = isolate->cpu_profiler(); - ASSERT(profiler != NULL); - return profiler->GetProfilesCount(); -} - - int CpuProfiler::GetProfileCount() { return reinterpret_cast(this)->GetProfilesCount(); } -const CpuProfile* CpuProfiler::GetProfile(int index, - Handle security_token) { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::CpuProfiler::GetProfile"); - i::CpuProfiler* profiler = isolate->cpu_profiler(); - ASSERT(profiler != NULL); - return reinterpret_cast( - profiler->GetProfile( - security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token), - index)); -} - - const CpuProfile* CpuProfiler::GetCpuProfile(int index, Handle security_token) { return reinterpret_cast( @@ -7367,19 +7345,6 @@ const CpuProfile* CpuProfiler::GetCpuProfile(int index) { } -const CpuProfile* CpuProfiler::FindProfile(unsigned uid, - Handle security_token) { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::CpuProfiler::FindProfile"); - i::CpuProfiler* profiler = isolate->cpu_profiler(); - ASSERT(profiler != NULL); - return reinterpret_cast( - profiler->FindProfile( - security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token), - uid)); -} - - const CpuProfile* CpuProfiler::FindCpuProfile(unsigned uid, Handle security_token) { return reinterpret_cast( @@ -7389,34 +7354,12 @@ const CpuProfile* CpuProfiler::FindCpuProfile(unsigned uid, } -void CpuProfiler::StartProfiling(Handle title, bool record_samples) { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::CpuProfiler::StartProfiling"); - i::CpuProfiler* profiler = isolate->cpu_profiler(); - ASSERT(profiler != NULL); - profiler->StartProfiling(*Utils::OpenHandle(*title), record_samples); -} - - void CpuProfiler::StartCpuProfiling(Handle title, bool record_samples) { reinterpret_cast(this)->StartProfiling( *Utils::OpenHandle(*title), record_samples); } -const CpuProfile* CpuProfiler::StopProfiling(Handle title, - Handle security_token) { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::CpuProfiler::StopProfiling"); - i::CpuProfiler* profiler = isolate->cpu_profiler(); - ASSERT(profiler != NULL); - return reinterpret_cast( - profiler->StopProfiling( - security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token), - *Utils::OpenHandle(*title))); -} - - const CpuProfile* CpuProfiler::StopCpuProfiling(Handle title, Handle security_token) { return reinterpret_cast( @@ -7434,15 +7377,6 @@ const CpuProfile* CpuProfiler::StopCpuProfiling(Handle title) { } -void CpuProfiler::DeleteAllProfiles() { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::CpuProfiler::DeleteAllProfiles"); - i::CpuProfiler* profiler = isolate->cpu_profiler(); - ASSERT(profiler != NULL); - profiler->DeleteAllProfiles(); -} - - void CpuProfiler::DeleteAllCpuProfiles() { reinterpret_cast(this)->DeleteAllProfiles(); } @@ -7576,13 +7510,6 @@ void HeapSnapshot::Delete() { } -HeapSnapshot::Type HeapSnapshot::GetType() const { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::HeapSnapshot::GetType"); - return kFull; -} - - unsigned HeapSnapshot::GetUid() const { i::Isolate* isolate = i::Isolate::Current(); IsDeadCheck(isolate, "v8::HeapSnapshot::GetUid"); @@ -7653,72 +7580,29 @@ void HeapSnapshot::Serialize(OutputStream* stream, } -int HeapProfiler::GetSnapshotsCount() { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::HeapProfiler::GetSnapshotsCount"); - return isolate->heap_profiler()->GetSnapshotsCount(); -} - - int HeapProfiler::GetSnapshotCount() { return reinterpret_cast(this)->GetSnapshotsCount(); } -const HeapSnapshot* HeapProfiler::GetSnapshot(int index) { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::HeapProfiler::GetSnapshot"); - return reinterpret_cast( - isolate->heap_profiler()->GetSnapshot(index)); -} - - const HeapSnapshot* HeapProfiler::GetHeapSnapshot(int index) { return reinterpret_cast( reinterpret_cast(this)->GetSnapshot(index)); } -const HeapSnapshot* HeapProfiler::FindSnapshot(unsigned uid) { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::HeapProfiler::FindSnapshot"); - return reinterpret_cast( - isolate->heap_profiler()->FindSnapshot(uid)); -} - - const HeapSnapshot* HeapProfiler::FindHeapSnapshot(unsigned uid) { return reinterpret_cast( reinterpret_cast(this)->FindSnapshot(uid)); } -SnapshotObjectId HeapProfiler::GetSnapshotObjectId(Handle value) { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::HeapProfiler::GetSnapshotObjectId"); - i::Handle obj = Utils::OpenHandle(*value); - return isolate->heap_profiler()->GetSnapshotObjectId(obj); -} - - SnapshotObjectId HeapProfiler::GetObjectId(Handle value) { i::Handle obj = Utils::OpenHandle(*value); return reinterpret_cast(this)->GetSnapshotObjectId(obj); } -const HeapSnapshot* HeapProfiler::TakeSnapshot(Handle title, - HeapSnapshot::Type type, - ActivityControl* control, - ObjectNameResolver* resolver) { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::HeapProfiler::TakeSnapshot"); - return reinterpret_cast( - isolate->heap_profiler()->TakeSnapshot( - *Utils::OpenHandle(*title), control, resolver)); -} - - const HeapSnapshot* HeapProfiler::TakeHeapSnapshot( Handle title, ActivityControl* control, @@ -7729,61 +7613,26 @@ const HeapSnapshot* HeapProfiler::TakeHeapSnapshot( } -void HeapProfiler::StartHeapObjectsTracking() { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::HeapProfiler::StartHeapObjectsTracking"); - isolate->heap_profiler()->StartHeapObjectsTracking(); -} - - void HeapProfiler::StartTrackingHeapObjects() { reinterpret_cast(this)->StartHeapObjectsTracking(); } -void HeapProfiler::StopHeapObjectsTracking() { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::HeapProfiler::StopHeapObjectsTracking"); - isolate->heap_profiler()->StopHeapObjectsTracking(); -} - - void HeapProfiler::StopTrackingHeapObjects() { reinterpret_cast(this)->StopHeapObjectsTracking(); } -SnapshotObjectId HeapProfiler::PushHeapObjectsStats(OutputStream* stream) { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::HeapProfiler::PushHeapObjectsStats"); - return isolate->heap_profiler()->PushHeapObjectsStats(stream); -} - - SnapshotObjectId HeapProfiler::GetHeapStats(OutputStream* stream) { return reinterpret_cast(this)->PushHeapObjectsStats(stream); } -void HeapProfiler::DeleteAllSnapshots() { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::HeapProfiler::DeleteAllSnapshots"); - isolate->heap_profiler()->DeleteAllSnapshots(); -} - - void HeapProfiler::DeleteAllHeapSnapshots() { reinterpret_cast(this)->DeleteAllSnapshots(); } -void HeapProfiler::DefineWrapperClass(uint16_t class_id, - WrapperInfoCallback callback) { - i::Isolate::Current()->heap_profiler()->DefineWrapperClass(class_id, - callback); -} - - void HeapProfiler::SetWrapperClassInfoProvider(uint16_t class_id, WrapperInfoCallback callback) { reinterpret_cast(this)->DefineWrapperClass(class_id, @@ -7791,17 +7640,6 @@ void HeapProfiler::SetWrapperClassInfoProvider(uint16_t class_id, } -int HeapProfiler::GetPersistentHandleCount() { - i::Isolate* isolate = i::Isolate::Current(); - return isolate->global_handles()->NumberOfGlobalHandles(); -} - - -size_t HeapProfiler::GetMemorySizeUsedByProfiler() { - return i::Isolate::Current()->heap_profiler()->GetMemorySizeUsedByProfiler(); -} - - size_t HeapProfiler::GetProfilerMemorySize() { return reinterpret_cast(this)-> GetMemorySizeUsedByProfiler(); diff --git a/src/global-handles.h b/src/global-handles.h index ac26e00..cd75133 100644 --- a/src/global-handles.h +++ b/src/global-handles.h @@ -152,7 +152,7 @@ class GlobalHandles { int NumberOfGlobalObjectWeakHandles(); // Returns the current number of handles to global objects. - int NumberOfGlobalHandles() { + int global_handles_count() const { return number_of_global_handles_; } diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc index beb8f7b..a07d528 100755 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc @@ -2956,7 +2956,7 @@ THREADED_TEST(ResettingGlobalHandle) { } v8::internal::GlobalHandles* global_handles = reinterpret_cast(isolate)->global_handles(); - int initial_handle_count = global_handles->NumberOfGlobalHandles(); + int initial_handle_count = global_handles->global_handles_count(); { v8::HandleScope scope(isolate); CHECK_EQ(v8::Local::New(isolate, global)->Length(), 3); @@ -2965,13 +2965,13 @@ THREADED_TEST(ResettingGlobalHandle) { v8::HandleScope scope(isolate); global.Reset(isolate, v8_str("longer")); } - CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count); + CHECK_EQ(global_handles->global_handles_count(), initial_handle_count); { v8::HandleScope scope(isolate); CHECK_EQ(v8::Local::New(isolate, global)->Length(), 6); } global.Dispose(isolate); - CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count - 1); + CHECK_EQ(global_handles->global_handles_count(), initial_handle_count - 1); } @@ -2984,7 +2984,7 @@ THREADED_TEST(ResettingGlobalHandleToEmpty) { } v8::internal::GlobalHandles* global_handles = reinterpret_cast(isolate)->global_handles(); - int initial_handle_count = global_handles->NumberOfGlobalHandles(); + int initial_handle_count = global_handles->global_handles_count(); { v8::HandleScope scope(isolate); CHECK_EQ(v8::Local::New(isolate, global)->Length(), 3); @@ -2995,7 +2995,7 @@ THREADED_TEST(ResettingGlobalHandleToEmpty) { global.Reset(isolate, empty); } CHECK(global.IsEmpty()); - CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count - 1); + CHECK_EQ(global_handles->global_handles_count(), initial_handle_count - 1); } @@ -3009,15 +3009,15 @@ THREADED_TEST(ClearAndLeakGlobal) { Local str = v8_str("str"); global_handles = reinterpret_cast(isolate)->global_handles(); - initial_handle_count = global_handles->NumberOfGlobalHandles(); + initial_handle_count = global_handles->global_handles_count(); global.Reset(isolate, str); } - CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count + 1); + CHECK_EQ(global_handles->global_handles_count(), initial_handle_count + 1); String* str = global.ClearAndLeak(); CHECK(global.IsEmpty()); - CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count + 1); + CHECK_EQ(global_handles->global_handles_count(), initial_handle_count + 1); global_handles->Destroy(reinterpret_cast(str)); - CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count); + CHECK_EQ(global_handles->global_handles_count(), initial_handle_count); } -- 2.7.4