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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/native_handler.dart

Issue 11615023: Version 0.2.9.7 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 8 years 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 | Annotate | Revision Log
OLDNEW
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:uri'; 7 import 'dart:uri';
8 import 'dart2jslib.dart' hide SourceString; 8 import 'dart2jslib.dart' hide SourceString;
9 import 'elements/elements.dart'; 9 import 'elements/elements.dart';
10 import 'js_backend/js_backend.dart'; 10 import 'js_backend/js_backend.dart';
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 '${unusedClasses.length} native classes omitted.'); 446 '${unusedClasses.length} native classes omitted.');
447 } 447 }
448 } 448 }
449 449
450 void maybeEnableNative(Compiler compiler, 450 void maybeEnableNative(Compiler compiler,
451 LibraryElement library, 451 LibraryElement library,
452 Uri uri) { 452 Uri uri) {
453 String libraryName = uri.toString(); 453 String libraryName = uri.toString();
454 if (library.entryCompilationUnit.script.name.contains( 454 if (library.entryCompilationUnit.script.name.contains(
455 'dart/tests/compiler/dart2js_native') 455 'dart/tests/compiler/dart2js_native')
456 || libraryName == 'dart:isolate'
456 || libraryName == 'dart:html' 457 || libraryName == 'dart:html'
457 || libraryName == 'dart:html_common' 458 || libraryName == 'dart:html_common'
458 || libraryName == 'dart:indexed_db' 459 || libraryName == 'dart:indexed_db'
459 || libraryName == 'dart:svg' 460 || libraryName == 'dart:svg'
460 || libraryName == 'dart:web_audio') { 461 || libraryName == 'dart:web_audio') {
461 library.canUseNative = true; 462 library.canUseNative = true;
462 } 463 }
463 } 464 }
464 465
465 /** 466 /**
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 builder.add(new HForeign( 889 builder.add(new HForeign(
889 new DartString.literal('${parameter.name.slowToString()} = #'), 890 new DartString.literal('${parameter.name.slowToString()} = #'),
890 const LiteralDartString('void'), 891 const LiteralDartString('void'),
891 <HInstruction>[jsClosure])); 892 <HInstruction>[jsClosure]));
892 } 893 }
893 }); 894 });
894 LiteralString jsCode = nativeBody.asLiteralString(); 895 LiteralString jsCode = nativeBody.asLiteralString();
895 builder.push(new HForeign.statement(jsCode.dartString, <HInstruction>[])); 896 builder.push(new HForeign.statement(jsCode.dartString, <HInstruction>[]));
896 } 897 }
897 } 898 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698