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

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

Issue 17599008: Stop passing the selector name separately to methods in the enqueuer. Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 1555
1556 // If we don't know what we're calling or if we are calling a getter, 1556 // If we don't know what we're calling or if we are calling a getter,
1557 // we need to register that fact that we may be calling a closure 1557 // we need to register that fact that we may be calling a closure
1558 // with the same arguments. 1558 // with the same arguments.
1559 Element target = node.element; 1559 Element target = node.element;
1560 if (target == null || target.isGetter()) { 1560 if (target == null || target.isGetter()) {
1561 // TODO(kasperl): If we have a typed selector for the call, we 1561 // TODO(kasperl): If we have a typed selector for the call, we
1562 // may know something about the types of closures that need 1562 // may know something about the types of closures that need
1563 // the specific closure call method. 1563 // the specific closure call method.
1564 Selector call = new Selector.callClosureFrom(selector); 1564 Selector call = new Selector.callClosureFrom(selector);
1565 world.registerDynamicInvocation(call.name, call); 1565 world.registerDynamicInvocation(call);
1566 } 1566 }
1567 1567
1568 SourceString name = node.selector.name; 1568 SourceString name = node.selector.name;
ngeoffray 2013/06/25 12:21:00 Remove line above.
kasperl 2013/06/25 12:28:32 Done.
1569 world.registerDynamicInvocation(name, selector); 1569 world.registerDynamicInvocation(selector);
1570 } 1570 }
1571 1571
1572 void registerSetter(HInvokeDynamic node) { 1572 void registerSetter(HInvokeDynamic node) {
1573 Selector selector = getOptimizedSelectorFor(node, node.selector); 1573 Selector selector = getOptimizedSelectorFor(node, node.selector);
1574 world.registerDynamicSetter(selector.name, selector); 1574 world.registerDynamicSetter(selector);
1575 HType valueType = node.isInterceptedCall 1575 HType valueType = node.isInterceptedCall
1576 ? node.inputs[2].instructionType 1576 ? node.inputs[2].instructionType
1577 : node.inputs[1].instructionType; 1577 : node.inputs[1].instructionType;
1578 } 1578 }
1579 1579
1580 void registerGetter(HInvokeDynamic node) { 1580 void registerGetter(HInvokeDynamic node) {
1581 Selector selector = getOptimizedSelectorFor(node, node.selector); 1581 Selector selector = getOptimizedSelectorFor(node, node.selector);
1582 world.registerDynamicGetter(selector.name, selector); 1582 world.registerDynamicGetter(selector);
1583 } 1583 }
1584 1584
1585 visitInvokeDynamicSetter(HInvokeDynamicSetter node) { 1585 visitInvokeDynamicSetter(HInvokeDynamicSetter node) {
1586 use(node.receiver); 1586 use(node.receiver);
1587 String name = backend.namer.invocationName(node.selector); 1587 String name = backend.namer.invocationName(node.selector);
1588 push(jsPropertyCall(pop(), name, visitArguments(node.inputs)), node); 1588 push(jsPropertyCall(pop(), name, visitArguments(node.inputs)), node);
1589 registerSetter(node); 1589 registerSetter(node);
1590 } 1590 }
1591 1591
1592 visitInvokeDynamicGetter(HInvokeDynamicGetter node) { 1592 visitInvokeDynamicGetter(HInvokeDynamicGetter node) {
1593 use(node.receiver); 1593 use(node.receiver);
1594 String name = backend.namer.invocationName(node.selector); 1594 String name = backend.namer.invocationName(node.selector);
1595 push(jsPropertyCall(pop(), name, visitArguments(node.inputs)), node); 1595 push(jsPropertyCall(pop(), name, visitArguments(node.inputs)), node);
1596 registerGetter(node); 1596 registerGetter(node);
1597 } 1597 }
1598 1598
1599 visitInvokeClosure(HInvokeClosure node) { 1599 visitInvokeClosure(HInvokeClosure node) {
1600 Selector call = new Selector.callClosureFrom(node.selector); 1600 Selector call = new Selector.callClosureFrom(node.selector);
1601 use(node.receiver); 1601 use(node.receiver);
1602 push(jsPropertyCall(pop(), 1602 push(jsPropertyCall(pop(),
1603 backend.namer.invocationName(call), 1603 backend.namer.invocationName(call),
1604 visitArguments(node.inputs)), 1604 visitArguments(node.inputs)),
1605 node); 1605 node);
1606 world.registerDynamicInvocation(call.name, call); 1606 world.registerDynamicInvocation(call);
1607 } 1607 }
1608 1608
1609 visitInvokeStatic(HInvokeStatic node) { 1609 visitInvokeStatic(HInvokeStatic node) {
1610 Element element = node.element; 1610 Element element = node.element;
1611 world.registerStaticUse(element); 1611 world.registerStaticUse(element);
1612 ClassElement cls = element.getEnclosingClass(); 1612 ClassElement cls = element.getEnclosingClass();
1613 if (element.isGenerativeConstructor() 1613 if (element.isGenerativeConstructor()
1614 || (element.isFactoryConstructor() && cls == compiler.listClass)) { 1614 || (element.isFactoryConstructor() && cls == compiler.listClass)) {
1615 world.registerInstantiatedClass(cls, work.resolutionTree); 1615 world.registerInstantiatedClass(cls, work.resolutionTree);
1616 } 1616 }
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after
2969 if (leftType.canBeNull() && rightType.canBeNull()) { 2969 if (leftType.canBeNull() && rightType.canBeNull()) {
2970 if (left.isConstantNull() || right.isConstantNull() || 2970 if (left.isConstantNull() || right.isConstantNull() ||
2971 (leftType.isPrimitive(compiler) && leftType == rightType)) { 2971 (leftType.isPrimitive(compiler) && leftType == rightType)) {
2972 return '=='; 2972 return '==';
2973 } 2973 }
2974 return null; 2974 return null;
2975 } else { 2975 } else {
2976 return '==='; 2976 return '===';
2977 } 2977 }
2978 } 2978 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698