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

Side by Side Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 11099044: Register parameter types for closure invocations to the backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Disable call_test for VM. Created 8 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class SsaCodeGeneratorTask extends CompilerTask { 5 class SsaCodeGeneratorTask extends CompilerTask {
6 6
7 final JavaScriptBackend backend; 7 final JavaScriptBackend backend;
8 8
9 SsaCodeGeneratorTask(JavaScriptBackend backend) 9 SsaCodeGeneratorTask(JavaScriptBackend backend)
10 : this.backend = backend, 10 : this.backend = backend,
(...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1542 } 1542 }
1543 1543
1544 visitInvokeClosure(HInvokeClosure node) { 1544 visitInvokeClosure(HInvokeClosure node) {
1545 use(node.receiver); 1545 use(node.receiver);
1546 push(jsPropertyCall(pop(), 1546 push(jsPropertyCall(pop(),
1547 backend.namer.closureInvocationName(node.selector), 1547 backend.namer.closureInvocationName(node.selector),
1548 visitArguments(node.inputs)), 1548 visitArguments(node.inputs)),
1549 node); 1549 node);
1550 Selector call = new Selector.callClosureFrom(node.selector); 1550 Selector call = new Selector.callClosureFrom(node.selector);
1551 world.registerDynamicInvocation(call.name, call); 1551 world.registerDynamicInvocation(call.name, call);
1552 // A closure can also be invoked through [HInvokeDynamicMethod] by
1553 // explicitly calling the [:call:] method. Therefore, we must also
1554 // register types here to let the backend invalidate wrong
1555 // optimizations.
1556 backend.registerDynamicInvocation(node, call, types);
1552 } 1557 }
1553 1558
1554 visitInvokeStatic(HInvokeStatic node) { 1559 visitInvokeStatic(HInvokeStatic node) {
1555 if (true && 1560 if (true &&
1556 (node.typeCode() == HInstruction.INVOKE_STATIC_TYPECODE || 1561 (node.typeCode() == HInstruction.INVOKE_STATIC_TYPECODE ||
1557 node.typeCode() == HInstruction.INVOKE_INTERCEPTOR_TYPECODE)) { 1562 node.typeCode() == HInstruction.INVOKE_INTERCEPTOR_TYPECODE)) {
1558 // Register this invocation to collect the types used at all call sites. 1563 // Register this invocation to collect the types used at all call sites.
1559 backend.registerStaticInvocation(node, types); 1564 backend.registerStaticInvocation(node, types);
1560 } 1565 }
1561 use(node.target); 1566 use(node.target);
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after
2983 if (leftType.canBeNull() && rightType.canBeNull()) { 2988 if (leftType.canBeNull() && rightType.canBeNull()) {
2984 if (left.isConstantNull() || right.isConstantNull() || 2989 if (left.isConstantNull() || right.isConstantNull() ||
2985 (leftType.isPrimitive() && leftType == rightType)) { 2990 (leftType.isPrimitive() && leftType == rightType)) {
2986 return '=='; 2991 return '==';
2987 } 2992 }
2988 return null; 2993 return null;
2989 } else { 2994 } else {
2990 return '==='; 2995 return '===';
2991 } 2996 }
2992 } 2997 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698