1 /* |
1 /* |
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
27 /** |
27 /** |
28 * A compilation request with extra HotSpot specific context such as a compilation identifier and |
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. |
29 * the address of a {@code JVMCIEnv} object that provides native context for a compilation. |
30 */ |
30 */ |
31 public class HotSpotCompilationRequest extends CompilationRequest { |
31 public class HotSpotCompilationRequest extends CompilationRequest { |
32 private final long jvmciEnv; |
32 /** |
|
33 * Address of the native {@code JVMCICompileState} associated with the request. |
|
34 */ |
|
35 private final long compileState; |
|
36 |
|
37 /** |
|
38 * An identifier for the request. |
|
39 */ |
33 private final int id; |
40 private final int id; |
34 |
41 |
35 /** |
42 /** |
36 * Creates a request to compile a method starting at a given BCI and allocates an identifier to |
43 * Creates a request to compile a method starting at a given BCI and allocates an identifier to |
37 * the request. |
44 * the request. |
38 * |
45 * |
39 * @param method the method to be compiled |
46 * @param method the method to be compiled |
40 * @param entryBCI the bytecode index (BCI) at which to start compiling where -1 denotes the |
47 * @param entryBCI the bytecode index (BCI) at which to start compiling where -1 denotes the |
41 * method's entry point |
48 * method's entry point |
42 * @param jvmciEnv address of a native {@code JVMCIEnv} object or 0L |
49 * @param compileState address of a native {@code JVMCICompileState} object or 0L |
43 */ |
50 */ |
44 public HotSpotCompilationRequest(HotSpotResolvedJavaMethod method, int entryBCI, long jvmciEnv) { |
51 public HotSpotCompilationRequest(HotSpotResolvedJavaMethod method, int entryBCI, long compileState) { |
45 this(method, entryBCI, jvmciEnv, method.allocateCompileId(entryBCI)); |
52 this(method, entryBCI, compileState, method.allocateCompileId(entryBCI)); |
46 } |
53 } |
47 |
54 |
48 /** |
55 /** |
49 * Creates a request to compile a method starting at a given BCI. |
56 * Creates a request to compile a method starting at a given BCI. |
50 * |
57 * |
51 * @param method the method to be compiled |
58 * @param method the method to be compiled |
52 * @param entryBCI the bytecode index (BCI) at which to start compiling where -1 denotes the |
59 * @param entryBCI the bytecode index (BCI) at which to start compiling where -1 denotes the |
53 * method's entry point |
60 * method's entry point |
54 * @param jvmciEnv address of a native {@code JVMCIEnv} object or 0L |
61 * @param compileState address of a native {@code JVMCICompileState} object or 0L |
55 * @param id an identifier for the request |
62 * @param id an identifier for the request |
56 */ |
63 */ |
57 public HotSpotCompilationRequest(HotSpotResolvedJavaMethod method, int entryBCI, long jvmciEnv, int id) { |
64 public HotSpotCompilationRequest(HotSpotResolvedJavaMethod method, int entryBCI, long compileState, int id) { |
58 super(method, entryBCI); |
65 super(method, entryBCI); |
59 this.jvmciEnv = jvmciEnv; |
66 this.compileState = compileState; |
60 this.id = id; |
67 this.id = id; |
61 } |
68 } |
62 |
69 |
63 @Override |
70 @Override |
64 public HotSpotResolvedJavaMethod getMethod() { |
71 public HotSpotResolvedJavaMethod getMethod() { |
65 return (HotSpotResolvedJavaMethod) super.getMethod(); |
72 return (HotSpotResolvedJavaMethod) super.getMethod(); |
66 } |
73 } |
67 |
74 |
68 /** |
75 /** |
69 * Gets the address of the native {@code JVMCIEnv} object or 0L if no such object exists. |
76 * Gets the address of the native {@code JVMCICompileState} or 0L if no such object exists. This |
|
77 * method should really be named {@code getCompileState} but must remain as is for API |
|
78 * stability. |
70 */ |
79 */ |
71 public long getJvmciEnv() { |
80 public long getJvmciEnv() { |
72 return jvmciEnv; |
81 return compileState; |
73 } |
82 } |
74 |
83 |
75 /** |
84 /** |
76 * Gets the VM allocated identifier for this compilation. |
85 * Gets the VM allocated identifier for this compilation. |
77 */ |
86 */ |
78 public int getId() { |
87 public int getId() { |
79 return id; |
88 return id; |
80 } |
89 } |
81 |
|
82 } |
90 } |