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

Unified Diff: sdk/lib/_internal/compiler/implementation/compiler.dart

Issue 11574030: Revert r16155: unit tests of the dart2js compiler fail. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/compiler.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/compiler.dart (revision 16155)
+++ sdk/lib/_internal/compiler/implementation/compiler.dart (working copy)
@@ -403,6 +403,11 @@
void enableIsolateSupport(LibraryElement element) {
// TODO(ahe): Move this method to Enqueuer.
isolateLibrary = element.patch;
+ isolateHelperLibrary = scanBuiltinLibrary('_isolate_helper');
+ importForeignLibrary(isolateHelperLibrary);
+ importHelperLibrary(isolateHelperLibrary);
+
+ libraryLoader.importLibrary(isolateLibrary, isolateHelperLibrary, null);
enqueuer.resolution.addToWorkList(
isolateHelperLibrary.find(START_ROOT_ISOLATE));
enqueuer.resolution.addToWorkList(
@@ -411,6 +416,20 @@
isolateHelperLibrary.find(const SourceString('_callInIsolate')));
enqueuer.codegen.addToWorkList(
isolateHelperLibrary.find(START_ROOT_ISOLATE));
+
+ // The helper library does not use the native language extension,
+ // so we manually set the native classes this library defines.
+ // TODO(ngeoffray): Enable annotations on these classes.
+ ClassElement cls = isolateHelperLibrary.find(const SourceString('_Window'));
+ cls.setNative('"*DOMWindow"');
+
+ cls = isolateHelperLibrary.find(const SourceString('_WorkerStub'));
+ cls.setNative('"*Worker"');
+
+ enqueuer.resolution.nativeEnqueuer.processNativeClassesInLibrary(
+ isolateHelperLibrary);
+ enqueuer.codegen.nativeEnqueuer.processNativeClassesInLibrary(
+ isolateHelperLibrary);
}
bool hasIsolateSupport() => isolateLibrary != null;
@@ -466,13 +485,6 @@
jsHelperLibrary = scanBuiltinLibrary('_js_helper');
interceptorsLibrary = scanBuiltinLibrary('_interceptors');
foreignLibrary = scanBuiltinLibrary('_foreign_helper');
- isolateHelperLibrary = scanBuiltinLibrary('_isolate_helper');
- // The helper library does not use the native language extension,
- // so we manually set the native classes this library defines.
- // TODO(ngeoffray): Enable annotations on these classes.
- ClassElement cls =
- isolateHelperLibrary.find(const SourceString('_WorkerStub'));
- cls.setNative('"*Worker"');
// The core library was loaded and patched before jsHelperLibrary was
// initialized, so it wasn't imported into those two libraries during
@@ -483,9 +495,6 @@
importForeignLibrary(jsHelperLibrary);
importForeignLibrary(interceptorsLibrary);
- importForeignLibrary(isolateHelperLibrary);
- importHelperLibrary(isolateHelperLibrary);
-
assertMethod = jsHelperLibrary.find(const SourceString('assertHelper'));
identicalFunction = coreLibrary.find(const SourceString('identical'));
@@ -518,12 +527,6 @@
}
}
- void importIsolateHelperLibrary(LibraryElement library) {
- if (isolateHelperLibrary != null) {
- libraryLoader.importLibrary(library, isolateHelperLibrary, null);
- }
- }
-
// TODO(karlklose,floitsch): move this to the javascript backend.
/** Enable the 'JS' helper for a library if needed. */
void maybeEnableJSHelper(LibraryElement library) {
@@ -559,21 +562,12 @@
}
}
- void maybeEnableIsolateHelper(LibraryElement library) {
- String libraryName = library.uri.toString();
- if (libraryName == 'dart:isolate'
- || libraryName == 'dart:html') {
- importIsolateHelperLibrary(library);
- }
- }
-
void runCompiler(Uri uri) {
log('compiling $uri ($BUILD_ID)');
scanBuiltinLibraries();
mainApp = libraryLoader.loadLibrary(uri, null, uri);
libraries.forEach((_, library) {
maybeEnableJSHelper(library);
- maybeEnableIsolateHelper(library);
});
final Element main = mainApp.find(MAIN);
if (main == null) {
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698