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

Unified Diff: sdk/lib/_internal/js_runtime/lib/isolate_helper.dart

Issue 1249023002: dart2js: support isolates in the startup-emitter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix typo. Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart b/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
index 5ff44bbc5f881fbeb560191959cdd340fa67b2dc..609f084377baa518cfee5ad1597e64c47c007e8e 100644
--- a/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
@@ -9,9 +9,9 @@ import 'dart:_js_embedded_names' show
CLASS_FIELDS_EXTRACTOR,
CREATE_NEW_ISOLATE,
CURRENT_SCRIPT,
- GLOBAL_FUNCTIONS,
INITIALIZE_EMPTY_INSTANCE,
- INSTANCE_FROM_CLASS_ID;
+ INSTANCE_FROM_CLASS_ID,
+ STATIC_FUNCTION_NAME_PROPERTY_NAME;
import 'dart:async';
import 'dart:collection' show Queue;
@@ -24,6 +24,7 @@ import 'dart:_js_helper' show
Null,
Primitives,
convertDartClosureToJS,
+ createDartClosureFromNameOfStaticFunction,
isDartObject,
random64,
requiresPreamble;
@@ -904,8 +905,7 @@ class IsolateNatives {
}
static _getJSFunctionFromName(String functionName) {
- var globalFunctionsContainer = JS_EMBEDDED_GLOBAL("", GLOBAL_FUNCTIONS);
- return JS("", "#[#]()", globalFunctionsContainer, functionName);
+ return createDartClosureFromNameOfStaticFunction(functionName);
}
/**
@@ -914,7 +914,9 @@ class IsolateNatives {
* but you should probably not count on this.
*/
static String _getJSFunctionName(Function f) {
- return (f is Closure) ? JS("String|Null", r'#.$name', f) : null;
+ return (f is Closure)
+ ? JS("String|Null", r'#[#]', f, STATIC_FUNCTION_NAME_PROPERTY_NAME)
+ : null;
}
/** Create a new JavaScript object instance given its constructor. */
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart ('k') | sdk/lib/_internal/js_runtime/lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698