< prev index next >

src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java

Print this page




  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 package jdk.vm.ci.hotspot;
  25 
  26 import static jdk.vm.ci.common.InitTimer.timer;
  27 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
  28 
  29 import java.lang.reflect.Executable;

  30 
  31 import jdk.vm.ci.code.BytecodeFrame;
  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.code.stack.InspectedFrameVisitor;
  36 import jdk.vm.ci.common.InitTimer;
  37 import jdk.vm.ci.common.JVMCIError;
  38 import jdk.vm.ci.meta.JavaType;
  39 import jdk.vm.ci.meta.ResolvedJavaMethod;
  40 import jdk.vm.ci.meta.ResolvedJavaType;
  41 
  42 /**
  43  * Calls from Java into HotSpot. The behavior of all the methods in this class that take a native
  44  * pointer as an argument (e.g., {@link #getSymbol(long)}) is undefined if the argument does not
  45  * denote a valid native object.
  46  */
  47 final class CompilerToVM {
  48     /**
  49      * Initializes the native part of the JVMCI runtime.


 640      * Invokes non-public method {@code java.lang.invoke.LambdaForm.compileToBytecode()} on
 641      * {@code lambdaForm} (which must be a {@code java.lang.invoke.LambdaForm} instance).
 642      */
 643     native void compileToBytecode(Object lambdaForm);
 644 
 645     /**
 646      * Gets the value of the VM flag named {@code name}.
 647      *
 648      * @param name name of a VM option
 649      * @return {@code this} if the named VM option doesn't exist, a {@link String} or {@code null}
 650      *         if its type is {@code ccstr} or {@code ccstrlist}, a {@link Double} if its type is
 651      *         {@code double}, a {@link Boolean} if its type is {@code bool} otherwise a
 652      *         {@link Long}
 653      */
 654     native Object getFlagValue(String name);
 655 
 656     /**
 657      * Gets the host class for {@code type}.
 658      */
 659     native HotSpotResolvedObjectTypeImpl getHostClass(HotSpotResolvedObjectTypeImpl type);













 660 }


  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 package jdk.vm.ci.hotspot;
  25 
  26 import static jdk.vm.ci.common.InitTimer.timer;
  27 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
  28 
  29 import java.lang.reflect.Executable;
  30 import java.lang.reflect.Field;
  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.code.stack.InspectedFrameVisitor;
  37 import jdk.vm.ci.common.InitTimer;
  38 import jdk.vm.ci.common.JVMCIError;
  39 import jdk.vm.ci.meta.JavaType;
  40 import jdk.vm.ci.meta.ResolvedJavaMethod;
  41 import jdk.vm.ci.meta.ResolvedJavaType;
  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.


 641      * Invokes non-public method {@code java.lang.invoke.LambdaForm.compileToBytecode()} on
 642      * {@code lambdaForm} (which must be a {@code java.lang.invoke.LambdaForm} instance).
 643      */
 644     native void compileToBytecode(Object lambdaForm);
 645 
 646     /**
 647      * Gets the value of the VM flag named {@code name}.
 648      *
 649      * @param name name of a VM option
 650      * @return {@code this} if the named VM option doesn't exist, a {@link String} or {@code null}
 651      *         if its type is {@code ccstr} or {@code ccstrlist}, a {@link Double} if its type is
 652      *         {@code double}, a {@link Boolean} if its type is {@code bool} otherwise a
 653      *         {@link Long}
 654      */
 655     native Object getFlagValue(String name);
 656 
 657     /**
 658      * Gets the host class for {@code type}.
 659      */
 660     native HotSpotResolvedObjectTypeImpl getHostClass(HotSpotResolvedObjectTypeImpl type);
 661 
 662     /**
 663      * Gets a {@link Executable} corresponding to {@code method}.
 664      */
 665     native Executable asReflectionExecutable(HotSpotResolvedJavaMethodImpl method);
 666 
 667     /**
 668      * Gets a {@link Field} denoted by {@code holder} and {@code index}.
 669      *
 670      * @param holder the class in which the requested field is declared
 671      * @param fieldIndex the {@code fieldDescriptor::index()} denoting the field
 672      */
 673     native Field asReflectionField(HotSpotResolvedObjectTypeImpl holder, int fieldIndex);
 674 }
< prev index next >