src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java
changeset 59095 03fbcd06b4c0
parent 58299 6df94ce3ab2f
equal deleted inserted replaced
59094:5d4c3724e4c7 59095:03fbcd06b4c0
    25 package org.graalvm.compiler.hotspot.stubs;
    25 package org.graalvm.compiler.hotspot.stubs;
    26 
    26 
    27 import static java.util.Collections.singletonList;
    27 import static java.util.Collections.singletonList;
    28 import static org.graalvm.compiler.core.GraalCompiler.emitFrontEnd;
    28 import static org.graalvm.compiler.core.GraalCompiler.emitFrontEnd;
    29 import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
    29 import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
       
    30 import static org.graalvm.compiler.core.common.GraalOptions.RegisterPressure;
    30 import static org.graalvm.compiler.debug.DebugContext.DEFAULT_LOG_STREAM;
    31 import static org.graalvm.compiler.debug.DebugContext.DEFAULT_LOG_STREAM;
    31 import static org.graalvm.compiler.debug.DebugOptions.DebugStubsAndSnippets;
    32 import static org.graalvm.compiler.debug.DebugOptions.DebugStubsAndSnippets;
    32 import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER;
    33 import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER;
    33 import static org.graalvm.util.CollectionsUtil.allMatch;
    34 import static org.graalvm.util.CollectionsUtil.allMatch;
    34 
    35 
    74 
    75 
    75 //JaCoCo Exclude
    76 //JaCoCo Exclude
    76 
    77 
    77 /**
    78 /**
    78  * Base class for implementing some low level code providing the out-of-line slow path for a snippet
    79  * Base class for implementing some low level code providing the out-of-line slow path for a snippet
    79  * and/or a callee saved call to a HotSpot C/C++ runtime function or even a another compiled Java
    80  * and/or a callee saved call to a HotSpot C/C++ runtime function or even another compiled Java
    80  * method.
    81  * method.
    81  */
    82  */
    82 public abstract class Stub {
    83 public abstract class Stub {
    83 
    84 
    84     /**
    85     /**
   133      *
   134      *
   134      * @param linkage linkage details for a call to the stub
   135      * @param linkage linkage details for a call to the stub
   135      */
   136      */
   136     public Stub(OptionValues options, HotSpotProviders providers, HotSpotForeignCallLinkage linkage) {
   137     public Stub(OptionValues options, HotSpotProviders providers, HotSpotForeignCallLinkage linkage) {
   137         this.linkage = linkage;
   138         this.linkage = linkage;
   138         this.options = new OptionValues(options, GraalOptions.TraceInlining, GraalOptions.TraceInliningForStubsAndSnippets.getValue(options));
   139         // The RegisterPressure flag can be ignored by a compilation that runs out of registers, so
       
   140         // the stub compilation must ignore the flag so that all allocatable registers are saved.
       
   141         this.options = new OptionValues(options, GraalOptions.TraceInlining, GraalOptions.TraceInliningForStubsAndSnippets.getValue(options), RegisterPressure, null);
   139         this.providers = providers;
   142         this.providers = providers;
   140     }
   143     }
   141 
   144 
   142     /**
   145     /**
   143      * Gets the linkage for a call to this stub from compiled code.
   146      * Gets the linkage for a call to this stub from compiled code.