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

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

Issue 2986393002: Record Typedef reference into Kernel FunctionType and resynthesyze typedefs in Analyzer. (Closed)
Patch Set: Drop @informative for typedefReference. Created 3 years, 4 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 | « pkg/kernel/lib/binary/ast_to_binary.dart ('k') | no next file » | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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/kernel_binary_flowgraph.h" 5 #include "vm/kernel_binary_flowgraph.h"
6 6
7 #include "vm/compiler.h" 7 #include "vm/compiler.h"
8 #include "vm/longjump.h" 8 #include "vm/longjump.h"
9 #include "vm/object_store.h" 9 #include "vm/object_store.h"
10 10
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 const intptr_t named_count = 1090 const intptr_t named_count =
1091 builder_->ReadListLength(); // read named_parameters list length. 1091 builder_->ReadListLength(); // read named_parameters list length.
1092 for (intptr_t i = 0; i < named_count; ++i) { 1092 for (intptr_t i = 0; i < named_count; ++i) {
1093 // read string reference (i.e. named_parameters[i].name). 1093 // read string reference (i.e. named_parameters[i].name).
1094 builder_->SkipStringReference(); 1094 builder_->SkipStringReference();
1095 VisitDartType(); // read named_parameters[i].type. 1095 VisitDartType(); // read named_parameters[i].type.
1096 } 1096 }
1097 } 1097 }
1098 1098
1099 builder_->SkipListOfStrings(); // read positional parameter names. 1099 builder_->SkipListOfStrings(); // read positional parameter names.
1100
1101 if (!simple) {
1102 builder_->SkipCanonicalNameReference(); // read typedef reference.
1103 }
1104
1100 VisitDartType(); // read return type. 1105 VisitDartType(); // read return type.
1101 } 1106 }
1102 1107
1103 void StreamingScopeBuilder::VisitTypeParameterType() { 1108 void StreamingScopeBuilder::VisitTypeParameterType() {
1104 Function& function = Function::Handle(Z, parsed_function_->function().raw()); 1109 Function& function = Function::Handle(Z, parsed_function_->function().raw());
1105 while (function.IsClosureFunction()) { 1110 while (function.IsClosureFunction()) {
1106 function = function.parent_function(); 1111 function = function.parent_function();
1107 } 1112 }
1108 1113
1109 if (function.IsFactory()) { 1114 if (function.IsFactory()) {
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 if (result_.IsMalformed()) { 1572 if (result_.IsMalformed()) {
1568 result_ = AbstractType::dynamic_type().raw(); 1573 result_ = AbstractType::dynamic_type().raw();
1569 } 1574 }
1570 parameter_types.SetAt(pos, result_); 1575 parameter_types.SetAt(pos, result_);
1571 parameter_names.SetAt(pos, name); 1576 parameter_names.SetAt(pos, name);
1572 } 1577 }
1573 } 1578 }
1574 1579
1575 builder_->SkipListOfStrings(); // read positional parameter names. 1580 builder_->SkipListOfStrings(); // read positional parameter names.
1576 1581
1582 if (!simple) {
1583 builder_->SkipCanonicalNameReference(); // read typedef reference.
1584 }
1585
1577 BuildTypeInternal(); // read return type. 1586 BuildTypeInternal(); // read return type.
1578 if (result_.IsMalformed()) { 1587 if (result_.IsMalformed()) {
1579 result_ = AbstractType::dynamic_type().raw(); 1588 result_ = AbstractType::dynamic_type().raw();
1580 } 1589 }
1581 signature_function.set_result_type(result_); 1590 signature_function.set_result_type(result_);
1582 1591
1583 Type& signature_type = 1592 Type& signature_type =
1584 Type::ZoneHandle(Z, signature_function.SignatureType()); 1593 Type::ZoneHandle(Z, signature_function.SignatureType());
1585 1594
1586 if (finalize_) { 1595 if (finalize_) {
(...skipping 2218 matching lines...) Expand 10 before | Expand all | Expand 10 after
3805 const intptr_t named_count = 3814 const intptr_t named_count =
3806 ReadListLength(); // read named_parameters list length. 3815 ReadListLength(); // read named_parameters list length.
3807 for (intptr_t i = 0; i < named_count; ++i) { 3816 for (intptr_t i = 0; i < named_count; ++i) {
3808 // read string reference (i.e. named_parameters[i].name). 3817 // read string reference (i.e. named_parameters[i].name).
3809 SkipStringReference(); 3818 SkipStringReference();
3810 SkipDartType(); // read named_parameters[i].type. 3819 SkipDartType(); // read named_parameters[i].type.
3811 } 3820 }
3812 } 3821 }
3813 3822
3814 SkipListOfStrings(); // read positional parameter names. 3823 SkipListOfStrings(); // read positional parameter names.
3824
3825 if (!simple) {
3826 SkipCanonicalNameReference(); // read typedef reference.
3827 }
3828
3815 SkipDartType(); // read return type. 3829 SkipDartType(); // read return type.
3816 } 3830 }
3817 3831
3818 void StreamingFlowGraphBuilder::SkipListOfExpressions() { 3832 void StreamingFlowGraphBuilder::SkipListOfExpressions() {
3819 intptr_t list_length = ReadListLength(); // read list length. 3833 intptr_t list_length = ReadListLength(); // read list length.
3820 for (intptr_t i = 0; i < list_length; ++i) { 3834 for (intptr_t i = 0; i < list_length; ++i) {
3821 SkipExpression(); // read ith expression. 3835 SkipExpression(); // read ith expression.
3822 } 3836 }
3823 } 3837 }
3824 3838
(...skipping 3475 matching lines...) Expand 10 before | Expand all | Expand 10 after
7300 } 7314 }
7301 } 7315 }
7302 7316
7303 return Array::Handle(Array::null()); 7317 return Array::Handle(Array::null());
7304 } 7318 }
7305 7319
7306 } // namespace kernel 7320 } // namespace kernel
7307 } // namespace dart 7321 } // namespace dart
7308 7322
7309 #endif // !defined(DART_PRECOMPILED_RUNTIME) 7323 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW
« no previous file with comments | « pkg/kernel/lib/binary/ast_to_binary.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698