< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java

Print this page


   1 /*
   2  * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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  */


  51  */
  52 public interface HotSpotLIRGenerator extends LIRGeneratorTool {
  53 
  54     /**
  55      * Emits an operation to make a tail call.
  56      *
  57      * @param args the arguments of the call
  58      * @param address the target address of the call
  59      */
  60     void emitTailcall(Value[] args, Value address);
  61 
  62     void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason);
  63 
  64     /**
  65      * Emits code for a {@link LoadConstantIndirectlyNode}.
  66      *
  67      * @param constant
  68      * @return value of loaded address in register
  69      */
  70     default Value emitLoadObjectAddress(Constant constant) {
  71         throw GraalError.unimplemented();
  72     }
  73 
  74     /**
  75      * Emits code for a {@link LoadConstantIndirectlyNode}.
  76      *
  77      * @param constant original constant
  78      * @param action action to perform on the metaspace object
  79      * @return Value of loaded address in register
  80      */
  81     default Value emitLoadMetaspaceAddress(Constant constant, HotSpotConstantLoadAction action) {
  82         throw GraalError.unimplemented();
  83     }
  84 
  85     /**
  86      * Emits code for a {@link GraalHotSpotVMConfigNode}.
  87      *
  88      * @param markId id of the value to load
  89      * @param kind type of the value to load
  90      * @return value of loaded global in register
  91      */
  92     default Value emitLoadConfigValue(int markId, LIRKind kind) {
  93         throw GraalError.unimplemented();
  94     }
  95 
  96     /**
  97      * Emits code for a {@link ResolveConstantNode} to resolve a {@link HotSpotObjectConstant}.
  98      *
  99      * @param constant original constant
 100      * @param constantDescription a description of the string that need to be materialized (and
 101      *            interned) as java.lang.String, generated with {@link EncodedSymbolConstant}
 102      * @param frameState frame state for the runtime call
 103      * @return Returns the address of the requested constant.
 104      */
 105     default Value emitObjectConstantRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
 106         throw GraalError.unimplemented();











 107     }
 108 
 109     /**
 110      * Emits code for a {@link ResolveConstantNode} to resolve a {@link HotSpotMetaspaceConstant}.
 111      *
 112      * @param constant original constant
 113      * @param constantDescription a symbolic description of the {@link HotSpotMetaspaceConstant}
 114      *            generated by {@link EncodedSymbolConstant}
 115      * @param frameState frame state for the runtime call
 116      * @return Returns the address of the requested constant.
 117      */
 118     default Value emitMetaspaceConstantRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
 119         throw GraalError.unimplemented();
 120     }
 121 
 122     /**
 123      * Emits code for a {@link ResolveMethodAndLoadCountersNode} to resolve a
 124      * {@link HotSpotMetaspaceConstant} that represents a {@link ResolvedJavaMethod} and return the
 125      * corresponding MethodCounters object.
 126      *
 127      * @param method original constant
 128      * @param klassHint a klass in which the method is declared
 129      * @param methodDescription is symbolic description of the constant generated by
 130      *            {@link EncodedSymbolConstant}
 131      * @param frameState frame state for the runtime call
 132      * @return Returns the address of the requested constant.
 133      */
 134     default Value emitResolveMethodAndLoadCounters(Constant method, Value klassHint, Value methodDescription, LIRFrameState frameState) {
 135         throw GraalError.unimplemented();
 136     }
 137 
 138     /**
 139      * Emits code for a {@link ResolveConstantNode} to resolve a klass
 140      * {@link HotSpotMetaspaceConstant} and run static initializer.
 141      *
 142      *
 143      * @param constant original constant
 144      * @param constantDescription a symbolic description of the {@link HotSpotMetaspaceConstant}
 145      *            generated by {@link EncodedSymbolConstant}
 146      * @param frameState frame state for the runtime call
 147      * @return Returns the address of the requested constant.
 148      */
 149     default Value emitKlassInitializationAndRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
 150         throw GraalError.unimplemented();
 151     }
 152 
 153     /**
 154      * Emits code for a {@link RandomSeedNode}.
 155      *
 156      * @return value of the counter
 157      */
 158     default Value emitRandomSeed() {
 159         throw GraalError.unimplemented();
 160     }
 161 
 162     /**
 163      * Gets a stack slot for a lock at a given lock nesting depth.
 164      */
 165     VirtualStackSlot getLockSlot(int lockDepth);
 166 
 167     @Override
 168     HotSpotProviders getProviders();
 169 
 170 }
   1 /*
   2  * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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  */


  51  */
  52 public interface HotSpotLIRGenerator extends LIRGeneratorTool {
  53 
  54     /**
  55      * Emits an operation to make a tail call.
  56      *
  57      * @param args the arguments of the call
  58      * @param address the target address of the call
  59      */
  60     void emitTailcall(Value[] args, Value address);
  61 
  62     void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason);
  63 
  64     /**
  65      * Emits code for a {@link LoadConstantIndirectlyNode}.
  66      *
  67      * @param constant
  68      * @return value of loaded address in register
  69      */
  70     default Value emitLoadObjectAddress(Constant constant) {
  71         throw new GraalError("Emitting code to load an object address is not currently supported on %s", target().arch);
  72     }
  73 
  74     /**
  75      * Emits code for a {@link LoadConstantIndirectlyNode}.
  76      *
  77      * @param constant original constant
  78      * @param action action to perform on the metaspace object
  79      * @return Value of loaded address in register
  80      */
  81     default Value emitLoadMetaspaceAddress(Constant constant, HotSpotConstantLoadAction action) {
  82         throw new GraalError("Emitting code to load a metaspace address is not currently supported on %s", target().arch);
  83     }
  84 
  85     /**
  86      * Emits code for a {@link GraalHotSpotVMConfigNode}.
  87      *
  88      * @param markId id of the value to load
  89      * @param kind type of the value to load
  90      * @return value of loaded global in register
  91      */
  92     default Value emitLoadConfigValue(int markId, LIRKind kind) {
  93         throw new GraalError("Emitting code to load a config value is not currently supported on %s", target().arch);
  94     }
  95 
  96     /**
  97      * Emits code for a {@link ResolveConstantNode} to resolve a {@link HotSpotObjectConstant}.
  98      *
  99      * @param constant original constant
 100      * @param constantDescription a description of the string that need to be materialized (and
 101      *            interned) as java.lang.String, generated with {@link EncodedSymbolConstant}
 102      * @param frameState frame state for the runtime call
 103      * @return the address of the requested constant.
 104      */
 105     default Value emitObjectConstantRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
 106         throw new GraalError("Emitting code to resolve an object constant is not currently supported on %s", target().arch);
 107     }
 108 
 109     /**
 110      * Emits code to resolve a dynamic constant.
 111      *
 112      * @param constant original constant
 113      * @param frameState frame state for the runtime call
 114      * @return the address of the requested constant.
 115      */
 116     default Value emitResolveDynamicInvoke(Constant constant, LIRFrameState frameState) {
 117         throw new GraalError("Emitting code to resolve a dynamic constant is not currently supported on %s", target().arch);
 118     }
 119 
 120     /**
 121      * Emits code for a {@link ResolveConstantNode} to resolve a {@link HotSpotMetaspaceConstant}.
 122      *
 123      * @param constant original constant
 124      * @param constantDescription a symbolic description of the {@link HotSpotMetaspaceConstant}
 125      *            generated by {@link EncodedSymbolConstant}
 126      * @param frameState frame state for the runtime call
 127      * @return the address of the requested constant.
 128      */
 129     default Value emitMetaspaceConstantRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
 130         throw new GraalError("Emitting code to resolve a metaspace constant is not currently supported on %s", target().arch);
 131     }
 132 
 133     /**
 134      * Emits code for a {@link ResolveMethodAndLoadCountersNode} to resolve a
 135      * {@link HotSpotMetaspaceConstant} that represents a {@link ResolvedJavaMethod} and return the
 136      * corresponding MethodCounters object.
 137      *
 138      * @param method original constant
 139      * @param klassHint a klass in which the method is declared
 140      * @param methodDescription is symbolic description of the constant generated by
 141      *            {@link EncodedSymbolConstant}
 142      * @param frameState frame state for the runtime call
 143      * @return the address of the requested constant.
 144      */
 145     default Value emitResolveMethodAndLoadCounters(Constant method, Value klassHint, Value methodDescription, LIRFrameState frameState) {
 146         throw new GraalError("Emitting code to resolve a method and load counters is not currently supported on %s", target().arch);
 147     }
 148 
 149     /**
 150      * Emits code for a {@link ResolveConstantNode} to resolve a klass
 151      * {@link HotSpotMetaspaceConstant} and run static initializer.
 152      *
 153      *
 154      * @param constant original constant
 155      * @param constantDescription a symbolic description of the {@link HotSpotMetaspaceConstant}
 156      *            generated by {@link EncodedSymbolConstant}
 157      * @param frameState frame state for the runtime call
 158      * @return the address of the requested constant.
 159      */
 160     default Value emitKlassInitializationAndRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
 161         throw new GraalError("Emitting code to initialize a class is not currently supported on %s", target().arch);
 162     }
 163 
 164     /**
 165      * Emits code for a {@link RandomSeedNode}.
 166      *
 167      * @return value of the counter
 168      */
 169     default Value emitRandomSeed() {
 170         throw new GraalError("Emitting code to return a random seed is not currently supported on %s", target().arch);
 171     }
 172 
 173     /**
 174      * Gets a stack slot for a lock at a given lock nesting depth.
 175      */
 176     VirtualStackSlot getLockSlot(int lockDepth);
 177 
 178     @Override
 179     HotSpotProviders getProviders();
 180 
 181 }
< prev index next >