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

Issue 10916252: Implement more of the mirrors library, primarily stuff to do with types. (Closed)

Created:
8 years, 3 months ago by turnidge
Modified:
8 years, 3 months ago
Reviewers:
gbracha, cshapiro
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Implement more of the mirrors library, primarily stuff to do with types. Highlights: - Implement FunctionClassMirror, used to reflect on the class of function objects. - Implement TypeVariableMirror, used to reflect on type variables. - Implement TypedefMirror, used to reflect on typedefs. - Implement returnType for MethodMirror - Implement type for VariableMirror/ParameterMirror - Added supporting functions to the dart embedding api: - Dart_ClassIsTypedef - Dart_ClassGetTypedefReferent - Dart_ClassIsFunctionClass - Dart_ClassGetFunctionClassSignature - Dart_FunctionReturnType - Dart_FunctionParameterType - Dart_VariableType - Dart_GetTypeVariableNames - Dart_LookupTypeVariable - Dart_IsTypeVariable - Dart_TypeVariableOwner - Dart_TypeVariableUpperBound Other stuff: - Fixed bug in Function::NumberOfImplicitParameters for signature functions. - Chnaged the default upper bound for type variables to Object from Dynamic. Discussed this with Gilad and Regis. - Fixed some smaller problems in mirrors_impl.dart. Committed: https://code.google.com/p/dart/source/detail?r=12342

Patch Set 1 #

Total comments: 54

Patch Set 2 : #

Patch Set 3 : #

Total comments: 4

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1343 lines, -303 lines) Patch
M lib/mirrors/mirrors.dart View 1 2 5 chunks +35 lines, -27 lines 0 comments Download
M runtime/include/dart_api.h View 1 2 3 9 chunks +131 lines, -13 lines 0 comments Download
M runtime/lib/mirrors.cc View 1 2 3 20 chunks +345 lines, -91 lines 0 comments Download
M runtime/lib/mirrors_impl.dart View 1 2 3 25 chunks +347 lines, -148 lines 0 comments Download
M runtime/tests/vm/dart/isolate_mirror_local_test.dart View 1 9 chunks +59 lines, -15 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 7 chunks +261 lines, -6 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 2 4 chunks +159 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 chunk +3 lines, -1 line 0 comments Download
M runtime/vm/parser.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M tests/lib/mirrors/mirrors_test.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8 (0 generated)
turnidge
8 years, 3 months ago (2012-09-12 00:28:33 UTC) #1
gbracha
I have some semantic concerns I mentioned in the comments: constrcutors are not members, the ...
8 years, 3 months ago (2012-09-12 01:36:40 UTC) #2
cshapiro
https://chromiumcodereview.appspot.com/10916252/diff/1/lib/mirrors/mirrors.dart File lib/mirrors/mirrors.dart (right): https://chromiumcodereview.appspot.com/10916252/diff/1/lib/mirrors/mirrors.dart#newcode405 lib/mirrors/mirrors.dart:405: * This map preserves the order of declaration of ...
8 years, 3 months ago (2012-09-12 18:52:07 UTC) #3
turnidge
Gilad -- ready for another look. https://chromiumcodereview.appspot.com/10916252/diff/1/runtime/tests/vm/dart/isolate_mirror_local_test.dart File runtime/tests/vm/dart/isolate_mirror_local_test.dart (right): https://chromiumcodereview.appspot.com/10916252/diff/1/runtime/tests/vm/dart/isolate_mirror_local_test.dart#newcode245 runtime/tests/vm/dart/isolate_mirror_local_test.dart:245: func = cls_mirror.members['MyClass']; ...
8 years, 3 months ago (2012-09-12 19:55:20 UTC) #4
gbracha
lgtm for the Dart code
8 years, 3 months ago (2012-09-12 20:14:35 UTC) #5
turnidge
Carl -- ready for another look. https://chromiumcodereview.appspot.com/10916252/diff/1/lib/mirrors/mirrors.dart File lib/mirrors/mirrors.dart (right): https://chromiumcodereview.appspot.com/10916252/diff/1/lib/mirrors/mirrors.dart#newcode405 lib/mirrors/mirrors.dart:405: * This map ...
8 years, 3 months ago (2012-09-12 21:39:30 UTC) #6
cshapiro
lgtm - some very minor stuff, dehandling comments might be best done in a separate ...
8 years, 3 months ago (2012-09-13 04:29:58 UTC) #7
turnidge
8 years, 3 months ago (2012-09-13 17:02:57 UTC) #8
https://chromiumcodereview.appspot.com/10916252/diff/1/runtime/include/dart_a...
File runtime/include/dart_api.h (right):

https://chromiumcodereview.appspot.com/10916252/diff/1/runtime/include/dart_a...
runtime/include/dart_api.h:2191: * Returns a handle to the return type of a
function.
On 2012/09/13 04:29:58, cshapiro wrote:
> I think the handle is superfluous, after all what else could it be?  Also, the
> inconsistent usage is a little bit confusing in the context of a reflection
API
> given the indirection inherent in many of these operations.

Fixed this use.  Will fix the more pervasive problem in a follow-up CL.

https://chromiumcodereview.appspot.com/10916252/diff/4005/runtime/lib/mirrors.cc
File runtime/lib/mirrors.cc (right):

https://chromiumcodereview.appspot.com/10916252/diff/4005/runtime/lib/mirrors...
runtime/lib/mirrors.cc:973: return  Dart_New(cls, Dart_Null(), ARRAY_SIZE(args),
args);
On 2012/09/13 04:29:58, cshapiro wrote:
> There is an extra space between "return" and "Dart_New".

Done.

https://chromiumcodereview.appspot.com/10916252/diff/4005/runtime/lib/mirrors...
File runtime/lib/mirrors_impl.dart (right):

https://chromiumcodereview.appspot.com/10916252/diff/4005/runtime/lib/mirrors...
runtime/lib/mirrors_impl.dart:394: if (_owner !== null && _owner is! Mirror) {
On 2012/09/13 04:29:58, cshapiro wrote:
> This could be != instead of !==.  There are a few such instances here, above,
> and below.

Fixed throughout.

Powered by Google App Engine
This is Rietveld 408576698