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

Unified Diff: pkg/compiler/lib/src/ssa/codegen.dart

Issue 2608143002: Refactor BackendHelpers to make 'find' methods private. (Closed)
Patch Set: Fix Created 3 years, 12 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: pkg/compiler/lib/src/ssa/codegen.dart
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index 2b3d5d49ac71a822ebbb4bc022b64ed50d4e6081..c9f4ae810d3668804a13294475c23b2c5a257280 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -2939,14 +2939,15 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
if (!optionalParameterTypes.isEmpty) {
arguments.add(new js.ArrayInitializer(optionalParameterTypes));
}
- push(js.js('#(#)', [accessHelper('buildFunctionType'), arguments]));
+ push(js.js('#(#)', [accessHelper(helpers.buildFunctionType), arguments]));
} else {
var arguments = [
returnType,
new js.ArrayInitializer(parameterTypes),
new js.ObjectInitializer(namedParameters)
];
- push(js.js('#(#)', [accessHelper('buildNamedFunctionType'), arguments]));
+ push(js.js(
+ '#(#)', [accessHelper(helpers.buildNamedFunctionType), arguments]));
}
}
@@ -3077,23 +3078,25 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
if (!typeArguments.isEmpty) {
arguments.add(new js.ArrayInitializer(typeArguments));
}
- push(js.js('#(#)',
- [accessHelper('buildInterfaceType', arguments.length), arguments]));
+ push(js.js('#(#)', [
+ accessHelper(helpers.buildInterfaceType, arguments.length),
+ arguments
+ ]));
}
void visitVoidType(HVoidType node) {
- push(js.js('#()', accessHelper('getVoidRuntimeType')));
+ push(js.js('#()', accessHelper(helpers.getVoidRuntimeType)));
}
void visitDynamicType(HDynamicType node) {
- push(js.js('#()', accessHelper('getDynamicRuntimeType')));
+ push(js.js('#()', accessHelper(helpers.getDynamicRuntimeType)));
}
- js.PropertyAccess accessHelper(String name, [int argumentCount = 0]) {
- Element helper = helpers.findHelper(name);
+ js.PropertyAccess accessHelper(FunctionEntity helper,
+ [int argumentCount = 0]) {
if (helper == null) {
// For mocked-up tests.
- return js.js('(void 0).$name');
+ return js.js('(void 0).dummy');
Siggi Cherem (dart-lang) 2017/01/03 17:05:37 could mock up tests be relying on the old name her
Johnni Winther 2017/01/04 10:10:57 They seem not to. I think we just need a dummy pro
}
registry.registerStaticUse(new StaticUse.staticInvoke(
helper, new CallStructure.unnamed(argumentCount)));

Powered by Google App Engine
This is Rietveld 408576698