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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 1422623014: Add TypeUse. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 1 month 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
« no previous file with comments | « pkg/compiler/lib/src/resolution/variables.dart ('k') | pkg/compiler/lib/src/ssa/codegen.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 part of ssa; 5 part of ssa;
6 6
7 class SsaFunctionCompiler implements FunctionCompiler { 7 class SsaFunctionCompiler implements FunctionCompiler {
8 final SsaCodeGeneratorTask generator; 8 final SsaCodeGeneratorTask generator;
9 final SsaBuilderTask builder; 9 final SsaBuilderTask builder;
10 final SsaOptimizerTask optimizer; 10 final SsaOptimizerTask optimizer;
(...skipping 2572 matching lines...) Expand 10 before | Expand all | Expand 10 after
2583 Element element = type.element; 2583 Element element = type.element;
2584 TypeMask mask = new TypeMask.subtype(element, compiler.world); 2584 TypeMask mask = new TypeMask.subtype(element, compiler.world);
2585 return new HTypeKnown.pinned(mask, original); 2585 return new HTypeKnown.pinned(mask, original);
2586 } 2586 }
2587 2587
2588 HInstruction _checkType(HInstruction original, DartType type, int kind) { 2588 HInstruction _checkType(HInstruction original, DartType type, int kind) {
2589 assert(compiler.enableTypeAssertions); 2589 assert(compiler.enableTypeAssertions);
2590 assert(type != null); 2590 assert(type != null);
2591 type = localsHandler.substInContext(type); 2591 type = localsHandler.substInContext(type);
2592 HInstruction other = buildTypeConversion(original, type, kind); 2592 HInstruction other = buildTypeConversion(original, type, kind);
2593 registry?.registerIsCheck(type); 2593 registry?.registerTypeUse(new TypeUse.isCheck(type));
2594 return other; 2594 return other;
2595 } 2595 }
2596 2596
2597 HInstruction potentiallyCheckOrTrustType(HInstruction original, DartType type, 2597 HInstruction potentiallyCheckOrTrustType(HInstruction original, DartType type,
2598 { int kind: HTypeConversion.CHECKED_MODE_CHECK }) { 2598 { int kind: HTypeConversion.CHECKED_MODE_CHECK }) {
2599 if (type == null) return original; 2599 if (type == null) return original;
2600 HInstruction checkedOrTrusted = original; 2600 HInstruction checkedOrTrusted = original;
2601 if (compiler.trustTypeAnnotations) { 2601 if (compiler.trustTypeAnnotations) {
2602 checkedOrTrusted = _trustType(original, type); 2602 checkedOrTrusted = _trustType(original, type);
2603 } else if (compiler.enableTypeAssertions) { 2603 } else if (compiler.enableTypeAssertions) {
(...skipping 6544 matching lines...) Expand 10 before | Expand all | Expand 10 after
9148 if (unaliased is TypedefType) throw 'unable to unalias $type'; 9148 if (unaliased is TypedefType) throw 'unable to unalias $type';
9149 unaliased.accept(this, builder); 9149 unaliased.accept(this, builder);
9150 } 9150 }
9151 9151
9152 void visitDynamicType(DynamicType type, SsaBuilder builder) { 9152 void visitDynamicType(DynamicType type, SsaBuilder builder) {
9153 JavaScriptBackend backend = builder.compiler.backend; 9153 JavaScriptBackend backend = builder.compiler.backend;
9154 ClassElement cls = backend.helpers.DynamicRuntimeType; 9154 ClassElement cls = backend.helpers.DynamicRuntimeType;
9155 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 9155 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
9156 } 9156 }
9157 } 9157 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/variables.dart ('k') | pkg/compiler/lib/src/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698