| OLD | NEW |
| 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 "platform/json.h" | 7 #include "platform/json.h" |
| 8 #include "vm/bootstrap_natives.h" | 8 #include "vm/bootstrap_natives.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/exceptions.h" | 10 #include "vm/exceptions.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 return target; | 252 return target; |
| 253 } | 253 } |
| 254 | 254 |
| 255 if (Dart_IsLibrary(target)) { | 255 if (Dart_IsLibrary(target)) { |
| 256 Dart_Handle cls_name = NewString("_LazyLibraryMirror"); | 256 Dart_Handle cls_name = NewString("_LazyLibraryMirror"); |
| 257 Dart_Handle cls = Dart_GetClass(MirrorLib(), cls_name); | 257 Dart_Handle cls = Dart_GetClass(MirrorLib(), cls_name); |
| 258 Dart_Handle args[] = { Dart_LibraryName(target) }; | 258 Dart_Handle args[] = { Dart_LibraryName(target) }; |
| 259 return Dart_New(cls, Dart_Null(), ARRAY_SIZE(args), args); | 259 return Dart_New(cls, Dart_Null(), ARRAY_SIZE(args), args); |
| 260 } | 260 } |
| 261 | 261 |
| 262 if (Dart_IsClass(target) || Dart_IsInterface(target)) { | 262 if (Dart_IsClass(target)) { |
| 263 if (Dart_ClassIsFunctionType(target)) { | 263 if (Dart_ClassIsFunctionType(target)) { |
| 264 Dart_Handle cls_name = NewString("_LazyFunctionTypeMirror"); | 264 Dart_Handle cls_name = NewString("_LazyFunctionTypeMirror"); |
| 265 Dart_Handle cls = Dart_GetClass(MirrorLib(), cls_name); | 265 Dart_Handle cls = Dart_GetClass(MirrorLib(), cls_name); |
| 266 | 266 |
| 267 Dart_Handle sig = Dart_ClassGetFunctionTypeSignature(target); | 267 Dart_Handle sig = Dart_ClassGetFunctionTypeSignature(target); |
| 268 Dart_Handle return_type = Dart_FunctionReturnType(sig); | 268 Dart_Handle return_type = Dart_FunctionReturnType(sig); |
| 269 if (Dart_IsError(return_type)) { | 269 if (Dart_IsError(return_type)) { |
| 270 return return_type; | 270 return return_type; |
| 271 } | 271 } |
| 272 | 272 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 owner_mirror, | 357 owner_mirror, |
| 358 CreateLazyMirror(upper_bound), | 358 CreateLazyMirror(upper_bound), |
| 359 }; | 359 }; |
| 360 Dart_Handle mirror = Dart_New(cls, Dart_Null(), ARRAY_SIZE(args), args); | 360 Dart_Handle mirror = Dart_New(cls, Dart_Null(), ARRAY_SIZE(args), args); |
| 361 return mirror; | 361 return mirror; |
| 362 } | 362 } |
| 363 | 363 |
| 364 | 364 |
| 365 static Dart_Handle CreateTypeVariableMap(Dart_Handle owner, | 365 static Dart_Handle CreateTypeVariableMap(Dart_Handle owner, |
| 366 Dart_Handle owner_mirror) { | 366 Dart_Handle owner_mirror) { |
| 367 ASSERT(Dart_IsClass(owner) || Dart_IsInterface(owner)); | 367 ASSERT(Dart_IsClass(owner)); |
| 368 // TODO(turnidge): This should be an immutable map. | 368 // TODO(turnidge): This should be an immutable map. |
| 369 Dart_Handle map = MapNew(); | 369 Dart_Handle map = MapNew(); |
| 370 if (Dart_IsError(map)) { | 370 if (Dart_IsError(map)) { |
| 371 return map; | 371 return map; |
| 372 } | 372 } |
| 373 | 373 |
| 374 Dart_Handle names = Dart_GetTypeVariableNames(owner); | 374 Dart_Handle names = Dart_GetTypeVariableNames(owner); |
| 375 if (Dart_IsError(names)) { | 375 if (Dart_IsError(names)) { |
| 376 return names; | 376 return names; |
| 377 } | 377 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 | 429 |
| 430 static Dart_Handle CreateMemberMap(Dart_Handle owner, Dart_Handle owner_mirror); | 430 static Dart_Handle CreateMemberMap(Dart_Handle owner, Dart_Handle owner_mirror); |
| 431 static Dart_Handle CreateConstructorMap(Dart_Handle owner, | 431 static Dart_Handle CreateConstructorMap(Dart_Handle owner, |
| 432 Dart_Handle owner_mirror); | 432 Dart_Handle owner_mirror); |
| 433 | 433 |
| 434 | 434 |
| 435 static Dart_Handle CreateClassMirror(Dart_Handle intf, | 435 static Dart_Handle CreateClassMirror(Dart_Handle intf, |
| 436 Dart_Handle intf_name, | 436 Dart_Handle intf_name, |
| 437 Dart_Handle lib, | 437 Dart_Handle lib, |
| 438 Dart_Handle lib_mirror) { | 438 Dart_Handle lib_mirror) { |
| 439 ASSERT(Dart_IsClass(intf) || Dart_IsInterface(intf)); | 439 ASSERT(Dart_IsClass(intf)); |
| 440 if (Dart_ClassIsTypedef(intf)) { | 440 if (Dart_ClassIsTypedef(intf)) { |
| 441 // This class is actually a typedef. Represent it specially in | 441 // This class is actually a typedef. Represent it specially in |
| 442 // reflection. | 442 // reflection. |
| 443 return CreateTypedefMirror(intf, intf_name, lib, lib_mirror); | 443 return CreateTypedefMirror(intf, intf_name, lib, lib_mirror); |
| 444 } | 444 } |
| 445 | 445 |
| 446 Dart_Handle cls_name = NewString("_LocalClassMirrorImpl"); | 446 Dart_Handle cls_name = NewString("_LocalClassMirrorImpl"); |
| 447 Dart_Handle cls = Dart_GetClass(MirrorLib(), cls_name); | 447 Dart_Handle cls = Dart_GetClass(MirrorLib(), cls_name); |
| 448 if (Dart_IsError(cls)) { | 448 if (Dart_IsError(cls)) { |
| 449 return cls; | 449 return cls; |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 } | 1197 } |
| 1198 | 1198 |
| 1199 | 1199 |
| 1200 void HandleMirrorsMessage(Isolate* isolate, | 1200 void HandleMirrorsMessage(Isolate* isolate, |
| 1201 Dart_Port reply_port, | 1201 Dart_Port reply_port, |
| 1202 const Instance& message) { | 1202 const Instance& message) { |
| 1203 UNIMPLEMENTED(); | 1203 UNIMPLEMENTED(); |
| 1204 } | 1204 } |
| 1205 | 1205 |
| 1206 } // namespace dart | 1206 } // namespace dart |
| OLD | NEW |