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

Side by Side Diff: pkg/kernel/lib/binary/ast_to_binary.dart

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_from_binary.dart ('k') | 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) 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 library kernel.ast_to_binary; 4 library kernel.ast_to_binary;
5 5
6 import '../ast.dart'; 6 import '../ast.dart';
7 import '../import_table.dart'; 7 import '../import_table.dart';
8 import 'tag.dart'; 8 import 'tag.dart';
9 import 'dart:convert'; 9 import 'dart:convert';
10 import 'dart:typed_data'; 10 import 'dart:typed_data';
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 } else { 1123 } else {
1124 writeByte(Tag.InterfaceType); 1124 writeByte(Tag.InterfaceType);
1125 writeReference(node.className); 1125 writeReference(node.className);
1126 writeNodeList(node.typeArguments); 1126 writeNodeList(node.typeArguments);
1127 } 1127 }
1128 } 1128 }
1129 1129
1130 visitFunctionType(FunctionType node) { 1130 visitFunctionType(FunctionType node) {
1131 if (node.requiredParameterCount == node.positionalParameters.length && 1131 if (node.requiredParameterCount == node.positionalParameters.length &&
1132 node.typeParameters.isEmpty && 1132 node.typeParameters.isEmpty &&
1133 node.namedParameters.isEmpty) { 1133 node.namedParameters.isEmpty &&
1134 node.typedefReference == null) {
1134 writeByte(Tag.SimpleFunctionType); 1135 writeByte(Tag.SimpleFunctionType);
1135 writeNodeList(node.positionalParameters); 1136 writeNodeList(node.positionalParameters);
1136 writeStringReferenceList(node.positionalParameterNames); 1137 writeStringReferenceList(node.positionalParameterNames);
1137 writeNode(node.returnType); 1138 writeNode(node.returnType);
1138 } else { 1139 } else {
1139 writeByte(Tag.FunctionType); 1140 writeByte(Tag.FunctionType);
1140 _typeParameterIndexer.enter(node.typeParameters); 1141 _typeParameterIndexer.enter(node.typeParameters);
1141 writeNodeList(node.typeParameters); 1142 writeNodeList(node.typeParameters);
1142 writeUInt30(node.requiredParameterCount); 1143 writeUInt30(node.requiredParameterCount);
1143 writeUInt30( 1144 writeUInt30(
1144 node.positionalParameters.length + node.namedParameters.length); 1145 node.positionalParameters.length + node.namedParameters.length);
1145 writeNodeList(node.positionalParameters); 1146 writeNodeList(node.positionalParameters);
1146 writeNodeList(node.namedParameters); 1147 writeNodeList(node.namedParameters);
1147 writeStringReferenceList(node.positionalParameterNames); 1148 writeStringReferenceList(node.positionalParameterNames);
1149 writeReference(node.typedefReference);
1148 writeNode(node.returnType); 1150 writeNode(node.returnType);
1149 _typeParameterIndexer.exit(node.typeParameters); 1151 _typeParameterIndexer.exit(node.typeParameters);
1150 } 1152 }
1151 } 1153 }
1152 1154
1153 visitNamedType(NamedType node) { 1155 visitNamedType(NamedType node) {
1154 writeStringReference(node.name); 1156 writeStringReference(node.name);
1155 writeNode(node.type); 1157 writeNode(node.type);
1156 } 1158 }
1157 1159
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 _sink.add(_buffer.sublist(0, length)); 1570 _sink.add(_buffer.sublist(0, length));
1569 _buffer = new Uint8List(SIZE); 1571 _buffer = new Uint8List(SIZE);
1570 flushedLength += length; 1572 flushedLength += length;
1571 length = 0; 1573 length = 0;
1572 } 1574 }
1573 1575
1574 void flushAndDestroy() { 1576 void flushAndDestroy() {
1575 _sink.add(_buffer.sublist(0, length)); 1577 _sink.add(_buffer.sublist(0, length));
1576 } 1578 }
1577 } 1579 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/binary/ast_from_binary.dart ('k') | runtime/vm/kernel_binary_flowgraph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698