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

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

Issue 15222002: Handle super calls in the backend type inferrer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 part of ssa; 5 part of ssa;
6 6
7 class SsaCodeGeneratorTask extends CompilerTask { 7 class SsaCodeGeneratorTask extends CompilerTask {
8 8
9 final JavaScriptBackend backend; 9 final JavaScriptBackend backend;
10 10
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 } else { 1641 } else {
1642 String methodName = backend.namer.getName(superMethod); 1642 String methodName = backend.namer.getName(superMethod);
1643 String className = backend.namer.isolateAccess(superClass); 1643 String className = backend.namer.isolateAccess(superClass);
1644 js.VariableUse classReference = new js.VariableUse(className); 1644 js.VariableUse classReference = new js.VariableUse(className);
1645 js.PropertyAccess prototype = 1645 js.PropertyAccess prototype =
1646 new js.PropertyAccess.field(classReference, "prototype"); 1646 new js.PropertyAccess.field(classReference, "prototype");
1647 js.PropertyAccess method = 1647 js.PropertyAccess method =
1648 new js.PropertyAccess.field(prototype, methodName); 1648 new js.PropertyAccess.field(prototype, methodName);
1649 push(jsPropertyCall( 1649 push(jsPropertyCall(
1650 method, "call", visitArguments(node.inputs, start: 0)), node); 1650 method, "call", visitArguments(node.inputs, start: 0)), node);
1651 // Register this invocation to collect the types used at all call sites.
1652 backend.registerDynamicInvocation(node, node.selector);
1651 } 1653 }
1652 world.registerStaticUse(superMethod); 1654 world.registerStaticUse(superMethod);
1653 } 1655 }
1654 1656
1655 visitFieldGet(HFieldGet node) { 1657 visitFieldGet(HFieldGet node) {
1656 use(node.receiver); 1658 use(node.receiver);
1657 Element element = node.element; 1659 Element element = node.element;
1658 if (element == backend.jsIndexableLength) { 1660 if (element == backend.jsIndexableLength) {
1659 // We're accessing a native JavaScript property called 'length' 1661 // We're accessing a native JavaScript property called 'length'
1660 // on a JS String or a JS array. Therefore, the name of that 1662 // on a JS String or a JS array. Therefore, the name of that
(...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after
2959 if (leftType.canBeNull() && rightType.canBeNull()) { 2961 if (leftType.canBeNull() && rightType.canBeNull()) {
2960 if (left.isConstantNull() || right.isConstantNull() || 2962 if (left.isConstantNull() || right.isConstantNull() ||
2961 (leftType.isPrimitive() && leftType == rightType)) { 2963 (leftType.isPrimitive() && leftType == rightType)) {
2962 return '=='; 2964 return '==';
2963 } 2965 }
2964 return null; 2966 return null;
2965 } else { 2967 } else {
2966 return '==='; 2968 return '===';
2967 } 2969 }
2968 } 2970 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | sdk/lib/_internal/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698