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

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

Issue 11280122: Do not type check parameters that are not passed directly. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 15200)
+++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy)
@@ -1607,11 +1607,22 @@
// because that is where the type guards will also be inserted.
// This way we ensure that a type guard will dominate the type
// check.
- signature.orderedForEachParameter((Element element) {
+ signature.orderedForEachParameter((Element parameterElement) {
+ if (element.isGenerativeConstructorBody()) {
+ ClosureScope scopeData =
+ localsHandler.closureData.capturingScopes[node];
+ if (scopeData != null
+ && scopeData.capturedVariableMapping.containsKey(
+ parameterElement)) {
+ // The parameter will be a field in the box passed as the
+ // last parameter. So no need to have it.
+ return;
+ }
+ }
HInstruction newParameter = potentiallyCheckType(
- localsHandler.directLocals[element],
- element.computeType(compiler));
- localsHandler.directLocals[element] = newParameter;
+ localsHandler.directLocals[parameterElement],
+ parameterElement.computeType(compiler));
+ localsHandler.directLocals[parameterElement] = newParameter;
});
returnType = signature.returnType;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698