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

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

Issue 14772041: Now that we inline instance methods on all kinds of receivers (not only "this" calls), we need to d… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « no previous file | tests/language/null_inline_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 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 1210
1211 if (canBeInlined == null) { 1211 if (canBeInlined == null) {
1212 canBeInlined = InlineWeeder.canBeInlined(functionExpression, newElements); 1212 canBeInlined = InlineWeeder.canBeInlined(functionExpression, newElements);
1213 backend.canBeInlined[function] = canBeInlined; 1213 backend.canBeInlined[function] = canBeInlined;
1214 if (!canBeInlined) return false; 1214 if (!canBeInlined) return false;
1215 } 1215 }
1216 1216
1217 assert(canBeInlined); 1217 assert(canBeInlined);
1218 InliningState state = enterInlinedMethod( 1218 InliningState state = enterInlinedMethod(
1219 function, selector, argumentsNodes, providedArguments, currentNode); 1219 function, selector, argumentsNodes, providedArguments, currentNode);
1220 // Add an explicit null check on the receiver. We use [element]
1221 // to get the same name in the NoSuchMethodError message as if we had
1222 // called it.
1223 if (element.isInstanceMember()
1224 && (selector.mask == null || selector.mask.isNullable)) {
1225 addWithPosition(
1226 new HFieldGet(element, providedArguments[0]), currentNode);
1227 }
1220 inlinedFrom(element, () { 1228 inlinedFrom(element, () {
1221 functionExpression.body.accept(this); 1229 functionExpression.body.accept(this);
1222 }); 1230 });
1223 leaveInlinedMethod(state); 1231 leaveInlinedMethod(state);
1224 return true; 1232 return true;
1225 } 1233 }
1226 1234
1227 inlinedFrom(Element element, f()) { 1235 inlinedFrom(Element element, f()) {
1228 assert(element is FunctionElement || element is VariableElement); 1236 assert(element is FunctionElement || element is VariableElement);
1229 return compiler.withCurrentElement(element, () { 1237 return compiler.withCurrentElement(element, () {
(...skipping 4039 matching lines...) Expand 10 before | Expand all | Expand 10 after
5269 new HSubGraphBlockInformation(elseBranch.graph)); 5277 new HSubGraphBlockInformation(elseBranch.graph));
5270 5278
5271 HBasicBlock conditionStartBlock = conditionBranch.block; 5279 HBasicBlock conditionStartBlock = conditionBranch.block;
5272 conditionStartBlock.setBlockFlow(info, joinBlock); 5280 conditionStartBlock.setBlockFlow(info, joinBlock);
5273 SubGraph conditionGraph = conditionBranch.graph; 5281 SubGraph conditionGraph = conditionBranch.graph;
5274 HIf branch = conditionGraph.end.last; 5282 HIf branch = conditionGraph.end.last;
5275 assert(branch is HIf); 5283 assert(branch is HIf);
5276 branch.blockInformation = conditionStartBlock.blockFlow; 5284 branch.blockInformation = conditionStartBlock.blockFlow;
5277 } 5285 }
5278 } 5286 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/null_inline_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698