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

Unified Diff: src/runtime.cc

Issue 22432009: Don't use Persistent in runtime (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 7 years, 4 months 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/i18n.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 10de6f9e5ec001c595a0b86632599f9be9a22074..f2cb0be1bcdce18392a3d8442ad1b2ee932620da 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -13621,11 +13621,11 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateDateTimeFormat) {
isolate->factory()->NewStringFromAscii(CStrVector("valid")),
NONE));
- Persistent<v8::Object> wrapper(reinterpret_cast<v8::Isolate*>(isolate),
- v8::Utils::ToLocal(local_object));
// Make object handle weak so we can delete the data format once GC kicks in.
- wrapper.MakeWeak<void>(NULL, &DateFormat::DeleteDateFormat);
- wrapper.ClearAndLeak();
+ Handle<Object> wrapper = isolate->global_handles()->Create(*local_object);
+ GlobalHandles::MakeWeak(reinterpret_cast<Object**>(wrapper.location()),
+ NULL,
+ DateFormat::DeleteDateFormat);
return *local_object;
}
@@ -13724,12 +13724,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateNumberFormat) {
isolate->factory()->NewStringFromAscii(CStrVector("valid")),
NONE));
- Persistent<v8::Object> wrapper(reinterpret_cast<v8::Isolate*>(isolate),
- v8::Utils::ToLocal(local_object));
- // Make object handle weak so we can delete the number format once GC kicks
- // in.
- wrapper.MakeWeak<void>(NULL, &NumberFormat::DeleteNumberFormat);
- wrapper.ClearAndLeak();
+ Handle<Object> wrapper = isolate->global_handles()->Create(*local_object);
+ GlobalHandles::MakeWeak(reinterpret_cast<Object**>(wrapper.location()),
+ NULL,
+ NumberFormat::DeleteNumberFormat);
return *local_object;
}
@@ -13837,11 +13835,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateCollator) {
isolate->factory()->NewStringFromAscii(CStrVector("valid")),
NONE));
- Persistent<v8::Object> wrapper(reinterpret_cast<v8::Isolate*>(isolate),
- v8::Utils::ToLocal(local_object));
- // Make object handle weak so we can delete the collator once GC kicks in.
- wrapper.MakeWeak<void>(NULL, &Collator::DeleteCollator);
- wrapper.ClearAndLeak();
+ Handle<Object> wrapper = isolate->global_handles()->Create(*local_object);
+ GlobalHandles::MakeWeak(reinterpret_cast<Object**>(wrapper.location()),
+ NULL,
+ Collator::DeleteCollator);
return *local_object;
}
« no previous file with comments | « src/i18n.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698