Remove dart:_isolate_helper.

The rest of the code was used in a single place, so I've moved the code to the
appropriate library.

Change-Id: Idd0416bf7365e3de05f20ab1184428ae7ae614b2
Reviewed-on: https://dart-review.googlesource.com/54745
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/compiler/lib/src/common/names.dart b/pkg/compiler/lib/src/common/names.dart
index 1237d5f..5d1116c 100644
--- a/pkg/compiler/lib/src/common/names.dart
+++ b/pkg/compiler/lib/src/common/names.dart
@@ -229,10 +229,6 @@
   static final Uri dart__js_embedded_names =
       new Uri(scheme: 'dart', path: '_js_embedded_names');
 
-  /// The URI for 'dart:_isolate_helper'.
-  static final Uri dart__isolate_helper =
-      new Uri(scheme: 'dart', path: '_isolate_helper');
-
   /// The URI for 'package:js'.
   static final Uri package_js = new Uri(scheme: 'package', path: 'js/js.dart');
 }
diff --git a/pkg/compiler/lib/src/common_elements.dart b/pkg/compiler/lib/src/common_elements.dart
index 2e87df4..33819fa 100644
--- a/pkg/compiler/lib/src/common_elements.dart
+++ b/pkg/compiler/lib/src/common_elements.dart
@@ -137,10 +137,6 @@
   LibraryEntity get foreignLibrary =>
       _foreignLibrary ??= _env.lookupLibrary(Uris.dart__foreign_helper);
 
-  LibraryEntity _isolateHelperLibrary;
-  LibraryEntity get isolateHelperLibrary =>
-      _isolateHelperLibrary ??= _env.lookupLibrary(Uris.dart__isolate_helper);
-
   /// Reference to the internal library to lookup functions to always inline.
   LibraryEntity _internalLibrary;
   LibraryEntity get internalLibrary => _internalLibrary ??=
diff --git a/pkg/compiler/lib/src/js_backend/backend_usage.dart b/pkg/compiler/lib/src/js_backend/backend_usage.dart
index ed8dced..3a62606 100644
--- a/pkg/compiler/lib/src/js_backend/backend_usage.dart
+++ b/pkg/compiler/lib/src/js_backend/backend_usage.dart
@@ -154,8 +154,7 @@
               element.sourcePosition.uri.path
                   .contains('_internal/js_runtime/lib/')) ||
           element.library == _commonElements.jsHelperLibrary ||
-          element.library == _commonElements.interceptorsLibrary ||
-          element.library == _commonElements.isolateHelperLibrary) {
+          element.library == _commonElements.interceptorsLibrary) {
         // TODO(johnniwinther): We should be more precise about these.
         return true;
       } else {
diff --git a/pkg/compiler/lib/src/kernel/dart2js_target.dart b/pkg/compiler/lib/src/kernel/dart2js_target.dart
index 25e4091..462ba79 100644
--- a/pkg/compiler/lib/src/kernel/dart2js_target.dart
+++ b/pkg/compiler/lib/src/kernel/dart2js_target.dart
@@ -80,7 +80,6 @@
     'dart:_foreign_helper',
     'dart:_interceptors',
     'dart:_internal',
-    'dart:_isolate_helper',
     'dart:_js_embedded_names',
     'dart:_js_helper',
     'dart:_js_names',
@@ -103,7 +102,6 @@
     'dart:_foreign_helper',
     'dart:_interceptors',
     'dart:_internal',
-    'dart:_isolate_helper',
     'dart:_js_embedded_names',
     'dart:_js_helper',
     'dart:_js_names',
diff --git a/pkg/compiler/lib/src/kernel/element_map_mixins.dart b/pkg/compiler/lib/src/kernel/element_map_mixins.dart
index 3588b19..a7f7901 100644
--- a/pkg/compiler/lib/src/kernel/element_map_mixins.dart
+++ b/pkg/compiler/lib/src/kernel/element_map_mixins.dart
@@ -158,7 +158,6 @@
       type ??= findIn(Uris.dart_core);
       type ??= findIn(Uris.dart__js_helper);
       type ??= findIn(Uris.dart__interceptors);
-      type ??= findIn(Uris.dart__isolate_helper);
       type ??= findIn(Uris.dart__native_typed_data);
       type ??= findIn(Uris.dart_collection);
       type ??= findIn(Uris.dart_math);
diff --git a/pkg/compiler/lib/src/kernel/kernel_strategy.dart b/pkg/compiler/lib/src/kernel/kernel_strategy.dart
index a0e7572..195881d 100644
--- a/pkg/compiler/lib/src/kernel/kernel_strategy.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_strategy.dart
@@ -103,8 +103,8 @@
 
   @override
   NativeClassFinder createNativeClassFinder(NativeBasicData nativeBasicData) {
-    return new BaseNativeClassFinder(_elementMap.elementEnvironment,
-        elementMap.commonElements, nativeBasicData);
+    return new BaseNativeClassFinder(
+        _elementMap.elementEnvironment, nativeBasicData);
   }
 
   NoSuchMethodResolver createNoSuchMethodResolver() {
diff --git a/pkg/compiler/lib/src/native/resolver.dart b/pkg/compiler/lib/src/native/resolver.dart
index fcc708e..e8af311 100644
--- a/pkg/compiler/lib/src/native/resolver.dart
+++ b/pkg/compiler/lib/src/native/resolver.dart
@@ -388,22 +388,16 @@
 
 class BaseNativeClassFinder implements NativeClassFinder {
   final ElementEnvironment _elementEnvironment;
-  final CommonElements _commonElements;
   final NativeBasicData _nativeBasicData;
 
   Map<String, ClassEntity> _tagOwner = new Map<String, ClassEntity>();
 
-  BaseNativeClassFinder(
-      this._elementEnvironment, this._commonElements, this._nativeBasicData);
+  BaseNativeClassFinder(this._elementEnvironment, this._nativeBasicData);
 
   Iterable<ClassEntity> computeNativeClasses(
       Iterable<LibraryEntity> libraries) {
     Set<ClassEntity> nativeClasses = new Set<ClassEntity>();
     libraries.forEach((l) => _processNativeClassesInLibrary(l, nativeClasses));
-    if (_commonElements.isolateHelperLibrary != null) {
-      _processNativeClassesInLibrary(
-          _commonElements.isolateHelperLibrary, nativeClasses);
-    }
     _processSubclassesOfNativeClasses(libraries, nativeClasses);
     return nativeClasses;
   }
@@ -512,7 +506,7 @@
       ElementEnvironment elementEnvironment,
       CommonElements commonElements,
       NativeBasicData nativeBasicData)
-      : super(elementEnvironment, commonElements, nativeBasicData);
+      : super(elementEnvironment, nativeBasicData);
 
   void _processNativeClass(
       ClassElement classElement, Set<ClassEntity> nativeClasses) {
diff --git a/sdk/lib/_internal/js_runtime/lib/async_patch.dart b/sdk/lib/_internal/js_runtime/lib/async_patch.dart
index eef525c..5ef35ee 100644
--- a/sdk/lib/_internal/js_runtime/lib/async_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/async_patch.dart
@@ -14,8 +14,6 @@
         wrapException,
         unwrapException;
 
-import 'dart:_isolate_helper' show TimerImpl;
-
 import 'dart:_foreign_helper' show JS, JS_GET_FLAG;
 
 import 'dart:_async_await_error_codes' as async_error_codes;
@@ -111,7 +109,7 @@
   static Timer _createTimer(Duration duration, void callback()) {
     int milliseconds = duration.inMilliseconds;
     if (milliseconds < 0) milliseconds = 0;
-    return new TimerImpl(milliseconds, callback);
+    return new _TimerImpl(milliseconds, callback);
   }
 
   @patch
@@ -119,10 +117,81 @@
       Duration duration, void callback(Timer timer)) {
     int milliseconds = duration.inMilliseconds;
     if (milliseconds < 0) milliseconds = 0;
-    return new TimerImpl.periodic(milliseconds, callback);
+    return new _TimerImpl.periodic(milliseconds, callback);
   }
 }
 
+class _TimerImpl implements Timer {
+  final bool _once;
+  int _handle;
+  int _tick = 0;
+
+  _TimerImpl(int milliseconds, void callback()) : _once = true {
+    if (_hasTimer()) {
+      void internalCallback() {
+        _handle = null;
+        this._tick = 1;
+        callback();
+      }
+
+      _handle = JS('int', 'self.setTimeout(#, #)',
+          convertDartClosureToJS(internalCallback, 0), milliseconds);
+    } else {
+      throw new UnsupportedError('`setTimeout()` not found.');
+    }
+  }
+
+  _TimerImpl.periodic(int milliseconds, void callback(Timer timer))
+      : _once = false {
+    if (_hasTimer()) {
+      int start = JS('int', 'Date.now()');
+      _handle = JS(
+          'int',
+          'self.setInterval(#, #)',
+          convertDartClosureToJS(() {
+            int tick = this._tick + 1;
+            if (milliseconds > 0) {
+              int duration = JS('int', 'Date.now()') - start;
+              if (duration > (tick + 1) * milliseconds) {
+                tick = duration ~/ milliseconds;
+              }
+            }
+            this._tick = tick;
+            callback(this);
+          }, 0),
+          milliseconds);
+    } else {
+      throw new UnsupportedError('Periodic timer.');
+    }
+  }
+
+  @override
+  bool get isActive => _handle != null;
+
+  @override
+  int get tick => _tick;
+
+  @override
+  void cancel() {
+    if (_hasTimer()) {
+      if (_handle == null) return;
+      if (_once) {
+        JS('void', 'self.clearTimeout(#)', _handle);
+      } else {
+        JS('void', 'self.clearInterval(#)', _handle);
+      }
+      _handle = null;
+    } else {
+      throw new UnsupportedError('Canceling a timer.');
+    }
+  }
+}
+
+bool _hasTimer() {
+  requiresPreamble();
+  return JS('', 'self.setTimeout') != null;
+}
+
 class _AsyncAwaitCompleter<T> implements Completer<T> {
   final _completer = new Completer<T>.sync();
   bool isSync;
diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart b/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
deleted file mode 100644
index 01f890b..0000000
--- a/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
+++ /dev/null
@@ -1,159 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library _isolate_helper;
-
-import 'dart:async';
-import 'dart:isolate';
-
-import 'dart:_js_embedded_names' show CURRENT_SCRIPT;
-
-import 'dart:_js_helper'
-    show convertDartClosureToJS, random64, requiresPreamble;
-
-import 'dart:_foreign_helper' show JS, JS_EMBEDDED_GLOBAL;
-
-import 'dart:_interceptors' show JSExtendableArray;
-
-/// Returns true if we are currently in a worker context.
-bool isWorker() {
-  requiresPreamble();
-  return JS('', '!self.window && !!self.postMessage');
-}
-
-/// The src url for the script tag that loaded this code.
-String thisScript = computeThisScript();
-
-/// The src url for the script tag that loaded this function.
-///
-/// Used to create JavaScript workers and load deferred libraries.
-String computeThisScript() {
-  var currentScript = JS_EMBEDDED_GLOBAL('', CURRENT_SCRIPT);
-  if (currentScript != null) {
-    return JS('String', 'String(#.src)', currentScript);
-  }
-  // A worker has no script tag - so get an url from a stack-trace.
-  if (isWorker()) return _computeThisScriptFromTrace();
-  // An isolate that doesn't support workers, but doesn't have a
-  // currentScript either. This is most likely a Chrome extension.
-  return null;
-}
-
-String _computeThisScriptFromTrace() {
-  var stack = JS('String|Null', 'new Error().stack');
-  if (stack == null) {
-    // According to Internet Explorer documentation, the stack
-    // property is not set until the exception is thrown. The stack
-    // property was not provided until IE10.
-    stack = JS(
-        'String|Null',
-        '(function() {'
-        'try { throw new Error() } catch(e) { return e.stack }'
-        '})()');
-    if (stack == null) throw new UnsupportedError('No stack trace');
-  }
-  var pattern, matches;
-
-  // This pattern matches V8, Chrome, and Internet Explorer stack
-  // traces that look like this:
-  // Error
-  //     at methodName (URI:LINE:COLUMN)
-  pattern = JS('', r'new RegExp("^ *at [^(]*\\((.*):[0-9]*:[0-9]*\\)$", "m")');
-
-  matches = JS('JSExtendableArray|Null', '#.match(#)', stack, pattern);
-  if (matches != null) return JS('String', '#[1]', matches);
-
-  // This pattern matches Firefox stack traces that look like this:
-  // methodName@URI:LINE
-  pattern = JS('', r'new RegExp("^[^@]*@(.*):[0-9]*$", "m")');
-
-  matches = JS('JSExtendableArray|Null', '#.match(#)', stack, pattern);
-  if (matches != null) return JS('String', '#[1]', matches);
-
-  throw new UnsupportedError('Cannot extract URI from "$stack"');
-}
-
-class ReceivePortImpl extends Stream implements ReceivePort {
-  ReceivePortImpl();
-
-  StreamSubscription listen(void onData(var event),
-      {Function onError, void onDone(), bool cancelOnError}) {
-    throw new UnsupportedError("ReceivePort.listen");
-  }
-
-  void close() {}
-
-  SendPort get sendPort => throw new UnsupportedError("ReceivePort.sendPort");
-}
-
-class TimerImpl implements Timer {
-  final bool _once;
-  int _handle;
-  int _tick = 0;
-
-  TimerImpl(int milliseconds, void callback()) : _once = true {
-    if (_hasTimer()) {
-      void internalCallback() {
-        _handle = null;
-        this._tick = 1;
-        callback();
-      }
-
-      _handle = JS('int', 'self.setTimeout(#, #)',
-          convertDartClosureToJS(internalCallback, 0), milliseconds);
-    } else {
-      throw new UnsupportedError('`setTimeout()` not found.');
-    }
-  }
-
-  TimerImpl.periodic(int milliseconds, void callback(Timer timer))
-      : _once = false {
-    if (_hasTimer()) {
-      int start = JS('int', 'Date.now()');
-      _handle = JS(
-          'int',
-          'self.setInterval(#, #)',
-          convertDartClosureToJS(() {
-            int tick = this._tick + 1;
-            if (milliseconds > 0) {
-              int duration = JS('int', 'Date.now()') - start;
-              if (duration > (tick + 1) * milliseconds) {
-                tick = duration ~/ milliseconds;
-              }
-            }
-            this._tick = tick;
-            callback(this);
-          }, 0),
-          milliseconds);
-    } else {
-      throw new UnsupportedError('Periodic timer.');
-    }
-  }
-
-  @override
-  bool get isActive => _handle != null;
-
-  @override
-  int get tick => _tick;
-
-  @override
-  void cancel() {
-    if (_hasTimer()) {
-      if (_handle == null) return;
-      if (_once) {
-        JS('void', 'self.clearTimeout(#)', _handle);
-      } else {
-        JS('void', 'self.clearInterval(#)', _handle);
-      }
-      _handle = null;
-    } else {
-      throw new UnsupportedError('Canceling a timer.');
-    }
-  }
-}
-
-bool _hasTimer() {
-  requiresPreamble();
-  return JS('', 'self.setTimeout') != null;
-}
diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
index cdb840b..37e6090 100644
--- a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
@@ -7,7 +7,6 @@
 import "dart:async";
 import 'dart:_foreign_helper' show JS;
 import 'dart:_js_helper' show patch;
-import 'dart:_isolate_helper' show ReceivePortImpl;
 
 @patch
 class Isolate {
@@ -107,7 +106,7 @@
 @patch
 class ReceivePort {
   @patch
-  factory ReceivePort() = ReceivePortImpl;
+  factory ReceivePort() = _ReceivePortImpl;
 
   @patch
   factory ReceivePort.fromRawReceivePort(RawReceivePort rawPort) {
@@ -115,6 +114,17 @@
   }
 }
 
+class _ReceivePortImpl extends Stream implements ReceivePort {
+  StreamSubscription listen(void onData(var event),
+      {Function onError, void onDone(), bool cancelOnError}) {
+    throw new UnsupportedError("ReceivePort.listen");
+  }
+
+  void close() {}
+
+  SendPort get sendPort => throw new UnsupportedError("ReceivePort.sendPort");
+}
+
 @patch
 class RawReceivePort {
   @patch
diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
index 1055a64..b5a370f 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
@@ -25,8 +25,6 @@
 
 import 'dart:collection';
 
-import 'dart:_isolate_helper' show thisScript, isWorker;
-
 import 'dart:async' show Completer, DeferredLoadException, Future;
 
 import 'dart:_foreign_helper'
@@ -3778,6 +3776,64 @@
   return JS('String', 'String(#.nonce)', currentScript);
 }
 
+/// Returns true if we are currently in a worker context.
+bool _isWorker() {
+  requiresPreamble();
+  return JS('', '!self.window && !!self.postMessage');
+}
+
+/// The src url for the script tag that loaded this code.
+String thisScript = _computeThisScript();
+
+/// The src url for the script tag that loaded this function.
+///
+/// Used to create JavaScript workers and load deferred libraries.
+String _computeThisScript() {
+  var currentScript = JS_EMBEDDED_GLOBAL('', CURRENT_SCRIPT);
+  if (currentScript != null) {
+    return JS('String', 'String(#.src)', currentScript);
+  }
+  // A worker has no script tag - so get an url from a stack-trace.
+  if (_isWorker()) return _computeThisScriptFromTrace();
+  // An isolate that doesn't support workers, but doesn't have a
+  // currentScript either. This is most likely a Chrome extension.
+  return null;
+}
+
+String _computeThisScriptFromTrace() {
+  var stack = JS('String|Null', 'new Error().stack');
+  if (stack == null) {
+    // According to Internet Explorer documentation, the stack
+    // property is not set until the exception is thrown. The stack
+    // property was not provided until IE10.
+    stack = JS(
+        'String|Null',
+        '(function() {'
+        'try { throw new Error() } catch(e) { return e.stack }'
+        '})()');
+    if (stack == null) throw new UnsupportedError('No stack trace');
+  }
+  var pattern, matches;
+
+  // This pattern matches V8, Chrome, and Internet Explorer stack
+  // traces that look like this:
+  // Error
+  //     at methodName (URI:LINE:COLUMN)
+  pattern = JS('', r'new RegExp("^ *at [^(]*\\((.*):[0-9]*:[0-9]*\\)$", "m")');
+
+  matches = JS('JSExtendableArray|Null', '#.match(#)', stack, pattern);
+  if (matches != null) return JS('String', '#[1]', matches);
+
+  // This pattern matches Firefox stack traces that look like this:
+  // methodName@URI:LINE
+  pattern = JS('', r'new RegExp("^[^@]*@(.*):[0-9]*$", "m")');
+
+  matches = JS('JSExtendableArray|Null', '#.match(#)', stack, pattern);
+  if (matches != null) return JS('String', '#[1]', matches);
+
+  throw new UnsupportedError('Cannot extract URI from "$stack"');
+}
+
 Future<Null> _loadHunk(String hunkName) {
   Future<Null> future = _loadingLibraries[hunkName];
   _eventLog.add(' - _loadHunk: $hunkName');
@@ -3823,7 +3879,7 @@
     } catch (error, stackTrace) {
       failure(error, "invoking dartDeferredLibraryLoader hook", stackTrace);
     }
-  } else if (isWorker()) {
+  } else if (_isWorker()) {
     // We are in a web worker. Load the code with an XMLHttpRequest.
     int index = uri.lastIndexOf('/');
     uri = '${uri.substring(0, index + 1)}$hunkName';
diff --git a/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart b/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart
index d6c32e0..5e1c046 100644
--- a/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart
+++ b/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart
@@ -157,11 +157,6 @@
       categories: "",
       documented: false,
       platforms: DART2JS_PLATFORM),
-  "_isolate_helper": const LibraryInfo(
-      "_internal/js_runtime/lib/isolate_helper.dart",
-      categories: "",
-      documented: false,
-      platforms: DART2JS_PLATFORM),
   "_js_names": const LibraryInfo("_internal/js_runtime/lib/js_names.dart",
       categories: "", documented: false, platforms: DART2JS_PLATFORM),
   "_js_primitives": const LibraryInfo(
diff --git a/sdk/lib/dart_client.platform b/sdk/lib/dart_client.platform
index 7002d78..805ac5c 100644
--- a/sdk/lib/dart_client.platform
+++ b/sdk/lib/dart_client.platform
@@ -47,7 +47,6 @@
 _js_helper: _internal/js_runtime/lib/js_helper.dart
 _interceptors: _internal/js_runtime/lib/interceptors.dart
 _foreign_helper: _internal/js_runtime/lib/foreign_helper.dart
-_isolate_helper: _internal/js_runtime/lib/isolate_helper.dart
 _js_names: _internal/js_runtime/lib/js_names.dart
 _js_primitives: _internal/js_runtime/lib/js_primitives.dart
 _js_embedded_names: _internal/js_runtime/lib/shared/embedded_names.dart
diff --git a/sdk/lib/dart_server.platform b/sdk/lib/dart_server.platform
index 7b72e67..290e1ef 100644
--- a/sdk/lib/dart_server.platform
+++ b/sdk/lib/dart_server.platform
@@ -44,7 +44,6 @@
 _js_helper: _internal/js_runtime/lib/js_helper.dart
 _interceptors: _internal/js_runtime/lib/interceptors.dart
 _foreign_helper: _internal/js_runtime/lib/foreign_helper.dart
-_isolate_helper: _internal/js_runtime/lib/isolate_helper.dart
 _js_names: _internal/js_runtime/lib/js_names.dart
 _js_primitives: _internal/js_runtime/lib/js_primitives.dart
 _js_embedded_names: _internal/js_runtime/lib/shared/embedded_names.dart
diff --git a/sdk/lib/dart_shared.platform b/sdk/lib/dart_shared.platform
index b9006e1..e8aa11c 100644
--- a/sdk/lib/dart_shared.platform
+++ b/sdk/lib/dart_shared.platform
@@ -41,7 +41,6 @@
 _js_helper: _internal/js_runtime/lib/js_helper.dart
 _interceptors: _internal/js_runtime/lib/interceptors.dart
 _foreign_helper: _internal/js_runtime/lib/foreign_helper.dart
-_isolate_helper: _internal/js_runtime/lib/isolate_helper.dart
 _js_names: _internal/js_runtime/lib/js_names.dart
 _js_primitives: _internal/js_runtime/lib/js_primitives.dart
 _js_embedded_names: _internal/js_runtime/lib/shared/embedded_names.dart
diff --git a/sdk/lib/libraries.json b/sdk/lib/libraries.json
index 966cd97..9f3f684 100644
--- a/sdk/lib/libraries.json
+++ b/sdk/lib/libraries.json
@@ -245,9 +245,6 @@
         "patches": "_internal/js_runtime/lib/convert_patch.dart",
         "uri": "convert/convert.dart"
       },
-      "_isolate_helper": {
-        "uri": "_internal/js_runtime/lib/isolate_helper.dart"
-      },
       "math": {
         "patches": "_internal/js_runtime/lib/math_patch.dart",
         "uri": "math/math.dart"
@@ -342,9 +339,6 @@
         "patches": "_internal/js_runtime/lib/convert_patch.dart",
         "uri": "convert/convert.dart"
       },
-      "_isolate_helper": {
-        "uri": "_internal/js_runtime/lib/isolate_helper.dart"
-      },
       "math": {
         "patches": "_internal/js_runtime/lib/math_patch.dart",
         "uri": "math/math.dart"
diff --git a/sdk/lib/libraries.yaml b/sdk/lib/libraries.yaml
index 09e8e6f..92c2391 100644
--- a/sdk/lib/libraries.yaml
+++ b/sdk/lib/libraries.yaml
@@ -242,9 +242,6 @@
     _foreign_helper:
       uri: "_internal/js_runtime/lib/foreign_helper.dart"
 
-    _isolate_helper:
-      uri: "_internal/js_runtime/lib/isolate_helper.dart"
-
     _js_names:
       uri: "_internal/js_runtime/lib/js_names.dart"
 
@@ -334,9 +331,6 @@
     _foreign_helper:
       uri: "_internal/js_runtime/lib/foreign_helper.dart"
 
-    _isolate_helper:
-      uri: "_internal/js_runtime/lib/isolate_helper.dart"
-
     _js_names:
       uri: "_internal/js_runtime/lib/js_names.dart"
 
diff --git a/tests/compiler/dart2js_extra/dummy_compiler_test.dart b/tests/compiler/dart2js_extra/dummy_compiler_test.dart
index 3e3a64f..0c13dbb 100644
--- a/tests/compiler/dart2js_extra/dummy_compiler_test.dart
+++ b/tests/compiler/dart2js_extra/dummy_compiler_test.dart
@@ -27,8 +27,6 @@
     return buildLibrarySource(DEFAULT_INTERCEPTORS_LIBRARY);
   } else if (uri.path.endsWith('js_helper.dart')) {
     return buildLibrarySource(DEFAULT_JS_HELPER_LIBRARY);
-  } else if (uri.path.endsWith('isolate_helper.dart')) {
-    return buildLibrarySource(DEFAULT_ISOLATE_HELPER_LIBRARY);
   } else if (uri.path.endsWith('/async.dart')) {
     return buildLibrarySource(DEFAULT_ASYNC_LIBRARY);
   } else {
diff --git a/tests/compiler/dart2js_extra/mock_libraries.dart b/tests/compiler/dart2js_extra/mock_libraries.dart
index f5f6e63..025f221 100644
--- a/tests/compiler/dart2js_extra/mock_libraries.dart
+++ b/tests/compiler/dart2js_extra/mock_libraries.dart
@@ -13,7 +13,6 @@
 _js_helper:_internal/js_runtime/lib/js_helper.dart
 _interceptors:_internal/js_runtime/lib/interceptors.dart
 _internal:internal/internal.dart
-_isolate_helper:_internal/js_runtime/lib/isolate_helper.dart
 """;
 
 String buildLibrarySource(Map<String, String> elementMap,
@@ -130,7 +129,6 @@
 const String DEFAULT_PATCH_CORE_SOURCE = r'''
 import 'dart:_js_helper';
 import 'dart:_interceptors';
-import 'dart:_isolate_helper';
 import 'dart:async';
 
 @patch
@@ -436,14 +434,6 @@
   'JavaScriptFunction': 'class JavaScriptFunction {}',
 };
 
-const Map<String, String> DEFAULT_ISOLATE_HELPER_LIBRARY =
-    const <String, String>{
-  'startRootIsolate': 'void startRootIsolate(entry, args) {}',
-  '_currentIsolate': 'var _currentIsolate;',
-  '_callInIsolate': 'var _callInIsolate;',
-  '_WorkerBase': 'class _WorkerBase {}',
-};
-
 const Map<String, String> DEFAULT_ASYNC_LIBRARY = const <String, String>{
   'DeferredLibrary': 'class DeferredLibrary {}',
   'Future': '''
diff --git a/tests/compiler/dart2js_native/compute_this_script_test.dart b/tests/compiler/dart2js_native/compute_this_script_test.dart
index 2cdfb52..fcf4539 100644
--- a/tests/compiler/dart2js_native/compute_this_script_test.dart
+++ b/tests/compiler/dart2js_native/compute_this_script_test.dart
@@ -2,17 +2,15 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// Test of IsolateNatives.computeThisScript().
+// Test of _computeThisScript().
 
-import 'dart:_isolate_helper';
+import 'dart:_js_helper' show thisScript;
 
 main() {
-  String script = computeThisScript();
-
   // This is somewhat brittle and relies on an implementation detail
   // of our test runner, but I can think of no other way to test this.
   // -- ahe
-  if (!script.endsWith('/out.js')) {
-    throw 'Unexpected script: "$script"';
+  if (!thisScript.endsWith('/out.js')) {
+    throw 'Unexpected script: "$thiscript"';
   }
 }