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

Unified Diff: src/handles.cc

Issue 99193002: Remove all stuff marked as V8_DEPRECATED. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/global-handles.cc ('k') | src/i18n.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles.cc
diff --git a/src/handles.cc b/src/handles.cc
index 2d414022e09203e8a1034ee24fd55ca49f699063..8bf3b0c46d202da728ab6905053742ce59a367a0 100644
--- a/src/handles.cc
+++ b/src/handles.cc
@@ -225,17 +225,15 @@ Handle<Object> LookupSingleCharacterStringFromCode(Isolate* isolate,
// collector will call the weak callback on the global handle
// associated with the wrapper and get rid of both the wrapper and the
// handle.
-static void ClearWrapperCache(v8::Isolate* v8_isolate,
- Persistent<v8::Value>* handle,
- void*) {
- Handle<Object> cache = Utils::OpenPersistent(handle);
- JSValue* wrapper = JSValue::cast(*cache);
+static void ClearWrapperCache(
+ const v8::WeakCallbackData<v8::Value, void>& data) {
+ Object** location = reinterpret_cast<Object**>(data.GetParameter());
+ JSValue* wrapper = JSValue::cast(*location);
Foreign* foreign = Script::cast(wrapper->value())->wrapper();
- ASSERT(foreign->foreign_address() ==
- reinterpret_cast<Address>(cache.location()));
+ ASSERT_EQ(foreign->foreign_address(), reinterpret_cast<Address>(location));
foreign->set_foreign_address(0);
- Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate);
- isolate->global_handles()->Destroy(cache.location());
+ GlobalHandles::Destroy(location);
+ Isolate* isolate = reinterpret_cast<Isolate*>(data.GetIsolate());
isolate->counters()->script_wrappers()->Decrement();
}
@@ -267,9 +265,9 @@ Handle<JSValue> GetScriptWrapper(Handle<Script> script) {
// for future use. The cache will automatically be cleared by the
// garbage collector when it is not used anymore.
Handle<Object> handle = isolate->global_handles()->Create(*result);
- isolate->global_handles()->MakeWeak(handle.location(),
- NULL,
- &ClearWrapperCache);
+ GlobalHandles::MakeWeak(handle.location(),
+ reinterpret_cast<void*>(handle.location()),
+ &ClearWrapperCache);
script->wrapper()->set_foreign_address(
reinterpret_cast<Address>(handle.location()));
return result;
« no previous file with comments | « src/global-handles.cc ('k') | src/i18n.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698