< prev index next >
src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java
Print this page
*** 298,363 ****
* @param index constant pool index
* @return constant pool entry
*/
private long getEntryAt(int index) {
assertBounds(index);
! return UNSAFE.getAddress(getMetaspaceConstantPool() + config().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
}
/**
* Gets the integer constant pool entry at index {@code index}.
*
* @param index constant pool index
* @return integer constant pool entry at index
*/
private int getIntAt(int index) {
assertTag(index, JVM_CONSTANT.Integer);
! return UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
}
/**
* Gets the long constant pool entry at index {@code index}.
*
* @param index constant pool index
* @return long constant pool entry
*/
private long getLongAt(int index) {
assertTag(index, JVM_CONSTANT.Long);
! return UNSAFE.getLong(getMetaspaceConstantPool() + config().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
}
/**
* Gets the float constant pool entry at index {@code index}.
*
* @param index constant pool index
* @return float constant pool entry
*/
private float getFloatAt(int index) {
assertTag(index, JVM_CONSTANT.Float);
! return UNSAFE.getFloat(getMetaspaceConstantPool() + config().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
}
/**
* Gets the double constant pool entry at index {@code index}.
*
* @param index constant pool index
* @return float constant pool entry
*/
private double getDoubleAt(int index) {
assertTag(index, JVM_CONSTANT.Double);
! return UNSAFE.getDouble(getMetaspaceConstantPool() + config().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
}
/**
* Gets the {@code JVM_CONSTANT_NameAndType} constant pool entry at index {@code index}.
*
* @param index constant pool index
* @return {@code JVM_CONSTANT_NameAndType} constant pool entry
*/
private int getNameAndTypeAt(int index) {
assertTag(index, JVM_CONSTANT.NameAndType);
! return UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
}
/**
* Gets the {@code JVM_CONSTANT_NameAndType} reference index constant pool entry at index
* {@code index}.
--- 298,369 ----
* @param index constant pool index
* @return constant pool entry
*/
private long getEntryAt(int index) {
assertBounds(index);
! int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
! return UNSAFE.getAddress(getMetaspaceConstantPool() + config().constantPoolSize + offset);
}
/**
* Gets the integer constant pool entry at index {@code index}.
*
* @param index constant pool index
* @return integer constant pool entry at index
*/
private int getIntAt(int index) {
assertTag(index, JVM_CONSTANT.Integer);
! int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
! return UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + offset);
}
/**
* Gets the long constant pool entry at index {@code index}.
*
* @param index constant pool index
* @return long constant pool entry
*/
private long getLongAt(int index) {
assertTag(index, JVM_CONSTANT.Long);
! int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
! return UNSAFE.getLong(getMetaspaceConstantPool() + config().constantPoolSize + offset);
}
/**
* Gets the float constant pool entry at index {@code index}.
*
* @param index constant pool index
* @return float constant pool entry
*/
private float getFloatAt(int index) {
assertTag(index, JVM_CONSTANT.Float);
! int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
! return UNSAFE.getFloat(getMetaspaceConstantPool() + config().constantPoolSize + offset);
}
/**
* Gets the double constant pool entry at index {@code index}.
*
* @param index constant pool index
* @return float constant pool entry
*/
private double getDoubleAt(int index) {
assertTag(index, JVM_CONSTANT.Double);
! int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
! return UNSAFE.getDouble(getMetaspaceConstantPool() + config().constantPoolSize + offset);
}
/**
* Gets the {@code JVM_CONSTANT_NameAndType} constant pool entry at index {@code index}.
*
* @param index constant pool index
* @return {@code JVM_CONSTANT_NameAndType} constant pool entry
*/
private int getNameAndTypeAt(int index) {
assertTag(index, JVM_CONSTANT.NameAndType);
! int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
! return UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + offset);
}
/**
* Gets the {@code JVM_CONSTANT_NameAndType} reference index constant pool entry at index
* {@code index}.
*** 434,444 ****
* @param index constant pool index
* @return klass reference index
*/
private int getUncachedKlassRefIndexAt(int index) {
assertTagIsFieldOrMethod(index);
! final int refIndex = UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
// klass ref index is in the low 16-bits.
return refIndex & 0xFFFF;
}
/**
--- 440,451 ----
* @param index constant pool index
* @return klass reference index
*/
private int getUncachedKlassRefIndexAt(int index) {
assertTagIsFieldOrMethod(index);
! int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
! final int refIndex = UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + offset);
// klass ref index is in the low 16-bits.
return refIndex & 0xFFFF;
}
/**
*** 680,698 ****
final HotSpotResolvedObjectTypeImpl type = compilerToVM().resolveTypeInPool(this, index);
Class<?> klass = type.mirror();
if (!klass.isPrimitive() && !klass.isArray()) {
UNSAFE.ensureClassInitialized(klass);
}
! switch (tag) {
! case MethodRef:
if (Bytecodes.isInvokeHandleAlias(opcode)) {
final int methodRefCacheIndex = rawIndexToConstantPoolIndex(cpi, opcode);
if (isInvokeHandle(methodRefCacheIndex, type)) {
compilerToVM().resolveInvokeHandleInPool(this, methodRefCacheIndex);
}
}
}
break;
case InvokeDynamic:
if (isInvokedynamicIndex(cpi)) {
compilerToVM().resolveInvokeDynamicInPool(this, cpi);
}
--- 687,705 ----
final HotSpotResolvedObjectTypeImpl type = compilerToVM().resolveTypeInPool(this, index);
Class<?> klass = type.mirror();
if (!klass.isPrimitive() && !klass.isArray()) {
UNSAFE.ensureClassInitialized(klass);
}
! if (tag == JVM_CONSTANT.MethodRef) {
if (Bytecodes.isInvokeHandleAlias(opcode)) {
final int methodRefCacheIndex = rawIndexToConstantPoolIndex(cpi, opcode);
if (isInvokeHandle(methodRefCacheIndex, type)) {
compilerToVM().resolveInvokeHandleInPool(this, methodRefCacheIndex);
}
}
}
+
break;
case InvokeDynamic:
if (isInvokedynamicIndex(cpi)) {
compilerToVM().resolveInvokeDynamicInPool(this, cpi);
}
< prev index next >