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

Side by Side Diff: runtime/vm/class_finalizer.cc

Issue 2951803005: Set and keep parent function of signature functions. (Closed)
Patch Set: address review comments Created 3 years, 6 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
« no previous file with comments | « no previous file | runtime/vm/kernel_binary_flowgraph.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "vm/class_finalizer.h" 5 #include "vm/class_finalizer.h"
6 6
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/hash_table.h" 8 #include "vm/hash_table.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 ResolveSignature(scope_class, signature); 584 ResolveSignature(scope_class, signature);
585 } else { 585 } else {
586 ASSERT(scope_class.IsClosureClass()); 586 ASSERT(scope_class.IsClosureClass());
587 ResolveSignature(cls, signature); 587 ResolveSignature(cls, signature);
588 ASSERT(type.arguments() == TypeArguments::null()); 588 ASSERT(type.arguments() == TypeArguments::null());
589 if (signature.IsSignatureFunction()) { 589 if (signature.IsSignatureFunction()) {
590 // Drop fields that are not necessary anymore after resolution. 590 // Drop fields that are not necessary anymore after resolution.
591 // The parent function, owner, and token position of a shared 591 // The parent function, owner, and token position of a shared
592 // canonical function type are meaningless, since the canonical 592 // canonical function type are meaningless, since the canonical
593 // representent is picked arbitrarily. 593 // representent is picked arbitrarily.
594 signature.set_parent_function(Function::Handle()); 594 // The parent function is however still required to finalize function
595 // type parameters when the function has a generic parent.
596 if (!signature.HasGenericParent()) {
597 signature.set_parent_function(Function::Handle());
598 }
595 // TODO(regis): As long as we support metadata in typedef signatures, 599 // TODO(regis): As long as we support metadata in typedef signatures,
596 // we cannot reset these fields used to reparse a typedef. 600 // we cannot reset these fields used to reparse a typedef.
597 // Note that the scope class of a typedef function type is always 601 // Note that the scope class of a typedef function type is always
598 // preserved as the typedef class (not reset to _Closure class), 602 // preserved as the typedef class (not reset to _Closure class),
599 // thereby preventing sharing of canonical function types between 603 // thereby preventing sharing of canonical function types between
600 // typedefs. Not being shared, these fields are therefore always 604 // typedefs. Not being shared, these fields are therefore always
601 // meaningful for typedefs. 605 // meaningful for typedefs.
602 if (!scope_class.IsTypedefClass()) { 606 if (!scope_class.IsTypedefClass()) {
603 signature.set_owner(Object::Handle()); 607 signature.set_owner(Object::Handle());
604 signature.set_token_pos(TokenPosition::kNoSource); 608 signature.set_token_pos(TokenPosition::kNoSource);
(...skipping 3195 matching lines...) Expand 10 before | Expand all | Expand 10 after
3800 ProgramVisitor::VisitFunctions(&function_visitor); 3804 ProgramVisitor::VisitFunctions(&function_visitor);
3801 3805
3802 class ClearCodeClassVisitor : public ClassVisitor { 3806 class ClearCodeClassVisitor : public ClassVisitor {
3803 void Visit(const Class& cls) { cls.DisableAllocationStub(); } 3807 void Visit(const Class& cls) { cls.DisableAllocationStub(); }
3804 }; 3808 };
3805 ClearCodeClassVisitor class_visitor; 3809 ClearCodeClassVisitor class_visitor;
3806 ProgramVisitor::VisitClasses(&class_visitor); 3810 ProgramVisitor::VisitClasses(&class_visitor);
3807 } 3811 }
3808 3812
3809 } // namespace dart 3813 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/kernel_binary_flowgraph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698