54084
|
1 |
/*
|
58299
|
2 |
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
|
54084
|
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 |
*/
|
|
23 |
|
|
24 |
|
|
25 |
package org.graalvm.compiler.core.gen;
|
|
26 |
|
|
27 |
import org.graalvm.compiler.code.CompilationResult;
|
|
28 |
import org.graalvm.compiler.core.common.CompilationIdentifier;
|
58299
|
29 |
import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig;
|
54084
|
30 |
import org.graalvm.compiler.lir.LIR;
|
|
31 |
import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
|
|
32 |
import org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory;
|
|
33 |
import org.graalvm.compiler.lir.framemap.FrameMap;
|
|
34 |
import org.graalvm.compiler.lir.gen.LIRGenerationResult;
|
|
35 |
import org.graalvm.compiler.lir.gen.LIRGeneratorTool;
|
|
36 |
import org.graalvm.compiler.nodes.StructuredGraph;
|
|
37 |
import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool;
|
|
38 |
|
|
39 |
import jdk.vm.ci.meta.ResolvedJavaMethod;
|
|
40 |
|
|
41 |
/**
|
|
42 |
* Provides compiler backend-specific generation helpers for the {@link LIRCompilerBackend}.
|
|
43 |
*/
|
|
44 |
public interface LIRGenerationProvider {
|
|
45 |
LIRGeneratorTool newLIRGenerator(LIRGenerationResult lirGenRes);
|
|
46 |
|
55509
|
47 |
LIRGenerationResult newLIRGenerationResult(CompilationIdentifier compilationId,
|
|
48 |
LIR lir,
|
58299
|
49 |
RegisterAllocationConfig registerAllocationConfig,
|
55509
|
50 |
StructuredGraph graph,
|
54084
|
51 |
Object stub);
|
|
52 |
|
|
53 |
NodeLIRBuilderTool newNodeLIRBuilder(StructuredGraph graph, LIRGeneratorTool lirGen);
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Creates the object used to fill in the details of a given compilation result.
|
|
57 |
*/
|
55509
|
58 |
CompilationResultBuilder newCompilationResultBuilder(LIRGenerationResult lirGenResult,
|
|
59 |
FrameMap frameMap,
|
|
60 |
CompilationResult compilationResult,
|
54084
|
61 |
CompilationResultBuilderFactory factory);
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Emits the code for a given graph.
|
|
65 |
*
|
|
66 |
* @param installedCodeOwner the method the compiled code will be associated with once
|
|
67 |
* installed. This argument can be null.
|
|
68 |
*/
|
|
69 |
void emitCode(CompilationResultBuilder crb, LIR lir, ResolvedJavaMethod installedCodeOwner);
|
|
70 |
}
|