src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java
changeset 58877 aec7bf35d6f5
parent 58299 6df94ce3ab2f
equal deleted inserted replaced
58876:1a8d65e71a66 58877:aec7bf35d6f5
   258 
   258 
   259     private LocationSet calcKillLocations() {
   259     private LocationSet calcKillLocations() {
   260         LocationSet result = new LocationSet();
   260         LocationSet result = new LocationSet();
   261         for (FixedNode node : this.getNodes()) {
   261         for (FixedNode node : this.getNodes()) {
   262             if (node instanceof MemoryCheckpoint.Single) {
   262             if (node instanceof MemoryCheckpoint.Single) {
   263                 LocationIdentity identity = ((MemoryCheckpoint.Single) node).getLocationIdentity();
   263                 LocationIdentity identity = ((MemoryCheckpoint.Single) node).getKilledLocationIdentity();
   264                 result.add(identity);
   264                 result.add(identity);
   265             } else if (node instanceof MemoryCheckpoint.Multi) {
   265             } else if (node instanceof MemoryCheckpoint.Multi) {
   266                 for (LocationIdentity identity : ((MemoryCheckpoint.Multi) node).getLocationIdentities()) {
   266                 for (LocationIdentity identity : ((MemoryCheckpoint.Multi) node).getKilledLocationIdentities()) {
   267                     result.add(identity);
   267                     result.add(identity);
   268                 }
   268                 }
   269             }
   269             }
   270             if (result.isAny()) {
   270             if (result.isAny()) {
   271                 break;
   271                 break;
   363     }
   363     }
   364 
   364 
   365     protected void setPostDominator(Block postdominator) {
   365     protected void setPostDominator(Block postdominator) {
   366         this.postdominator = postdominator;
   366         this.postdominator = postdominator;
   367     }
   367     }
       
   368 
       
   369     /**
       
   370      * Checks whether {@code this} block is in the same loop or an outer loop of the block given as
       
   371      * parameter.
       
   372      */
       
   373     public boolean isInSameOrOuterLoopOf(Block block) {
       
   374 
       
   375         if (this.loop == null) {
       
   376             // We are in no loop, so this holds true for every other block.
       
   377             return true;
       
   378         }
       
   379 
       
   380         Loop<Block> l = block.loop;
       
   381         while (l != null) {
       
   382             if (l == this.loop) {
       
   383                 return true;
       
   384             }
       
   385             l = l.getParent();
       
   386         }
       
   387 
       
   388         return false;
       
   389     }
   368 }
   390 }