src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java

Print this page




 524                                  * values (if the live range is extended to a call site, the value
 525                                  * would be in a register at the call otherwise).
 526                                  */
 527                                 op.visitEachState(stateProc);
 528                             }
 529 
 530                         }   // end of instruction iteration
 531                             // number label instruction
 532                         instructionIndex--;
 533                         numberInstruction(block, instructions.get(0), instructionIndex);
 534                         AbstractBlockBase<?> pred = blockId == 0 ? null : blocks[blockId - 1];
 535                         handleBlockBegin(block, pred);
 536                     }
 537                     if (debug.isDumpEnabled(DebugContext.VERY_DETAILED_LEVEL)) {
 538                         allocator.printIntervals("After Block " + block);
 539                     }
 540                 }   // end of block iteration
 541                 assert instructionIndex == 0 : "not at start?" + instructionIndex;
 542                 handleTraceBegin(blocks[0]);
 543 



 544                 // fix spill state for phi/incoming intervals
 545                 for (TraceInterval interval : allocator.intervals()) {
 546                     if (interval != null && interval.spillState().equals(SpillState.NoDefinitionFound) && interval.spillDefinitionPos() != -1) {

 547                         // there was a definition in a phi/incoming
 548                         interval.setSpillState(SpillState.NoSpillStore);
 549                     }




 550                 }
 551                 if (TraceRAuseInterTraceHints.getValue(allocator.getLIR().getOptions())) {
 552                     addInterTraceHints();
 553                 }

 554                 for (FixedInterval interval1 : allocator.fixedIntervals()) {
 555                     if (interval1 != null) {
 556                         /* We use [-1, 0] to avoid intersection with incoming values. */
 557                         interval1.addRange(-1, 0);
 558                     }
 559                 }
 560             }
 561         }
 562 
 563         private void handleTraceBegin(AbstractBlockBase<?> block) {
 564             LIRInstruction op = getLIR().getLIRforBlock(block).get(0);
 565             GlobalLivenessInfo livenessInfo = allocator.getGlobalLivenessInfo();
 566             for (int varNum : livenessInfo.getBlockIn(block)) {
 567                 if (isAliveAtBlockBegin(varNum)) {
 568                     addVariableDef(livenessInfo.getVariable(varNum), op, RegisterPriority.None);
 569                 }
 570             }
 571         }
 572 
 573         private boolean isAliveAtBlockBegin(int varNum) {




 524                                  * values (if the live range is extended to a call site, the value
 525                                  * would be in a register at the call otherwise).
 526                                  */
 527                                 op.visitEachState(stateProc);
 528                             }
 529 
 530                         }   // end of instruction iteration
 531                             // number label instruction
 532                         instructionIndex--;
 533                         numberInstruction(block, instructions.get(0), instructionIndex);
 534                         AbstractBlockBase<?> pred = blockId == 0 ? null : blocks[blockId - 1];
 535                         handleBlockBegin(block, pred);
 536                     }
 537                     if (debug.isDumpEnabled(DebugContext.VERY_DETAILED_LEVEL)) {
 538                         allocator.printIntervals("After Block " + block);
 539                     }
 540                 }   // end of block iteration
 541                 assert instructionIndex == 0 : "not at start?" + instructionIndex;
 542                 handleTraceBegin(blocks[0]);
 543 
 544                 if (TraceRAuseInterTraceHints.getValue(allocator.getLIR().getOptions())) {
 545                     addInterTraceHints();
 546                 }
 547                 // fix spill state for phi/incoming intervals
 548                 for (TraceInterval interval : allocator.intervals()) {
 549                     if (interval != null) {
 550                         if (interval.spillState().equals(SpillState.NoDefinitionFound) && interval.spillDefinitionPos() != -1) {
 551                             // there was a definition in a phi/incoming
 552                             interval.setSpillState(SpillState.NoSpillStore);
 553                         }
 554                         if (interval.preSpilledAllocated()) {
 555                             // pre-spill unused, start in memory intervals
 556                             allocator.assignSpillSlot(interval);
 557                         }
 558                     }


 559                 }
 560 
 561                 for (FixedInterval interval1 : allocator.fixedIntervals()) {
 562                     if (interval1 != null) {
 563                         /* We use [-1, 0] to avoid intersection with incoming values. */
 564                         interval1.addRange(-1, 0);
 565                     }
 566                 }
 567             }
 568         }
 569 
 570         private void handleTraceBegin(AbstractBlockBase<?> block) {
 571             LIRInstruction op = getLIR().getLIRforBlock(block).get(0);
 572             GlobalLivenessInfo livenessInfo = allocator.getGlobalLivenessInfo();
 573             for (int varNum : livenessInfo.getBlockIn(block)) {
 574                 if (isAliveAtBlockBegin(varNum)) {
 575                     addVariableDef(livenessInfo.getVariable(varNum), op, RegisterPriority.None);
 576                 }
 577             }
 578         }
 579 
 580         private boolean isAliveAtBlockBegin(int varNum) {


src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File