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 package jdk.vm.ci.hotspot;
25
26 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
27 import static jdk.vm.ci.inittimer.InitTimer.timer;
28
29 import java.lang.reflect.Constructor;
30 import java.lang.reflect.Method;
31
32 import jdk.vm.ci.code.InstalledCode;
33 import jdk.vm.ci.code.InvalidInstalledCodeException;
34 import jdk.vm.ci.code.TargetDescription;
35 import jdk.vm.ci.common.JVMCIError;
36 import jdk.vm.ci.hotspotvmconfig.HotSpotVMField;
37 import jdk.vm.ci.inittimer.InitTimer;
38 import jdk.vm.ci.meta.JavaType;
39 import jdk.vm.ci.meta.ResolvedJavaMethod;
40 import jdk.vm.ci.meta.ResolvedJavaType;
41 import sun.misc.Unsafe;
42
43 /**
44 * Calls from Java into HotSpot. The behavior of all the methods in this class that take a native
45 * pointer as an argument (e.g., {@link #getSymbol(long)}) is undefined if the argument does not
46 * denote a valid native object.
47 */
48 final class CompilerToVM {
49 /**
50 * Initializes the native part of the JVMCI runtime.
51 */
587 *
588 * @param base an object to read from or null
589 * @param displacement
590 * @param compressed true if the location contains a compressed Klass*
591 * @return null or the resolved method for this location
592 */
593 native HotSpotResolvedObjectTypeImpl getResolvedJavaType(Object base, long displacement, boolean compressed);
594
595 /**
596 * Return the size of the HotSpot ProfileData* pointed at by {@code position}. If
597 * {@code position} is outside the space of the MethodData then an
598 * {@link IllegalArgumentException} is thrown. A {@code position} inside the MethodData but that
599 * isn't pointing at a valid ProfileData will crash the VM.
600 *
601 * @param metaspaceMethodData
602 * @param position
603 * @return the size of the ProfileData item pointed at by {@code position}
604 * @throws IllegalArgumentException if an out of range position is given
605 */
606 native int methodDataProfileDataSize(long metaspaceMethodData, int position);
607 }
|
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 package jdk.vm.ci.hotspot;
25
26 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
27 import static jdk.vm.ci.inittimer.InitTimer.timer;
28
29 import java.lang.reflect.Constructor;
30 import java.lang.reflect.Method;
31
32 import jdk.vm.ci.code.BytecodeFrame;
33 import jdk.vm.ci.code.InstalledCode;
34 import jdk.vm.ci.code.InvalidInstalledCodeException;
35 import jdk.vm.ci.code.TargetDescription;
36 import jdk.vm.ci.common.JVMCIError;
37 import jdk.vm.ci.hotspotvmconfig.HotSpotVMField;
38 import jdk.vm.ci.inittimer.InitTimer;
39 import jdk.vm.ci.meta.JavaType;
40 import jdk.vm.ci.meta.ResolvedJavaMethod;
41 import jdk.vm.ci.meta.ResolvedJavaType;
42 import sun.misc.Unsafe;
43
44 /**
45 * Calls from Java into HotSpot. The behavior of all the methods in this class that take a native
46 * pointer as an argument (e.g., {@link #getSymbol(long)}) is undefined if the argument does not
47 * denote a valid native object.
48 */
49 final class CompilerToVM {
50 /**
51 * Initializes the native part of the JVMCI runtime.
52 */
588 *
589 * @param base an object to read from or null
590 * @param displacement
591 * @param compressed true if the location contains a compressed Klass*
592 * @return null or the resolved method for this location
593 */
594 native HotSpotResolvedObjectTypeImpl getResolvedJavaType(Object base, long displacement, boolean compressed);
595
596 /**
597 * Return the size of the HotSpot ProfileData* pointed at by {@code position}. If
598 * {@code position} is outside the space of the MethodData then an
599 * {@link IllegalArgumentException} is thrown. A {@code position} inside the MethodData but that
600 * isn't pointing at a valid ProfileData will crash the VM.
601 *
602 * @param metaspaceMethodData
603 * @param position
604 * @return the size of the ProfileData item pointed at by {@code position}
605 * @throws IllegalArgumentException if an out of range position is given
606 */
607 native int methodDataProfileDataSize(long metaspaceMethodData, int position);
608
609 /**
610 * Return the amount of native stack required for the interpreter frames represented by
611 * {@code frame}. This is used when emitting the stack banging code to ensure that there is
612 * enough space for the frames during deoptimization.
613 *
614 * @param frame
615 * @return the number of bytes required for deoptimization of this frame state
616 */
617 native int interpreterFrameSize(BytecodeFrame frame);
618 }
|