OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 native; | 5 library native; |
6 | 6 |
7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
8 import 'dart2jslib.dart'; | 8 import 'dart2jslib.dart'; |
9 import 'dart_types.dart'; | 9 import 'dart_types.dart'; |
10 import 'elements/elements.dart'; | 10 import 'elements/elements.dart'; |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 LibraryElement library) { | 616 LibraryElement library) { |
617 String libraryName = library.canonicalUri.toString(); | 617 String libraryName = library.canonicalUri.toString(); |
618 if (library.entryCompilationUnit.script.name.contains( | 618 if (library.entryCompilationUnit.script.name.contains( |
619 'dart/tests/compiler/dart2js_native') | 619 'dart/tests/compiler/dart2js_native') |
620 || libraryName == 'dart:async' | 620 || libraryName == 'dart:async' |
621 || libraryName == 'dart:html' | 621 || libraryName == 'dart:html' |
622 || libraryName == 'dart:html_common' | 622 || libraryName == 'dart:html_common' |
623 || libraryName == 'dart:indexed_db' | 623 || libraryName == 'dart:indexed_db' |
624 || libraryName == 'dart:js' | 624 || libraryName == 'dart:js' |
625 || libraryName == 'dart:svg' | 625 || libraryName == 'dart:svg' |
626 || libraryName == 'dart:_native_typed_data' | 626 || libraryName == 'dart:typed_data' |
627 || libraryName == 'dart:web_audio' | 627 || libraryName == 'dart:web_audio' |
628 || libraryName == 'dart:web_gl' | 628 || libraryName == 'dart:web_gl' |
629 || libraryName == 'dart:web_sql') { | 629 || libraryName == 'dart:web_sql') { |
630 library.canUseNative = true; | 630 library.canUseNative = true; |
631 } | 631 } |
632 } | 632 } |
633 | 633 |
634 class SideEffectsVisitor extends js.BaseVisitor { | 634 class SideEffectsVisitor extends js.BaseVisitor { |
635 final SideEffects sideEffects; | 635 final SideEffects sideEffects; |
636 SideEffectsVisitor(this.sideEffects); | 636 SideEffectsVisitor(this.sideEffects); |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 } | 1135 } |
1136 LiteralString jsCode = nativeBody.asLiteralString(); | 1136 LiteralString jsCode = nativeBody.asLiteralString(); |
1137 builder.push(new HForeign.statement( | 1137 builder.push(new HForeign.statement( |
1138 new js.LiteralStatement(jsCode.dartString.slowToString()), | 1138 new js.LiteralStatement(jsCode.dartString.slowToString()), |
1139 <HInstruction>[], | 1139 <HInstruction>[], |
1140 new SideEffects(), | 1140 new SideEffects(), |
1141 null, | 1141 null, |
1142 backend.dynamicType)); | 1142 backend.dynamicType)); |
1143 } | 1143 } |
1144 } | 1144 } |
OLD | NEW |