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

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

Issue 2778223002: Add primitive to create closures and use it for closure conversion (Closed)
Patch Set: Skip context param in closure type construction, rather than remove it Created 3 years, 8 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
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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 writeNode(node.vectorExpression); 744 writeNode(node.vectorExpression);
745 writeUInt30(node.index); 745 writeUInt30(node.index);
746 writeNode(node.value); 746 writeNode(node.value);
747 } 747 }
748 748
749 visitVectorCopy(VectorCopy node) { 749 visitVectorCopy(VectorCopy node) {
750 writeByte(Tag.VectorCopy); 750 writeByte(Tag.VectorCopy);
751 writeNode(node.vectorExpression); 751 writeNode(node.vectorExpression);
752 } 752 }
753 753
754 visitClosureCreation(ClosureCreation node) {
755 writeByte(Tag.ClosureCreation);
756 writeMemberReference(node.topLevelFunctionReference.asMember);
asgerf 2017/03/31 12:08:43 Please use: writeReference(node.topLevelFunctionRe
Dmitry Stefantsov 2017/03/31 12:40:18 Thanks! Done.
757 writeNode(node.contextVector);
758 writeNode(node.functionType);
759 }
760
754 writeStatementOrEmpty(Statement node) { 761 writeStatementOrEmpty(Statement node) {
755 if (node == null) { 762 if (node == null) {
756 writeByte(Tag.EmptyStatement); 763 writeByte(Tag.EmptyStatement);
757 } else { 764 } else {
758 writeNode(node); 765 writeNode(node);
759 } 766 }
760 } 767 }
761 768
762 visitInvalidStatement(InvalidStatement node) { 769 visitInvalidStatement(InvalidStatement node) {
763 writeByte(Tag.InvalidStatement); 770 writeByte(Tag.InvalidStatement);
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 void flush() { 1304 void flush() {
1298 _sink.add(_buffer.sublist(0, length)); 1305 _sink.add(_buffer.sublist(0, length));
1299 _buffer = new Uint8List(SIZE); 1306 _buffer = new Uint8List(SIZE);
1300 length = 0; 1307 length = 0;
1301 } 1308 }
1302 1309
1303 void flushAndDestroy() { 1310 void flushAndDestroy() {
1304 _sink.add(_buffer.sublist(0, length)); 1311 _sink.add(_buffer.sublist(0, length));
1305 } 1312 }
1306 } 1313 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698