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

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

Issue 23660008: Fix a bug in the variable allocator: a pure instruction between an inlined if and its inlined expre… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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
Index: sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart (revision 27475)
+++ sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart (working copy)
@@ -184,6 +184,7 @@
class SsaLiveIntervalBuilder extends HBaseVisitor {
final Compiler compiler;
final Set<HInstruction> generateAtUseSite;
+ final Set<HInstruction> controlFlowOperators;
/**
* A counter to assign start and end ids to live ranges. The initial
@@ -203,7 +204,8 @@
*/
final Map<HInstruction, LiveInterval> liveIntervals;
- SsaLiveIntervalBuilder(this.compiler, this.generateAtUseSite)
+ SsaLiveIntervalBuilder(
+ this.compiler, this.generateAtUseSite, this.controlFlowOperators)
: liveInstructions = new Map<HBasicBlock, LiveEnvironment>(),
liveIntervals = new Map<HInstruction, LiveInterval>();
@@ -263,6 +265,19 @@
LiveEnvironment environment =
new LiveEnvironment(liveIntervals, instructionId);
+ // If the control flow instruction in this block will actually be
+ // inlined in the codegen in the join block, we need to make
+ // whatever is used by that control flow instruction as live in
+ // the join block.
+ if (controlFlowOperators.contains(block.last)) {
+ HIf ifInstruction = block.last;
+ HBasicBlock joinBlock = ifInstruction.joinBlock;
+ if (generateAtUseSite.contains(joinBlock.phis.first)) {
+ markInputsAsLiveInEnvironment(
+ ifInstruction, liveInstructions[joinBlock]);
+ }
+ }
+
// Add to the environment the liveIn of its successor, as well as
// the inputs of the phis of the successor that flow from this block.
for (int i = 0; i < block.successors.length; i++) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | tests/language/inlined_conditional_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698