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

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

Issue 3003863002: [kernel] Position on switch expression (Closed)
Patch Set: ... Created 3 years, 3 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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 writeOffset(node.bodyOffset); 962 writeOffset(node.bodyOffset);
963 writeVariableDeclaration(node.variable); 963 writeVariableDeclaration(node.variable);
964 writeNode(node.iterable); 964 writeNode(node.iterable);
965 writeNode(node.body); 965 writeNode(node.body);
966 _variableIndexer.popScope(); 966 _variableIndexer.popScope();
967 } 967 }
968 968
969 visitSwitchStatement(SwitchStatement node) { 969 visitSwitchStatement(SwitchStatement node) {
970 _switchCaseIndexer.enter(node); 970 _switchCaseIndexer.enter(node);
971 writeByte(Tag.SwitchStatement); 971 writeByte(Tag.SwitchStatement);
972 writeOffset(node.fileOffset);
972 writeNode(node.expression); 973 writeNode(node.expression);
973 writeNodeList(node.cases); 974 writeNodeList(node.cases);
974 _switchCaseIndexer.exit(node); 975 _switchCaseIndexer.exit(node);
975 } 976 }
976 977
977 visitSwitchCase(SwitchCase node) { 978 visitSwitchCase(SwitchCase node) {
978 // Note: there is no tag on SwitchCase. 979 // Note: there is no tag on SwitchCase.
979 int length = node.expressions.length; 980 int length = node.expressions.length;
980 writeUInt30(length); 981 writeUInt30(length);
981 for (int i = 0; i < length; ++i) { 982 for (int i = 0; i < length; ++i) {
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1551 _sink.add(_buffer.sublist(0, length)); 1552 _sink.add(_buffer.sublist(0, length));
1552 _buffer = new Uint8List(SIZE); 1553 _buffer = new Uint8List(SIZE);
1553 flushedLength += length; 1554 flushedLength += length;
1554 length = 0; 1555 length = 0;
1555 } 1556 }
1556 1557
1557 void flushAndDestroy() { 1558 void flushAndDestroy() {
1558 _sink.add(_buffer.sublist(0, length)); 1559 _sink.add(_buffer.sublist(0, length));
1559 } 1560 }
1560 } 1561 }
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