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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1413213004: Move remaining helpers to BackendHelpers (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/cps_ir/type_mask_system.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/cps_ir/type_mask_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698