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

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

Issue 12299006: Start tracking all registered elements in one big full function set (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Register fields. 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 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 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 backend.addOneShotInterceptor(selector); 1573 backend.addOneShotInterceptor(selector);
1574 if (selector.isGetter()) { 1574 if (selector.isGetter()) {
1575 registerGetter(node); 1575 registerGetter(node);
1576 } else if (selector.isSetter()) { 1576 } else if (selector.isSetter()) {
1577 registerSetter(node); 1577 registerSetter(node);
1578 } else { 1578 } else {
1579 registerMethodInvoke(node); 1579 registerMethodInvoke(node);
1580 } 1580 }
1581 } 1581 }
1582 1582
1583 Selector getOptimizedSelectorFor(HInvokeDynamic node, 1583 Selector getOptimizedSelectorFor(HInvokeDynamic node, Selector selector) {
1584 Selector defaultSelector) {
1585 // If [JSInvocationMirror.invokeOn] has been called, we must not create a 1584 // If [JSInvocationMirror.invokeOn] has been called, we must not create a
1586 // typed selector based on the receiver type. 1585 // typed selector based on the receiver type.
1587 if (node.element == null && // Invocation is not exact. 1586 if (node.element == null && // Invocation is not exact.
1588 backend.compiler.enabledInvokeOn) { 1587 backend.compiler.enabledInvokeOn) {
1589 return defaultSelector; 1588 return selector;
1590 } 1589 }
1591 int receiverIndex = node.isInterceptorCall ? 1 : 0; 1590 int receiverIndex = node.isInterceptorCall ? 1 : 0;
1592 HType receiverHType = types[node.inputs[receiverIndex]]; 1591 HType receiverType = types[node.inputs[receiverIndex]];
1593 DartType receiverType = receiverHType.computeType(compiler); 1592 return receiverType.refine(selector, compiler);
1594 if (receiverType != null && !receiverType.isMalformed) {
1595 if (receiverHType.isExact()) {
1596 return new TypedSelector.exact(receiverType, defaultSelector);
1597 } else if (receiverHType.isInterfaceType()) {
1598 return new TypedSelector.subtype(receiverType, defaultSelector);
1599 } else {
1600 return new TypedSelector.subclass(receiverType, defaultSelector);
1601 }
1602 } else {
1603 return defaultSelector;
1604 }
1605 } 1593 }
1606 1594
1607 void registerInvoke(HInvokeDynamic node) { 1595 void registerInvoke(HInvokeDynamic node) {
1608 bool inLoop = node.block.enclosingLoopHeader != null; 1596 bool inLoop = node.block.enclosingLoopHeader != null;
1609 SourceString name = node.selector.name; 1597 SourceString name = node.selector.name;
1610 if (inLoop) { 1598 if (inLoop) {
1611 Element target = node.element; 1599 Element target = node.element;
1612 if (target != null) { 1600 if (target != null) {
1613 backend.builder.functionsCalledInLoop.add(target); 1601 backend.builder.functionsCalledInLoop.add(target);
1614 } else { 1602 } else {
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after
3013 if (leftType.canBeNull() && rightType.canBeNull()) { 3001 if (leftType.canBeNull() && rightType.canBeNull()) {
3014 if (left.isConstantNull() || right.isConstantNull() || 3002 if (left.isConstantNull() || right.isConstantNull() ||
3015 (leftType.isPrimitive() && leftType == rightType)) { 3003 (leftType.isPrimitive() && leftType == rightType)) {
3016 return '=='; 3004 return '==';
3017 } 3005 }
3018 return null; 3006 return null;
3019 } else { 3007 } else {
3020 return '==='; 3008 return '===';
3021 } 3009 }
3022 } 3010 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698