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

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

Issue 23258002: Load builtin helper libraries on demand. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments. Created 7 years, 4 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 | 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:collection' show Queue; 7 import 'dart:collection' show Queue;
8 import 'dart2jslib.dart' hide SourceString; 8 import 'dart2jslib.dart' hide SourceString;
9 import 'dart_types.dart'; 9 import 'dart_types.dart';
10 import 'elements/elements.dart'; 10 import 'elements/elements.dart';
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 ClassElement _annotationCreatesClass; 113 ClassElement _annotationCreatesClass;
114 ClassElement _annotationReturnsClass; 114 ClassElement _annotationReturnsClass;
115 ClassElement _annotationJsNameClass; 115 ClassElement _annotationJsNameClass;
116 116
117 /// Subclasses of [NativeEnqueuerBase] are constructed by the backend. 117 /// Subclasses of [NativeEnqueuerBase] are constructed by the backend.
118 NativeEnqueuerBase(this.world, this.compiler, this.enableLiveTypeAnalysis); 118 NativeEnqueuerBase(this.world, this.compiler, this.enableLiveTypeAnalysis);
119 119
120 void processNativeClasses(Iterable<LibraryElement> libraries) { 120 void processNativeClasses(Iterable<LibraryElement> libraries) {
121 libraries.forEach(processNativeClassesInLibrary); 121 libraries.forEach(processNativeClassesInLibrary);
122 processNativeClassesInLibrary(compiler.isolateHelperLibrary); 122 if (compiler.isolateHelperLibrary != null) {
123 123 processNativeClassesInLibrary(compiler.isolateHelperLibrary);
124 }
124 processSubclassesOfNativeClasses(libraries); 125 processSubclassesOfNativeClasses(libraries);
125
126 if (!enableLiveTypeAnalysis) { 126 if (!enableLiveTypeAnalysis) {
127 nativeClasses.forEach((c) => enqueueClass(c, 'forced')); 127 nativeClasses.forEach((c) => enqueueClass(c, 'forced'));
128 flushQueue(); 128 flushQueue();
129 } 129 }
130 } 130 }
131 131
132 void processNativeClassesInLibrary(LibraryElement library) { 132 void processNativeClassesInLibrary(LibraryElement library) {
133 // Use implementation to ensure the inclusion of injected members. 133 // Use implementation to ensure the inclusion of injected members.
134 library.implementation.forEachLocalMember((Element element) { 134 library.implementation.forEachLocalMember((Element element) {
135 if (element.isClass() && element.isNative()) { 135 if (element.isClass() && element.isNative()) {
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 'native "..." syntax is restricted to functions with zero parameters', 1143 'native "..." syntax is restricted to functions with zero parameters',
1144 node: nativeBody); 1144 node: nativeBody);
1145 } 1145 }
1146 LiteralString jsCode = nativeBody.asLiteralString(); 1146 LiteralString jsCode = nativeBody.asLiteralString();
1147 builder.push(new HForeign.statement( 1147 builder.push(new HForeign.statement(
1148 new js.LiteralStatement(jsCode.dartString.slowToString()), 1148 new js.LiteralStatement(jsCode.dartString.slowToString()),
1149 <HInstruction>[], 1149 <HInstruction>[],
1150 new SideEffects())); 1150 new SideEffects()));
1151 } 1151 }
1152 } 1152 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/library_loader.dart ('k') | tests/compiler/dart2js/library_load_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698