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

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

Issue 14015004: Remove call-indirections from type tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 2748 matching lines...) Expand 10 before | Expand all | Expand 10 after
2759 add(helperCall); 2759 add(helperCall);
2760 HInstruction representations = 2760 HInstruction representations =
2761 buildTypeArgumentRepresentations(type); 2761 buildTypeArgumentRepresentations(type);
2762 add(representations); 2762 add(representations);
2763 HInstruction isFieldName = 2763 HInstruction isFieldName =
2764 addConstantString(node, backend.namer.operatorIs(element)); 2764 addConstantString(node, backend.namer.operatorIs(element));
2765 // TODO(karlklose): use [:null:] for [asField] if [element] does not 2765 // TODO(karlklose): use [:null:] for [asField] if [element] does not
2766 // have a subclass. 2766 // have a subclass.
2767 HInstruction asFieldName = 2767 HInstruction asFieldName =
2768 addConstantString(node, backend.namer.substitutionName(element)); 2768 addConstantString(node, backend.namer.substitutionName(element));
2769 HInstruction native =
2770 graph.addConstantBool(needsNativeCheck, constantSystem);
2771 List<HInstruction> inputs = <HInstruction>[helperCall, 2769 List<HInstruction> inputs = <HInstruction>[helperCall,
2772 expression, 2770 expression,
2773 isFieldName, 2771 isFieldName,
2774 representations, 2772 representations,
2775 asFieldName, 2773 asFieldName];
2776 native];
2777 HInstruction call = new HInvokeStatic(inputs, HType.BOOLEAN); 2774 HInstruction call = new HInvokeStatic(inputs, HType.BOOLEAN);
2778 add(call); 2775 add(call);
2779 instruction = new HIs(type, <HInstruction>[expression, call], 2776 instruction = new HIs(type, <HInstruction>[expression, call],
2780 HIs.COMPOUND_CHECK); 2777 HIs.COMPOUND_CHECK);
2781 } else { 2778 } else {
2782 instruction = new HIs(type, <HInstruction>[expression], HIs.RAW_CHECK); 2779 instruction = new HIs(type, <HInstruction>[expression], HIs.RAW_CHECK);
2783 } 2780 }
2784 if (isNot) { 2781 if (isNot) {
2785 add(instruction); 2782 add(instruction);
2786 instruction = new HNot(instruction); 2783 instruction = new HNot(instruction);
(...skipping 2444 matching lines...) Expand 10 before | Expand all | Expand 10 after
5231 new HSubGraphBlockInformation(elseBranch.graph)); 5228 new HSubGraphBlockInformation(elseBranch.graph));
5232 5229
5233 HBasicBlock conditionStartBlock = conditionBranch.block; 5230 HBasicBlock conditionStartBlock = conditionBranch.block;
5234 conditionStartBlock.setBlockFlow(info, joinBlock); 5231 conditionStartBlock.setBlockFlow(info, joinBlock);
5235 SubGraph conditionGraph = conditionBranch.graph; 5232 SubGraph conditionGraph = conditionBranch.graph;
5236 HIf branch = conditionGraph.end.last; 5233 HIf branch = conditionGraph.end.last;
5237 assert(branch is HIf); 5234 assert(branch is HIf);
5238 branch.blockInformation = conditionStartBlock.blockFlow; 5235 branch.blockInformation = conditionStartBlock.blockFlow;
5239 } 5236 }
5240 } 5237 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698