< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java

Print this page




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 package org.graalvm.compiler.lir.gen;
  24 

  25 import org.graalvm.compiler.core.common.CompilationIdentifier;
  26 import org.graalvm.compiler.core.common.CompilationIdentifier.Verbosity;
  27 import org.graalvm.compiler.debug.DebugContext;
  28 import org.graalvm.compiler.lir.LIR;
  29 import org.graalvm.compiler.lir.LIRInstruction;
  30 import org.graalvm.compiler.lir.framemap.FrameMap;
  31 import org.graalvm.compiler.lir.framemap.FrameMapBuilder;
  32 import org.graalvm.util.EconomicMap;
  33 import org.graalvm.util.Equivalence;
  34 
  35 import jdk.vm.ci.code.CallingConvention;
  36 
  37 public class LIRGenerationResult {
  38 
  39     private final LIR lir;
  40     private final FrameMapBuilder frameMapBuilder;
  41     private FrameMap frameMap;
  42     private final CallingConvention callingConvention;
  43     /**
  44      * Records whether the code being generated makes at least one foreign call.


 104 
 105     /**
 106      * Creates a {@link FrameMap} out of the {@link FrameMapBuilder}. This method should only be
 107      * called once. After calling it, {@link #getFrameMapBuilder()} can no longer be used.
 108      *
 109      * @see FrameMapBuilder#buildFrameMap
 110      */
 111     public void buildFrameMap() {
 112         assert frameMap == null : "buildFrameMap() can only be called once!";
 113         frameMap = frameMapBuilder.buildFrameMap(this);
 114     }
 115 
 116     /**
 117      * Returns the {@link FrameMap} associated with this {@link LIRGenerationResult}.
 118      *
 119      * This method can only be called after {@link #buildFrameMap}.
 120      */
 121     public FrameMap getFrameMap() {
 122         assert frameMap != null : "getFrameMap() can only be used after calling buildFrameMap()!";
 123         return frameMap;




 124     }
 125 
 126     public LIR getLIR() {
 127         return lir;
 128     }
 129 
 130     /**
 131      * Determines whether the code being generated makes at least one foreign call.
 132      */
 133     public boolean hasForeignCall() {
 134         return hasForeignCall;
 135     }
 136 
 137     public final void setForeignCall(boolean hasForeignCall) {
 138         this.hasForeignCall = hasForeignCall;
 139     }
 140 
 141     public String getCompilationUnitName() {
 142         if (compilationId == null || compilationId == CompilationIdentifier.INVALID_COMPILATION_ID) {
 143             return "<unknown>";


   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 package org.graalvm.compiler.lir.gen;
  24 
  25 import jdk.vm.ci.code.RegisterConfig;
  26 import org.graalvm.compiler.core.common.CompilationIdentifier;
  27 import org.graalvm.compiler.core.common.CompilationIdentifier.Verbosity;
  28 import org.graalvm.compiler.debug.DebugContext;
  29 import org.graalvm.compiler.lir.LIR;
  30 import org.graalvm.compiler.lir.LIRInstruction;
  31 import org.graalvm.compiler.lir.framemap.FrameMap;
  32 import org.graalvm.compiler.lir.framemap.FrameMapBuilder;
  33 import org.graalvm.util.EconomicMap;
  34 import org.graalvm.util.Equivalence;
  35 
  36 import jdk.vm.ci.code.CallingConvention;
  37 
  38 public class LIRGenerationResult {
  39 
  40     private final LIR lir;
  41     private final FrameMapBuilder frameMapBuilder;
  42     private FrameMap frameMap;
  43     private final CallingConvention callingConvention;
  44     /**
  45      * Records whether the code being generated makes at least one foreign call.


 105 
 106     /**
 107      * Creates a {@link FrameMap} out of the {@link FrameMapBuilder}. This method should only be
 108      * called once. After calling it, {@link #getFrameMapBuilder()} can no longer be used.
 109      *
 110      * @see FrameMapBuilder#buildFrameMap
 111      */
 112     public void buildFrameMap() {
 113         assert frameMap == null : "buildFrameMap() can only be called once!";
 114         frameMap = frameMapBuilder.buildFrameMap(this);
 115     }
 116 
 117     /**
 118      * Returns the {@link FrameMap} associated with this {@link LIRGenerationResult}.
 119      *
 120      * This method can only be called after {@link #buildFrameMap}.
 121      */
 122     public FrameMap getFrameMap() {
 123         assert frameMap != null : "getFrameMap() can only be used after calling buildFrameMap()!";
 124         return frameMap;
 125     }
 126 
 127     public final RegisterConfig getRegisterConfig() {
 128         return frameMapBuilder.getRegisterConfig();
 129     }
 130 
 131     public LIR getLIR() {
 132         return lir;
 133     }
 134 
 135     /**
 136      * Determines whether the code being generated makes at least one foreign call.
 137      */
 138     public boolean hasForeignCall() {
 139         return hasForeignCall;
 140     }
 141 
 142     public final void setForeignCall(boolean hasForeignCall) {
 143         this.hasForeignCall = hasForeignCall;
 144     }
 145 
 146     public String getCompilationUnitName() {
 147         if (compilationId == null || compilationId == CompilationIdentifier.INVALID_COMPILATION_ID) {
 148             return "<unknown>";
< prev index next >