Make sure isolate library is initialized before using isolate natives.

The compiler only adds 'startRootIsolate' if we use the dart:isolate library.

===
    if (hasIsolateSupport()) {
      enqueuer.codegen.addToWorkList(
          isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE));
      enqueuer.codegen.registerGetOfStaticFunction(main);
    }
===

However the isolate-native library requires some of the startRootIsolate
elements to be resolved. Therefore we must use the dart:isolate library
in the native-isolate tests.

Review URL: https://codereview.chromium.org//167493002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32709 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
floitsch@google.com 2014-02-14 19:10:38 +00:00
parent 2883d99e8e
commit b9dd61f71b
3 changed files with 8 additions and 3 deletions

View file

@ -501,6 +501,8 @@ typedef _MainFunction();
typedef _MainFunctionArgs(args);
typedef _MainFunctionArgsMessage(args, message);
/// Note: IsolateNatives depends on _globalState which is only set up correctly
/// when 'dart:isolate' has been imported.
class IsolateNatives {
static String thisScript = computeThisScript();

View file

@ -5,8 +5,14 @@
// Test of IsolateNatives.computeThisScript().
import 'dart:_isolate_helper';
// The isolate helper library is not correctly set up if the dart:isolate
// library hasn't been loaded.
import 'dart:isolate';
main() {
// Need to use the isolate-library so dart2js correctly initializes the
// library.
Capability cab = new Capability();
String script = IsolateNatives.computeThisScript();
// This is somewhat brittle and relies on an implementation detail

View file

@ -22,6 +22,3 @@ only_pass_on_d8_test: Fail, OK # This test should only pass on D8.
[ $browser || $runtime == d8 ]
only_pass_on_jsshell_test: Fail, OK # This test should only pass on jsshell.
[ $compiler == dart2js && $checked && $runtime == d8 ]
compute_this_script_test: Crash # TODO(floitsch): Mark as failing while debugging.