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

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

Issue 10855020: Infer guaranteed types for static calls that are only called once. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Reviving CL after reverting Created 8 years, 4 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 | « no previous file | dart/lib/compiler/implementation/types/types.dart » ('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 Interceptors { 5 class Interceptors {
6 Compiler compiler; 6 Compiler compiler;
7 Interceptors(Compiler this.compiler); 7 Interceptors(Compiler this.compiler);
8 8
9 SourceString mapOperatorToMethodName(Operator op) { 9 SourceString mapOperatorToMethodName(Operator op) {
10 String name = op.source.stringValue; 10 String name = op.source.stringValue;
(...skipping 3278 matching lines...) Expand 10 before | Expand all | Expand 10 after
3289 3289
3290 visitTypedef(Typedef node) { 3290 visitTypedef(Typedef node) {
3291 compiler.unimplemented('SsaBuilder.visitTypedef', node: node); 3291 compiler.unimplemented('SsaBuilder.visitTypedef', node: node);
3292 } 3292 }
3293 3293
3294 visitTypeVariable(TypeVariable node) { 3294 visitTypeVariable(TypeVariable node) {
3295 compiler.internalError('SsaBuilder.visitTypeVariable'); 3295 compiler.internalError('SsaBuilder.visitTypeVariable');
3296 } 3296 }
3297 3297
3298 HType mapInferredType(Element element) { 3298 HType mapInferredType(Element element) {
3299 if (element === builder.compiler.boolClass) return HType.BOOLEAN; 3299 if (element === builder.compiler.boolClass) return HType.BOOLEAN;
kasperl 2012/08/08 12:36:47 I'm a bit worried about how we deal with null here
ahe 2012/08/08 12:40:04 Right now, I use the intClass to mean the concrete
3300 if (element === builder.compiler.doubleClass) return HType.DOUBLE; 3300 if (element === builder.compiler.doubleClass) return HType.DOUBLE;
3301 if (element === builder.compiler.intClass) return HType.INTEGER; 3301 if (element === builder.compiler.intClass) return HType.INTEGER;
3302 // TODO(ahe): How to map listClass to HType? 3302 if (element === builder.compiler.listClass) return HType.READABLE_ARRAY;
ngeoffray 2012/08/16 12:55:40 Why?
ahe 2012/08/16 17:15:19 What else would you use?
ngeoffray 2012/08/17 07:59:28 HBoundedPotentialPrimitiveArray. A user-defined cl
ahe 2012/08/21 15:05:38 It will always be a JS array. That is what concret
3303 if (element === builder.compiler.listClass) return HType.UNKNOWN;
3304 if (element === builder.compiler.nullClass) return HType.NULL; 3303 if (element === builder.compiler.nullClass) return HType.NULL;
3305 if (element === builder.compiler.stringClass) return HType.STRING; 3304 if (element === builder.compiler.stringClass) return HType.STRING;
3306 return HType.UNKNOWN; 3305 return HType.UNKNOWN;
3307 } 3306 }
3308 3307
3309 /** HACK HACK HACK */ 3308 /** HACK HACK HACK */
3310 void hackAroundPossiblyAbortingBody(Node statement, void body()) { 3309 void hackAroundPossiblyAbortingBody(Node statement, void body()) {
3311 visitCondition() { 3310 visitCondition() {
3312 stack.add(graph.addConstantBool(true)); 3311 stack.add(graph.addConstantBool(true));
3313 } 3312 }
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
3600 new HSubGraphBlockInformation(elseBranch.graph)); 3599 new HSubGraphBlockInformation(elseBranch.graph));
3601 3600
3602 HBasicBlock conditionStartBlock = conditionBranch.block; 3601 HBasicBlock conditionStartBlock = conditionBranch.block;
3603 conditionStartBlock.setBlockFlow(info, joinBlock); 3602 conditionStartBlock.setBlockFlow(info, joinBlock);
3604 SubGraph conditionGraph = conditionBranch.graph; 3603 SubGraph conditionGraph = conditionBranch.graph;
3605 HIf branch = conditionGraph.end.last; 3604 HIf branch = conditionGraph.end.last;
3606 assert(branch is HIf); 3605 assert(branch is HIf);
3607 branch.blockInformation = conditionStartBlock.blockFlow; 3606 branch.blockInformation = conditionStartBlock.blockFlow;
3608 } 3607 }
3609 } 3608 }
OLDNEW
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/types/types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698