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

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

Issue 11489011: Make identical an external function and make it throw in both runtimes, as they both recognize it. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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 3352 matching lines...) Expand 10 before | Expand all | Expand 10 after
3363 // TODO(5347): Try to avoid the need for calling [implementation] before 3363 // TODO(5347): Try to avoid the need for calling [implementation] before
3364 // calling [addStaticSendArgumentsToList]. 3364 // calling [addStaticSendArgumentsToList].
3365 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments, 3365 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments,
3366 element.implementation, 3366 element.implementation,
3367 inputs); 3367 inputs);
3368 if (!succeeded) { 3368 if (!succeeded) {
3369 generateWrongArgumentCountError(node, element, node.arguments); 3369 generateWrongArgumentCountError(node, element, node.arguments);
3370 return; 3370 return;
3371 } 3371 }
3372 3372
3373 // TODO(kasperl): Try to use the general inlining infrastructure for
3374 // inlining the identical function.
3375 if (identical(element, compiler.identicalFunction)) { 3373 if (identical(element, compiler.identicalFunction)) {
3376 pushWithPosition(new HIdentity(target, inputs[1], inputs[2]), node); 3374 pushWithPosition(new HIdentity(target, inputs[1], inputs[2]), node);
3377 return; 3375 return;
3378 } 3376 }
3379 3377
3380 HInvokeStatic instruction = new HInvokeStatic(inputs); 3378 HInvokeStatic instruction = new HInvokeStatic(inputs);
3381 // TODO(ngeoffray): Only do this if knowing the return type is 3379 // TODO(ngeoffray): Only do this if knowing the return type is
3382 // useful. 3380 // useful.
3383 HType returnType = 3381 HType returnType =
3384 builder.backend.optimisticReturnTypesWithRecompilationOnTypeChange( 3382 builder.backend.optimisticReturnTypesWithRecompilationOnTypeChange(
(...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after
4991 new HSubGraphBlockInformation(elseBranch.graph)); 4989 new HSubGraphBlockInformation(elseBranch.graph));
4992 4990
4993 HBasicBlock conditionStartBlock = conditionBranch.block; 4991 HBasicBlock conditionStartBlock = conditionBranch.block;
4994 conditionStartBlock.setBlockFlow(info, joinBlock); 4992 conditionStartBlock.setBlockFlow(info, joinBlock);
4995 SubGraph conditionGraph = conditionBranch.graph; 4993 SubGraph conditionGraph = conditionBranch.graph;
4996 HIf branch = conditionGraph.end.last; 4994 HIf branch = conditionGraph.end.last;
4997 assert(branch is HIf); 4995 assert(branch is HIf);
4998 branch.blockInformation = conditionStartBlock.blockFlow; 4996 branch.blockInformation = conditionStartBlock.blockFlow;
4999 } 4997 }
5000 } 4998 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698