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

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

Issue 11090016: Change core lib, dart2js, and more for new optional parameters syntax (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/scanner/listener.dart ('k') | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/builder.dart
===================================================================
--- lib/compiler/implementation/ssa/builder.dart (revision 13683)
+++ lib/compiler/implementation/ssa/builder.dart (working copy)
@@ -1243,25 +1243,25 @@
Map<Element, HInstruction> fieldValues) {
assert(invariant(classElement, classElement.isImplementation));
classElement.forEachInstanceField(
+ (ClassElement enclosingClass, Element member) {
+ TreeElements definitions = compiler.analyzeElement(member);
+ Node node = member.parseNode(compiler);
+ SendSet assignment = node.asSendSet();
+ HInstruction value;
+ if (assignment === null) {
+ value = graph.addConstantNull(constantSystem);
+ } else {
+ Node right = assignment.arguments.head;
+ TreeElements savedElements = elements;
+ elements = definitions;
+ right.accept(this);
+ elements = savedElements;
+ value = pop();
+ }
+ fieldValues[member] = value;
+ },
includeBackendMembers: true,
- includeSuperMembers: false,
- f: (ClassElement enclosingClass, Element member) {
- TreeElements definitions = compiler.analyzeElement(member);
- Node node = member.parseNode(compiler);
- SendSet assignment = node.asSendSet();
- HInstruction value;
- if (assignment === null) {
- value = graph.addConstantNull(constantSystem);
- } else {
- Node right = assignment.arguments.head;
- TreeElements savedElements = elements;
- elements = definitions;
- right.accept(this);
- elements = savedElements;
- value = pop();
- }
- fieldValues[member] = value;
- });
+ includeSuperMembers: false);
}
@@ -1315,12 +1315,12 @@
// Call the JavaScript constructor with the fields as argument.
List<HInstruction> constructorArguments = <HInstruction>[];
classElement.forEachInstanceField(
+ (ClassElement enclosingClass, Element member) {
+ constructorArguments.add(
+ potentiallyCheckType(fieldValues[member], member));
+ },
includeBackendMembers: true,
- includeSuperMembers: true,
- f: (ClassElement enclosingClass, Element member) {
- constructorArguments.add(
- potentiallyCheckType(fieldValues[member], member));
- });
+ includeSuperMembers: true);
HForeignNew newObject = new HForeignNew(classElement, constructorArguments);
add(newObject);
@@ -3017,7 +3017,7 @@
}
// TODO(antonm): migrate rest of SsaBuilder to internalError.
- internalError(String reason, [Node node]) {
+ internalError(String reason, {Node node}) {
compiler.internalError(reason, node: node);
}
@@ -3337,8 +3337,7 @@
}
visitConditional(Conditional node) {
- SsaBranchBuilder brancher =
- new SsaBranchBuilder(this, diagnosticNode: node);
+ SsaBranchBuilder brancher = new SsaBranchBuilder(this, node);
brancher.handleConditional(() => visit(node.condition),
() => visit(node.thenExpression),
() => visit(node.elseExpression));
@@ -4308,7 +4307,7 @@
* return value implies that [mayReuseFromLocals] was set to [:true:].
*/
bool mergeLocals(SsaBranch fromBranch, SsaBranch toBranch,
- [bool mayReuseFromLocals]) {
+ {bool mayReuseFromLocals}) {
LocalsHandler fromLocals = fromBranch.exitLocals;
if (toBranch.startLocals == null) {
if (mayReuseFromLocals) {
@@ -4367,7 +4366,7 @@
_handleDiamondBranch(visitCondition, visitThen, visitElse, true);
}
- void handleLogicalAndOr(void left(), void right(), [bool isAnd]) {
+ void handleLogicalAndOr(void left(), void right(), {bool isAnd}) {
// x && y is transformed into:
// t0 = boolify(x);
// if (t0) {
@@ -4409,7 +4408,7 @@
void handleLogicalAndOrWithLeftNode(Node left,
void visitRight(),
- [bool isAnd]) {
+ {bool isAnd}) {
// This method is similar to [handleLogicalAndOr] but optimizes the case
// where left is a logical "and" or logical "or".
//
@@ -4433,10 +4432,11 @@
Node middle = link.head;
handleLogicalAndOrWithLeftNode(
newLeft,
- () => handleLogicalAndOrWithLeftNode(middle, visitRight, isAnd),
+ () => handleLogicalAndOrWithLeftNode(middle, visitRight,
+ isAnd: isAnd),
isAnd: isAnd);
} else {
- handleLogicalAndOr(() => builder.visit(left), visitRight, isAnd);
+ handleLogicalAndOr(() => builder.visit(left), visitRight, isAnd: isAnd);
}
}
« no previous file with comments | « lib/compiler/implementation/scanner/listener.dart ('k') | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698