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

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: Addres comments. 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 // TODO(karlklose): move this type registration to the codegen.
3591 compiler.codegenWorld.instantiatedTypes.add(type);
3590 visitNewSend(node.send, type); 3592 visitNewSend(node.send, type);
3591 } 3593 }
3592 } 3594 }
3593 } 3595 }
3594 3596
3595 visitSendSet(SendSet node) { 3597 visitSendSet(SendSet node) {
3596 Element element = elements[node]; 3598 Element element = elements[node];
3597 if (!Elements.isUnresolved(element) && element.impliesType()) { 3599 if (!Elements.isUnresolved(element) && element.impliesType()) {
3598 Identifier selector = node.selector; 3600 Identifier selector = node.selector;
3599 generateThrowNoSuchMethod(node, selector.source.slowToString(), 3601 generateThrowNoSuchMethod(node, selector.source.slowToString(),
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after
5032 new HSubGraphBlockInformation(elseBranch.graph)); 5034 new HSubGraphBlockInformation(elseBranch.graph));
5033 5035
5034 HBasicBlock conditionStartBlock = conditionBranch.block; 5036 HBasicBlock conditionStartBlock = conditionBranch.block;
5035 conditionStartBlock.setBlockFlow(info, joinBlock); 5037 conditionStartBlock.setBlockFlow(info, joinBlock);
5036 SubGraph conditionGraph = conditionBranch.graph; 5038 SubGraph conditionGraph = conditionBranch.graph;
5037 HIf branch = conditionGraph.end.last; 5039 HIf branch = conditionGraph.end.last;
5038 assert(branch is HIf); 5040 assert(branch is HIf);
5039 branch.blockInformation = conditionStartBlock.blockFlow; 5041 branch.blockInformation = conditionStartBlock.blockFlow;
5040 } 5042 }
5041 } 5043 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698