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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 187503002: 1. Restructure reusable handles to make individual Scopes for each handle type (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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/base_isolate.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 33332)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -614,8 +614,8 @@
Dart_WeakPersistentHandleFinalizer callback) {
ApiState* state = isolate->api_state();
ASSERT(state != NULL);
- ReusableObjectHandleScope reused_obj_handle(isolate);
- Object& ref = reused_obj_handle.Handle();
+ REUSABLE_OBJECT_HANDLESCOPE(isolate);
+ Object& ref = isolate->ObjectHandle();
ref = Api::UnwrapHandle(object);
FinalizablePersistentHandle* finalizable_ref = is_prologue ?
state->prologue_weak_persistent_handles().AllocateHandle() :
@@ -1375,8 +1375,8 @@
DART_EXPORT bool Dart_IsInstance(Dart_Handle object) {
Isolate* isolate = Isolate::Current();
CHECK_ISOLATE(isolate);
- ReusableObjectHandleScope reused_obj_handle(isolate);
- Object& ref = reused_obj_handle.Handle();
+ REUSABLE_OBJECT_HANDLESCOPE(isolate);
+ Object& ref = isolate->ObjectHandle();
ref = Api::UnwrapHandle(object);
return ref.IsInstance();
}
@@ -3883,8 +3883,8 @@
}
Isolate* isolate = arguments->isolate();
CHECK_ISOLATE(isolate);
- ReusableObjectHandleScope reused_obj_handle(isolate);
- Object& obj = reused_obj_handle.Handle();
+ REUSABLE_OBJECT_HANDLESCOPE(isolate);
+ Object& obj = isolate->ObjectHandle();
obj = arguments->NativeArgAt(arg_index);
if (obj.IsNull()) {
for (intptr_t i = 0; i < num_fields; i++) {
@@ -3934,8 +3934,8 @@
return Api::Success();
}
*peer = NULL;
- ReusableObjectHandleScope reused_obj_handle(isolate);
- Object& obj = reused_obj_handle.Handle();
+ REUSABLE_OBJECT_HANDLESCOPE(isolate);
+ Object& obj = isolate->ObjectHandle();
obj = arguments->NativeArgAt(arg_index);
if (RawObject::IsStringClassId(obj.GetClassId())) {
return Api::NewHandle(isolate, obj.raw());
@@ -3959,8 +3959,8 @@
CURRENT_FUNC, arguments->NativeArgCount() - 1, index);
}
Isolate* isolate = arguments->isolate();
- ReusableObjectHandleScope reused_obj_handle(isolate);
- Object& obj = reused_obj_handle.Handle();
+ REUSABLE_OBJECT_HANDLESCOPE(isolate);
+ Object& obj = isolate->ObjectHandle();
obj = arguments->NativeArgAt(index);
intptr_t cid = obj.GetClassId();
if (cid == kSmiCid) {
@@ -4016,8 +4016,8 @@
CURRENT_FUNC, arguments->NativeArgCount() - 1, index);
}
Isolate* isolate = arguments->isolate();
- ReusableObjectHandleScope reused_obj_handle(isolate);
- Object& obj = reused_obj_handle.Handle();
+ REUSABLE_OBJECT_HANDLESCOPE(isolate);
+ Object& obj = isolate->ObjectHandle();
obj = arguments->NativeArgAt(index);
intptr_t cid = obj.GetClassId();
if (cid == kDoubleCid) {
@@ -4555,8 +4555,8 @@
}
Isolate* isolate = Isolate::Current();
CHECK_ISOLATE(isolate);
- ReusableObjectHandleScope reused_obj_handle(isolate);
- Object& obj = reused_obj_handle.Handle();
+ REUSABLE_OBJECT_HANDLESCOPE(isolate);
+ Object& obj = isolate->ObjectHandle();
obj = Api::UnwrapHandle(object);
if (obj.IsNull() || obj.IsNumber() || obj.IsBool()) {
const char* msg =
@@ -4575,8 +4575,8 @@
DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer) {
Isolate* isolate = Isolate::Current();
CHECK_ISOLATE(isolate);
- ReusableObjectHandleScope reused_obj_handle(isolate);
- Object& obj = reused_obj_handle.Handle();
+ REUSABLE_OBJECT_HANDLESCOPE(isolate);
+ Object& obj = isolate->ObjectHandle();
obj = Api::UnwrapHandle(object);
if (obj.IsNull() || obj.IsNumber() || obj.IsBool()) {
const char* msg =
« no previous file with comments | « runtime/vm/base_isolate.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698