Index: src/allocation-tracker.cc |
diff --git a/src/allocation-tracker.cc b/src/allocation-tracker.cc |
index 8044cef3c810b42e3bce9eb47fe1c25d3cc3d411..59ba6c99a67241345f02e84032326dec7ddea1da 100644 |
--- a/src/allocation-tracker.cc |
+++ b/src/allocation-tracker.cc |
@@ -246,16 +246,15 @@ AllocationTracker::UnresolvedLocation::UnresolvedLocation( |
info_(info) { |
script_ = Handle<Script>::cast( |
script->GetIsolate()->global_handles()->Create(script)); |
- GlobalHandles::MakeWeak( |
- reinterpret_cast<Object**>(script_.location()), |
- this, &HandleWeakScript); |
+ GlobalHandles::MakeWeak(reinterpret_cast<Object**>(script_.location()), |
+ this, |
+ &HandleWeakScript); |
} |
AllocationTracker::UnresolvedLocation::~UnresolvedLocation() { |
if (!script_.is_null()) { |
- script_->GetIsolate()->global_handles()->Destroy( |
- reinterpret_cast<Object**>(script_.location())); |
+ GlobalHandles::Destroy(reinterpret_cast<Object**>(script_.location())); |
} |
} |
@@ -268,12 +267,11 @@ void AllocationTracker::UnresolvedLocation::Resolve() { |
void AllocationTracker::UnresolvedLocation::HandleWeakScript( |
- v8::Isolate* isolate, |
- v8::Persistent<v8::Value>* obj, |
- void* data) { |
- UnresolvedLocation* location = reinterpret_cast<UnresolvedLocation*>(data); |
- location->script_ = Handle<Script>::null(); |
- obj->Reset(); |
+ const v8::WeakCallbackData<v8::Value, void>& data) { |
+ UnresolvedLocation* loc = |
+ reinterpret_cast<UnresolvedLocation*>(data.GetParameter()); |
+ GlobalHandles::Destroy(reinterpret_cast<Object**>(loc->script_.location())); |
+ loc->script_ = Handle<Script>::null(); |
} |