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

Unified Diff: frog/gen.dart

Issue 8577003: Convert most of the javascript isolate code into Dart, inject JS code only when (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 9 years, 1 month 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
Index: frog/gen.dart
diff --git a/frog/gen.dart b/frog/gen.dart
index 0825425f9666fccafeb42b968fc734cee9d36d74..f79c83629d312b112124ffe157ff7a734c69cfaf 100644
--- a/frog/gen.dart
+++ b/frog/gen.dart
@@ -37,6 +37,16 @@ class WorldGenerator {
genMethod(
world.coreimpl.types['StringImplementation'].getMember('contains'));
+ // Only include isolate-specific code if isolates are used.
+ if (world.corelib.types['Isolate'].isUsed
+ || world.coreimpl.types['ReceivePortImpl'].isUsed) {
+ corejs.useIsolates = true;
+ MethodMember isolateMain =
+ world.coreimpl.topType.resolveMember('startAsIsolate').members[0];
+ mainCall = isolateMain.invoke(metaGen, null, null,
+ new Arguments(null, [main._get(metaGen, main.definition, null)]));
+ }
+
writeTypes(world.coreimpl);
writeTypes(world.corelib);
@@ -45,7 +55,7 @@ class WorldGenerator {
writeTypes(main.declaringType.library);
_writeGlobals();
- writer.writeln('RunEntry(function() {${mainCall.code};}, []);');
+ writer.writeln('${mainCall.code};');
}
GlobalValue globalForStaticField(FieldMember field, Value fieldValue,

Powered by Google App Engine
This is Rietveld 408576698