src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/LIRGenerationProvider.java
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 58299 6df94ce3ab2f
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
54084
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
     1
/*
58299
6df94ce3ab2f 8229201: Update Graal
dlong
parents: 55509
diff changeset
     2
 * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
54084
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
     4
 *
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
     7
 * published by the Free Software Foundation.
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
     8
 *
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    13
 * accompanied this code).
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    14
 *
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    18
 *
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    21
 * questions.
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    22
 */
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    23
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    24
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    25
package org.graalvm.compiler.core.gen;
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    26
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    27
import org.graalvm.compiler.code.CompilationResult;
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    28
import org.graalvm.compiler.core.common.CompilationIdentifier;
58299
6df94ce3ab2f 8229201: Update Graal
dlong
parents: 55509
diff changeset
    29
import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig;
54084
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    30
import org.graalvm.compiler.lir.LIR;
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    31
import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    32
import org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory;
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    33
import org.graalvm.compiler.lir.framemap.FrameMap;
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    34
import org.graalvm.compiler.lir.gen.LIRGenerationResult;
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    35
import org.graalvm.compiler.lir.gen.LIRGeneratorTool;
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    36
import org.graalvm.compiler.nodes.StructuredGraph;
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    37
import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool;
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    38
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    39
import jdk.vm.ci.meta.ResolvedJavaMethod;
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    40
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    41
/**
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    42
 * Provides compiler backend-specific generation helpers for the {@link LIRCompilerBackend}.
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    43
 */
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    44
public interface LIRGenerationProvider {
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    45
    LIRGeneratorTool newLIRGenerator(LIRGenerationResult lirGenRes);
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    46
55509
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 54084
diff changeset
    47
    LIRGenerationResult newLIRGenerationResult(CompilationIdentifier compilationId,
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 54084
diff changeset
    48
                    LIR lir,
58299
6df94ce3ab2f 8229201: Update Graal
dlong
parents: 55509
diff changeset
    49
                    RegisterAllocationConfig registerAllocationConfig,
55509
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 54084
diff changeset
    50
                    StructuredGraph graph,
54084
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    51
                    Object stub);
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    52
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    53
    NodeLIRBuilderTool newNodeLIRBuilder(StructuredGraph graph, LIRGeneratorTool lirGen);
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    54
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    55
    /**
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    56
     * Creates the object used to fill in the details of a given compilation result.
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    57
     */
55509
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 54084
diff changeset
    58
    CompilationResultBuilder newCompilationResultBuilder(LIRGenerationResult lirGenResult,
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 54084
diff changeset
    59
                    FrameMap frameMap,
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 54084
diff changeset
    60
                    CompilationResult compilationResult,
54084
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    61
                    CompilationResultBuilderFactory factory);
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    62
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    63
    /**
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    64
     * Emits the code for a given graph.
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    65
     *
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    66
     * @param installedCodeOwner the method the compiled code will be associated with once
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    67
     *            installed. This argument can be null.
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    68
     */
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    69
    void emitCode(CompilationResultBuilder crb, LIR lir, ResolvedJavaMethod installedCodeOwner);
84f10bbf993f 8218074: Update Graal
jwilhelm
parents:
diff changeset
    70
}