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

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

Issue 16847006: Also deal with List.filled in the backend, not just the inferrer and list tracer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | tests/compiler/dart2js/list_tracer_node_type_test.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 /** 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 3345 matching lines...) Expand 10 before | Expand all | Expand 10 after
3356 * Invariant: [type] must not be malformed in checked mode. 3356 * Invariant: [type] must not be malformed in checked mode.
3357 */ 3357 */
3358 handleNewSend(NewExpression node, InterfaceType type) { 3358 handleNewSend(NewExpression node, InterfaceType type) {
3359 Send send = node.send; 3359 Send send = node.send;
3360 assert(invariant(send, 3360 assert(invariant(send,
3361 !compiler.enableTypeAssertions || !type.isMalformed, 3361 !compiler.enableTypeAssertions || !type.isMalformed,
3362 message: '$type is malformed in checked mode')); 3362 message: '$type is malformed in checked mode'));
3363 bool isListConstructor = false; 3363 bool isListConstructor = false;
3364 computeType(element) { 3364 computeType(element) {
3365 Element originalElement = elements[send]; 3365 Element originalElement = elements[send];
3366 if (Elements.isFixedListConstructorCall( 3366 if (Elements.isFixedListConstructorCall(originalElement, send, compiler)
3367 originalElement, send, compiler)) { 3367 || Elements.isFilledListConstructorCall(
3368 originalElement, send, compiler)) {
3368 isListConstructor = true; 3369 isListConstructor = true;
3369 HType inferred = 3370 HType inferred =
3370 new HType.inferredForNode(currentElement, send, compiler); 3371 new HType.inferredForNode(currentElement, send, compiler);
3371 return inferred.isUnknown() ? backend.fixedArrayType : inferred; 3372 return inferred.isUnknown() ? backend.fixedArrayType : inferred;
3372 } else if (Elements.isGrowableListConstructorCall( 3373 } else if (Elements.isGrowableListConstructorCall(
3373 originalElement, send, compiler)) { 3374 originalElement, send, compiler)) {
3374 isListConstructor = true; 3375 isListConstructor = true;
3375 HType inferred = 3376 HType inferred =
3376 new HType.inferredForNode(currentElement, send, compiler); 3377 new HType.inferredForNode(currentElement, send, compiler);
3377 return inferred.isUnknown() ? backend.extendableArrayType : inferred; 3378 return inferred.isUnknown() ? backend.extendableArrayType : inferred;
(...skipping 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after
5413 new HSubGraphBlockInformation(elseBranch.graph)); 5414 new HSubGraphBlockInformation(elseBranch.graph));
5414 5415
5415 HBasicBlock conditionStartBlock = conditionBranch.block; 5416 HBasicBlock conditionStartBlock = conditionBranch.block;
5416 conditionStartBlock.setBlockFlow(info, joinBlock); 5417 conditionStartBlock.setBlockFlow(info, joinBlock);
5417 SubGraph conditionGraph = conditionBranch.graph; 5418 SubGraph conditionGraph = conditionBranch.graph;
5418 HIf branch = conditionGraph.end.last; 5419 HIf branch = conditionGraph.end.last;
5419 assert(branch is HIf); 5420 assert(branch is HIf);
5420 branch.blockInformation = conditionStartBlock.blockFlow; 5421 branch.blockInformation = conditionStartBlock.blockFlow;
5421 } 5422 }
5422 } 5423 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/list_tracer_node_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698