Deprecate Persistent functions which were marked to be deprecated.

BUG=
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/23707009

Patch from Marja Hölttä <marja@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16493 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 281de965
......@@ -634,8 +634,7 @@ template <class T> class Persistent // NOLINT
* This handle's reference, and any other references to the storage
* cell remain and IsEmpty will still return false.
*/
// TODO(dcarney): deprecate
V8_INLINE(void Dispose(Isolate* isolate)) { Dispose(); }
V8_DEPRECATED(V8_INLINE(void Dispose(Isolate* isolate))) { Dispose(); }
/**
* Make the reference to this object weak. When only weak handles
......@@ -667,8 +666,7 @@ template <class T> class Persistent // NOLINT
V8_INLINE(void ClearWeak());
// TODO(dcarney): deprecate
V8_INLINE(void ClearWeak(Isolate* isolate)) { ClearWeak(); }
V8_DEPRECATED(V8_INLINE(void ClearWeak(Isolate* isolate))) { ClearWeak(); }
/**
* Marks the reference to this object independent. Garbage collector is free
......@@ -678,8 +676,9 @@ template <class T> class Persistent // NOLINT
*/
V8_INLINE(void MarkIndependent());
// TODO(dcarney): deprecate
V8_INLINE(void MarkIndependent(Isolate* isolate)) { MarkIndependent(); }
V8_DEPRECATED(V8_INLINE(void MarkIndependent(Isolate* isolate))) {
MarkIndependent();
}
/**
* Marks the reference to this object partially dependent. Partially dependent
......@@ -691,29 +690,29 @@ template <class T> class Persistent // NOLINT
*/
V8_INLINE(void MarkPartiallyDependent());
// TODO(dcarney): deprecate
V8_INLINE(void MarkPartiallyDependent(Isolate* isolate)) {
V8_DEPRECATED(V8_INLINE(void MarkPartiallyDependent(Isolate* isolate))) {
MarkPartiallyDependent();
}
V8_INLINE(bool IsIndependent() const);
// TODO(dcarney): deprecate
V8_INLINE(bool IsIndependent(Isolate* isolate) const) {
V8_DEPRECATED(V8_INLINE(bool IsIndependent(Isolate* isolate)) const) {
return IsIndependent();
}
/** Checks if the handle holds the only reference to an object. */
V8_INLINE(bool IsNearDeath() const);
// TODO(dcarney): deprecate
V8_INLINE(bool IsNearDeath(Isolate* isolate) const) { return IsNearDeath(); }
V8_DEPRECATED(V8_INLINE(bool IsNearDeath(Isolate* isolate)) const) {
return IsNearDeath();
}
/** Returns true if the handle's reference is weak. */
V8_INLINE(bool IsWeak() const);
// TODO(dcarney): deprecate
V8_INLINE(bool IsWeak(Isolate* isolate) const) { return IsWeak(); }
V8_DEPRECATED(V8_INLINE(bool IsWeak(Isolate* isolate)) const) {
return IsWeak();
}
/**
* Assigns a wrapper class ID to the handle. See RetainedObjectInfo interface
......@@ -721,8 +720,8 @@ template <class T> class Persistent // NOLINT
*/
V8_INLINE(void SetWrapperClassId(uint16_t class_id));
// TODO(dcarney): deprecate
V8_INLINE(void SetWrapperClassId(Isolate* isolate, uint16_t class_id)) {
V8_DEPRECATED(
V8_INLINE(void SetWrapperClassId(Isolate * isolate, uint16_t class_id))) {
SetWrapperClassId(class_id);
}
......@@ -732,8 +731,7 @@ template <class T> class Persistent // NOLINT
*/
V8_INLINE(uint16_t WrapperClassId() const);
// TODO(dcarney): deprecate
V8_INLINE(uint16_t WrapperClassId(Isolate* isolate) const) {
V8_DEPRECATED(V8_INLINE(uint16_t WrapperClassId(Isolate* isolate)) const) {
return WrapperClassId();
}
......@@ -5736,7 +5734,7 @@ void Persistent<T>::MarkPartiallyDependent() {
template <class T>
void Persistent<T>::Reset(Isolate* isolate, const Handle<T>& other) {
Dispose(isolate);
Dispose();
#ifdef V8_USE_UNSAFE_HANDLES
*this = *New(isolate, other);
#else
......@@ -5754,7 +5752,7 @@ void Persistent<T>::Reset(Isolate* isolate, const Handle<T>& other) {
#ifndef V8_USE_UNSAFE_HANDLES
template <class T>
void Persistent<T>::Reset(Isolate* isolate, const Persistent<T>& other) {
Dispose(isolate);
Dispose();
if (other.IsEmpty()) {
this->val_ = NULL;
return;
......
......@@ -291,9 +291,8 @@ JsHttpRequestProcessor::~JsHttpRequestProcessor() {
// Dispose the persistent handles. When noone else has any
// references to the objects stored in the handles they will be
// automatically reclaimed.
Isolate* isolate = GetIsolate();
context_.Dispose(isolate);
process_.Dispose(isolate);
context_.Dispose();
process_.Dispose();
}
......
......@@ -271,10 +271,10 @@ PerIsolateData::RealmScope::RealmScope(PerIsolateData* data) : data_(data) {
PerIsolateData::RealmScope::~RealmScope() {
// Drop realms to avoid keeping them alive.
for (int i = 0; i < data_->realm_count_; ++i)
data_->realms_[i].Dispose(data_->isolate_);
data_->realms_[i].Dispose();
delete[] data_->realms_;
if (!data_->realm_shared_.IsEmpty())
data_->realm_shared_.Dispose(data_->isolate_);
data_->realm_shared_.Dispose();
}
......@@ -361,7 +361,7 @@ void Shell::RealmDispose(const v8::FunctionCallbackInfo<v8::Value>& args) {
Throw("Invalid realm index");
return;
}
data->realms_[index].Dispose(isolate);
data->realms_[index].Dispose();
data->realms_[index].Clear();
}
......@@ -420,7 +420,7 @@ void Shell::RealmSharedSet(Local<String> property,
const PropertyCallbackInfo<void>& info) {
Isolate* isolate = info.GetIsolate();
PerIsolateData* data = PerIsolateData::Get(isolate);
if (!data->realm_shared_.IsEmpty()) data->realm_shared_.Dispose(isolate);
if (!data->realm_shared_.IsEmpty()) data->realm_shared_.Dispose();
data->realm_shared_.Reset(isolate, value);
}
......
......@@ -709,7 +709,7 @@ void ScriptCache::HandleWeakScript(v8::Isolate* isolate,
script_cache->collected_scripts_.Add(id);
// Clear the weak handle.
obj->Dispose(isolate);
obj->Dispose();
}
......
......@@ -872,7 +872,7 @@ void DateFormat::DeleteDateFormat(v8::Isolate* isolate,
v8::Utils::OpenPersistent(object))->GetInternalField(0));
// Then dispose of the persistent handle to JS object.
object->Dispose(isolate);
object->Dispose();
}
......@@ -936,7 +936,7 @@ void NumberFormat::DeleteNumberFormat(v8::Isolate* isolate,
v8::Utils::OpenPersistent(object))->GetInternalField(0));
// Then dispose of the persistent handle to JS object.
object->Dispose(isolate);
object->Dispose();
}
......@@ -997,7 +997,7 @@ void Collator::DeleteCollator(v8::Isolate* isolate,
v8::Utils::OpenPersistent(object))->GetInternalField(0));
// Then dispose of the persistent handle to JS object.
object->Dispose(isolate);
object->Dispose();
}
......@@ -1064,7 +1064,7 @@ void BreakIterator::DeleteBreakIterator(v8::Isolate* isolate,
v8::Utils::OpenPersistent(object))->GetInternalField(1));
// Then dispose of the persistent handle to JS object.
object->Dispose(isolate);
object->Dispose();
}
} } // namespace v8::internal
......@@ -398,7 +398,7 @@ int main(int argc, char** argv) {
// context even after we have disposed of the context.
HEAP->CollectAllGarbage(i::Heap::kNoGCFlags, "mksnapshot");
i::Object* raw_context = *v8::Utils::OpenPersistent(context);
context.Dispose(isolate);
context.Dispose();
CppByteSink sink(argv[1]);
// This results in a somewhat smaller snapshot, probably because it gets rid
// of some things that are cached between garbage collections.
......
This diff is collapsed.
......@@ -6635,7 +6635,7 @@ TEST(ScriptCollectedEventContext) {
v8::Local<v8::Context>::New(isolate, context);
local_context->Exit();
}
context.Dispose(isolate);
context.Dispose();
// Do garbage collection to collect the script above which is no longer
// referenced.
......
......@@ -38,11 +38,11 @@ class HandleArray : public Malloced {
public:
static const unsigned kArraySize = 200;
explicit HandleArray() {}
~HandleArray() { Reset(v8::Isolate::GetCurrent()); }
void Reset(v8::Isolate* isolate) {
~HandleArray() { Reset(); }
void Reset() {
for (unsigned i = 0; i < kArraySize; i++) {
if (handles_[i].IsEmpty()) continue;
handles_[i].Dispose(isolate);
handles_[i].Dispose();
handles_[i].Clear();
}
}
......
......@@ -56,7 +56,7 @@ class DeclarationContext {
HandleScope scope(isolate);
Local<Context> context = Local<Context>::New(isolate, context_);
context->Exit();
context_.Dispose(isolate);
context_.Dispose();
}
}
......
......@@ -1201,11 +1201,11 @@ TEST(HeapSnapshotRetainedObjectInfo) {
heap_profiler->SetWrapperClassInfoProvider(
2, TestRetainedObjectInfo::WrapperInfoCallback);
v8::Persistent<v8::String> p_AAA(isolate, v8_str("AAA"));
p_AAA.SetWrapperClassId(isolate, 1);
p_AAA.SetWrapperClassId(1);
v8::Persistent<v8::String> p_BBB(isolate, v8_str("BBB"));
p_BBB.SetWrapperClassId(isolate, 1);
p_BBB.SetWrapperClassId(1);
v8::Persistent<v8::String> p_CCC(isolate, v8_str("CCC"));
p_CCC.SetWrapperClassId(isolate, 2);
p_CCC.SetWrapperClassId(2);
CHECK_EQ(0, TestRetainedObjectInfo::instances.length());
const v8::HeapSnapshot* snapshot =
heap_profiler->TakeHeapSnapshot(v8_str("retained"));
......@@ -1711,7 +1711,7 @@ bool HasWeakGlobalHandle() {
static void PersistentHandleCallback(v8::Isolate* isolate,
v8::Persistent<v8::Value>* handle,
void*) {
handle->Dispose(isolate);
handle->Dispose();
}
......
......@@ -401,7 +401,7 @@ static void TestWeakGlobalHandleCallback(v8::Isolate* isolate,
v8::Persistent<v8::Value>* handle,
void* id) {
if (1234 == reinterpret_cast<intptr_t>(id)) WeakPointerCleared = true;
handle->Dispose(isolate);
handle->Dispose();
}
......@@ -1723,12 +1723,12 @@ TEST(LeakNativeContextViaMap) {
ctx2->Global()->Set(v8_str("o"), v8::Int32::New(0));
ctx2->Exit();
v8::Local<v8::Context>::New(isolate, ctx1)->Exit();
ctx1p.Dispose(isolate);
ctx1p.Dispose();
v8::V8::ContextDisposedNotification();
}
HEAP->CollectAllAvailableGarbage();
CHECK_EQ(2, NumberOfGlobalObjects());
ctx2p.Dispose(isolate);
ctx2p.Dispose();
HEAP->CollectAllAvailableGarbage();
CHECK_EQ(0, NumberOfGlobalObjects());
}
......@@ -1769,12 +1769,12 @@ TEST(LeakNativeContextViaFunction) {
ctx2->Global()->Set(v8_str("o"), v8::Int32::New(0));
ctx2->Exit();
ctx1->Exit();
ctx1p.Dispose(ctx1->GetIsolate());
ctx1p.Dispose();
v8::V8::ContextDisposedNotification();
}
HEAP->CollectAllAvailableGarbage();
CHECK_EQ(2, NumberOfGlobalObjects());
ctx2p.Dispose(isolate);
ctx2p.Dispose();
HEAP->CollectAllAvailableGarbage();
CHECK_EQ(0, NumberOfGlobalObjects());
}
......@@ -1813,12 +1813,12 @@ TEST(LeakNativeContextViaMapKeyed) {
ctx2->Global()->Set(v8_str("o"), v8::Int32::New(0));
ctx2->Exit();
ctx1->Exit();
ctx1p.Dispose(ctx1->GetIsolate());
ctx1p.Dispose();
v8::V8::ContextDisposedNotification();
}
HEAP->CollectAllAvailableGarbage();
CHECK_EQ(2, NumberOfGlobalObjects());
ctx2p.Dispose(isolate);
ctx2p.Dispose();
HEAP->CollectAllAvailableGarbage();
CHECK_EQ(0, NumberOfGlobalObjects());
}
......@@ -1861,12 +1861,12 @@ TEST(LeakNativeContextViaMapProto) {
ctx2->Global()->Set(v8_str("o"), v8::Int32::New(0));
ctx2->Exit();
ctx1->Exit();
ctx1p.Dispose(isolate);
ctx1p.Dispose();
v8::V8::ContextDisposedNotification();
}
HEAP->CollectAllAvailableGarbage();
CHECK_EQ(2, NumberOfGlobalObjects());
ctx2p.Dispose(isolate);
ctx2p.Dispose();
HEAP->CollectAllAvailableGarbage();
CHECK_EQ(0, NumberOfGlobalObjects());
}
......
......@@ -307,7 +307,7 @@ static void WeakPointerCallback(v8::Isolate* isolate,
void* id) {
ASSERT(id == reinterpret_cast<void*>(1234));
NumberOfWeakCalls++;
handle->Dispose(isolate);
handle->Dispose();
}
......
......@@ -412,7 +412,7 @@ TEST(PartialSerialization) {
v8::HandleScope handle_scope(v8_isolate);
v8::Local<v8::Context>::New(v8_isolate, env)->Exit();
}
env.Dispose(v8_isolate);
env.Dispose();
FileByteSink startup_sink(startup_name.start());
StartupSerializer startup_serializer(&startup_sink);
......@@ -558,7 +558,7 @@ TEST(ContextSerialization) {
i::Object* raw_context = *v8::Utils::OpenPersistent(env);
env.Dispose(v8_isolate);
env.Dispose();
FileByteSink startup_sink(startup_name.start());
StartupSerializer startup_serializer(&startup_sink);
......
......@@ -69,7 +69,7 @@ static void WeakPointerCallback(v8::Isolate* isolate,
void* id) {
ASSERT(id == reinterpret_cast<void*>(1234));
NumberOfWeakCalls++;
handle->Dispose(isolate);
handle->Dispose();
}
......
......@@ -69,7 +69,7 @@ static void WeakPointerCallback(v8::Isolate* isolate,
void* id) {
ASSERT(id == reinterpret_cast<void*>(1234));
NumberOfWeakCalls++;
handle->Dispose(isolate);
handle->Dispose();
}
......
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