< prev index next >

src/hotspot/share/jvmci/jvmciCompilerToVM.cpp

Print this page

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

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