Commit 6f09cb47 authored by yurys@chromium.org's avatar yurys@chromium.org

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
parent 0bc8ef88
...@@ -172,18 +172,12 @@ class V8EXPORT CpuProfiler { ...@@ -172,18 +172,12 @@ class V8EXPORT CpuProfiler {
* obtaining profiling results. * obtaining profiling results.
*/ */
/** Deprecated. Use GetProfileCount instead. */
V8_DEPRECATED(static int GetProfilesCount());
/** /**
* Returns the number of profiles collected (doesn't include * Returns the number of profiles collected (doesn't include
* profiles that are being collected at the moment of call.) * profiles that are being collected at the moment of call.)
*/ */
int GetProfileCount(); int GetProfileCount();
/** Deprecated. Use GetCpuProfile instead. */
V8_DEPRECATED(static const CpuProfile* GetProfile(
int index,
Handle<Value> security_token = Handle<Value>()));
/** Deprecated. Use GetCpuProfile with single parameter. */ /** Deprecated. Use GetCpuProfile with single parameter. */
V8_DEPRECATED(const CpuProfile* GetCpuProfile( V8_DEPRECATED(const CpuProfile* GetCpuProfile(
int index, int index,
...@@ -191,18 +185,11 @@ class V8EXPORT CpuProfiler { ...@@ -191,18 +185,11 @@ class V8EXPORT CpuProfiler {
/** Returns a profile by index. */ /** Returns a profile by index. */
const CpuProfile* GetCpuProfile(int index); const CpuProfile* GetCpuProfile(int index);
/** Deprecated. Use FindProfile instead. */
V8_DEPRECATED(static const CpuProfile* FindProfile(
unsigned uid,
Handle<Value> security_token = Handle<Value>()));
/** Returns a profile by uid. */ /** Returns a profile by uid. */
V8_DEPRECATED(const CpuProfile* FindCpuProfile( V8_DEPRECATED(const CpuProfile* FindCpuProfile(
unsigned uid, unsigned uid,
Handle<Value> security_token = Handle<Value>())); Handle<Value> security_token = Handle<Value>()));
/** Deprecated. Use StartCpuProfiling instead. */
V8_DEPRECATED(static void StartProfiling(Handle<String> title,
bool record_samples = false));
/** /**
* Starts collecting CPU profile. Title may be an empty string. It * Starts collecting CPU profile. Title may be an empty string. It
* is allowed to have several profiles being collected at * is allowed to have several profiles being collected at
...@@ -216,10 +203,6 @@ class V8EXPORT CpuProfiler { ...@@ -216,10 +203,6 @@ class V8EXPORT CpuProfiler {
*/ */
void StartCpuProfiling(Handle<String> title, bool record_samples = false); void StartCpuProfiling(Handle<String> title, bool record_samples = false);
/** Deprecated. Use StopCpuProfiling instead. */
V8_DEPRECATED(static const CpuProfile* StopProfiling(
Handle<String> title,
Handle<Value> security_token = Handle<Value>()));
/** /**
* Deprecated. Use StopCpuProfiling with one parameter instead. * Deprecated. Use StopCpuProfiling with one parameter instead.
*/ */
...@@ -232,8 +215,6 @@ class V8EXPORT CpuProfiler { ...@@ -232,8 +215,6 @@ class V8EXPORT CpuProfiler {
*/ */
const CpuProfile* StopCpuProfiling(Handle<String> title); const CpuProfile* StopCpuProfiling(Handle<String> title);
/** Deprecated. Use DeleteAllCpuProfiles instead. */
V8_DEPRECATED(static void DeleteAllProfiles());
/** /**
* Deletes all existing profiles, also cancelling all profiling * Deletes all existing profiles, also cancelling all profiling
* activity. All previously returned pointers to profiles and their * activity. All previously returned pointers to profiles and their
...@@ -346,16 +327,10 @@ class V8EXPORT HeapGraphNode { ...@@ -346,16 +327,10 @@ class V8EXPORT HeapGraphNode {
*/ */
class V8EXPORT HeapSnapshot { class V8EXPORT HeapSnapshot {
public: public:
enum Type {
kFull = 0 // Heap snapshot with all instances and references.
};
enum SerializationFormat { enum SerializationFormat {
kJSON = 0 // See format description near 'Serialize' method. kJSON = 0 // See format description near 'Serialize' method.
}; };
/** Deprecated. Returns kFull. */
V8_DEPRECATED(Type GetType() const);
/** Returns heap snapshot UID (assigned by the profiler.) */ /** Returns heap snapshot UID (assigned by the profiler.) */
unsigned GetUid() const; unsigned GetUid() const;
...@@ -431,24 +406,15 @@ class V8EXPORT HeapProfiler { ...@@ -431,24 +406,15 @@ class V8EXPORT HeapProfiler {
typedef RetainedObjectInfo* (*WrapperInfoCallback) typedef RetainedObjectInfo* (*WrapperInfoCallback)
(uint16_t class_id, Handle<Value> wrapper); (uint16_t class_id, Handle<Value> wrapper);
/** Deprecated. Use GetSnapshotCount instead. */
V8_DEPRECATED(static int GetSnapshotsCount());
/** Returns the number of snapshots taken. */ /** Returns the number of snapshots taken. */
int GetSnapshotCount(); int GetSnapshotCount();
/** Deprecated. Use GetHeapSnapshot instead. */
V8_DEPRECATED(static const HeapSnapshot* GetSnapshot(int index));
/** Returns a snapshot by index. */ /** Returns a snapshot by index. */
const HeapSnapshot* GetHeapSnapshot(int index); const HeapSnapshot* GetHeapSnapshot(int index);
/** Deprecated. Use FindHeapSnapshot instead. */
V8_DEPRECATED(static const HeapSnapshot* FindSnapshot(unsigned uid));
/** Returns a profile by uid. */ /** Returns a profile by uid. */
V8_DEPRECATED(const HeapSnapshot* FindHeapSnapshot(unsigned uid)); V8_DEPRECATED(const HeapSnapshot* FindHeapSnapshot(unsigned uid));
/** Deprecated. Use GetObjectId instead. */
V8_DEPRECATED(static SnapshotObjectId GetSnapshotObjectId(
Handle<Value> value));
/** /**
* Returns SnapshotObjectId for a heap object referenced by |value| if * Returns SnapshotObjectId for a heap object referenced by |value| if
* it has been seen by the heap profiler, kUnknownObjectId otherwise. * it has been seen by the heap profiler, kUnknownObjectId otherwise.
...@@ -476,12 +442,6 @@ class V8EXPORT HeapProfiler { ...@@ -476,12 +442,6 @@ class V8EXPORT HeapProfiler {
virtual ~ObjectNameResolver() {} virtual ~ObjectNameResolver() {}
}; };
/** Deprecated. Use TakeHeapSnapshot instead. */
V8_DEPRECATED(static const HeapSnapshot* TakeSnapshot(
Handle<String> 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. * Takes a heap snapshot and returns it. Title may be an empty string.
*/ */
...@@ -490,9 +450,6 @@ class V8EXPORT HeapProfiler { ...@@ -490,9 +450,6 @@ class V8EXPORT HeapProfiler {
ActivityControl* control = NULL, ActivityControl* control = NULL,
ObjectNameResolver* global_object_name_resolver = 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 * Starts tracking of heap objects population statistics. After calling
* this method, all heap objects relocations done by the garbage collector * this method, all heap objects relocations done by the garbage collector
...@@ -500,9 +457,6 @@ class V8EXPORT HeapProfiler { ...@@ -500,9 +457,6 @@ class V8EXPORT HeapProfiler {
*/ */
void StartTrackingHeapObjects(); 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 * Adds a new time interval entry to the aggregated statistics array. The
* time interval entry contains information on the current heap objects * time interval entry contains information on the current heap objects
...@@ -517,8 +471,6 @@ class V8EXPORT HeapProfiler { ...@@ -517,8 +471,6 @@ class V8EXPORT HeapProfiler {
*/ */
SnapshotObjectId GetHeapStats(OutputStream* stream); SnapshotObjectId GetHeapStats(OutputStream* stream);
/** Deprecated. Use StopTrackingHeapObjects instead. */
V8_DEPRECATED(static void StopHeapObjectsTracking());
/** /**
* Stops tracking of heap objects population statistics, cleans up all * Stops tracking of heap objects population statistics, cleans up all
* collected data. StartHeapObjectsTracking must be called again prior to * collected data. StartHeapObjectsTracking must be called again prior to
...@@ -526,18 +478,12 @@ class V8EXPORT HeapProfiler { ...@@ -526,18 +478,12 @@ class V8EXPORT HeapProfiler {
*/ */
void StopTrackingHeapObjects(); void StopTrackingHeapObjects();
/** Deprecated. Use DeleteAllHeapSnapshots instead. */
V8_DEPRECATED(static void DeleteAllSnapshots());
/** /**
* Deletes all snapshots taken. All previously returned pointers to * Deletes all snapshots taken. All previously returned pointers to
* snapshots and their contents become invalid after this call. * snapshots and their contents become invalid after this call.
*/ */
void DeleteAllHeapSnapshots(); 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. */ /** Binds a callback to embedder's class ID. */
void SetWrapperClassInfoProvider( void SetWrapperClassInfoProvider(
uint16_t class_id, uint16_t class_id,
...@@ -550,13 +496,6 @@ class V8EXPORT HeapProfiler { ...@@ -550,13 +496,6 @@ class V8EXPORT HeapProfiler {
*/ */
static const uint16_t kPersistentHandleNoClassId = 0; 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. */ /** Returns memory used for profiler internal data and snapshots. */
size_t GetProfilerMemorySize(); size_t GetProfilerMemorySize();
...@@ -590,7 +529,7 @@ class V8EXPORT HeapProfiler { ...@@ -590,7 +529,7 @@ class V8EXPORT HeapProfiler {
* objects for heap snapshots, he can do it in a GC prologue * objects for heap snapshots, he can do it in a GC prologue
* handler, and / or by assigning wrapper class ids in the following way: * 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. * 2. Call SetWrapperClassId on certain persistent handles.
* *
* V8 takes ownership of RetainedObjectInfo instances passed to it and * V8 takes ownership of RetainedObjectInfo instances passed to it and
......
...@@ -7325,33 +7325,11 @@ int CpuProfile::GetSamplesCount() const { ...@@ -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() { int CpuProfiler::GetProfileCount() {
return reinterpret_cast<i::CpuProfiler*>(this)->GetProfilesCount(); return reinterpret_cast<i::CpuProfiler*>(this)->GetProfilesCount();
} }
const CpuProfile* CpuProfiler::GetProfile(int index,
Handle<Value> 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<const CpuProfile*>(
profiler->GetProfile(
security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
index));
}
const CpuProfile* CpuProfiler::GetCpuProfile(int index, const CpuProfile* CpuProfiler::GetCpuProfile(int index,
Handle<Value> security_token) { Handle<Value> security_token) {
return reinterpret_cast<const CpuProfile*>( return reinterpret_cast<const CpuProfile*>(
...@@ -7367,19 +7345,6 @@ const CpuProfile* CpuProfiler::GetCpuProfile(int index) { ...@@ -7367,19 +7345,6 @@ const CpuProfile* CpuProfiler::GetCpuProfile(int index) {
} }
const CpuProfile* CpuProfiler::FindProfile(unsigned uid,
Handle<Value> 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<const CpuProfile*>(
profiler->FindProfile(
security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
uid));
}
const CpuProfile* CpuProfiler::FindCpuProfile(unsigned uid, const CpuProfile* CpuProfiler::FindCpuProfile(unsigned uid,
Handle<Value> security_token) { Handle<Value> security_token) {
return reinterpret_cast<const CpuProfile*>( return reinterpret_cast<const CpuProfile*>(
...@@ -7389,34 +7354,12 @@ const CpuProfile* CpuProfiler::FindCpuProfile(unsigned uid, ...@@ -7389,34 +7354,12 @@ const CpuProfile* CpuProfiler::FindCpuProfile(unsigned uid,
} }
void CpuProfiler::StartProfiling(Handle<String> 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<String> title, bool record_samples) { void CpuProfiler::StartCpuProfiling(Handle<String> title, bool record_samples) {
reinterpret_cast<i::CpuProfiler*>(this)->StartProfiling( reinterpret_cast<i::CpuProfiler*>(this)->StartProfiling(
*Utils::OpenHandle(*title), record_samples); *Utils::OpenHandle(*title), record_samples);
} }
const CpuProfile* CpuProfiler::StopProfiling(Handle<String> title,
Handle<Value> 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<const CpuProfile*>(
profiler->StopProfiling(
security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
*Utils::OpenHandle(*title)));
}
const CpuProfile* CpuProfiler::StopCpuProfiling(Handle<String> title, const CpuProfile* CpuProfiler::StopCpuProfiling(Handle<String> title,
Handle<Value> security_token) { Handle<Value> security_token) {
return reinterpret_cast<const CpuProfile*>( return reinterpret_cast<const CpuProfile*>(
...@@ -7434,15 +7377,6 @@ const CpuProfile* CpuProfiler::StopCpuProfiling(Handle<String> title) { ...@@ -7434,15 +7377,6 @@ const CpuProfile* CpuProfiler::StopCpuProfiling(Handle<String> 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() { void CpuProfiler::DeleteAllCpuProfiles() {
reinterpret_cast<i::CpuProfiler*>(this)->DeleteAllProfiles(); reinterpret_cast<i::CpuProfiler*>(this)->DeleteAllProfiles();
} }
...@@ -7576,13 +7510,6 @@ void HeapSnapshot::Delete() { ...@@ -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 { unsigned HeapSnapshot::GetUid() const {
i::Isolate* isolate = i::Isolate::Current(); i::Isolate* isolate = i::Isolate::Current();
IsDeadCheck(isolate, "v8::HeapSnapshot::GetUid"); IsDeadCheck(isolate, "v8::HeapSnapshot::GetUid");
...@@ -7653,72 +7580,29 @@ void HeapSnapshot::Serialize(OutputStream* stream, ...@@ -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() { int HeapProfiler::GetSnapshotCount() {
return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotsCount(); return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotsCount();
} }
const HeapSnapshot* HeapProfiler::GetSnapshot(int index) {
i::Isolate* isolate = i::Isolate::Current();
IsDeadCheck(isolate, "v8::HeapProfiler::GetSnapshot");
return reinterpret_cast<const HeapSnapshot*>(
isolate->heap_profiler()->GetSnapshot(index));
}
const HeapSnapshot* HeapProfiler::GetHeapSnapshot(int index) { const HeapSnapshot* HeapProfiler::GetHeapSnapshot(int index) {
return reinterpret_cast<const HeapSnapshot*>( return reinterpret_cast<const HeapSnapshot*>(
reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshot(index)); reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshot(index));
} }
const HeapSnapshot* HeapProfiler::FindSnapshot(unsigned uid) {
i::Isolate* isolate = i::Isolate::Current();
IsDeadCheck(isolate, "v8::HeapProfiler::FindSnapshot");
return reinterpret_cast<const HeapSnapshot*>(
isolate->heap_profiler()->FindSnapshot(uid));
}
const HeapSnapshot* HeapProfiler::FindHeapSnapshot(unsigned uid) { const HeapSnapshot* HeapProfiler::FindHeapSnapshot(unsigned uid) {
return reinterpret_cast<const HeapSnapshot*>( return reinterpret_cast<const HeapSnapshot*>(
reinterpret_cast<i::HeapProfiler*>(this)->FindSnapshot(uid)); reinterpret_cast<i::HeapProfiler*>(this)->FindSnapshot(uid));
} }
SnapshotObjectId HeapProfiler::GetSnapshotObjectId(Handle<Value> value) {
i::Isolate* isolate = i::Isolate::Current();
IsDeadCheck(isolate, "v8::HeapProfiler::GetSnapshotObjectId");
i::Handle<i::Object> obj = Utils::OpenHandle(*value);
return isolate->heap_profiler()->GetSnapshotObjectId(obj);
}
SnapshotObjectId HeapProfiler::GetObjectId(Handle<Value> value) { SnapshotObjectId HeapProfiler::GetObjectId(Handle<Value> value) {
i::Handle<i::Object> obj = Utils::OpenHandle(*value); i::Handle<i::Object> obj = Utils::OpenHandle(*value);
return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotObjectId(obj); return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotObjectId(obj);
} }
const HeapSnapshot* HeapProfiler::TakeSnapshot(Handle<String> title,
HeapSnapshot::Type type,
ActivityControl* control,
ObjectNameResolver* resolver) {
i::Isolate* isolate = i::Isolate::Current();
IsDeadCheck(isolate, "v8::HeapProfiler::TakeSnapshot");
return reinterpret_cast<const HeapSnapshot*>(
isolate->heap_profiler()->TakeSnapshot(
*Utils::OpenHandle(*title), control, resolver));
}
const HeapSnapshot* HeapProfiler::TakeHeapSnapshot( const HeapSnapshot* HeapProfiler::TakeHeapSnapshot(
Handle<String> title, Handle<String> title,
ActivityControl* control, ActivityControl* control,
...@@ -7729,61 +7613,26 @@ const HeapSnapshot* HeapProfiler::TakeHeapSnapshot( ...@@ -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() { void HeapProfiler::StartTrackingHeapObjects() {
reinterpret_cast<i::HeapProfiler*>(this)->StartHeapObjectsTracking(); reinterpret_cast<i::HeapProfiler*>(this)->StartHeapObjectsTracking();
} }
void HeapProfiler::StopHeapObjectsTracking() {
i::Isolate* isolate = i::Isolate::Current();
IsDeadCheck(isolate, "v8::HeapProfiler::StopHeapObjectsTracking");
isolate->heap_profiler()->StopHeapObjectsTracking();
}
void HeapProfiler::StopTrackingHeapObjects() { void HeapProfiler::StopTrackingHeapObjects() {
reinterpret_cast<i::HeapProfiler*>(this)->StopHeapObjectsTracking(); reinterpret_cast<i::HeapProfiler*>(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) { SnapshotObjectId HeapProfiler::GetHeapStats(OutputStream* stream) {
return reinterpret_cast<i::HeapProfiler*>(this)->PushHeapObjectsStats(stream); return reinterpret_cast<i::HeapProfiler*>(this)->PushHeapObjectsStats(stream);
} }
void HeapProfiler::DeleteAllSnapshots() {
i::Isolate* isolate = i::Isolate::Current();
IsDeadCheck(isolate, "v8::HeapProfiler::DeleteAllSnapshots");
isolate->heap_profiler()->DeleteAllSnapshots();
}
void HeapProfiler::DeleteAllHeapSnapshots() { void HeapProfiler::DeleteAllHeapSnapshots() {
reinterpret_cast<i::HeapProfiler*>(this)->DeleteAllSnapshots(); reinterpret_cast<i::HeapProfiler*>(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, void HeapProfiler::SetWrapperClassInfoProvider(uint16_t class_id,
WrapperInfoCallback callback) { WrapperInfoCallback callback) {
reinterpret_cast<i::HeapProfiler*>(this)->DefineWrapperClass(class_id, reinterpret_cast<i::HeapProfiler*>(this)->DefineWrapperClass(class_id,
...@@ -7791,17 +7640,6 @@ void HeapProfiler::SetWrapperClassInfoProvider(uint16_t 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() { size_t HeapProfiler::GetProfilerMemorySize() {
return reinterpret_cast<i::HeapProfiler*>(this)-> return reinterpret_cast<i::HeapProfiler*>(this)->
GetMemorySizeUsedByProfiler(); GetMemorySizeUsedByProfiler();
......
...@@ -152,7 +152,7 @@ class GlobalHandles { ...@@ -152,7 +152,7 @@ class GlobalHandles {
int NumberOfGlobalObjectWeakHandles(); int NumberOfGlobalObjectWeakHandles();
// Returns the current number of handles to global objects. // Returns the current number of handles to global objects.
int NumberOfGlobalHandles() { int global_handles_count() const {
return number_of_global_handles_; return number_of_global_handles_;
} }
......
...@@ -2956,7 +2956,7 @@ THREADED_TEST(ResettingGlobalHandle) { ...@@ -2956,7 +2956,7 @@ THREADED_TEST(ResettingGlobalHandle) {
} }
v8::internal::GlobalHandles* global_handles = v8::internal::GlobalHandles* global_handles =
reinterpret_cast<v8::internal::Isolate*>(isolate)->global_handles(); reinterpret_cast<v8::internal::Isolate*>(isolate)->global_handles();
int initial_handle_count = global_handles->NumberOfGlobalHandles(); int initial_handle_count = global_handles->global_handles_count();
{ {
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 3); CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 3);
...@@ -2965,13 +2965,13 @@ THREADED_TEST(ResettingGlobalHandle) { ...@@ -2965,13 +2965,13 @@ THREADED_TEST(ResettingGlobalHandle) {
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
global.Reset(isolate, v8_str("longer")); 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); v8::HandleScope scope(isolate);
CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 6); CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 6);
} }
global.Dispose(isolate); 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) { ...@@ -2984,7 +2984,7 @@ THREADED_TEST(ResettingGlobalHandleToEmpty) {
} }
v8::internal::GlobalHandles* global_handles = v8::internal::GlobalHandles* global_handles =
reinterpret_cast<v8::internal::Isolate*>(isolate)->global_handles(); reinterpret_cast<v8::internal::Isolate*>(isolate)->global_handles();
int initial_handle_count = global_handles->NumberOfGlobalHandles(); int initial_handle_count = global_handles->global_handles_count();
{ {
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 3); CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 3);
...@@ -2995,7 +2995,7 @@ THREADED_TEST(ResettingGlobalHandleToEmpty) { ...@@ -2995,7 +2995,7 @@ THREADED_TEST(ResettingGlobalHandleToEmpty) {
global.Reset(isolate, empty); global.Reset(isolate, empty);
} }
CHECK(global.IsEmpty()); 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) { ...@@ -3009,15 +3009,15 @@ THREADED_TEST(ClearAndLeakGlobal) {
Local<String> str = v8_str("str"); Local<String> str = v8_str("str");
global_handles = global_handles =
reinterpret_cast<v8::internal::Isolate*>(isolate)->global_handles(); reinterpret_cast<v8::internal::Isolate*>(isolate)->global_handles();
initial_handle_count = global_handles->NumberOfGlobalHandles(); initial_handle_count = global_handles->global_handles_count();
global.Reset(isolate, str); 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(); String* str = global.ClearAndLeak();
CHECK(global.IsEmpty()); 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<i::Object**>(str)); global_handles->Destroy(reinterpret_cast<i::Object**>(str));
CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count); CHECK_EQ(global_handles->global_handles_count(), initial_handle_count);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment