2369 case T_FLOAT: value.f = typeArrayOop(xobj())->float_at(index); break;
2370 case T_LONG: value.j = typeArrayOop(xobj())->long_at(index); break;
2371 case T_INT: value.i = typeArrayOop(xobj())->int_at(index); break;
2372 case T_SHORT: value.s = typeArrayOop(xobj())->short_at(index); break;
2373 case T_CHAR: value.c = typeArrayOop(xobj())->char_at(index); break;
2374 case T_BYTE: value.b = typeArrayOop(xobj())->byte_at(index); break;
2375 case T_BOOLEAN: value.z = typeArrayOop(xobj())->byte_at(index) & 1; break;
2376 default: ShouldNotReachHere();
2377 }
2378 result = JVMCIENV->create_box(element_type, &value, JVMCI_CHECK_NULL);
2379 }
2380 assert(!result.is_null(), "must have a value");
2381 return JVMCIENV->get_jobject(result);
2382 }
2383 return nullptr;;
2384 C2V_END
2385
2386
2387 C2V_VMENTRY_0(jint, arrayBaseOffset, (JNIEnv* env, jobject, jchar type_char))
2388 BasicType type = JVMCIENV->typeCharToBasicType(type_char, JVMCI_CHECK_0);
2389 return arrayOopDesc::header_size(type) * HeapWordSize;
2390 C2V_END
2391
2392 C2V_VMENTRY_0(jint, arrayIndexScale, (JNIEnv* env, jobject, jchar type_char))
2393 BasicType type = JVMCIENV->typeCharToBasicType(type_char, JVMCI_CHECK_0);
2394 return type2aelembytes(type);
2395 C2V_END
2396
2397 C2V_VMENTRY(void, releaseClearedOopHandles, (JNIEnv* env, jobject))
2398 JVMCIENV->runtime()->release_cleared_oop_handles();
2399 C2V_END
2400
2401 static void requireJVMCINativeLibrary(JVMCI_TRAPS) {
2402 if (!UseJVMCINativeLibrary) {
2403 JVMCI_THROW_MSG(UnsupportedOperationException, "JVMCI shared library is not enabled (requires -XX:+UseJVMCINativeLibrary)");
2404 }
2405 }
2406
2407 C2V_VMENTRY_NULL(jlongArray, registerNativeMethods, (JNIEnv* env, jobject, jclass mirror))
2408 requireJVMCINativeLibrary(JVMCI_CHECK_NULL);
2409 requireInHotSpot("registerNativeMethods", JVMCI_CHECK_NULL);
|
2369 case T_FLOAT: value.f = typeArrayOop(xobj())->float_at(index); break;
2370 case T_LONG: value.j = typeArrayOop(xobj())->long_at(index); break;
2371 case T_INT: value.i = typeArrayOop(xobj())->int_at(index); break;
2372 case T_SHORT: value.s = typeArrayOop(xobj())->short_at(index); break;
2373 case T_CHAR: value.c = typeArrayOop(xobj())->char_at(index); break;
2374 case T_BYTE: value.b = typeArrayOop(xobj())->byte_at(index); break;
2375 case T_BOOLEAN: value.z = typeArrayOop(xobj())->byte_at(index) & 1; break;
2376 default: ShouldNotReachHere();
2377 }
2378 result = JVMCIENV->create_box(element_type, &value, JVMCI_CHECK_NULL);
2379 }
2380 assert(!result.is_null(), "must have a value");
2381 return JVMCIENV->get_jobject(result);
2382 }
2383 return nullptr;;
2384 C2V_END
2385
2386
2387 C2V_VMENTRY_0(jint, arrayBaseOffset, (JNIEnv* env, jobject, jchar type_char))
2388 BasicType type = JVMCIENV->typeCharToBasicType(type_char, JVMCI_CHECK_0);
2389 return arrayOopDesc::base_offset_in_bytes(type);
2390 C2V_END
2391
2392 C2V_VMENTRY_0(jint, arrayIndexScale, (JNIEnv* env, jobject, jchar type_char))
2393 BasicType type = JVMCIENV->typeCharToBasicType(type_char, JVMCI_CHECK_0);
2394 return type2aelembytes(type);
2395 C2V_END
2396
2397 C2V_VMENTRY(void, releaseClearedOopHandles, (JNIEnv* env, jobject))
2398 JVMCIENV->runtime()->release_cleared_oop_handles();
2399 C2V_END
2400
2401 static void requireJVMCINativeLibrary(JVMCI_TRAPS) {
2402 if (!UseJVMCINativeLibrary) {
2403 JVMCI_THROW_MSG(UnsupportedOperationException, "JVMCI shared library is not enabled (requires -XX:+UseJVMCINativeLibrary)");
2404 }
2405 }
2406
2407 C2V_VMENTRY_NULL(jlongArray, registerNativeMethods, (JNIEnv* env, jobject, jclass mirror))
2408 requireJVMCINativeLibrary(JVMCI_CHECK_NULL);
2409 requireInHotSpot("registerNativeMethods", JVMCI_CHECK_NULL);
|