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

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

Issue 14079003: Implement Symbol correctly in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 7 years, 8 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 3324 matching lines...) Expand 10 before | Expand all | Expand 10 after
3335 } 3335 }
3336 } 3336 }
3337 3337
3338 Element constructor = elements[node]; 3338 Element constructor = elements[node];
3339 Selector selector = elements.getSelector(node); 3339 Selector selector = elements.getSelector(node);
3340 if (compiler.enqueuer.resolution.getCachedElements(constructor) == null) { 3340 if (compiler.enqueuer.resolution.getCachedElements(constructor) == null) {
3341 compiler.internalError("Unresolved element: $constructor", node: node); 3341 compiler.internalError("Unresolved element: $constructor", node: node);
3342 } 3342 }
3343 FunctionElement functionElement = constructor; 3343 FunctionElement functionElement = constructor;
3344 constructor = functionElement.redirectionTarget; 3344 constructor = functionElement.redirectionTarget;
3345 final bool isSymbolConstructor =
3346 functionElement == compiler.symbolConstructor;
3347
3348 if (isSymbolConstructor) {
3349 constructor = compiler.symbolValidatedConstructor;
3350 assert(invariant(node, constructor != null,
3351 message: 'Constructor Symbol.validated is missing'));
3352 selector = compiler.symbolValidatedConstructorSelector;
3353 assert(invariant(node, selector != null,
3354 message: 'Constructor Symbol.validated is missing'));
3355 }
3356
3345 // TODO(5346): Try to avoid the need for calling [declaration] before 3357 // TODO(5346): Try to avoid the need for calling [declaration] before
3346 // creating an [HStatic]. 3358 // creating an [HStatic].
3347 HInstruction target = new HStatic(constructor.declaration); 3359 HInstruction target = new HStatic(constructor.declaration);
3348 add(target); 3360 add(target);
3349 var inputs = <HInstruction>[]; 3361 var inputs = <HInstruction>[];
3350 inputs.add(target); 3362 inputs.add(target);
3351 // TODO(5347): Try to avoid the need for calling [implementation] before 3363 // TODO(5347): Try to avoid the need for calling [implementation] before
3352 // calling [addStaticSendArgumentsToList]. 3364 // calling [addStaticSendArgumentsToList].
3353 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments, 3365 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments,
3354 constructor.implementation, 3366 constructor.implementation,
(...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after
5193 new HSubGraphBlockInformation(elseBranch.graph)); 5205 new HSubGraphBlockInformation(elseBranch.graph));
5194 5206
5195 HBasicBlock conditionStartBlock = conditionBranch.block; 5207 HBasicBlock conditionStartBlock = conditionBranch.block;
5196 conditionStartBlock.setBlockFlow(info, joinBlock); 5208 conditionStartBlock.setBlockFlow(info, joinBlock);
5197 SubGraph conditionGraph = conditionBranch.graph; 5209 SubGraph conditionGraph = conditionBranch.graph;
5198 HIf branch = conditionGraph.end.last; 5210 HIf branch = conditionGraph.end.last;
5199 assert(branch is HIf); 5211 assert(branch is HIf);
5200 branch.blockInformation = conditionStartBlock.blockFlow; 5212 branch.blockInformation = conditionStartBlock.blockFlow;
5201 } 5213 }
5202 } 5214 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698