hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java
author alanb
Thu, 17 Mar 2016 19:04:01 +0000
changeset 36508 5f9eee6b383b
child 38686 6c51f29cbc5d
permissions -rw-r--r--
8142968: Module System implementation Summary: Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282 Reviewed-by: acorn, ccheung, coleenp, ctornqvi, dholmes, dsimms, gtriantafill, iklam, jiangli, mgronlun, mseledtsov, cjplummer, sspitsyn, stefank, twisti, hseigel, lfoltan, alanb, mchung, dfazunen Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, harold.seigel@oracle.com, lois.foltan@oracle.com, calvin.cheung@oracle.com, christian.tornqvist@oracle.com, erik.joelsson@oracle.com, george.triantafillou@oracle.com, igor.ignatyev@oracle.com, ioi.lam@oracle.com, james.laskey@oracle.com, jean-francois.denise@oracle.com, jiangli.zhou@oracle.com, markus.gronlund@oracle.com, serguei.spitsyn@oracle.com, staffan.larsen@oracle.com, sundararajan.athijegannathan@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
     1
/*
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
     2
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
     4
 *
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
     7
 * published by the Free Software Foundation.
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
     8
 *
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    13
 * accompanied this code).
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    14
 *
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    18
 *
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    21
 * questions.
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    22
 */
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    23
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    24
package jdk.vm.ci.hotspot;
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    25
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    26
import jdk.vm.ci.code.InstalledCode;
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    27
import jdk.vm.ci.code.InvalidInstalledCodeException;
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    28
import jdk.vm.ci.code.TargetDescription;
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    29
import jdk.vm.ci.meta.ConstantPool;
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    30
import jdk.vm.ci.meta.ResolvedJavaMethod;
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    31
import jdk.vm.ci.meta.SpeculationLog;
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    32
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    33
/**
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    34
 * A simple "proxy" class to get test access to CompilerToVM package-private methods
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    35
 */
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    36
public class CompilerToVMHelper {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    37
    public static final CompilerToVM CTVM = new CompilerToVM();
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    38
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    39
    public static byte[] getBytecode(HotSpotResolvedJavaMethod method) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    40
        return CTVM.getBytecode((HotSpotResolvedJavaMethodImpl)method);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    41
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    42
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    43
    public static int getExceptionTableLength(HotSpotResolvedJavaMethod method) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    44
        return CTVM.getExceptionTableLength((HotSpotResolvedJavaMethodImpl)method);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    45
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    46
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    47
    public static long getExceptionTableStart(HotSpotResolvedJavaMethod method) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    48
        return CTVM.getExceptionTableStart((HotSpotResolvedJavaMethodImpl)method);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    49
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    50
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    51
    public static boolean canInlineMethod(HotSpotResolvedJavaMethod method) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    52
        return CTVM.canInlineMethod((HotSpotResolvedJavaMethodImpl)method);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    53
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    54
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    55
    public static boolean shouldInlineMethod(HotSpotResolvedJavaMethod method) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    56
        return CTVM.shouldInlineMethod((HotSpotResolvedJavaMethodImpl)method);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    57
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    58
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    59
    public static HotSpotResolvedJavaMethod findUniqueConcreteMethod(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    60
            HotSpotResolvedObjectType actualHolderType,
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    61
            HotSpotResolvedJavaMethod method) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    62
        return CTVM.findUniqueConcreteMethod((HotSpotResolvedObjectTypeImpl) actualHolderType, (HotSpotResolvedJavaMethodImpl)method);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    63
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    64
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    65
    public static HotSpotResolvedObjectType getImplementor(HotSpotResolvedObjectType type) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    66
        return CTVM.getImplementor((HotSpotResolvedObjectTypeImpl) type);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    67
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    68
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    69
    public static boolean methodIsIgnoredBySecurityStackWalk(HotSpotResolvedJavaMethod method) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    70
        return CTVM.methodIsIgnoredBySecurityStackWalk((HotSpotResolvedJavaMethodImpl)method);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    71
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    72
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    73
    public static HotSpotResolvedObjectType lookupType(String name,
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    74
            Class<?> accessingClass, boolean resolve) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    75
        return CTVM.lookupType(name, accessingClass, resolve);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    76
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    77
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    78
    public static Object resolveConstantInPool(ConstantPool constantPool, int cpi) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    79
        return CTVM.resolveConstantInPool((HotSpotConstantPool) constantPool, cpi);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    80
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    81
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    82
    public static Object resolvePossiblyCachedConstantInPool(ConstantPool constantPool, int cpi) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    83
        return CTVM.resolvePossiblyCachedConstantInPool((HotSpotConstantPool) constantPool, cpi);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    84
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    85
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    86
    public static int lookupNameAndTypeRefIndexInPool(ConstantPool constantPool, int cpi) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    87
        return CTVM.lookupNameAndTypeRefIndexInPool((HotSpotConstantPool) constantPool, cpi);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    88
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    89
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    90
    public static String lookupNameInPool(ConstantPool constantPool, int cpi) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    91
        return CTVM.lookupNameInPool((HotSpotConstantPool) constantPool, cpi);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    92
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    93
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    94
    public static String lookupSignatureInPool(ConstantPool constantPool, int cpi) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    95
        return CTVM.lookupSignatureInPool((HotSpotConstantPool) constantPool, cpi);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    96
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    97
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    98
    public static int lookupKlassRefIndexInPool(ConstantPool constantPool, int cpi) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
    99
        return CTVM.lookupKlassRefIndexInPool((HotSpotConstantPool) constantPool, cpi);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   100
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   101
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   102
    public static Object lookupKlassInPool(ConstantPool constantPool, int cpi) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   103
        return CTVM.lookupKlassInPool((HotSpotConstantPool) constantPool, cpi);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   104
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   105
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   106
    public static HotSpotResolvedJavaMethod lookupMethodInPool(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   107
            ConstantPool constantPool, int cpi, byte opcode) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   108
        return CTVM.lookupMethodInPool((HotSpotConstantPool) constantPool, cpi, opcode);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   109
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   110
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   111
    public static void resolveInvokeDynamicInPool(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   112
            ConstantPool constantPool, int cpi) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   113
        CTVM.resolveInvokeDynamicInPool((HotSpotConstantPool) constantPool, cpi);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   114
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   115
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   116
    public static void resolveInvokeHandleInPool(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   117
            ConstantPool constantPool, int cpi) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   118
        CTVM.resolveInvokeHandleInPool((HotSpotConstantPool) constantPool, cpi);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   119
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   120
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   121
    public static HotSpotResolvedObjectType resolveTypeInPool(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   122
            ConstantPool constantPool, int cpi) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   123
        return CTVM.resolveTypeInPool((HotSpotConstantPool) constantPool, cpi);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   124
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   125
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   126
    public static HotSpotResolvedObjectType resolveFieldInPool(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   127
            ConstantPool constantPool, int cpi, byte opcode, long[] info) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   128
        return CTVM.resolveFieldInPool((HotSpotConstantPool) constantPool, cpi, opcode, info);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   129
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   130
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   131
    public static int constantPoolRemapInstructionOperandFromCache(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   132
            ConstantPool constantPool, int cpci) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   133
        return CTVM.constantPoolRemapInstructionOperandFromCache((HotSpotConstantPool) constantPool, cpci);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   134
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   135
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   136
    public static Object lookupAppendixInPool(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   137
            ConstantPool constantPool, int cpi) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   138
        return CTVM.lookupAppendixInPool((HotSpotConstantPool) constantPool, cpi);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   139
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   140
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   141
    public static int installCode(TargetDescription target,
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   142
            HotSpotCompiledCode compiledCode, InstalledCode code, HotSpotSpeculationLog speculationLog) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   143
        return CTVM.installCode(target, compiledCode, code, speculationLog);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   144
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   145
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   146
    public static int getMetadata(TargetDescription target,
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   147
            HotSpotCompiledCode compiledCode, HotSpotMetaData metaData) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   148
        return CTVM.getMetadata(target, compiledCode, metaData);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   149
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   150
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   151
    public static void resetCompilationStatistics() {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   152
        CTVM.resetCompilationStatistics();
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   153
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   154
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   155
    public static long initializeConfiguration(HotSpotVMConfig config) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   156
        return CTVM.initializeConfiguration(config);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   157
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   158
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   159
    public static HotSpotResolvedJavaMethod resolveMethod(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   160
            HotSpotResolvedObjectType exactReceiver,
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   161
            HotSpotResolvedJavaMethod method,
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   162
            HotSpotResolvedObjectType caller) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   163
        return CTVM.resolveMethod((HotSpotResolvedObjectTypeImpl) exactReceiver, (HotSpotResolvedJavaMethodImpl) method, (HotSpotResolvedObjectTypeImpl) caller);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   164
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   165
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   166
    public static HotSpotResolvedJavaMethod getClassInitializer(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   167
            HotSpotResolvedObjectType type) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   168
        return CTVM.getClassInitializer((HotSpotResolvedObjectTypeImpl) type);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   169
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   170
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   171
    public static boolean hasFinalizableSubclass(HotSpotResolvedObjectType type) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   172
        return CTVM.hasFinalizableSubclass((HotSpotResolvedObjectTypeImpl) type);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   173
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   174
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   175
    public static HotSpotResolvedJavaMethodImpl getResolvedJavaMethodAtSlot(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   176
            Class<?> holder, int slot) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   177
        return CTVM.getResolvedJavaMethodAtSlot(holder, slot);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   178
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   179
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   180
    public static long getMaxCallTargetOffset(long address) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   181
        return CTVM.getMaxCallTargetOffset(address);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   182
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   183
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   184
    public static String disassembleCodeBlob(InstalledCode codeBlob) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   185
        return CTVM.disassembleCodeBlob(codeBlob);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   186
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   187
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   188
    public static StackTraceElement getStackTraceElement(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   189
            HotSpotResolvedJavaMethod method, int bci) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   190
        return CTVM.getStackTraceElement((HotSpotResolvedJavaMethodImpl)method, bci);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   191
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   192
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   193
    public static Object executeInstalledCode(Object[] args,
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   194
            InstalledCode installedCode) throws InvalidInstalledCodeException {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   195
        return CTVM.executeInstalledCode(args, installedCode);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   196
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   197
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   198
    public static long[] getLineNumberTable(HotSpotResolvedJavaMethod method) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   199
        return CTVM.getLineNumberTable((HotSpotResolvedJavaMethodImpl)method);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   200
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   201
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   202
    public static int getLocalVariableTableLength(HotSpotResolvedJavaMethod method) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   203
        return CTVM.getLocalVariableTableLength((HotSpotResolvedJavaMethodImpl)method);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   204
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   205
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   206
    public static long getLocalVariableTableStart(HotSpotResolvedJavaMethod method) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   207
        return CTVM.getLocalVariableTableStart((HotSpotResolvedJavaMethodImpl)method);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   208
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   209
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   210
    public static Object readUncompressedOop(long address) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   211
        return CTVM.readUncompressedOop(address);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   212
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   213
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   214
    public static void doNotInlineOrCompile(HotSpotResolvedJavaMethod method) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   215
        CTVM.doNotInlineOrCompile((HotSpotResolvedJavaMethodImpl)method);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   216
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   217
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   218
    public static void reprofile(HotSpotResolvedJavaMethod method) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   219
        CTVM.reprofile((HotSpotResolvedJavaMethodImpl)method);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   220
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   221
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   222
    public static void invalidateInstalledCode(InstalledCode installedCode) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   223
        CTVM.invalidateInstalledCode(installedCode);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   224
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   225
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   226
    public static long[] collectCounters() {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   227
        return CTVM.collectCounters();
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   228
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   229
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   230
    public static boolean isMature(long metaspaceMethodData) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   231
        return CTVM.isMature(metaspaceMethodData);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   232
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   233
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   234
    public static int allocateCompileId(HotSpotResolvedJavaMethod method,
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   235
            int entryBCI) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   236
        return CTVM.allocateCompileId((HotSpotResolvedJavaMethodImpl) method, entryBCI);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   237
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   238
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   239
    public static boolean hasCompiledCodeForOSR(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   240
            HotSpotResolvedJavaMethod method, int entryBCI, int level) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   241
        return CTVM.hasCompiledCodeForOSR((HotSpotResolvedJavaMethodImpl) method, entryBCI, level);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   242
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   243
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   244
    public static String getSymbol(long metaspaceSymbol) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   245
        return CTVM.getSymbol(metaspaceSymbol);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   246
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   247
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   248
    public static HotSpotStackFrameReference getNextStackFrame(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   249
            HotSpotStackFrameReference frame,
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   250
            ResolvedJavaMethod[] methods, int initialSkip) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   251
        return CTVM.getNextStackFrame(frame, methods, initialSkip);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   252
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   253
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   254
    public static void materializeVirtualObjects(
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   255
            HotSpotStackFrameReference stackFrame, boolean invalidate) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   256
        CTVM.materializeVirtualObjects(stackFrame, invalidate);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   257
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   258
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   259
    public static int getVtableIndexForInterfaceMethod(HotSpotResolvedObjectType type,
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   260
            HotSpotResolvedJavaMethod method) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   261
        return CTVM.getVtableIndexForInterfaceMethod((HotSpotResolvedObjectTypeImpl) type, (HotSpotResolvedJavaMethodImpl) method);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   262
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   263
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   264
    public static boolean shouldDebugNonSafepoints() {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   265
        return CTVM.shouldDebugNonSafepoints();
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   266
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   267
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   268
    public static void writeDebugOutput(byte[] bytes, int offset, int length) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   269
        CTVM.writeDebugOutput(bytes, offset, length);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   270
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   271
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   272
    public static void flushDebugOutput() {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   273
        CTVM.flushDebugOutput();
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   274
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   275
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   276
    public static HotSpotResolvedJavaMethod getResolvedJavaMethod(Object base,
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   277
            long displacement) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   278
        return CTVM.getResolvedJavaMethod(base, displacement);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   279
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   280
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   281
    public static HotSpotConstantPool getConstantPool(Object base, long displacement) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   282
        return CTVM.getConstantPool(base, displacement);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   283
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   284
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   285
    public static HotSpotResolvedObjectType getResolvedJavaType(Object base,
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   286
            long displacement, boolean compressed) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   287
        return CTVM.getResolvedJavaType(base, displacement, compressed);
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   288
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   289
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   290
    public static long getMetaspacePointer(Object o) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   291
        return ((MetaspaceWrapperObject) o).getMetaspacePointer();
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   292
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   293
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   294
    public static Class<?> CompilerToVMClass() {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   295
        return CompilerToVM.class;
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   296
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   297
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   298
    public static Class<?> HotSpotConstantPoolClass() {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   299
        return HotSpotConstantPool.class;
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   300
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   301
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   302
    public static Class<?> getMirror(HotSpotResolvedObjectType type) {
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   303
        return ((HotSpotResolvedJavaType) type).mirror();
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   304
    }
5f9eee6b383b 8142968: Module System implementation
alanb
parents:
diff changeset
   305
}