Search in sources :

Example 1 with Type

use of com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.InlineAssemblyConstraint.Type in project graal by oracle.

the class LLVMGenerator method getLLVMFunctionArgTypes.

private LLVMTypeRef[] getLLVMFunctionArgTypes(ResolvedJavaMethod method, boolean forMainFunction) {
    ResolvedJavaType receiver = method.hasReceiver() ? method.getDeclaringClass() : null;
    JavaType[] javaParameterTypes = method.getSignature().toParameterTypes(receiver);
    LLVMTypeRef[] parameterTypes = Arrays.stream(javaParameterTypes).map(type -> getLLVMStackType(getTypeKind(type.resolve(null), forMainFunction))).toArray(LLVMTypeRef[]::new);
    LLVMTypeRef[] newParameterTypes = parameterTypes;
    if (!isEntryPoint(method) && SpecialRegister.count() > 0) {
        newParameterTypes = new LLVMTypeRef[SpecialRegister.count() + parameterTypes.length];
        for (SpecialRegister reg : SpecialRegister.registers()) {
            newParameterTypes[reg.index] = builder.wordType();
        }
        System.arraycopy(parameterTypes, 0, newParameterTypes, SpecialRegister.count(), parameterTypes.length);
    }
    return newParameterTypes;
}
Also used : SubstrateCallingConvention(com.oracle.svm.core.graal.code.SubstrateCallingConvention) Arrays(java.util.Arrays) ResolvedJavaType(jdk.vm.ci.meta.ResolvedJavaType) GuardedAnnotationAccess(org.graalvm.util.GuardedAnnotationAccess) SubstrateOptions(com.oracle.svm.core.SubstrateOptions) ReflectionUtil(com.oracle.svm.util.ReflectionUtil) LIRGenerationResult(org.graalvm.compiler.lir.gen.LIRGenerationResult) CEntryPointData(com.oracle.svm.hosted.code.CEntryPointData) LinkageType(com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.LinkageType) LLVMKind(com.oracle.svm.core.graal.llvm.util.LLVMUtils.LLVMKind) CodeGenProviders(org.graalvm.compiler.core.common.spi.CodeGenProviders) Map(java.util.Map) LLVMUtils.dumpValues(com.oracle.svm.core.graal.llvm.util.LLVMUtils.dumpValues) LLVMIRBuilder.isFloatType(com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.isFloatType) LLVMIRBuilder.isVectorType(com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.isVectorType) LIRKindTool(org.graalvm.compiler.core.common.spi.LIRKindTool) WriteHeapBaseNode(com.oracle.svm.core.graal.nodes.WriteHeapBaseNode) LLVMUtils.getVal(com.oracle.svm.core.graal.llvm.util.LLVMUtils.getVal) SubstrateLIRGenerator(com.oracle.svm.core.graal.code.SubstrateLIRGenerator) MemoryOrderMode(org.graalvm.compiler.core.common.memory.MemoryOrderMode) Stamp(org.graalvm.compiler.core.common.type.Stamp) LLVMStackSlot(com.oracle.svm.core.graal.llvm.util.LLVMUtils.LLVMStackSlot) WriteCurrentVMThreadNode(com.oracle.svm.core.graal.nodes.WriteCurrentVMThreadNode) TargetDescription(jdk.vm.ci.code.TargetDescription) PlatformKind(jdk.vm.ci.meta.PlatformKind) JavaType(jdk.vm.ci.meta.JavaType) CompressEncoding(org.graalvm.compiler.core.common.CompressEncoding) SnippetRuntime(com.oracle.svm.core.snippets.SnippetRuntime) CodeCacheProvider(jdk.vm.ci.code.CodeCacheProvider) LLVMIRBuilder.isDoubleType(com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.isDoubleType) CEnum(org.graalvm.nativeimage.c.constant.CEnum) MetaAccessProvider(jdk.vm.ci.meta.MetaAccessProvider) AbstractBlockBase(org.graalvm.compiler.core.common.cfg.AbstractBlockBase) LIRFrameState(org.graalvm.compiler.lir.LIRFrameState) LLVMVariable(com.oracle.svm.core.graal.llvm.util.LLVMUtils.LLVMVariable) LLVMTypeRef(com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMTypeRef) GCStrategy(com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.GCStrategy) ReferenceAccess(com.oracle.svm.core.heap.ReferenceAccess) Register(jdk.vm.ci.code.Register) ArrayList(java.util.ArrayList) SubstrateCallingConventionType(com.oracle.svm.core.graal.code.SubstrateCallingConventionType) LLVMBasicBlockRef(com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMBasicBlockRef) GraalError.shouldNotReachHere(org.graalvm.compiler.debug.GraalError.shouldNotReachHere) CompilationResult(org.graalvm.compiler.code.CompilationResult) MemoryBarriers(jdk.vm.ci.code.MemoryBarriers) VirtualStackSlot(org.graalvm.compiler.lir.VirtualStackSlot) SubstrateDataBuilder(com.oracle.svm.core.graal.code.SubstrateDataBuilder) FloatConvert(org.graalvm.compiler.core.common.calc.FloatConvert) Attribute(com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.Attribute) AtomicLong(java.util.concurrent.atomic.AtomicLong) StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) DataSectionReference(jdk.vm.ci.code.site.DataSectionReference) Block(org.graalvm.compiler.nodes.cfg.Block) FrameAccess(com.oracle.svm.core.FrameAccess) CallingConvention(jdk.vm.ci.code.CallingConvention) LLVMStackMapInfo(com.oracle.svm.core.graal.llvm.util.LLVMStackMapInfo) Providers(org.graalvm.compiler.phases.util.Providers) LLVMUtils.dumpTypes(com.oracle.svm.core.graal.llvm.util.LLVMUtils.dumpTypes) LLVMTargetSpecific(com.oracle.svm.core.graal.llvm.util.LLVMTargetSpecific) Constant(jdk.vm.ci.meta.Constant) CEntryPointOptions(com.oracle.svm.core.c.function.CEntryPointOptions) BiFunction(java.util.function.BiFunction) IllegalStamp(org.graalvm.compiler.core.common.type.IllegalStamp) LIRInstruction(org.graalvm.compiler.lir.LIRInstruction) LLVMVersionChecker(com.oracle.svm.core.graal.llvm.LLVMFeature.LLVMVersionChecker) InlineAssemblyConstraint(com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.InlineAssemblyConstraint) LabelRef(org.graalvm.compiler.lir.LabelRef) StampFactory(org.graalvm.compiler.core.common.type.StampFactory) JavaKind(jdk.vm.ci.meta.JavaKind) LLVMUtils(com.oracle.svm.core.graal.llvm.util.LLVMUtils) ForeignCallsProvider(org.graalvm.compiler.core.common.spi.ForeignCallsProvider) DebugInfo(jdk.vm.ci.code.DebugInfo) RawPointerStamp(org.graalvm.compiler.core.common.type.RawPointerStamp) Location(com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.InlineAssemblyConstraint.Location) SubstrateRegisterConfig(com.oracle.svm.core.graal.meta.SubstrateRegisterConfig) NumUtil(org.graalvm.compiler.core.common.NumUtil) LLVMExceptionUnwind(com.oracle.svm.core.graal.llvm.runtime.LLVMExceptionUnwind) AbstractBeginNode(org.graalvm.compiler.nodes.AbstractBeginNode) ForeignCallLinkage(org.graalvm.compiler.core.common.spi.ForeignCallLinkage) Type(com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.InlineAssemblyConstraint.Type) LLVMUtils.getType(com.oracle.svm.core.graal.llvm.util.LLVMUtils.getType) VMError(com.oracle.svm.core.util.VMError) JavaConstant(jdk.vm.ci.meta.JavaConstant) ValueNode(org.graalvm.compiler.nodes.ValueNode) List(java.util.List) GraalError.unimplemented(org.graalvm.compiler.debug.GraalError.unimplemented) Value(jdk.vm.ci.meta.Value) GraalError(org.graalvm.compiler.debug.GraalError) StackSlot(jdk.vm.ci.code.StackSlot) ArithmeticLIRGeneratorTool(org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool) ValueKind(jdk.vm.ci.meta.ValueKind) LLVMValueWrapper(com.oracle.svm.core.graal.llvm.util.LLVMUtils.LLVMValueWrapper) LLVMIRBuilder(com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) NarrowOopStamp(org.graalvm.compiler.nodes.type.NarrowOopStamp) LLVMIntrinsicGenerator(com.oracle.svm.core.graal.llvm.replacements.LLVMIntrinsicGenerator) HashMap(java.util.HashMap) SubstrateObjectConstant(com.oracle.svm.core.meta.SubstrateObjectConstant) LLVMConstant(com.oracle.svm.core.graal.llvm.util.LLVMUtils.LLVMConstant) LLVMIRBuilder.typeOf(com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.typeOf) ReservedRegisters(com.oracle.svm.core.ReservedRegisters) HostedMethod(com.oracle.svm.hosted.meta.HostedMethod) ParameterNode(org.graalvm.compiler.nodes.ParameterNode) HostedType(com.oracle.svm.hosted.meta.HostedType) Condition(org.graalvm.compiler.core.common.calc.Condition) Variable(org.graalvm.compiler.lir.Variable) MoveFactory(org.graalvm.compiler.lir.gen.MoveFactory) LIRKind(org.graalvm.compiler.core.common.LIRKind) SubstrateUtil(com.oracle.svm.core.SubstrateUtil) LLVMValueRef(com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMValueRef) RegisterValue(jdk.vm.ci.code.RegisterValue) LLVMIRBuilder.isIntegerType(com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.isIntegerType) InfopointReason(jdk.vm.ci.code.site.InfopointReason) JavaVersionUtil(org.graalvm.compiler.serviceprovider.JavaVersionUtil) Node(org.graalvm.compiler.graph.Node) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod) LLVMPendingSpecialRegisterRead(com.oracle.svm.core.graal.llvm.util.LLVMUtils.LLVMPendingSpecialRegisterRead) ResolvedJavaType(jdk.vm.ci.meta.ResolvedJavaType) JavaType(jdk.vm.ci.meta.JavaType) LLVMTypeRef(com.oracle.svm.shadowed.org.bytedeco.llvm.LLVM.LLVMTypeRef) ResolvedJavaType(jdk.vm.ci.meta.ResolvedJavaType)

Aggregations

FrameAccess (com.oracle.svm.core.FrameAccess)1 ReservedRegisters (com.oracle.svm.core.ReservedRegisters)1 SubstrateOptions (com.oracle.svm.core.SubstrateOptions)1 SubstrateUtil (com.oracle.svm.core.SubstrateUtil)1 CEntryPointOptions (com.oracle.svm.core.c.function.CEntryPointOptions)1 SubstrateCallingConvention (com.oracle.svm.core.graal.code.SubstrateCallingConvention)1 SubstrateCallingConventionType (com.oracle.svm.core.graal.code.SubstrateCallingConventionType)1 SubstrateDataBuilder (com.oracle.svm.core.graal.code.SubstrateDataBuilder)1 SubstrateLIRGenerator (com.oracle.svm.core.graal.code.SubstrateLIRGenerator)1 LLVMVersionChecker (com.oracle.svm.core.graal.llvm.LLVMFeature.LLVMVersionChecker)1 LLVMIntrinsicGenerator (com.oracle.svm.core.graal.llvm.replacements.LLVMIntrinsicGenerator)1 LLVMExceptionUnwind (com.oracle.svm.core.graal.llvm.runtime.LLVMExceptionUnwind)1 LLVMIRBuilder (com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder)1 Attribute (com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.Attribute)1 GCStrategy (com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.GCStrategy)1 InlineAssemblyConstraint (com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.InlineAssemblyConstraint)1 Location (com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.InlineAssemblyConstraint.Location)1 Type (com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.InlineAssemblyConstraint.Type)1 LinkageType (com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.LinkageType)1 LLVMIRBuilder.isDoubleType (com.oracle.svm.core.graal.llvm.util.LLVMIRBuilder.isDoubleType)1