| OLD | NEW |
| 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 Loading... |
| 1573 Selector selector = getOptimizedSelectorFor(node, node.selector); | 1573 Selector selector = getOptimizedSelectorFor(node, node.selector); |
| 1574 world.registerDynamicSetter(selector.name, selector); | 1574 world.registerDynamicSetter(selector.name, 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.name, selector); |
| 1583 world.registerInstantiatedClass( | |
| 1584 compiler.functionClass, work.resolutionTree); | |
| 1585 } | 1583 } |
| 1586 | 1584 |
| 1587 visitInvokeDynamicSetter(HInvokeDynamicSetter node) { | 1585 visitInvokeDynamicSetter(HInvokeDynamicSetter node) { |
| 1588 use(node.receiver); | 1586 use(node.receiver); |
| 1589 String name = backend.namer.invocationName(node.selector); | 1587 String name = backend.namer.invocationName(node.selector); |
| 1590 push(jsPropertyCall(pop(), name, visitArguments(node.inputs)), node); | 1588 push(jsPropertyCall(pop(), name, visitArguments(node.inputs)), node); |
| 1591 registerSetter(node); | 1589 registerSetter(node); |
| 1592 } | 1590 } |
| 1593 | 1591 |
| 1594 visitInvokeDynamicGetter(HInvokeDynamicGetter node) { | 1592 visitInvokeDynamicGetter(HInvokeDynamicGetter node) { |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1976 push(value, node); | 1974 push(value, node); |
| 1977 } | 1975 } |
| 1978 | 1976 |
| 1979 void visitSwitch(HSwitch node) { | 1977 void visitSwitch(HSwitch node) { |
| 1980 // Switches are handled using [visitSwitchInfo]. | 1978 // Switches are handled using [visitSwitchInfo]. |
| 1981 } | 1979 } |
| 1982 | 1980 |
| 1983 void visitStatic(HStatic node) { | 1981 void visitStatic(HStatic node) { |
| 1984 Element element = node.element; | 1982 Element element = node.element; |
| 1985 if (element.isFunction()) { | 1983 if (element.isFunction()) { |
| 1986 world.registerInstantiatedClass( | |
| 1987 compiler.functionClass, work.resolutionTree); | |
| 1988 push(new js.VariableUse( | 1984 push(new js.VariableUse( |
| 1989 backend.namer.isolateStaticClosureAccess(node.element))); | 1985 backend.namer.isolateStaticClosureAccess(node.element))); |
| 1990 } else { | 1986 } else { |
| 1991 push(new js.VariableUse(backend.namer.isolateAccess(node.element))); | 1987 push(new js.VariableUse(backend.namer.isolateAccess(node.element))); |
| 1992 } | 1988 } |
| 1993 world.registerStaticUse(element); | 1989 world.registerStaticUse(element); |
| 1994 } | 1990 } |
| 1995 | 1991 |
| 1996 void visitLazyStatic(HLazyStatic node) { | 1992 void visitLazyStatic(HLazyStatic node) { |
| 1997 Element element = node.element; | 1993 Element element = node.element; |
| (...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2973 if (leftType.canBeNull() && rightType.canBeNull()) { | 2969 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 2974 if (left.isConstantNull() || right.isConstantNull() || | 2970 if (left.isConstantNull() || right.isConstantNull() || |
| 2975 (leftType.isPrimitive(compiler) && leftType == rightType)) { | 2971 (leftType.isPrimitive(compiler) && leftType == rightType)) { |
| 2976 return '=='; | 2972 return '=='; |
| 2977 } | 2973 } |
| 2978 return null; | 2974 return null; |
| 2979 } else { | 2975 } else { |
| 2980 return '==='; | 2976 return '==='; |
| 2981 } | 2977 } |
| 2982 } | 2978 } |
| OLD | NEW |