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

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

Issue 10389063: Implement PrimitiveOrNull types. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 | « lib/compiler/implementation/dart2js.dart ('k') | lib/compiler/implementation/ssa/optimize.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 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 Element sourceElement) { 1041 Element sourceElement) {
1042 if (!compiler.enableTypeAssertions) return original; 1042 if (!compiler.enableTypeAssertions) return original;
1043 1043
1044 Type type = sourceElement.computeType(compiler); 1044 Type type = sourceElement.computeType(compiler);
1045 if (type === null) return original; 1045 if (type === null) return original;
1046 if (type.element === compiler.dynamicClass) return original; 1046 if (type.element === compiler.dynamicClass) return original;
1047 if (type.element === compiler.objectClass) return original; 1047 if (type.element === compiler.objectClass) return original;
1048 1048
1049 HType convertedType = new HType.fromBoundedType(type, compiler, true); 1049 HType convertedType = new HType.fromBoundedType(type, compiler, true);
1050 1050
1051 // TODO(ngeoffray): the factory method should never return null.
1052 if (convertedType === null) {
1053 return original;
1054 }
1055
1056 // No need to convert if we know the instruction has 1051 // No need to convert if we know the instruction has
1057 // [convertedType] as a bound. 1052 // [convertedType] as a bound.
1058 if (original.guaranteedType == convertedType) { 1053 if (original.guaranteedType == convertedType) {
1059 return original; 1054 return original;
1060 } 1055 }
1061 1056
1062 HInstruction instruction = 1057 HInstruction instruction =
1063 new HTypeConversion(convertedType, original, true); 1058 new HTypeConversion(convertedType, original, true);
1064 add(instruction); 1059 add(instruction);
1065 return instruction; 1060 return instruction;
(...skipping 2254 matching lines...) Expand 10 before | Expand all | Expand 10 after
3320 <HInstruction>[target, input], 3315 <HInstruction>[target, input],
3321 HType.STRING)); 3316 HType.STRING));
3322 return builder.pop(); 3317 return builder.pop();
3323 } 3318 }
3324 3319
3325 HInstruction result() { 3320 HInstruction result() {
3326 flushLiterals(); 3321 flushLiterals();
3327 return prefix; 3322 return prefix;
3328 } 3323 }
3329 } 3324 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/dart2js.dart ('k') | lib/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698