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 5248f915e10c2810e8de4c55b2ea022acd1b4ad2..c882259fbdd51f9eb75271f782de0f219773e067 100644 |
--- a/pkg/compiler/lib/src/ssa/codegen.dart |
+++ b/pkg/compiler/lib/src/ssa/codegen.dart |
@@ -2825,8 +2825,22 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { |
if (helper == null) { |
assert(type.isFunctionType); |
- use(node.inputs[0]); |
+ assert(node.usesMethodOnType); |
+ |
+ String name = node.isCastTypeCheck ? '_asCheck' : '_assertCheck'; |
+ HInstruction reifiedType = node.inputs[0]; |
+ HInstruction checkedInput = node.inputs[1]; |
+ use(reifiedType); |
+ js.Expression receiver = pop(); |
+ use(checkedInput); |
+ Selector selector = new Selector.call( |
+ new Name(name, helpers.jsHelperLibrary), CallStructure.ONE_ARG); |
+ registry.registerDynamicUse( |
+ new DynamicUse(selector, reifiedType.instructionType)); |
+ js.Name methodLiteral = backend.namer.invocationName(selector); |
+ push(js.js('#.#(#)', [receiver, methodLiteral, pop()])); |
} else { |
+ assert(!node.usesMethodOnType); |
push(helper.generateCall(this, node)); |
} |
} |