author | kvn |
Wed, 01 May 2019 12:31:29 -0700 | |
changeset 54669 | ad45b3802d4e |
parent 47216 | 71c04702a3d5 |
child 55463 | 31bf7b93df5d |
permissions | -rw-r--r-- |
43972 | 1 |
/* |
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. |
43972 | 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 |
package jdk.vm.ci.hotspot; |
|
24 |
||
25 |
import jdk.vm.ci.code.CompilationRequest; |
|
26 |
||
27 |
/** |
|
28 |
* A compilation request with extra HotSpot specific context such as a compilation identifier and |
|
29 |
* the address of a {@code JVMCIEnv} object that provides native context for a compilation. |
|
30 |
*/ |
|
31 |
public class HotSpotCompilationRequest extends CompilationRequest { |
|
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
32 |
/** |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
33 |
* Address of the native {@code JVMCICompileState} associated with the request. |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
34 |
*/ |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
35 |
private final long compileState; |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
36 |
|
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
37 |
/** |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
38 |
* An identifier for the request. |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
39 |
*/ |
43972 | 40 |
private final int id; |
41 |
||
42 |
/** |
|
43 |
* Creates a request to compile a method starting at a given BCI and allocates an identifier to |
|
44 |
* the request. |
|
45 |
* |
|
46 |
* @param method the method to be compiled |
|
47 |
* @param entryBCI the bytecode index (BCI) at which to start compiling where -1 denotes the |
|
48 |
* method's entry point |
|
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
49 |
* @param compileState address of a native {@code JVMCICompileState} object or 0L |
43972 | 50 |
*/ |
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
51 |
public HotSpotCompilationRequest(HotSpotResolvedJavaMethod method, int entryBCI, long compileState) { |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
52 |
this(method, entryBCI, compileState, method.allocateCompileId(entryBCI)); |
43972 | 53 |
} |
54 |
||
55 |
/** |
|
56 |
* Creates a request to compile a method starting at a given BCI. |
|
57 |
* |
|
58 |
* @param method the method to be compiled |
|
59 |
* @param entryBCI the bytecode index (BCI) at which to start compiling where -1 denotes the |
|
60 |
* method's entry point |
|
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
61 |
* @param compileState address of a native {@code JVMCICompileState} object or 0L |
43972 | 62 |
* @param id an identifier for the request |
63 |
*/ |
|
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
64 |
public HotSpotCompilationRequest(HotSpotResolvedJavaMethod method, int entryBCI, long compileState, int id) { |
43972 | 65 |
super(method, entryBCI); |
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
66 |
this.compileState = compileState; |
43972 | 67 |
this.id = id; |
68 |
} |
|
69 |
||
70 |
@Override |
|
71 |
public HotSpotResolvedJavaMethod getMethod() { |
|
72 |
return (HotSpotResolvedJavaMethod) super.getMethod(); |
|
73 |
} |
|
74 |
||
75 |
/** |
|
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
76 |
* Gets the address of the native {@code JVMCICompileState} or 0L if no such object exists. This |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
77 |
* method should really be named {@code getCompileState} but must remain as is for API |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
78 |
* stability. |
43972 | 79 |
*/ |
80 |
public long getJvmciEnv() { |
|
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
47216
diff
changeset
|
81 |
return compileState; |
43972 | 82 |
} |
83 |
||
84 |
/** |
|
85 |
* Gets the VM allocated identifier for this compilation. |
|
86 |
*/ |
|
87 |
public int getId() { |
|
88 |
return id; |
|
89 |
} |
|
90 |
} |