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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 26166003: Revert "Add TypeVariable object on runtime to support reflection on type variables." and "Fix type … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
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 part of ssa; 5 part of ssa;
6 6
7 /** 7 /**
8 * A special element for the extra parameter taken by intercepted 8 * A special element for the extra parameter taken by intercepted
9 * methods. We need to override [Element.computeType] because our 9 * methods. We need to override [Element.computeType] because our
10 * optimizers may look at its declared type. 10 * optimizers may look at its declared type.
(...skipping 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after
2839 // to the runtime type information for type variables as instructions. 2839 // to the runtime type information for type variables as instructions.
2840 if (type.kind == TypeKind.TYPE_VARIABLE) { 2840 if (type.kind == TypeKind.TYPE_VARIABLE) {
2841 return buildLiteralList(<HInstruction>[addTypeVariableReference(type)]); 2841 return buildLiteralList(<HInstruction>[addTypeVariableReference(type)]);
2842 } else { 2842 } else {
2843 assert(type.element.isClass()); 2843 assert(type.element.isClass());
2844 InterfaceType interface = type; 2844 InterfaceType interface = type;
2845 List<HInstruction> inputs = <HInstruction>[]; 2845 List<HInstruction> inputs = <HInstruction>[];
2846 bool first = true; 2846 bool first = true;
2847 List<String> templates = <String>[]; 2847 List<String> templates = <String>[];
2848 for (DartType argument in interface.typeArguments) { 2848 for (DartType argument in interface.typeArguments) {
2849 templates.add(rti.getTypeRepresentationWithHashes(argument, (variable) { 2849 templates.add(rti.getTypeRepresentation(argument, (variable) {
2850 HInstruction runtimeType = addTypeVariableReference(variable); 2850 HInstruction runtimeType = addTypeVariableReference(variable);
2851 inputs.add(runtimeType); 2851 inputs.add(runtimeType);
2852 })); 2852 }));
2853 } 2853 }
2854 String template = '[${templates.join(', ')}]'; 2854 String template = '[${templates.join(', ')}]';
2855 js.Expression code = js.js.parseForeignJS(template); 2855 js.Expression code = js.js.parseForeignJS(template);
2856 HInstruction representation = 2856 HInstruction representation =
2857 createForeign(code, backend.readableArrayType, inputs); 2857 createForeign(code, backend.readableArrayType, inputs);
2858 return representation; 2858 return representation;
2859 } 2859 }
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
3537 } 3537 }
3538 3538
3539 HInstruction analyzeTypeArgument(DartType argument) { 3539 HInstruction analyzeTypeArgument(DartType argument) {
3540 if (argument.treatAsDynamic) { 3540 if (argument.treatAsDynamic) {
3541 // Represent [dynamic] as [null]. 3541 // Represent [dynamic] as [null].
3542 return graph.addConstantNull(compiler); 3542 return graph.addConstantNull(compiler);
3543 } 3543 }
3544 3544
3545 List<HInstruction> inputs = <HInstruction>[]; 3545 List<HInstruction> inputs = <HInstruction>[];
3546 3546
3547 String template = rti.getTypeRepresentationWithHashes(argument, (variable) { 3547 String template = rti.getTypeRepresentation(argument, (variable) {
3548 inputs.add(addTypeVariableReference(variable)); 3548 inputs.add(addTypeVariableReference(variable));
3549 }); 3549 });
3550 3550
3551 js.Expression code = js.js.parseForeignJS(template); 3551 js.Expression code = js.js.parseForeignJS(template);
3552 HInstruction result = createForeign(code, backend.stringType, inputs); 3552 HInstruction result = createForeign(code, backend.stringType, inputs);
3553 add(result); 3553 add(result);
3554 return result; 3554 return result;
3555 } 3555 }
3556 3556
3557 void handleListConstructor(InterfaceType type, 3557 void handleListConstructor(InterfaceType type,
(...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after
5591 new HSubGraphBlockInformation(elseBranch.graph)); 5591 new HSubGraphBlockInformation(elseBranch.graph));
5592 5592
5593 HBasicBlock conditionStartBlock = conditionBranch.block; 5593 HBasicBlock conditionStartBlock = conditionBranch.block;
5594 conditionStartBlock.setBlockFlow(info, joinBlock); 5594 conditionStartBlock.setBlockFlow(info, joinBlock);
5595 SubGraph conditionGraph = conditionBranch.graph; 5595 SubGraph conditionGraph = conditionBranch.graph;
5596 HIf branch = conditionGraph.end.last; 5596 HIf branch = conditionGraph.end.last;
5597 assert(branch is HIf); 5597 assert(branch is HIf);
5598 branch.blockInformation = conditionStartBlock.blockFlow; 5598 branch.blockInformation = conditionStartBlock.blockFlow;
5599 } 5599 }
5600 } 5600 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | sdk/lib/_internal/lib/js_mirrors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698