OLD | NEW |
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 library dart2js.ir_pickler; | 5 library dart2js.ir_pickler; |
6 | 6 |
7 import 'ir_nodes.dart'; | 7 import 'ir_nodes.dart'; |
8 import '../dart2jslib.dart' show | 8 import '../dart2jslib.dart' show |
9 Constant, FalseConstant, TrueConstant, IntConstant, DoubleConstant, | 9 Constant, FalseConstant, TrueConstant, IntConstant, DoubleConstant, |
10 StringConstant, NullConstant, ListConstant, MapConstant, | 10 StringConstant, NullConstant, ListConstant, MapConstant, |
11 InterceptorConstant, DummyReceiverConstant, FunctionConstant, TypeConstant, | 11 InterceptorConstant, FunctionConstant, TypeConstant, ConstructedConstant, |
12 ConstructedConstant, | |
13 ConstantVisitor, ConstantSystem, | 12 ConstantVisitor, ConstantSystem, |
14 Compiler; | 13 Compiler; |
15 import 'dart:typed_data' show ByteData, Endianness, Uint8List; | 14 import 'dart:typed_data' show ByteData, Endianness, Uint8List; |
16 import 'dart:convert' show UTF8; | 15 import 'dart:convert' show UTF8; |
17 import '../tree/tree.dart' show | 16 import '../tree/tree.dart' show |
18 DartString, LiteralDartString, RawSourceDartString, EscapedSourceDartString, | 17 DartString, LiteralDartString, RawSourceDartString, EscapedSourceDartString, |
19 ConsDartString; | 18 ConsDartString; |
20 import '../elements/elements.dart' show | 19 import '../elements/elements.dart' show |
21 Element, LibraryElement, FunctionElement; | 20 Element, LibraryElement, FunctionElement; |
22 import '../universe/universe.dart' show Selector, TypedSelector, SelectorKind; | 21 import '../universe/universe.dart' show Selector, TypedSelector, SelectorKind; |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 pickler.writeDartString(constant.value); | 454 pickler.writeDartString(constant.value); |
456 } | 455 } |
457 | 456 |
458 void visitNull(NullConstant constant) { | 457 void visitNull(NullConstant constant) { |
459 pickler.writeConstNull(); | 458 pickler.writeConstNull(); |
460 } | 459 } |
461 | 460 |
462 void visitList(ListConstant constant) => abort(constant); | 461 void visitList(ListConstant constant) => abort(constant); |
463 void visitMap(MapConstant constant) => abort(constant); | 462 void visitMap(MapConstant constant) => abort(constant); |
464 void visitInterceptor(InterceptorConstant constant) => abort(constant); | 463 void visitInterceptor(InterceptorConstant constant) => abort(constant); |
465 void visitDummyReceiver(DummyReceiverConstant constant) => abort(constant); | |
466 void visitFunction(FunctionConstant constant) => abort(constant); | 464 void visitFunction(FunctionConstant constant) => abort(constant); |
467 void visitType(TypeConstant constant) => abort(constant); | 465 void visitType(TypeConstant constant) => abort(constant); |
468 void visitConstructed(ConstructedConstant constant) => abort(constant); | 466 void visitConstructed(ConstructedConstant constant) => abort(constant); |
469 | 467 |
470 void abort(Constant value) => throw "Can not pickle constant $value"; | 468 void abort(Constant value) => throw "Can not pickle constant $value"; |
471 } | 469 } |
OLD | NEW |