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

Side by Side Diff: runtime/lib/mirrors.cc

Issue 18242003: Add a VM defined class MirrorReference as an opaque pointer for Dart code to VM internal objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_debugger_api.h" 6 #include "include/dart_debugger_api.h"
7 #include "include/dart_mirrors_api.h" 7 #include "include/dart_mirrors_api.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/bootstrap_natives.h" 9 #include "vm/bootstrap_natives.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 static void FreeVMReference(Dart_WeakPersistentHandle weak_ref, void* data) { 118 static void FreeVMReference(Dart_WeakPersistentHandle weak_ref, void* data) {
119 Dart_PersistentHandle perm_handle = 119 Dart_PersistentHandle perm_handle =
120 reinterpret_cast<Dart_PersistentHandle>(data); 120 reinterpret_cast<Dart_PersistentHandle>(data);
121 Dart_DeletePersistentHandle(perm_handle); 121 Dart_DeletePersistentHandle(perm_handle);
122 Dart_DeleteWeakPersistentHandle(weak_ref); 122 Dart_DeleteWeakPersistentHandle(weak_ref);
123 } 123 }
124 124
125 125
126 static Dart_Handle CreateVMReference(Dart_Handle handle) { 126 static Dart_Handle CreateVMReference(Dart_Handle handle) {
127 // Create the VMReference object. 127 // Create the VMReference object.
128 Dart_Handle cls_name = NewString("VMReference"); 128 Dart_Handle cls_name = NewString("OldVMReference");
siva 2013/06/30 01:12:48 VMReference for the new internal VM class seems ve
rmacnak 2013/07/01 15:50:28 It is intended to be rather generic. It might hold
129 Dart_Handle type = Dart_GetType(MirrorLib(), cls_name, 0, NULL); 129 Dart_Handle type = Dart_GetType(MirrorLib(), cls_name, 0, NULL);
130 if (Dart_IsError(type)) { 130 if (Dart_IsError(type)) {
131 return type; 131 return type;
132 } 132 }
133 Dart_Handle vm_ref = Dart_New(type, Dart_Null(), 0, NULL); 133 Dart_Handle vm_ref = Dart_New(type, Dart_Null(), 0, NULL);
134 if (Dart_IsError(vm_ref)) { 134 if (Dart_IsError(vm_ref)) {
135 return vm_ref; 135 return vm_ref;
136 } 136 }
137 137
138 // Allocate a persistent handle. 138 // Allocate a persistent handle.
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 Dart_ExitScope(); 1398 Dart_ExitScope();
1399 } 1399 }
1400 1400
1401 void HandleMirrorsMessage(Isolate* isolate, 1401 void HandleMirrorsMessage(Isolate* isolate,
1402 Dart_Port reply_port, 1402 Dart_Port reply_port,
1403 const Instance& message) { 1403 const Instance& message) {
1404 UNIMPLEMENTED(); 1404 UNIMPLEMENTED();
1405 } 1405 }
1406 1406
1407 } // namespace dart 1407 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698