Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
index 5e224e25438c518d8e2f62451d016941f83e659f..5427b8289006601807115bed002a61014fef7c26 100644 |
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
@@ -22,6 +22,8 @@ import '../elements/modelx.dart' show |
ConstructorBodyElementX, |
FunctionSignatureX; |
import '../io/source_information.dart'; |
+import '../js_backend/backend_helpers.dart' show |
+ BackendHelpers; |
import '../js_backend/js_backend.dart' show |
JavaScriptBackend, |
SyntheticConstantKind; |
@@ -2535,6 +2537,7 @@ class JsIrBuilderVisitor extends IrBuilderVisitor { |
SourceInformationBuilder sourceInformationBuilder) |
: super(elements, compiler, sourceInformationBuilder); |
+ BackendHelpers get helpers => backend.helpers; |
/// Builds the IR for creating an instance of the closure class corresponding |
/// to the given nested function. |
@@ -3371,9 +3374,8 @@ class JsIrBuilderVisitor extends IrBuilderVisitor { |
/// Call a helper method from the isolate library. The isolate library uses |
/// its own isolate structure, that encapsulates dart2js's isolate. |
- ir.Primitive buildIsolateHelperInvocation(String helperName, |
+ ir.Primitive buildIsolateHelperInvocation(Element element, |
CallStructure callStructure) { |
- Element element = backend.isolateHelperLibrary.find(helperName); |
if (element == null) { |
reporter.internalError(node, |
'Isolate library and compiler mismatch.'); |
@@ -3455,7 +3457,7 @@ class JsIrBuilderVisitor extends IrBuilderVisitor { |
validateArgumentCount(minimum: 2); |
ast.Node builtin = argumentNodes.tail.head; |
- JsBuiltin value = getEnumValue(builtin, backend.jsBuiltinEnum, |
+ JsBuiltin value = getEnumValue(builtin, helpers.jsBuiltinEnum, |
JsBuiltin.values); |
js.Template template = backend.emitter.builtinTemplateFor(value); |
List<ir.Primitive> arguments = |
@@ -3493,7 +3495,7 @@ class JsIrBuilderVisitor extends IrBuilderVisitor { |
validateArgumentCount(exactly: 1); |
ast.Node argument = argumentNodes.head; |
- JsGetName id = getEnumValue(argument, backend.jsGetNameEnum, |
+ JsGetName id = getEnumValue(argument, helpers.jsGetNameEnum, |
JsGetName.values); |
js.Name name = backend.namer.getNameForJsGetName(argument, id); |
ConstantValue nameConstant = |
@@ -3532,7 +3534,7 @@ class JsIrBuilderVisitor extends IrBuilderVisitor { |
// to fetch the current isolate. |
continue getStaticState; |
} |
- return buildIsolateHelperInvocation('_currentIsolate', |
+ return buildIsolateHelperInvocation(backend.helpers.currentIsolate, |
CallStructure.NO_ARGS); |
getStaticState: case 'JS_GET_STATIC_STATE': |
@@ -3561,7 +3563,7 @@ class JsIrBuilderVisitor extends IrBuilderVisitor { |
return irBuilder.buildCallInvocation(closure, CallStructure.NO_ARGS, |
const <ir.Primitive>[]); |
} |
- return buildIsolateHelperInvocation('_callInIsolate', |
+ return buildIsolateHelperInvocation(backend.helpers.callInIsolate, |
CallStructure.TWO_ARGS); |
default: |