| 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 class SsaCodeGeneratorTask extends CompilerTask { | 5 class SsaCodeGeneratorTask extends CompilerTask { |
| 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); | 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); |
| 7 String get name() => 'SSA code generator'; | 7 String get name() => 'SSA code generator'; |
| 8 | 8 |
| 9 | 9 |
| 10 String buildJavaScriptFunction(FunctionElement element, | 10 String buildJavaScriptFunction(FunctionElement element, |
| (...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1302 visitArguments(node.inputs); | 1302 visitArguments(node.inputs); |
| 1303 endExpression(JSPrecedence.CALL_PRECEDENCE); | 1303 endExpression(JSPrecedence.CALL_PRECEDENCE); |
| 1304 } | 1304 } |
| 1305 | 1305 |
| 1306 visitInvokeSuper(HInvokeSuper node) { | 1306 visitInvokeSuper(HInvokeSuper node) { |
| 1307 beginExpression(JSPrecedence.CALL_PRECEDENCE); | 1307 beginExpression(JSPrecedence.CALL_PRECEDENCE); |
| 1308 Element superMethod = node.element; | 1308 Element superMethod = node.element; |
| 1309 Element superClass = superMethod.enclosingElement; | 1309 Element superClass = superMethod.enclosingElement; |
| 1310 // Remove the element and 'this'. | 1310 // Remove the element and 'this'. |
| 1311 int argumentCount = node.inputs.length - 2; | 1311 int argumentCount = node.inputs.length - 2; |
| 1312 String className = compiler.namer.isolatePropertyAccess(superClass); | 1312 String className = compiler.namer.isolateAccess(superClass); |
| 1313 if (superMethod.kind == ElementKind.FUNCTION || | 1313 if (superMethod.kind == ElementKind.FUNCTION || |
| 1314 superMethod.kind == ElementKind.GENERATIVE_CONSTRUCTOR) { | 1314 superMethod.kind == ElementKind.GENERATIVE_CONSTRUCTOR) { |
| 1315 String methodName = compiler.namer.instanceMethodName( | 1315 String methodName = compiler.namer.instanceMethodName( |
| 1316 currentLibrary, superMethod.name, argumentCount); | 1316 currentLibrary, superMethod.name, argumentCount); |
| 1317 buffer.add('$className.prototype.$methodName.call'); | 1317 buffer.add('$className.prototype.$methodName.call'); |
| 1318 visitArguments(node.inputs); | 1318 visitArguments(node.inputs); |
| 1319 } else if (superMethod.kind == ElementKind.FIELD) { | 1319 } else if (superMethod.kind == ElementKind.FIELD) { |
| 1320 buffer.add('this.${compiler.namer.getName(superMethod)}'); | 1320 buffer.add('this.${compiler.namer.getName(superMethod)}'); |
| 1321 } else { | 1321 } else { |
| 1322 assert(superMethod.kind == ElementKind.GETTER); | 1322 assert(superMethod.kind == ElementKind.GETTER); |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2294 startBailoutSwitch(); | 2294 startBailoutSwitch(); |
| 2295 } | 2295 } |
| 2296 } | 2296 } |
| 2297 | 2297 |
| 2298 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { | 2298 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { |
| 2299 if (labeledBlockInfo.body.start.hasGuards()) { | 2299 if (labeledBlockInfo.body.start.hasGuards()) { |
| 2300 endBailoutSwitch(); | 2300 endBailoutSwitch(); |
| 2301 } | 2301 } |
| 2302 } | 2302 } |
| 2303 } | 2303 } |
| OLD | NEW |