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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart

Issue 12299008: Stop resolving all of js_helper unconditionally. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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/compiler/implementation/ssa/codegen.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 18614)
+++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy)
@@ -2116,7 +2116,7 @@
if (node.isString(types)) {
use(node);
} else {
- Element convertToString = compiler.findHelper(const SourceString("S"));
+ Element convertToString = backend.getStringInterpolationHelper();
world.registerStaticUse(convertToString);
js.VariableUse variableUse =
new js.VariableUse(backend.namer.isolateAccess(convertToString));
@@ -2393,43 +2393,6 @@
// TODO(johnniwinther): Refactor this method.
void visitTypeConversion(HTypeConversion node) {
- Map<String, SourceString> castNames = const <String, SourceString> {
- "stringTypeCheck":
- const SourceString("stringTypeCast"),
- "doubleTypeCheck":
- const SourceString("doubleTypeCast"),
- "numTypeCheck":
- const SourceString("numTypeCast"),
- "boolTypeCheck":
- const SourceString("boolTypeCast"),
- "functionTypeCheck":
- const SourceString("functionTypeCast"),
- "intTypeCheck":
- const SourceString("intTypeCast"),
- "numberOrStringSuperNativeTypeCheck":
- const SourceString("numberOrStringSuperNativeTypeCast"),
- "numberOrStringSuperTypeCheck":
- const SourceString("numberOrStringSuperTypeCast"),
- "stringSuperNativeTypeCheck":
- const SourceString("stringSuperNativeTypeCast"),
- "stringSuperTypeCheck":
- const SourceString("stringSuperTypeCast"),
- "listTypeCheck":
- const SourceString("listTypeCast"),
- "listSuperNativeTypeCheck":
- const SourceString("listSuperNativeTypeCast"),
- "listSuperTypeCheck":
- const SourceString("listSuperTypeCast"),
- "callTypeCheck":
- const SourceString("callTypeCast"),
- "propertyTypeCheck":
- const SourceString("propertyTypeCast"),
- // TODO(johnniwinther): Add a malformedTypeCast which produces a TypeError
- // with another message.
- "malformedTypeCheck":
- const SourceString("malformedTypeCheck")
- };
-
if (node.isChecked) {
DartType type = node.type.computeType(compiler);
Element element = type.element;
@@ -2460,7 +2423,7 @@
} else {
helper = backend.getCheckedModeHelper(type);
if (node.isCastTypeCheck) {
- helper = castNames[helper.stringValue];
+ helper = backend.castNames[helper.stringValue];
}
}
FunctionElement helperElement = compiler.findHelper(helper);

Powered by Google App Engine
This is Rietveld 408576698