| 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 final JavaScriptBackend backend; | 6 final JavaScriptBackend backend; |
| 7 SsaCodeGeneratorTask(JavaScriptBackend backend) | 7 SsaCodeGeneratorTask(JavaScriptBackend backend) |
| 8 : this.backend = backend, | 8 : this.backend = backend, |
| 9 super(backend.compiler); | 9 super(backend.compiler); |
| 10 String get name() => 'SSA code generator'; | 10 String get name() => 'SSA code generator'; |
| (...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1433 String className = compiler.namer.isolateAccess(superClass); | 1433 String className = compiler.namer.isolateAccess(superClass); |
| 1434 if (superMethod.kind == ElementKind.FUNCTION || | 1434 if (superMethod.kind == ElementKind.FUNCTION || |
| 1435 superMethod.kind == ElementKind.GENERATIVE_CONSTRUCTOR) { | 1435 superMethod.kind == ElementKind.GENERATIVE_CONSTRUCTOR) { |
| 1436 String methodName = compiler.namer.instanceMethodName( | 1436 String methodName = compiler.namer.instanceMethodName( |
| 1437 currentLibrary, superMethod.name, argumentCount); | 1437 currentLibrary, superMethod.name, argumentCount); |
| 1438 buffer.add('$className.prototype.$methodName.call'); | 1438 buffer.add('$className.prototype.$methodName.call'); |
| 1439 visitArguments(node.inputs); | 1439 visitArguments(node.inputs); |
| 1440 } else if (superMethod.kind == ElementKind.FIELD) { | 1440 } else if (superMethod.kind == ElementKind.FIELD) { |
| 1441 buffer.add('this.${compiler.namer.getName(superMethod)}'); | 1441 buffer.add('this.${compiler.namer.getName(superMethod)}'); |
| 1442 } else { | 1442 } else { |
| 1443 assert(superMethod.kind == ElementKind.GETTER); | 1443 assert(superMethod.kind == ElementKind.GETTER || |
| 1444 String methodName = | 1444 superMethod.kind == ElementKind.SETTER); |
| 1445 compiler.namer.getterName(currentLibrary, superMethod.name); | 1445 String methodName; |
| 1446 if (superMethod.kind == ElementKind.GETTER) { |
| 1447 methodName = |
| 1448 compiler.namer.getterName(currentLibrary, superMethod.name); |
| 1449 } else { |
| 1450 methodName = |
| 1451 compiler.namer.setterName(currentLibrary, superMethod.name); |
| 1452 } |
| 1446 buffer.add('$className.prototype.$methodName.call'); | 1453 buffer.add('$className.prototype.$methodName.call'); |
| 1447 visitArguments(node.inputs); | 1454 visitArguments(node.inputs); |
| 1448 } | 1455 } |
| 1449 endExpression(JSPrecedence.CALL_PRECEDENCE); | 1456 endExpression(JSPrecedence.CALL_PRECEDENCE); |
| 1450 world.registerStaticUse(superMethod); | 1457 world.registerStaticUse(superMethod); |
| 1451 } | 1458 } |
| 1452 | 1459 |
| 1453 visitFieldGet(HFieldGet node) { | 1460 visitFieldGet(HFieldGet node) { |
| 1454 if (!node.isFromActivation()) { | 1461 if (!node.isFromActivation()) { |
| 1455 String name = | 1462 String name = |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2495 startBailoutSwitch(); | 2502 startBailoutSwitch(); |
| 2496 } | 2503 } |
| 2497 } | 2504 } |
| 2498 | 2505 |
| 2499 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { | 2506 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { |
| 2500 if (labeledBlockInfo.body.start.hasGuards()) { | 2507 if (labeledBlockInfo.body.start.hasGuards()) { |
| 2501 endBailoutSwitch(); | 2508 endBailoutSwitch(); |
| 2502 } | 2509 } |
| 2503 } | 2510 } |
| 2504 } | 2511 } |
| OLD | NEW |