316 * @throws JVMCIError if there is something wrong with the compiled code or the associated
317 * metadata.
318 */
319 native int installCode(TargetDescription target, HotSpotCompiledCode compiledCode, InstalledCode code, HotSpotSpeculationLog speculationLog);
320
321 /**
322 * Generates the VM metadata for some compiled code and copies them into {@code metaData}. This
323 * method does not install anything into the code cache.
324 *
325 * @param target the target where this code would be installed
326 * @param compiledCode the result of a compilation
327 * @param metaData the metadata is written to this object
328 * @return the outcome of the installation which will be one of
329 * {@link HotSpotVMConfig#codeInstallResultOk},
330 * {@link HotSpotVMConfig#codeInstallResultCacheFull},
331 * {@link HotSpotVMConfig#codeInstallResultCodeTooLarge},
332 * {@link HotSpotVMConfig#codeInstallResultDependenciesFailed} or
333 * {@link HotSpotVMConfig#codeInstallResultDependenciesInvalid}.
334 * @throws JVMCIError if there is something wrong with the compiled code or the metadata
335 */
336 public native int getMetadata(TargetDescription target, HotSpotCompiledCode compiledCode, HotSpotMetaData metaData);
337
338 /**
339 * Resets all compilation statistics.
340 */
341 native void resetCompilationStatistics();
342
343 /**
344 * Reads the database of VM info. The return value encodes the info in a nested object array
345 * that is described by the pseudo Java object {@code info} below:
346 *
347 * <pre>
348 * info = [
349 * VMField[] vmFields,
350 * [String name, Long size, ...] vmTypeSizes,
351 * [String name, Long value, ...] vmConstants,
352 * [String name, Long value, ...] vmAddresses,
353 * VMFlag[] vmFlags
354 * VMIntrinsicMethod[] vmIntrinsics
355 * ]
356 * </pre>
588 * @param displacement
589 * @param compressed true if the location contains a compressed Klass*
590 * @return null or the resolved method for this location
591 */
592 native HotSpotResolvedObjectTypeImpl getResolvedJavaType(Object base, long displacement, boolean compressed);
593
594 /**
595 * Return the size of the HotSpot ProfileData* pointed at by {@code position}. If
596 * {@code position} is outside the space of the MethodData then an
597 * {@link IllegalArgumentException} is thrown. A {@code position} inside the MethodData but that
598 * isn't pointing at a valid ProfileData will crash the VM.
599 *
600 * @param metaspaceMethodData
601 * @param position
602 * @return the size of the ProfileData item pointed at by {@code position}
603 * @throws IllegalArgumentException if an out of range position is given
604 */
605 native int methodDataProfileDataSize(long metaspaceMethodData, int position);
606
607 /**
608 * Return the amount of native stack required for the interpreter frames represented by
609 * {@code frame}. This is used when emitting the stack banging code to ensure that there is
610 * enough space for the frames during deoptimization.
611 *
612 * @param frame
613 * @return the number of bytes required for deoptimization of this frame state
614 */
615 native int interpreterFrameSize(BytecodeFrame frame);
616
617 /**
618 * Invokes non-public method {@code java.lang.invoke.LambdaForm.compileToBytecode()} on
619 * {@code lambdaForm} (which must be a {@code java.lang.invoke.LambdaForm} instance).
620 */
621 native void compileToBytecode(Object lambdaForm);
622 }
|
316 * @throws JVMCIError if there is something wrong with the compiled code or the associated
317 * metadata.
318 */
319 native int installCode(TargetDescription target, HotSpotCompiledCode compiledCode, InstalledCode code, HotSpotSpeculationLog speculationLog);
320
321 /**
322 * Generates the VM metadata for some compiled code and copies them into {@code metaData}. This
323 * method does not install anything into the code cache.
324 *
325 * @param target the target where this code would be installed
326 * @param compiledCode the result of a compilation
327 * @param metaData the metadata is written to this object
328 * @return the outcome of the installation which will be one of
329 * {@link HotSpotVMConfig#codeInstallResultOk},
330 * {@link HotSpotVMConfig#codeInstallResultCacheFull},
331 * {@link HotSpotVMConfig#codeInstallResultCodeTooLarge},
332 * {@link HotSpotVMConfig#codeInstallResultDependenciesFailed} or
333 * {@link HotSpotVMConfig#codeInstallResultDependenciesInvalid}.
334 * @throws JVMCIError if there is something wrong with the compiled code or the metadata
335 */
336 native int getMetadata(TargetDescription target, HotSpotCompiledCode compiledCode, HotSpotMetaData metaData);
337
338 /**
339 * Resets all compilation statistics.
340 */
341 native void resetCompilationStatistics();
342
343 /**
344 * Reads the database of VM info. The return value encodes the info in a nested object array
345 * that is described by the pseudo Java object {@code info} below:
346 *
347 * <pre>
348 * info = [
349 * VMField[] vmFields,
350 * [String name, Long size, ...] vmTypeSizes,
351 * [String name, Long value, ...] vmConstants,
352 * [String name, Long value, ...] vmAddresses,
353 * VMFlag[] vmFlags
354 * VMIntrinsicMethod[] vmIntrinsics
355 * ]
356 * </pre>
588 * @param displacement
589 * @param compressed true if the location contains a compressed Klass*
590 * @return null or the resolved method for this location
591 */
592 native HotSpotResolvedObjectTypeImpl getResolvedJavaType(Object base, long displacement, boolean compressed);
593
594 /**
595 * Return the size of the HotSpot ProfileData* pointed at by {@code position}. If
596 * {@code position} is outside the space of the MethodData then an
597 * {@link IllegalArgumentException} is thrown. A {@code position} inside the MethodData but that
598 * isn't pointing at a valid ProfileData will crash the VM.
599 *
600 * @param metaspaceMethodData
601 * @param position
602 * @return the size of the ProfileData item pointed at by {@code position}
603 * @throws IllegalArgumentException if an out of range position is given
604 */
605 native int methodDataProfileDataSize(long metaspaceMethodData, int position);
606
607 /**
608 * Gets the fingerprint for a given Klass*
609 *
610 * @param metaspaceKlass
611 * @return the value of the fingerprint (zero for arrays and synthetic classes).
612 */
613 native long getFingerprint(long metaspaceKlass);
614
615 /**
616 * Return the amount of native stack required for the interpreter frames represented by
617 * {@code frame}. This is used when emitting the stack banging code to ensure that there is
618 * enough space for the frames during deoptimization.
619 *
620 * @param frame
621 * @return the number of bytes required for deoptimization of this frame state
622 */
623 native int interpreterFrameSize(BytecodeFrame frame);
624
625 /**
626 * Invokes non-public method {@code java.lang.invoke.LambdaForm.compileToBytecode()} on
627 * {@code lambdaForm} (which must be a {@code java.lang.invoke.LambdaForm} instance).
628 */
629 native void compileToBytecode(Object lambdaForm);
630 }
|