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

Side by Side Diff: pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart

Issue 2608143002: Refactor BackendHelpers to make 'find' methods private. (Closed)
Patch Set: Fix Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import '../compiler.dart' show Compiler; 5 import '../compiler.dart' show Compiler;
6 import '../dart_types.dart'; 6 import '../dart_types.dart';
7 import '../elements/elements.dart'; 7 import '../elements/elements.dart';
8 import '../js/js.dart' as jsAst; 8 import '../js/js.dart' as jsAst;
9 import '../js/js.dart' show js; 9 import '../js/js.dart' show js;
10 import '../ssa/codegen.dart' show SsaCodeGenerator; 10 import '../ssa/codegen.dart' show SsaCodeGenerator;
11 import '../ssa/nodes.dart' show HTypeConversion; 11 import '../ssa/nodes.dart' show HTypeConversion;
12 import '../universe/call_structure.dart' show CallStructure; 12 import '../universe/call_structure.dart' show CallStructure;
13 import '../universe/use.dart' show StaticUse; 13 import '../universe/use.dart' show StaticUse;
14 import 'backend.dart'; 14 import 'backend.dart';
15 15
16 class CheckedModeHelper { 16 class CheckedModeHelper {
17 final String name; 17 final String name;
18 18
19 const CheckedModeHelper(String this.name); 19 const CheckedModeHelper(String this.name);
20 20
21 StaticUse getStaticUse(Compiler compiler) { 21 StaticUse getStaticUse(Compiler compiler) {
22 JavaScriptBackend backend = compiler.backend; 22 JavaScriptBackend backend = compiler.backend;
23 return new StaticUse.staticInvoke( 23 return new StaticUse.staticInvoke(
24 backend.helpers.findHelper(name), callStructure); 24 backend.helpers.jsHelperLibrary.find(name), callStructure);
Siggi Cherem (dart-lang) 2017/01/03 17:05:37 maybe add a TODO about fixing this one too? It se
Johnni Winther 2017/01/04 10:10:57 Added a TODO. What we really need is to only creat
25 } 25 }
26 26
27 CallStructure get callStructure => CallStructure.ONE_ARG; 27 CallStructure get callStructure => CallStructure.ONE_ARG;
28 28
29 jsAst.Expression generateCall( 29 jsAst.Expression generateCall(
30 SsaCodeGenerator codegen, HTypeConversion node) { 30 SsaCodeGenerator codegen, HTypeConversion node) {
31 StaticUse staticUse = getStaticUse(codegen.compiler); 31 StaticUse staticUse = getStaticUse(codegen.compiler);
32 codegen.registry.registerStaticUse(staticUse); 32 codegen.registry.registerStaticUse(staticUse);
33 List<jsAst.Expression> arguments = <jsAst.Expression>[]; 33 List<jsAst.Expression> arguments = <jsAst.Expression>[];
34 codegen.use(node.checkedInput); 34 codegen.use(node.checkedInput);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 DartType type = node.typeExpression; 131 DartType type = node.typeExpression;
132 Element element = type.element; 132 Element element = type.element;
133 jsAst.Name isField = codegen.backend.namer.operatorIs(element); 133 jsAst.Name isField = codegen.backend.namer.operatorIs(element);
134 arguments.add(js.quoteName(isField)); 134 arguments.add(js.quoteName(isField));
135 codegen.use(node.typeRepresentation); 135 codegen.use(node.typeRepresentation);
136 arguments.add(codegen.pop()); 136 arguments.add(codegen.pop());
137 jsAst.Name asField = codegen.backend.namer.substitutionName(element); 137 jsAst.Name asField = codegen.backend.namer.substitutionName(element);
138 arguments.add(js.quoteName(asField)); 138 arguments.add(js.quoteName(asField));
139 } 139 }
140 } 140 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698