Chromium Code Reviews| Index: runtime/lib/mirrors.cc |
| =================================================================== |
| --- runtime/lib/mirrors.cc (revision 24851) |
| +++ runtime/lib/mirrors.cc (working copy) |
| @@ -630,7 +630,6 @@ |
| static Dart_Handle CreateMethodMirror(Dart_Handle func, |
| - Dart_Handle func_name, |
| Dart_Handle owner_mirror) { |
| ASSERT(Dart_IsFunction(func)); |
| Dart_Handle mirror_cls_name = NewString("_LocalMethodMirrorImpl"); |
| @@ -682,7 +681,7 @@ |
| // TODO(turnidge): Implement constructor kinds (arguments 7 - 10). |
| Dart_Handle args[] = { |
| - func_name, |
| + CreateMirrorReference(func), |
| owner_mirror, |
| CreateParameterMirrorList(func), |
| CreateLazyMirror(return_type), |
| @@ -806,7 +805,7 @@ |
| continue; |
| } |
| - Dart_Handle func_mirror = CreateMethodMirror(func, func_name, owner_mirror); |
| + Dart_Handle func_mirror = CreateMethodMirror(func, owner_mirror); |
| if (Dart_IsError(func_mirror)) { |
| return func_mirror; |
| } |
| @@ -850,7 +849,7 @@ |
| continue; |
| } |
| - Dart_Handle func_mirror = CreateMethodMirror(func, func_name, owner_mirror); |
| + Dart_Handle func_mirror = CreateMethodMirror(func, owner_mirror); |
| if (Dart_IsError(func_mirror)) { |
| return func_mirror; |
| } |
| @@ -1086,7 +1085,6 @@ |
| } |
| // TODO(turnidge): Why not use the real function name here? |
|
rmacnak
2013/07/09 22:27:46
Comment no longer applies
|
| - Dart_Handle func_name = NewString("call"); |
| Dart_Handle func_owner = Dart_FunctionOwner(func); |
| if (Dart_IsError(func_owner)) { |
| return func_owner; |
| @@ -1095,7 +1093,7 @@ |
| // TODO(turnidge): Pass the function owner here. This will require |
| // us to support functions in CreateLazyMirror. |
| Dart_Handle func_mirror = |
| - CreateMethodMirror(func, func_name, Dart_Null()); |
| + CreateMethodMirror(func, Dart_Null()); |
| if (Dart_IsError(func_mirror)) { |
| return func_mirror; |
| } |
| @@ -1430,4 +1428,13 @@ |
| return klass.Name(); |
| } |
| +DEFINE_NATIVE_ENTRY(MethodMirror_name, 1) { |
| + const MirrorReference& func_ref = |
| + MirrorReference::CheckedHandle(arguments->NativeArgAt(0)); |
| + Function& func = Function::Handle(); |
| + func ^= func_ref.referent(); |
| + return func.UserVisibleName(); |
| +} |
|
siva
2013/07/10 00:09:49
I think it is possible to abstract this into a sin
rmacnak
2013/07/10 00:28:58
So you're suggesting we dispatch on the kind of re
siva
2013/07/10 01:04:19
Yes. It is not going to be too large maybe a switc
|
| + |
| + |
|
siva
2013/07/10 00:09:49
extra blank line here.
Michael Lippautz (Google)
2013/07/10 00:30:41
Done.
|
| } // namespace dart |