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

Unified Diff: runtime/vm/object.h

Issue 9956133: Remove many calls to Isolate::Current() in the dart embedding api by (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 | « runtime/vm/native_entry.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 6189)
+++ runtime/vm/object.h (working copy)
@@ -40,19 +40,24 @@
initializeHandle(this, value); \
ASSERT(IsNull() || Is##object()); \
} \
- static object& Handle(Isolate* islt, Raw##object* raw_ptr) { \
- object* obj = reinterpret_cast<object*>(VMHandles::AllocateHandle(islt)); \
+ static object& Handle(Isolate* isolate, Raw##object* raw_ptr) { \
+ object* obj = \
+ reinterpret_cast<object*>(VMHandles::AllocateHandle(isolate)); \
initializeHandle(obj, raw_ptr); \
return *obj; \
} \
static object& Handle() { \
return Handle(Isolate::Current(), object::null()); \
} \
+ static object& Handle(Isolate* isolate) { \
+ return Handle(isolate, object::null()); \
+ } \
static object& Handle(Raw##object* raw_ptr) { \
return Handle(Isolate::Current(), raw_ptr); \
} \
- static object& CheckedHandle(Isolate* islt, RawObject* raw_ptr) { \
- object* obj = reinterpret_cast<object*>(VMHandles::AllocateHandle(islt)); \
+ static object& CheckedHandle(Isolate* isolate, RawObject* raw_ptr) { \
+ object* obj = \
+ reinterpret_cast<object*>(VMHandles::AllocateHandle(isolate)); \
initializeHandle(obj, raw_ptr); \
if (!obj->Is##object()) { \
FATAL("Handle check failed."); \
@@ -233,6 +238,10 @@
return Handle(Isolate::Current(), null_);
}
+ static Object& Handle(Isolate* isolate) {
+ return Handle(isolate, null_);
+ }
+
static Object& Handle(RawObject* raw_ptr) {
return Handle(Isolate::Current(), raw_ptr);
}
« no previous file with comments | « runtime/vm/native_entry.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698