本文整理匯總了Java中jdk.vm.ci.meta.ResolvedJavaMethod.getCodeSize方法的典型用法代碼示例。如果您正苦於以下問題:Java ResolvedJavaMethod.getCodeSize方法的具體用法?Java ResolvedJavaMethod.getCodeSize怎麽用?Java ResolvedJavaMethod.getCodeSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類jdk.vm.ci.meta.ResolvedJavaMethod
的用法示例。
在下文中一共展示了ResolvedJavaMethod.getCodeSize方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: methodName
import jdk.vm.ci.meta.ResolvedJavaMethod; //導入方法依賴的package包/類
private static String methodName(ResolvedJavaMethod method, Invoke invoke) {
if (invoke != null && invoke.stateAfter() != null) {
return methodName(invoke.stateAfter(), invoke.bci()) + ": " + method.format("%H.%n(%p):%r") + " (" + method.getCodeSize() + " bytes)";
} else {
return method.format("%H.%n(%p):%r") + " (" + method.getCodeSize() + " bytes)";
}
}
示例2: getBytecodeSize
import jdk.vm.ci.meta.ResolvedJavaMethod; //導入方法依賴的package包/類
/**
* Gets the input bytecode {@linkplain ResolvedJavaMethod#getCodeSize() size} from which this
* graph is constructed. This ignores how many bytecodes in each constituent method are actually
* parsed (which may be none for methods whose IR is retrieved from a cache or less than the
* full amount for any given method due to profile guided branch pruning).
*/
public int getBytecodeSize() {
int res = 0;
for (ResolvedJavaMethod e : methods) {
res += e.getCodeSize();
}
return res;
}
示例3: getCodeSizeTest
import jdk.vm.ci.meta.ResolvedJavaMethod; //導入方法依賴的package包/類
/**
* @see ResolvedJavaMethod#getCodeSize()
*/
@Test
public void getCodeSizeTest() {
for (Map.Entry<Method, ResolvedJavaMethod> e : methods.entrySet()) {
ResolvedJavaMethod m = e.getValue();
int codeSize = m.getCodeSize();
if (m.isAbstract()) {
assertTrue(codeSize == 0);
} else if (!m.isNative()) {
assertTrue(codeSize > 0);
}
}
}
示例4: methodName
import jdk.vm.ci.meta.ResolvedJavaMethod; //導入方法依賴的package包/類
private static String methodName(ResolvedJavaMethod method) {
return method.format("%H.%n(%p):%r") + " (" + method.getCodeSize() + " bytes)";
}