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

Side by Side Diff: dart/frog/leg/ssa/codegen.dart

Issue 9753007: Implement super-send to non-function. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 | « dart/frog/leg/ssa/builder.dart ('k') | dart/tests/co19/co19-leg.status » ('j') | 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 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 String generate(WorkItem work, HGraph graph) { 9 String generate(WorkItem work, HGraph graph) {
10 return measure(() { 10 return measure(() {
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 endExpression(JSPrecedence.CALL_PRECEDENCE); 631 endExpression(JSPrecedence.CALL_PRECEDENCE);
632 } 632 }
633 633
634 visitInvokeSuper(HInvokeSuper node) { 634 visitInvokeSuper(HInvokeSuper node) {
635 beginExpression(JSPrecedence.CALL_PRECEDENCE); 635 beginExpression(JSPrecedence.CALL_PRECEDENCE);
636 Element superMethod = node.element; 636 Element superMethod = node.element;
637 Element superClass = superMethod.enclosingElement; 637 Element superClass = superMethod.enclosingElement;
638 // Remove the element and 'this'. 638 // Remove the element and 'this'.
639 int argumentCount = node.inputs.length - 2; 639 int argumentCount = node.inputs.length - 2;
640 String className = compiler.namer.isolatePropertyAccess(superClass); 640 String className = compiler.namer.isolatePropertyAccess(superClass);
641 String methodName = compiler.namer.instanceMethodName( 641 String methodName;
642 currentLibrary, superMethod.name, argumentCount); 642 if (superMethod.kind == ElementKind.FUNCTION ||
643 superMethod.kind == ElementKind.GENERATIVE_CONSTRUCTOR) {
644 methodName = compiler.namer.instanceMethodName(
645 currentLibrary, superMethod.name, argumentCount);
646 } else {
647 methodName = compiler.namer.getterName(currentLibrary, superMethod.name);
648 compiler.registerDynamicGetter(superMethod.name);
ngeoffray 2012/03/20 15:03:49 Please add a comment on why you're registering whe
ahe 2012/03/21 10:09:55 Done.
649 }
643 buffer.add('$className.prototype.$methodName.call'); 650 buffer.add('$className.prototype.$methodName.call');
644 visitArguments(node.inputs); 651 visitArguments(node.inputs);
645 endExpression(JSPrecedence.CALL_PRECEDENCE); 652 endExpression(JSPrecedence.CALL_PRECEDENCE);
646 compiler.registerStaticUse(superMethod); 653 compiler.registerStaticUse(superMethod);
647 } 654 }
648 655
649 visitFieldGet(HFieldGet node) { 656 visitFieldGet(HFieldGet node) {
650 String name = JsNames.getValid(node.element.name.slowToString()); 657 String name = JsNames.getValid(node.element.name.slowToString());
651 if (node.receiver !== null) { 658 if (node.receiver !== null) {
652 beginExpression(JSPrecedence.MEMBER_PRECEDENCE); 659 beginExpression(JSPrecedence.MEMBER_PRECEDENCE);
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
1484 startBailoutSwitch(); 1491 startBailoutSwitch();
1485 } 1492 }
1486 } 1493 }
1487 1494
1488 void endElse(HIf node) { 1495 void endElse(HIf node) {
1489 if (node.elseBlock.hasBailouts()) { 1496 if (node.elseBlock.hasBailouts()) {
1490 endBailoutSwitch(); 1497 endBailoutSwitch();
1491 } 1498 }
1492 } 1499 }
1493 } 1500 }
OLDNEW
« no previous file with comments | « dart/frog/leg/ssa/builder.dart ('k') | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698