< prev index next >

src/hotspot/share/jvmci/jvmciCompilerToVM.cpp

Print this page

2100         case T_SHORT:         value.s = typeArrayOop(xobj())->short_at(index);          break;
2101         case T_CHAR:          value.c = typeArrayOop(xobj())->char_at(index);           break;
2102         case T_BYTE:          value.b = typeArrayOop(xobj())->byte_at(index);           break;
2103         case T_BOOLEAN:       value.z = typeArrayOop(xobj())->byte_at(index) & 1;       break;
2104         default:              ShouldNotReachHere();
2105       }
2106       result = JVMCIENV->create_box(element_type, &value, JVMCI_CHECK_NULL);
2107     }
2108     assert(!result.is_null(), "must have a value");
2109     return JVMCIENV->get_jobject(result);
2110   }
2111   return NULL;;
2112 C2V_END
2113 
2114 
2115 C2V_VMENTRY_0(jint, arrayBaseOffset, (JNIEnv* env, jobject, jobject kind))
2116   if (kind == NULL) {
2117     JVMCI_THROW_0(NullPointerException);
2118   }
2119   BasicType type = JVMCIENV->kindToBasicType(JVMCIENV->wrap(kind), JVMCI_CHECK_0);
2120   return arrayOopDesc::header_size(type) * HeapWordSize;
2121 C2V_END
2122 
2123 C2V_VMENTRY_0(jint, arrayIndexScale, (JNIEnv* env, jobject, jobject kind))
2124   if (kind == NULL) {
2125     JVMCI_THROW_0(NullPointerException);
2126   }
2127   BasicType type = JVMCIENV->kindToBasicType(JVMCIENV->wrap(kind), JVMCI_CHECK_0);
2128   return type2aelembytes(type);
2129 C2V_END
2130 
2131 C2V_VMENTRY(void, deleteGlobalHandle, (JNIEnv* env, jobject, jlong h))
2132   jobject handle = (jobject)(address)h;
2133   if (handle != NULL) {
2134     JVMCIENV->runtime()->destroy_global(handle);
2135   }
2136 }
2137 
2138 static void requireJVMCINativeLibrary(JVMCI_TRAPS) {
2139   if (!UseJVMCINativeLibrary) {
2140     JVMCI_THROW_MSG(UnsupportedOperationException, "JVMCI shared library is not enabled (requires -XX:+UseJVMCINativeLibrary)");

2100         case T_SHORT:         value.s = typeArrayOop(xobj())->short_at(index);          break;
2101         case T_CHAR:          value.c = typeArrayOop(xobj())->char_at(index);           break;
2102         case T_BYTE:          value.b = typeArrayOop(xobj())->byte_at(index);           break;
2103         case T_BOOLEAN:       value.z = typeArrayOop(xobj())->byte_at(index) & 1;       break;
2104         default:              ShouldNotReachHere();
2105       }
2106       result = JVMCIENV->create_box(element_type, &value, JVMCI_CHECK_NULL);
2107     }
2108     assert(!result.is_null(), "must have a value");
2109     return JVMCIENV->get_jobject(result);
2110   }
2111   return NULL;;
2112 C2V_END
2113 
2114 
2115 C2V_VMENTRY_0(jint, arrayBaseOffset, (JNIEnv* env, jobject, jobject kind))
2116   if (kind == NULL) {
2117     JVMCI_THROW_0(NullPointerException);
2118   }
2119   BasicType type = JVMCIENV->kindToBasicType(JVMCIENV->wrap(kind), JVMCI_CHECK_0);
2120   return arrayOopDesc::base_offset_in_bytes(type);
2121 C2V_END
2122 
2123 C2V_VMENTRY_0(jint, arrayIndexScale, (JNIEnv* env, jobject, jobject kind))
2124   if (kind == NULL) {
2125     JVMCI_THROW_0(NullPointerException);
2126   }
2127   BasicType type = JVMCIENV->kindToBasicType(JVMCIENV->wrap(kind), JVMCI_CHECK_0);
2128   return type2aelembytes(type);
2129 C2V_END
2130 
2131 C2V_VMENTRY(void, deleteGlobalHandle, (JNIEnv* env, jobject, jlong h))
2132   jobject handle = (jobject)(address)h;
2133   if (handle != NULL) {
2134     JVMCIENV->runtime()->destroy_global(handle);
2135   }
2136 }
2137 
2138 static void requireJVMCINativeLibrary(JVMCI_TRAPS) {
2139   if (!UseJVMCINativeLibrary) {
2140     JVMCI_THROW_MSG(UnsupportedOperationException, "JVMCI shared library is not enabled (requires -XX:+UseJVMCINativeLibrary)");
< prev index next >