< prev index next >

src/hotspot/share/jvmci/jvmciCompilerToVM.cpp

Print this page

2183         case T_FLOAT:         value.f = typeArrayOop(xobj())->float_at(index);         break;
2184         case T_LONG:          value.j = typeArrayOop(xobj())->long_at(index);          break;
2185         case T_INT:           value.i = typeArrayOop(xobj())->int_at(index);            break;
2186         case T_SHORT:         value.s = typeArrayOop(xobj())->short_at(index);          break;
2187         case T_CHAR:          value.c = typeArrayOop(xobj())->char_at(index);           break;
2188         case T_BYTE:          value.b = typeArrayOop(xobj())->byte_at(index);           break;
2189         case T_BOOLEAN:       value.z = typeArrayOop(xobj())->byte_at(index) & 1;       break;
2190         default:              ShouldNotReachHere();
2191       }
2192       result = JVMCIENV->create_box(element_type, &value, JVMCI_CHECK_NULL);
2193     }
2194     assert(!result.is_null(), "must have a value");
2195     return JVMCIENV->get_jobject(result);
2196   }
2197   return NULL;;
2198 C2V_END
2199 
2200 
2201 C2V_VMENTRY_0(jint, arrayBaseOffset, (JNIEnv* env, jobject, jchar type_char))
2202   BasicType type = JVMCIENV->typeCharToBasicType(type_char, JVMCI_CHECK_0);
2203   return arrayOopDesc::header_size(type) * HeapWordSize;
2204 C2V_END
2205 
2206 C2V_VMENTRY_0(jint, arrayIndexScale, (JNIEnv* env, jobject, jchar type_char))
2207   BasicType type = JVMCIENV->typeCharToBasicType(type_char, JVMCI_CHECK_0);
2208   return type2aelembytes(type);
2209 C2V_END
2210 
2211 C2V_VMENTRY(void, releaseClearedOopHandles, (JNIEnv* env, jobject))
2212   JVMCIENV->runtime()->release_cleared_oop_handles();
2213 C2V_END
2214 
2215 static void requireJVMCINativeLibrary(JVMCI_TRAPS) {
2216   if (!UseJVMCINativeLibrary) {
2217     JVMCI_THROW_MSG(UnsupportedOperationException, "JVMCI shared library is not enabled (requires -XX:+UseJVMCINativeLibrary)");
2218   }
2219 }
2220 
2221 C2V_VMENTRY_NULL(jlongArray, registerNativeMethods, (JNIEnv* env, jobject, jclass mirror))
2222   requireJVMCINativeLibrary(JVMCI_CHECK_NULL);
2223   requireInHotSpot("registerNativeMethods", JVMCI_CHECK_NULL);

2183         case T_FLOAT:         value.f = typeArrayOop(xobj())->float_at(index);         break;
2184         case T_LONG:          value.j = typeArrayOop(xobj())->long_at(index);          break;
2185         case T_INT:           value.i = typeArrayOop(xobj())->int_at(index);            break;
2186         case T_SHORT:         value.s = typeArrayOop(xobj())->short_at(index);          break;
2187         case T_CHAR:          value.c = typeArrayOop(xobj())->char_at(index);           break;
2188         case T_BYTE:          value.b = typeArrayOop(xobj())->byte_at(index);           break;
2189         case T_BOOLEAN:       value.z = typeArrayOop(xobj())->byte_at(index) & 1;       break;
2190         default:              ShouldNotReachHere();
2191       }
2192       result = JVMCIENV->create_box(element_type, &value, JVMCI_CHECK_NULL);
2193     }
2194     assert(!result.is_null(), "must have a value");
2195     return JVMCIENV->get_jobject(result);
2196   }
2197   return NULL;;
2198 C2V_END
2199 
2200 
2201 C2V_VMENTRY_0(jint, arrayBaseOffset, (JNIEnv* env, jobject, jchar type_char))
2202   BasicType type = JVMCIENV->typeCharToBasicType(type_char, JVMCI_CHECK_0);
2203   return arrayOopDesc::base_offset_in_bytes(type);
2204 C2V_END
2205 
2206 C2V_VMENTRY_0(jint, arrayIndexScale, (JNIEnv* env, jobject, jchar type_char))
2207   BasicType type = JVMCIENV->typeCharToBasicType(type_char, JVMCI_CHECK_0);
2208   return type2aelembytes(type);
2209 C2V_END
2210 
2211 C2V_VMENTRY(void, releaseClearedOopHandles, (JNIEnv* env, jobject))
2212   JVMCIENV->runtime()->release_cleared_oop_handles();
2213 C2V_END
2214 
2215 static void requireJVMCINativeLibrary(JVMCI_TRAPS) {
2216   if (!UseJVMCINativeLibrary) {
2217     JVMCI_THROW_MSG(UnsupportedOperationException, "JVMCI shared library is not enabled (requires -XX:+UseJVMCINativeLibrary)");
2218   }
2219 }
2220 
2221 C2V_VMENTRY_NULL(jlongArray, registerNativeMethods, (JNIEnv* env, jobject, jclass mirror))
2222   requireJVMCINativeLibrary(JVMCI_CHECK_NULL);
2223   requireInHotSpot("registerNativeMethods", JVMCI_CHECK_NULL);
< prev index next >