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

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

Issue 12088019: Fix issue https://code.google.com/p/dart/issues/detail?id=8106: save the sourceElement in the one s… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/interceptor_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 abstract class OptimizationPhase { 7 abstract class OptimizationPhase {
8 String get name; 8 String get name;
9 void visitGraph(HGraph graph); 9 void visitGraph(HGraph graph);
10 } 10 }
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 // If [node] was loop hoisted, we keep the interceptor. 1522 // If [node] was loop hoisted, we keep the interceptor.
1523 if (!user.hasSameLoopHeaderAs(node)) return; 1523 if (!user.hasSameLoopHeaderAs(node)) return;
1524 1524
1525 // Replace the user with a [HOneShotInterceptor]. 1525 // Replace the user with a [HOneShotInterceptor].
1526 HConstant nullConstant = graph.addConstantNull(constantSystem); 1526 HConstant nullConstant = graph.addConstantNull(constantSystem);
1527 List<HInstruction> inputs = new List<HInstruction>.from(user.inputs); 1527 List<HInstruction> inputs = new List<HInstruction>.from(user.inputs);
1528 inputs[0] = nullConstant; 1528 inputs[0] = nullConstant;
1529 HOneShotInterceptor interceptor = new HOneShotInterceptor( 1529 HOneShotInterceptor interceptor = new HOneShotInterceptor(
1530 user.selector, inputs, node.interceptedClasses); 1530 user.selector, inputs, node.interceptedClasses);
1531 interceptor.sourcePosition = user.sourcePosition; 1531 interceptor.sourcePosition = user.sourcePosition;
1532 interceptor.sourceElement = user.sourceElement;
1532 1533
1533 HBasicBlock block = user.block; 1534 HBasicBlock block = user.block;
1534 block.addAfter(user, interceptor); 1535 block.addAfter(user, interceptor);
1535 block.rewrite(user, interceptor); 1536 block.rewrite(user, interceptor);
1536 block.remove(user); 1537 block.remove(user);
1537 1538
1538 // The interceptor will be removed in the dead code elimination 1539 // The interceptor will be removed in the dead code elimination
1539 // phase. Note that removing it here would not work because of how 1540 // phase. Note that removing it here would not work because of how
1540 // the [visitBasicBlock] is implemented. 1541 // the [visitBasicBlock] is implemented.
1541 } 1542 }
1542 } 1543 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/interceptor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698