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

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

Issue 11316264: Snapshotting changes for dart:html_common (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Sync to latest. 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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 } 410 }
411 411
412 void maybeEnableNative(Compiler compiler, 412 void maybeEnableNative(Compiler compiler,
413 LibraryElement library, 413 LibraryElement library,
414 Uri uri) { 414 Uri uri) {
415 String libraryName = uri.toString(); 415 String libraryName = uri.toString();
416 if (library.entryCompilationUnit.script.name.contains( 416 if (library.entryCompilationUnit.script.name.contains(
417 'dart/tests/compiler/dart2js_native') 417 'dart/tests/compiler/dart2js_native')
418 || libraryName == 'dart:isolate' 418 || libraryName == 'dart:isolate'
419 || libraryName == 'dart:html' 419 || libraryName == 'dart:html'
420 || libraryName == 'dart:html_common'
420 || libraryName == 'dart:svg' 421 || libraryName == 'dart:svg'
421 || libraryName == 'dart:web_audio') { 422 || libraryName == 'dart:web_audio') {
422 library.canUseNative = true; 423 library.canUseNative = true;
423 } 424 }
424 } 425 }
425 426
426 /** 427 /**
427 * A summary of the behavior of a native element. 428 * A summary of the behavior of a native element.
428 * 429 *
429 * Native code can return values of one type and cause native subtypes of 430 * Native code can return values of one type and cause native subtypes of
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 builder.add(new HForeign( 863 builder.add(new HForeign(
863 new DartString.literal('${parameter.name.slowToString()} = #'), 864 new DartString.literal('${parameter.name.slowToString()} = #'),
864 const LiteralDartString('void'), 865 const LiteralDartString('void'),
865 <HInstruction>[jsClosure])); 866 <HInstruction>[jsClosure]));
866 } 867 }
867 }); 868 });
868 LiteralString jsCode = nativeBody.asLiteralString(); 869 LiteralString jsCode = nativeBody.asLiteralString();
869 builder.push(new HForeign.statement(jsCode.dartString, <HInstruction>[])); 870 builder.push(new HForeign.statement(jsCode.dartString, <HInstruction>[]));
870 } 871 }
871 } 872 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/compiler.dart ('k') | sdk/lib/_internal/libraries.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698