Chromium Code Reviews| Index: runtime/vm/object.cc |
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
| index 08821a27c542653e4afa6d19076ed8b2754b7551..28b4dbee71ec0f81088e2fe66f1415791c8db73e 100644 |
| --- a/runtime/vm/object.cc |
| +++ b/runtime/vm/object.cc |
| @@ -5616,6 +5616,11 @@ void Function::set_parent_function(const Function& value) const { |
| bool Function::HasGenericParent() const { |
| + if (IsImplicitClosureFunction()) { |
| + // The parent function of an implicit closure function is not the enclosing |
| + // function we are asking about here. |
| + return false; |
| + } |
| Function& parent = Function::Handle(parent_function()); |
| while (!parent.IsNull()) { |
| if (parent.IsGeneric()) { |
| @@ -6014,6 +6019,9 @@ intptr_t Function::NumTypeParameters(Thread* thread) const { |
| intptr_t Function::NumParentTypeParameters() const { |
| + if (IsImplicitClosureFunction()) { |
| + return 0; |
| + } |
| Thread* thread = Thread::Current(); |
| Function& parent = Function::Handle(parent_function()); |
| intptr_t num_parent_type_params = 0; |
| @@ -6052,6 +6060,11 @@ RawTypeParameter* Function::LookupTypeParameter( |
| } |
| } |
| } |
| + if (function.IsImplicitClosureFunction()) { |
| + // The parent function is not the enclosing function, but the closurized |
| + // function with identical type parameters. |
| + break; |
| + } |
| function ^= function.parent_function(); |
| if (function_level != NULL) { |
| (*function_level)--; |
| @@ -6343,11 +6356,14 @@ enum QualifiedFunctionLibKind { |
| static intptr_t ConstructFunctionFullyQualifiedCString( |
| - const Function& function, |
| + const Function& fun, |
| char** chars, |
| intptr_t reserve_len, |
| bool with_lib, |
| QualifiedFunctionLibKind lib_kind) { |
| + // Hide implicit closure functions. |
| + const Function& function = Function::Handle( |
|
rmacnak
2017/04/25 19:21:42
I think this output is only used for debug printin
regis
2017/04/25 19:57:26
OK, I removed the change.
|
| + fun.IsImplicitClosureFunction() ? fun.parent_function() : fun.raw()); |
| const char* name = String::Handle(function.name()).ToCString(); |
| const char* function_format = (reserve_len == 0) ? "%s" : "%s_"; |
| reserve_len += OS::SNPrint(NULL, 0, function_format, name); |