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

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

Issue 11557010: Implement subtype checks on type arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update test expectations. Created 8 years 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 3569 matching lines...) Expand 10 before | Expand all | Expand 10 after
3580 Constant constant = handler.compileNodeWithDefinitions(node, elements); 3580 Constant constant = handler.compileNodeWithDefinitions(node, elements);
3581 stack.add(graph.addConstant(constant)); 3581 stack.add(graph.addConstant(constant));
3582 } else { 3582 } else {
3583 DartType type = elements.getType(node); 3583 DartType type = elements.getType(node);
3584 if (compiler.enableTypeAssertions && type.isMalformed) { 3584 if (compiler.enableTypeAssertions && type.isMalformed) {
3585 String reasons = fetchReasonsFromMalformedType(type); 3585 String reasons = fetchReasonsFromMalformedType(type);
3586 // TODO(johnniwinther): Change to resemble type errors from bounds check 3586 // TODO(johnniwinther): Change to resemble type errors from bounds check
3587 // on type arguments. 3587 // on type arguments.
3588 generateRuntimeError(node, '$type is malformed: $reasons'); 3588 generateRuntimeError(node, '$type is malformed: $reasons');
3589 } else { 3589 } else {
3590 compiler.codegenWorld.instantiatedTypes.add(type);
ngeoffray 2012/12/12 12:09:11 You should not register in builder.dart, bit in co
karlklose 2012/12/12 14:50:47 I cannot do this now, we need a way to encode the
3590 visitNewSend(node.send, type); 3591 visitNewSend(node.send, type);
3591 } 3592 }
3592 } 3593 }
3593 } 3594 }
3594 3595
3595 visitSendSet(SendSet node) { 3596 visitSendSet(SendSet node) {
3596 Element element = elements[node]; 3597 Element element = elements[node];
3597 if (!Elements.isUnresolved(element) && element.impliesType()) { 3598 if (!Elements.isUnresolved(element) && element.impliesType()) {
3598 Identifier selector = node.selector; 3599 Identifier selector = node.selector;
3599 generateThrowNoSuchMethod(node, selector.source.slowToString(), 3600 generateThrowNoSuchMethod(node, selector.source.slowToString(),
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after
5032 new HSubGraphBlockInformation(elseBranch.graph)); 5033 new HSubGraphBlockInformation(elseBranch.graph));
5033 5034
5034 HBasicBlock conditionStartBlock = conditionBranch.block; 5035 HBasicBlock conditionStartBlock = conditionBranch.block;
5035 conditionStartBlock.setBlockFlow(info, joinBlock); 5036 conditionStartBlock.setBlockFlow(info, joinBlock);
5036 SubGraph conditionGraph = conditionBranch.graph; 5037 SubGraph conditionGraph = conditionBranch.graph;
5037 HIf branch = conditionGraph.end.last; 5038 HIf branch = conditionGraph.end.last;
5038 assert(branch is HIf); 5039 assert(branch is HIf);
5039 branch.blockInformation = conditionStartBlock.blockFlow; 5040 branch.blockInformation = conditionStartBlock.blockFlow;
5040 } 5041 }
5041 } 5042 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698