| 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 import 'dart:math' as math; | 5 import 'dart:math' as math; |
| 6 import '../common.dart'; | 6 import '../common.dart'; |
| 7 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 7 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
| 8 import '../common/tasks.dart' show CompilerTask; | 8 import '../common/tasks.dart' show CompilerTask; |
| 9 import '../compiler.dart' show Compiler; | 9 import '../compiler.dart' show Compiler; |
| 10 import '../constants/constant_system.dart'; | 10 import '../constants/constant_system.dart'; |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 | 315 |
| 316 js.Expression pop() { | 316 js.Expression pop() { |
| 317 return expressionStack.removeLast(); | 317 return expressionStack.removeLast(); |
| 318 } | 318 } |
| 319 | 319 |
| 320 void preGenerateMethod(HGraph graph) { | 320 void preGenerateMethod(HGraph graph) { |
| 321 new SsaInstructionSelection(closedWorld, backend.interceptorData) | 321 new SsaInstructionSelection(closedWorld, backend.interceptorData) |
| 322 .visitGraph(graph); | 322 .visitGraph(graph); |
| 323 new SsaTypeKnownRemover().visitGraph(graph); | 323 new SsaTypeKnownRemover().visitGraph(graph); |
| 324 new SsaTrustedCheckRemover(compiler.options).visitGraph(graph); | 324 new SsaTrustedCheckRemover(compiler.options).visitGraph(graph); |
| 325 new SsaInstructionMerger(generateAtUseSite, backend).visitGraph(graph); | 325 new SsaInstructionMerger(generateAtUseSite, backend.superMemberData) |
| 326 .visitGraph(graph); |
| 326 new SsaConditionMerger(generateAtUseSite, controlFlowOperators) | 327 new SsaConditionMerger(generateAtUseSite, controlFlowOperators) |
| 327 .visitGraph(graph); | 328 .visitGraph(graph); |
| 328 SsaLiveIntervalBuilder intervalBuilder = | 329 SsaLiveIntervalBuilder intervalBuilder = |
| 329 new SsaLiveIntervalBuilder(generateAtUseSite, controlFlowOperators); | 330 new SsaLiveIntervalBuilder(generateAtUseSite, controlFlowOperators); |
| 330 intervalBuilder.visitGraph(graph); | 331 intervalBuilder.visitGraph(graph); |
| 331 SsaVariableAllocator allocator = new SsaVariableAllocator( | 332 SsaVariableAllocator allocator = new SsaVariableAllocator( |
| 332 backend.namer, | 333 backend.namer, |
| 333 intervalBuilder.liveInstructions, | 334 intervalBuilder.liveInstructions, |
| 334 intervalBuilder.liveIntervals, | 335 intervalBuilder.liveIntervals, |
| 335 generateAtUseSite); | 336 generateAtUseSite); |
| (...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1893 : new StaticUse.superFieldSet(superElement)); | 1894 : new StaticUse.superFieldSet(superElement)); |
| 1894 use(node.value); | 1895 use(node.value); |
| 1895 push(new js.Assignment(access, pop()) | 1896 push(new js.Assignment(access, pop()) |
| 1896 .withSourceInformation(node.sourceInformation)); | 1897 .withSourceInformation(node.sourceInformation)); |
| 1897 } else { | 1898 } else { |
| 1898 registry.registerStaticUse(new StaticUse.superGet(superElement)); | 1899 registry.registerStaticUse(new StaticUse.superGet(superElement)); |
| 1899 push(access); | 1900 push(access); |
| 1900 } | 1901 } |
| 1901 } else { | 1902 } else { |
| 1902 Selector selector = node.selector; | 1903 Selector selector = node.selector; |
| 1903 if (!backend.maybeRegisterAliasedSuperMember(superElement, selector)) { | 1904 if (!backend.superMemberData |
| 1905 .maybeRegisterAliasedSuperMember(superElement, selector)) { |
| 1904 js.Name methodName; | 1906 js.Name methodName; |
| 1905 if (selector.isGetter && !superElement.isGetter) { | 1907 if (selector.isGetter && !superElement.isGetter) { |
| 1906 // If this is a tear-off, register the fact that a tear-off closure | 1908 // If this is a tear-off, register the fact that a tear-off closure |
| 1907 // will be created, and that this tear-off must bypass ordinary | 1909 // will be created, and that this tear-off must bypass ordinary |
| 1908 // dispatch to ensure the super method is invoked. | 1910 // dispatch to ensure the super method is invoked. |
| 1909 FunctionEntity helper = backend.helpers.closureFromTearOff; | 1911 FunctionEntity helper = backend.helpers.closureFromTearOff; |
| 1910 registry.registerStaticUse(new StaticUse.staticInvoke( | 1912 registry.registerStaticUse(new StaticUse.staticInvoke( |
| 1911 helper, new CallStructure.unnamed(node.inputs.length))); | 1913 helper, new CallStructure.unnamed(node.inputs.length))); |
| 1912 registry.registerStaticUse(new StaticUse.superTearOff(node.element)); | 1914 registry.registerStaticUse(new StaticUse.superTearOff(node.element)); |
| 1913 methodName = backend.namer.invocationName(selector); | 1915 methodName = backend.namer.invocationName(selector); |
| (...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2981 return closedWorld.anyStrictSubclassOf(cls, (ClassEntity subclass) { | 2983 return closedWorld.anyStrictSubclassOf(cls, (ClassEntity subclass) { |
| 2982 return !backend.rtiSubstitutions.isTrivialSubstitution(subclass, cls); | 2984 return !backend.rtiSubstitutions.isTrivialSubstitution(subclass, cls); |
| 2983 }); | 2985 }); |
| 2984 } | 2986 } |
| 2985 | 2987 |
| 2986 @override | 2988 @override |
| 2987 void visitRef(HRef node) { | 2989 void visitRef(HRef node) { |
| 2988 visit(node.value); | 2990 visit(node.value); |
| 2989 } | 2991 } |
| 2990 } | 2992 } |
| OLD | NEW |