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

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

Issue 12544021: Fix bug 9090: provide the paramter checks arguments to the generative constructor body after the re… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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
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 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 List bodyCallInputs = <HInstruction>[]; 1470 List bodyCallInputs = <HInstruction>[];
1471 bodyCallInputs.add(newObject); 1471 bodyCallInputs.add(newObject);
1472 TreeElements elements = 1472 TreeElements elements =
1473 compiler.enqueuer.resolution.getCachedElements(constructor); 1473 compiler.enqueuer.resolution.getCachedElements(constructor);
1474 Node node = constructor.parseNode(compiler); 1474 Node node = constructor.parseNode(compiler);
1475 ClosureClassMap parameterClosureData = 1475 ClosureClassMap parameterClosureData =
1476 compiler.closureToClassMapper.getMappingForNestedFunction(node); 1476 compiler.closureToClassMapper.getMappingForNestedFunction(node);
1477 1477
1478 1478
1479 FunctionSignature functionSignature = body.computeSignature(compiler); 1479 FunctionSignature functionSignature = body.computeSignature(compiler);
1480 // Provide the parameters to the generative constructor body.
1480 functionSignature.orderedForEachParameter((parameter) { 1481 functionSignature.orderedForEachParameter((parameter) {
1481 // if [parameter] is boxed, it will be a field in the box passed as the 1482 // If [parameter] is boxed, it will be a field in the box passed as the
1482 // last parameter. So no need to direclty pass it. 1483 // last parameter. So no need to direclty pass it.
kasperl 2013/03/13 09:43:47 direclty -> directly
ngeoffray 2013/03/13 09:55:28 Done.
1483 if (!localsHandler.isBoxed(parameter)) { 1484 if (!localsHandler.isBoxed(parameter)) {
1484 bodyCallInputs.add(localsHandler.readLocal(parameter)); 1485 bodyCallInputs.add(localsHandler.readLocal(parameter));
1485 } 1486 }
1487 });
1488
1489 // Provide the parameter checks to the generative constructor
1490 // body.
1491 functionSignature.orderedForEachParameter((parameter) {
1486 // If [parameter] is checked, we pass the already computed 1492 // If [parameter] is checked, we pass the already computed
1487 // boolean to the constructor body. 1493 // boolean to the constructor body.
1488 if (elements.isParameterChecked(parameter)) { 1494 if (elements.isParameterChecked(parameter)) {
1489 Element fieldCheck = 1495 Element fieldCheck =
1490 parameterClosureData.parametersWithSentinel[parameter]; 1496 parameterClosureData.parametersWithSentinel[parameter];
1491 bodyCallInputs.add(localsHandler.readLocal(fieldCheck)); 1497 bodyCallInputs.add(localsHandler.readLocal(fieldCheck));
1492 } 1498 }
1493 }); 1499 });
1494 1500
1495 ClassElement currentClass = constructor.getEnclosingClass(); 1501 ClassElement currentClass = constructor.getEnclosingClass();
(...skipping 3614 matching lines...) Expand 10 before | Expand all | Expand 10 after
5110 new HSubGraphBlockInformation(elseBranch.graph)); 5116 new HSubGraphBlockInformation(elseBranch.graph));
5111 5117
5112 HBasicBlock conditionStartBlock = conditionBranch.block; 5118 HBasicBlock conditionStartBlock = conditionBranch.block;
5113 conditionStartBlock.setBlockFlow(info, joinBlock); 5119 conditionStartBlock.setBlockFlow(info, joinBlock);
5114 SubGraph conditionGraph = conditionBranch.graph; 5120 SubGraph conditionGraph = conditionBranch.graph;
5115 HIf branch = conditionGraph.end.last; 5121 HIf branch = conditionGraph.end.last;
5116 assert(branch is HIf); 5122 assert(branch is HIf);
5117 branch.blockInformation = conditionStartBlock.blockFlow; 5123 branch.blockInformation = conditionStartBlock.blockFlow;
5118 } 5124 }
5119 } 5125 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/argument_definition6_test.dart » ('j') | tests/language/argument_definition6_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698