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

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

Issue 2497313003: Fix HTypeConversion.checkedInput (Closed)
Patch Set: Add some comments Created 4 years, 1 month 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/ssa/builder_kernel.dart ('k') | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698