src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54847 59ea39bb2809
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
   203   JVMCIObject name = JVMCIENV->wrap(name_handle);
   203   JVMCIObject name = JVMCIENV->wrap(name_handle);
   204   if (name.is_null()) {
   204   if (name.is_null()) {
   205     JVMCI_THROW_NULL(NullPointerException);
   205     JVMCI_THROW_NULL(NullPointerException);
   206   }
   206   }
   207   const char* cstring = JVMCIENV->as_utf8_string(name);
   207   const char* cstring = JVMCIENV->as_utf8_string(name);
   208   JVMFlag* flag = JVMFlag::find_flag(cstring, strlen(cstring), /* allow_locked */ true, /* return_flag */ true);
   208   const JVMFlag* flag = JVMFlag::find_declared_flag(cstring);
   209   if (flag == NULL) {
   209   if (flag == NULL) {
   210     return c2vm;
   210     return c2vm;
   211   }
   211   }
   212   if (flag->is_bool()) {
   212   if (flag->is_bool()) {
   213     jvalue prim;
   213     jvalue prim;
   450 C2V_VMENTRY_NULL(jobject, findUniqueConcreteMethod, (JNIEnv* env, jobject, jobject jvmci_type, jobject jvmci_method))
   450 C2V_VMENTRY_NULL(jobject, findUniqueConcreteMethod, (JNIEnv* env, jobject, jobject jvmci_type, jobject jvmci_method))
   451   methodHandle method = JVMCIENV->asMethod(jvmci_method);
   451   methodHandle method = JVMCIENV->asMethod(jvmci_method);
   452   Klass* holder = JVMCIENV->asKlass(jvmci_type);
   452   Klass* holder = JVMCIENV->asKlass(jvmci_type);
   453   if (holder->is_interface()) {
   453   if (holder->is_interface()) {
   454     JVMCI_THROW_MSG_NULL(InternalError, err_msg("Interface %s should be handled in Java code", holder->external_name()));
   454     JVMCI_THROW_MSG_NULL(InternalError, err_msg("Interface %s should be handled in Java code", holder->external_name()));
       
   455   }
       
   456   if (method->can_be_statically_bound()) {
       
   457     JVMCI_THROW_MSG_NULL(InternalError, err_msg("Effectively static method %s.%s should be handled in Java code", method->method_holder()->external_name(), method->external_name()));
   455   }
   458   }
   456 
   459 
   457   methodHandle ucm;
   460   methodHandle ucm;
   458   {
   461   {
   459     MutexLocker locker(Compile_lock);
   462     MutexLocker locker(Compile_lock);
   563   }
   566   }
   564   JVMCIObject result = JVMCIENV->get_jvmci_type(resolved_klass, JVMCI_CHECK_NULL);
   567   JVMCIObject result = JVMCIENV->get_jvmci_type(resolved_klass, JVMCI_CHECK_NULL);
   565   return JVMCIENV->get_jobject(result);
   568   return JVMCIENV->get_jobject(result);
   566 C2V_END
   569 C2V_END
   567 
   570 
       
   571 C2V_VMENTRY_NULL(jobject, getArrayType, (JNIEnv* env, jobject, jobject jvmci_type))
       
   572   if (jvmci_type == NULL) {
       
   573     JVMCI_THROW_0(NullPointerException);
       
   574   }
       
   575 
       
   576   JVMCIObject jvmci_type_object = JVMCIENV->wrap(jvmci_type);
       
   577   JVMCIKlassHandle array_klass(THREAD);
       
   578   if (JVMCIENV->isa_HotSpotResolvedPrimitiveType(jvmci_type_object)) {
       
   579     BasicType type = JVMCIENV->kindToBasicType(JVMCIENV->get_HotSpotResolvedPrimitiveType_kind(jvmci_type_object), JVMCI_CHECK_0);
       
   580     if (type == T_VOID) {
       
   581       return NULL;
       
   582     }
       
   583     array_klass = Universe::typeArrayKlassObj(type);
       
   584     if (array_klass == NULL) {
       
   585       JVMCI_THROW_MSG_NULL(InternalError, err_msg("No array klass for primitive type %s", type2name(type)));
       
   586     }
       
   587   } else {
       
   588     Klass* klass = JVMCIENV->asKlass(jvmci_type);
       
   589     if (klass == NULL) {
       
   590       JVMCI_THROW_0(NullPointerException);
       
   591     }
       
   592     array_klass = klass->array_klass(CHECK_NULL);
       
   593   }
       
   594   JVMCIObject result = JVMCIENV->get_jvmci_type(array_klass, JVMCI_CHECK_NULL);
       
   595   return JVMCIENV->get_jobject(result);
       
   596 C2V_END
       
   597 
   568 C2V_VMENTRY_NULL(jobject, lookupClass, (JNIEnv* env, jobject, jclass mirror))
   598 C2V_VMENTRY_NULL(jobject, lookupClass, (JNIEnv* env, jobject, jclass mirror))
   569   requireInHotSpot("lookupClass", JVMCI_CHECK_NULL);
   599   requireInHotSpot("lookupClass", JVMCI_CHECK_NULL);
   570   if (mirror == NULL) {
   600   if (mirror == NULL) {
   571     return NULL;
   601     return NULL;
   572   }
   602   }
   576     JVMCI_THROW_MSG_NULL(IllegalArgumentException, "Primitive classes are unsupported");
   606     JVMCI_THROW_MSG_NULL(IllegalArgumentException, "Primitive classes are unsupported");
   577   }
   607   }
   578   JVMCIObject result = JVMCIENV->get_jvmci_type(klass, JVMCI_CHECK_NULL);
   608   JVMCIObject result = JVMCIENV->get_jvmci_type(klass, JVMCI_CHECK_NULL);
   579   return JVMCIENV->get_jobject(result);
   609   return JVMCIENV->get_jobject(result);
   580 }
   610 }
   581 
       
   582 C2V_VMENTRY_NULL(jobject, resolveConstantInPool, (JNIEnv* env, jobject, jobject jvmci_constant_pool, jint index))
       
   583   constantPoolHandle cp = JVMCIENV->asConstantPool(jvmci_constant_pool);
       
   584   oop result = cp->resolve_constant_at(index, CHECK_NULL);
       
   585   return JVMCIENV->get_jobject(JVMCIENV->get_object_constant(result));
       
   586 C2V_END
       
   587 
   611 
   588 C2V_VMENTRY_NULL(jobject, resolvePossiblyCachedConstantInPool, (JNIEnv* env, jobject, jobject jvmci_constant_pool, jint index))
   612 C2V_VMENTRY_NULL(jobject, resolvePossiblyCachedConstantInPool, (JNIEnv* env, jobject, jobject jvmci_constant_pool, jint index))
   589   constantPoolHandle cp = JVMCIENV->asConstantPool(jvmci_constant_pool);
   613   constantPoolHandle cp = JVMCIENV->asConstantPool(jvmci_constant_pool);
   590   oop result = cp->resolve_possibly_cached_constant_at(index, CHECK_NULL);
   614   oop result = cp->resolve_possibly_cached_constant_at(index, CHECK_NULL);
   591   return JVMCIENV->get_jobject(JVMCIENV->get_object_constant(result));
   615   return JVMCIENV->get_jobject(JVMCIENV->get_object_constant(result));
   919   if (table_size > 0) {
   943   if (table_size > 0) {
   920     handler->copy_bytes_to((address) HotSpotJVMCI::resolve(exceptionArray)->byte_at_addr(0));
   944     handler->copy_bytes_to((address) HotSpotJVMCI::resolve(exceptionArray)->byte_at_addr(0));
   921   }
   945   }
   922   HotSpotJVMCI::HotSpotMetaData::set_exceptionBytes(JVMCIENV, metadata_handle, exceptionArray);
   946   HotSpotJVMCI::HotSpotMetaData::set_exceptionBytes(JVMCIENV, metadata_handle, exceptionArray);
   923 
   947 
       
   948   ImplicitExceptionTable* implicit = code_metadata.get_implicit_exception_table();
       
   949   int implicit_table_size = implicit->size_in_bytes();
       
   950   JVMCIPrimitiveArray implicitExceptionArray = JVMCIENV->new_byteArray(implicit_table_size, JVMCI_CHECK_(JVMCI::cache_full));
       
   951   if (implicit_table_size > 0) {
       
   952     implicit->copy_bytes_to((address) HotSpotJVMCI::resolve(implicitExceptionArray)->byte_at_addr(0), implicit_table_size);
       
   953   }
       
   954   HotSpotJVMCI::HotSpotMetaData::set_implicitExceptionBytes(JVMCIENV, metadata_handle, implicitExceptionArray);
       
   955 
   924   return result;
   956   return result;
   925 #else
   957 #else
   926   JVMCI_THROW_MSG_0(InternalError, "unimplemented");
   958   JVMCI_THROW_MSG_0(InternalError, "unimplemented");
   927 #endif
   959 #endif
   928 C2V_END
   960 C2V_END
  1000   jca.set_alternative_target(nm);
  1032   jca.set_alternative_target(nm);
  1001   JavaCalls::call(&result, mh, &jca, CHECK_NULL);
  1033   JavaCalls::call(&result, mh, &jca, CHECK_NULL);
  1002 
  1034 
  1003   if (jap.get_ret_type() == T_VOID) {
  1035   if (jap.get_ret_type() == T_VOID) {
  1004     return NULL;
  1036     return NULL;
  1005   } else if (jap.get_ret_type() == T_OBJECT || jap.get_ret_type() == T_ARRAY) {
  1037   } else if (is_reference_type(jap.get_ret_type())) {
  1006     return JNIHandles::make_local((oop) result.get_jobject());
  1038     return JNIHandles::make_local((oop) result.get_jobject());
  1007   } else {
  1039   } else {
  1008     jvalue *value = (jvalue *) result.get_value_addr();
  1040     jvalue *value = (jvalue *) result.get_value_addr();
  1009     // Narrow the value down if required (Important on big endian machines)
  1041     // Narrow the value down if required (Important on big endian machines)
  1010     switch (jap.get_ret_type()) {
  1042     switch (jap.get_ret_type()) {
  1111     JVMCIENV->copy_longs_from(temp_array, array, 0, JVMCICounterSize);
  1143     JVMCIENV->copy_longs_from(temp_array, array, 0, JVMCICounterSize);
  1112   }
  1144   }
  1113   return (jlongArray) JVMCIENV->get_jobject(array);
  1145   return (jlongArray) JVMCIENV->get_jobject(array);
  1114 C2V_END
  1146 C2V_END
  1115 
  1147 
  1116 C2V_VMENTRY_0(int, allocateCompileId, (JNIEnv* env, jobject, jobject jvmci_method, int entry_bci))
  1148 C2V_VMENTRY_0(jint, getCountersSize, (JNIEnv* env, jobject))
       
  1149   return (jint) JVMCICounterSize;
       
  1150 C2V_END
       
  1151 
       
  1152 C2V_VMENTRY(void, setCountersSize, (JNIEnv* env, jobject, jint new_size))
       
  1153   JavaThread::resize_all_jvmci_counters(new_size);
       
  1154 C2V_END
       
  1155 
       
  1156 C2V_VMENTRY_0(jint, allocateCompileId, (JNIEnv* env, jobject, jobject jvmci_method, int entry_bci))
  1117   HandleMark hm;
  1157   HandleMark hm;
  1118   if (jvmci_method == NULL) {
  1158   if (jvmci_method == NULL) {
  1119     JVMCI_THROW_0(NullPointerException);
  1159     JVMCI_THROW_0(NullPointerException);
  1120   }
  1160   }
  1121   Method* method = JVMCIENV->asMethod(jvmci_method);
  1161   Method* method = JVMCIENV->asMethod(jvmci_method);
  1211                   if (sv->value().is_null()) {
  1251                   if (sv->value().is_null()) {
  1212                     objects->append(sv);
  1252                     objects->append(sv);
  1213                   }
  1253                   }
  1214                 }
  1254                 }
  1215               }
  1255               }
  1216               bool realloc_failures = Deoptimization::realloc_objects(thread, fst.current(), objects, CHECK_NULL);
  1256               bool realloc_failures = Deoptimization::realloc_objects(thread, fst.current(), fst.register_map(), objects, CHECK_NULL);
  1217               Deoptimization::reassign_fields(fst.current(), fst.register_map(), objects, realloc_failures, false);
  1257               Deoptimization::reassign_fields(fst.current(), fst.register_map(), objects, realloc_failures, false);
  1218               realloc_called = true;
  1258               realloc_called = true;
  1219 
  1259 
  1220               GrowableArray<ScopeValue*>* local_values = scope->locals();
  1260               GrowableArray<ScopeValue*>* local_values = scope->locals();
  1221               assert(local_values != NULL, "NULL locals");
  1261               assert(local_values != NULL, "NULL locals");
  1469   if (objects == NULL) {
  1509   if (objects == NULL) {
  1470     // no objects to materialize
  1510     // no objects to materialize
  1471     return;
  1511     return;
  1472   }
  1512   }
  1473 
  1513 
  1474   bool realloc_failures = Deoptimization::realloc_objects(thread, fstAfterDeopt.current(), objects, CHECK);
  1514   bool realloc_failures = Deoptimization::realloc_objects(thread, fstAfterDeopt.current(), fstAfterDeopt.register_map(), objects, CHECK);
  1475   Deoptimization::reassign_fields(fstAfterDeopt.current(), fstAfterDeopt.register_map(), objects, realloc_failures, false);
  1515   Deoptimization::reassign_fields(fstAfterDeopt.current(), fstAfterDeopt.register_map(), objects, realloc_failures, false);
  1476 
  1516 
  1477   for (int frame_index = 0; frame_index < virtualFrames->length(); frame_index++) {
  1517   for (int frame_index = 0; frame_index < virtualFrames->length(); frame_index++) {
  1478     compiledVFrame* cvf = virtualFrames->at(frame_index);
  1518     compiledVFrame* cvf = virtualFrames->at(frame_index);
  1479 
  1519 
  1613 
  1653 
  1614 C2V_VMENTRY(void, flushDebugOutput, (JNIEnv* env, jobject))
  1654 C2V_VMENTRY(void, flushDebugOutput, (JNIEnv* env, jobject))
  1615   tty->flush();
  1655   tty->flush();
  1616 C2V_END
  1656 C2V_END
  1617 
  1657 
  1618 C2V_VMENTRY_0(int, methodDataProfileDataSize, (JNIEnv* env, jobject, jlong metaspace_method_data, jint position))
  1658 C2V_VMENTRY_0(jint, methodDataProfileDataSize, (JNIEnv* env, jobject, jlong metaspace_method_data, jint position))
  1619   MethodData* mdo = JVMCIENV->asMethodData(metaspace_method_data);
  1659   MethodData* mdo = JVMCIENV->asMethodData(metaspace_method_data);
  1620   ProfileData* profile_data = mdo->data_at(position);
  1660   ProfileData* profile_data = mdo->data_at(position);
  1621   if (mdo->is_valid(profile_data)) {
  1661   if (mdo->is_valid(profile_data)) {
  1622     return profile_data->size_in_bytes();
  1662     return profile_data->size_in_bytes();
  1623   }
  1663   }
  1719     InstanceKlass* k = InstanceKlass::cast(klass);
  1759     InstanceKlass* k = InstanceKlass::cast(klass);
  1720     k->initialize(CHECK);
  1760     k->initialize(CHECK);
  1721   }
  1761   }
  1722 C2V_END
  1762 C2V_END
  1723 
  1763 
  1724 C2V_VMENTRY_0(int, interpreterFrameSize, (JNIEnv* env, jobject, jobject bytecode_frame_handle))
  1764 C2V_VMENTRY_0(jint, interpreterFrameSize, (JNIEnv* env, jobject, jobject bytecode_frame_handle))
  1725   if (bytecode_frame_handle == NULL) {
  1765   if (bytecode_frame_handle == NULL) {
  1726     JVMCI_THROW_0(NullPointerException);
  1766     JVMCI_THROW_0(NullPointerException);
  1727   }
  1767   }
  1728 
  1768 
  1729   JVMCIObject top_bytecode_frame = JVMCIENV->wrap(bytecode_frame_handle);
  1769   JVMCIObject top_bytecode_frame = JVMCIENV->wrap(bytecode_frame_handle);
  1767     JVMCI_THROW_MSG(IllegalArgumentException,
  1807     JVMCI_THROW_MSG(IllegalArgumentException,
  1768                     err_msg("Unexpected type: %s", lambda_form->klass()->external_name()))
  1808                     err_msg("Unexpected type: %s", lambda_form->klass()->external_name()))
  1769   }
  1809   }
  1770 C2V_END
  1810 C2V_END
  1771 
  1811 
  1772 C2V_VMENTRY_0(int, getIdentityHashCode, (JNIEnv* env, jobject, jobject object))
  1812 C2V_VMENTRY_0(jint, getIdentityHashCode, (JNIEnv* env, jobject, jobject object))
  1773   Handle obj = JVMCIENV->asConstant(JVMCIENV->wrap(object), JVMCI_CHECK_0);
  1813   Handle obj = JVMCIENV->asConstant(JVMCIENV->wrap(object), JVMCI_CHECK_0);
  1774   return obj->identity_hash();
  1814   return obj->identity_hash();
  1775 C2V_END
  1815 C2V_END
  1776 
  1816 
  1777 C2V_VMENTRY_0(jboolean, isInternedString, (JNIEnv* env, jobject, jobject object))
  1817 C2V_VMENTRY_0(jboolean, isInternedString, (JNIEnv* env, jobject, jobject object))
  2166 }
  2206 }
  2167 
  2207 
  2168 C2V_VMENTRY(void, deleteGlobalHandle, (JNIEnv* env, jobject, jlong h))
  2208 C2V_VMENTRY(void, deleteGlobalHandle, (JNIEnv* env, jobject, jlong h))
  2169   jobject handle = (jobject)(address)h;
  2209   jobject handle = (jobject)(address)h;
  2170   if (handle != NULL) {
  2210   if (handle != NULL) {
  2171     assert(JVMCI::is_global_handle(handle), "Invalid delete of global JNI handle");
  2211     JVMCI::destroy_global(handle);
  2172     *((oop*)handle) = NULL; // Mark the handle as deleted, allocate will reuse it
       
  2173   }
  2212   }
  2174 }
  2213 }
  2175 
  2214 
  2176 static void requireJVMCINativeLibrary(JVMCI_TRAPS) {
  2215 static void requireJVMCINativeLibrary(JVMCI_TRAPS) {
  2177   if (!UseJVMCINativeLibrary) {
  2216   if (!UseJVMCINativeLibrary) {
  2395       JVMCINMethodData* data = nm->jvmci_nmethod_data();
  2434       JVMCINMethodData* data = nm->jvmci_nmethod_data();
  2396       if (data != NULL) {
  2435       if (data != NULL) {
  2397         if (peerEnv->is_hotspot()) {
  2436         if (peerEnv->is_hotspot()) {
  2398           // Only the mirror in the HotSpot heap is accessible
  2437           // Only the mirror in the HotSpot heap is accessible
  2399           // through JVMCINMethodData
  2438           // through JVMCINMethodData
  2400           oop nmethod_mirror = data->get_nmethod_mirror(nm);
  2439           oop nmethod_mirror = data->get_nmethod_mirror(nm, /* phantom_ref */ true);
  2401           if (nmethod_mirror != NULL) {
  2440           if (nmethod_mirror != NULL) {
  2402             result = HotSpotJVMCI::wrap(nmethod_mirror);
  2441             result = HotSpotJVMCI::wrap(nmethod_mirror);
  2403           }
  2442           }
  2404         }
  2443         }
  2405       }
  2444       }
  2422         if (peerEnv->is_hotspot()) {
  2461         if (peerEnv->is_hotspot()) {
  2423           JVMCINMethodData* data = nm->jvmci_nmethod_data();
  2462           JVMCINMethodData* data = nm->jvmci_nmethod_data();
  2424           if (data == NULL) {
  2463           if (data == NULL) {
  2425             JVMCI_THROW_MSG_0(IllegalArgumentException, "Cannot set HotSpotNmethod mirror for default nmethod");
  2464             JVMCI_THROW_MSG_0(IllegalArgumentException, "Cannot set HotSpotNmethod mirror for default nmethod");
  2426           }
  2465           }
  2427           if (data->get_nmethod_mirror(nm) != NULL) {
  2466           if (data->get_nmethod_mirror(nm, /* phantom_ref */ false) != NULL) {
  2428             JVMCI_THROW_MSG_0(IllegalArgumentException, "Cannot overwrite existing HotSpotNmethod mirror for nmethod");
  2467             JVMCI_THROW_MSG_0(IllegalArgumentException, "Cannot overwrite existing HotSpotNmethod mirror for nmethod");
  2429           }
  2468           }
  2430           oop nmethod_mirror = HotSpotJVMCI::resolve(result);
  2469           oop nmethod_mirror = HotSpotJVMCI::resolve(result);
  2431           data->set_nmethod_mirror(nm, nmethod_mirror);
  2470           data->set_nmethod_mirror(nm, nmethod_mirror);
  2432         }
  2471         }
  2549 
  2588 
  2550 C2V_VMENTRY(void, releaseFailedSpeculations, (JNIEnv* env, jobject, jlong failed_speculations_address))
  2589 C2V_VMENTRY(void, releaseFailedSpeculations, (JNIEnv* env, jobject, jlong failed_speculations_address))
  2551   FailedSpeculation::free_failed_speculations((FailedSpeculation**)(address) failed_speculations_address);
  2590   FailedSpeculation::free_failed_speculations((FailedSpeculation**)(address) failed_speculations_address);
  2552 }
  2591 }
  2553 
  2592 
  2554 C2V_VMENTRY_0(bool, addFailedSpeculation, (JNIEnv* env, jobject, jlong failed_speculations_address, jbyteArray speculation_obj))
  2593 C2V_VMENTRY_0(jboolean, addFailedSpeculation, (JNIEnv* env, jobject, jlong failed_speculations_address, jbyteArray speculation_obj))
  2555   JVMCIPrimitiveArray speculation_handle = JVMCIENV->wrap(speculation_obj);
  2594   JVMCIPrimitiveArray speculation_handle = JVMCIENV->wrap(speculation_obj);
  2556   int speculation_len = JVMCIENV->get_length(speculation_handle);
  2595   int speculation_len = JVMCIENV->get_length(speculation_handle);
  2557   char* speculation = NEW_RESOURCE_ARRAY(char, speculation_len);
  2596   char* speculation = NEW_RESOURCE_ARRAY(char, speculation_len);
  2558   JVMCIENV->copy_bytes_to(speculation_handle, (jbyte*) speculation, 0, speculation_len);
  2597   JVMCIENV->copy_bytes_to(speculation_handle, (jbyte*) speculation, 0, speculation_len);
  2559   return FailedSpeculation::add_failed_speculation(NULL, (FailedSpeculation**)(address) failed_speculations_address, (address) speculation, speculation_len);
  2598   return FailedSpeculation::add_failed_speculation(NULL, (FailedSpeculation**)(address) failed_speculations_address, (address) speculation, speculation_len);
       
  2599 }
       
  2600 
       
  2601 C2V_VMENTRY(void, callSystemExit, (JNIEnv* env, jobject, jint status))
       
  2602   JavaValue result(T_VOID);
       
  2603   JavaCallArguments jargs(1);
       
  2604   jargs.push_int(status);
       
  2605   JavaCalls::call_static(&result,
       
  2606                        SystemDictionary::System_klass(),
       
  2607                        vmSymbols::exit_method_name(),
       
  2608                        vmSymbols::int_void_signature(),
       
  2609                        &jargs,
       
  2610                        CHECK);
  2560 }
  2611 }
  2561 
  2612 
  2562 #define CC (char*)  /*cast a literal from (const char*)*/
  2613 #define CC (char*)  /*cast a literal from (const char*)*/
  2563 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f))
  2614 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f))
  2564 
  2615 
  2603   {CC "setNotInlinableOrCompilable",                  CC "(" HS_RESOLVED_METHOD ")V",                                                       FN_PTR(setNotInlinableOrCompilable)},
  2654   {CC "setNotInlinableOrCompilable",                  CC "(" HS_RESOLVED_METHOD ")V",                                                       FN_PTR(setNotInlinableOrCompilable)},
  2604   {CC "isCompilable",                                 CC "(" HS_RESOLVED_METHOD ")Z",                                                       FN_PTR(isCompilable)},
  2655   {CC "isCompilable",                                 CC "(" HS_RESOLVED_METHOD ")Z",                                                       FN_PTR(isCompilable)},
  2605   {CC "hasNeverInlineDirective",                      CC "(" HS_RESOLVED_METHOD ")Z",                                                       FN_PTR(hasNeverInlineDirective)},
  2656   {CC "hasNeverInlineDirective",                      CC "(" HS_RESOLVED_METHOD ")Z",                                                       FN_PTR(hasNeverInlineDirective)},
  2606   {CC "shouldInlineMethod",                           CC "(" HS_RESOLVED_METHOD ")Z",                                                       FN_PTR(shouldInlineMethod)},
  2657   {CC "shouldInlineMethod",                           CC "(" HS_RESOLVED_METHOD ")Z",                                                       FN_PTR(shouldInlineMethod)},
  2607   {CC "lookupType",                                   CC "(" STRING HS_RESOLVED_KLASS "Z)" HS_RESOLVED_TYPE,                                FN_PTR(lookupType)},
  2658   {CC "lookupType",                                   CC "(" STRING HS_RESOLVED_KLASS "Z)" HS_RESOLVED_TYPE,                                FN_PTR(lookupType)},
       
  2659   {CC "getArrayType",                                 CC "(" HS_RESOLVED_TYPE ")" HS_RESOLVED_KLASS,                                        FN_PTR(getArrayType)},
  2608   {CC "lookupClass",                                  CC "(" CLASS ")" HS_RESOLVED_TYPE,                                                    FN_PTR(lookupClass)},
  2660   {CC "lookupClass",                                  CC "(" CLASS ")" HS_RESOLVED_TYPE,                                                    FN_PTR(lookupClass)},
  2609   {CC "lookupNameInPool",                             CC "(" HS_CONSTANT_POOL "I)" STRING,                                                  FN_PTR(lookupNameInPool)},
  2661   {CC "lookupNameInPool",                             CC "(" HS_CONSTANT_POOL "I)" STRING,                                                  FN_PTR(lookupNameInPool)},
  2610   {CC "lookupNameAndTypeRefIndexInPool",              CC "(" HS_CONSTANT_POOL "I)I",                                                        FN_PTR(lookupNameAndTypeRefIndexInPool)},
  2662   {CC "lookupNameAndTypeRefIndexInPool",              CC "(" HS_CONSTANT_POOL "I)I",                                                        FN_PTR(lookupNameAndTypeRefIndexInPool)},
  2611   {CC "lookupSignatureInPool",                        CC "(" HS_CONSTANT_POOL "I)" STRING,                                                  FN_PTR(lookupSignatureInPool)},
  2663   {CC "lookupSignatureInPool",                        CC "(" HS_CONSTANT_POOL "I)" STRING,                                                  FN_PTR(lookupSignatureInPool)},
  2612   {CC "lookupKlassRefIndexInPool",                    CC "(" HS_CONSTANT_POOL "I)I",                                                        FN_PTR(lookupKlassRefIndexInPool)},
  2664   {CC "lookupKlassRefIndexInPool",                    CC "(" HS_CONSTANT_POOL "I)I",                                                        FN_PTR(lookupKlassRefIndexInPool)},
  2613   {CC "lookupKlassInPool",                            CC "(" HS_CONSTANT_POOL "I)Ljava/lang/Object;",                                       FN_PTR(lookupKlassInPool)},
  2665   {CC "lookupKlassInPool",                            CC "(" HS_CONSTANT_POOL "I)Ljava/lang/Object;",                                       FN_PTR(lookupKlassInPool)},
  2614   {CC "lookupAppendixInPool",                         CC "(" HS_CONSTANT_POOL "I)" OBJECTCONSTANT,                                          FN_PTR(lookupAppendixInPool)},
  2666   {CC "lookupAppendixInPool",                         CC "(" HS_CONSTANT_POOL "I)" OBJECTCONSTANT,                                          FN_PTR(lookupAppendixInPool)},
  2615   {CC "lookupMethodInPool",                           CC "(" HS_CONSTANT_POOL "IB)" HS_RESOLVED_METHOD,                                     FN_PTR(lookupMethodInPool)},
  2667   {CC "lookupMethodInPool",                           CC "(" HS_CONSTANT_POOL "IB)" HS_RESOLVED_METHOD,                                     FN_PTR(lookupMethodInPool)},
  2616   {CC "constantPoolRemapInstructionOperandFromCache", CC "(" HS_CONSTANT_POOL "I)I",                                                        FN_PTR(constantPoolRemapInstructionOperandFromCache)},
  2668   {CC "constantPoolRemapInstructionOperandFromCache", CC "(" HS_CONSTANT_POOL "I)I",                                                        FN_PTR(constantPoolRemapInstructionOperandFromCache)},
  2617   {CC "resolveConstantInPool",                        CC "(" HS_CONSTANT_POOL "I)" OBJECTCONSTANT,                                          FN_PTR(resolveConstantInPool)},
       
  2618   {CC "resolvePossiblyCachedConstantInPool",          CC "(" HS_CONSTANT_POOL "I)" OBJECTCONSTANT,                                          FN_PTR(resolvePossiblyCachedConstantInPool)},
  2669   {CC "resolvePossiblyCachedConstantInPool",          CC "(" HS_CONSTANT_POOL "I)" OBJECTCONSTANT,                                          FN_PTR(resolvePossiblyCachedConstantInPool)},
  2619   {CC "resolveTypeInPool",                            CC "(" HS_CONSTANT_POOL "I)" HS_RESOLVED_KLASS,                                       FN_PTR(resolveTypeInPool)},
  2670   {CC "resolveTypeInPool",                            CC "(" HS_CONSTANT_POOL "I)" HS_RESOLVED_KLASS,                                       FN_PTR(resolveTypeInPool)},
  2620   {CC "resolveFieldInPool",                           CC "(" HS_CONSTANT_POOL "I" HS_RESOLVED_METHOD "B[I)" HS_RESOLVED_KLASS,              FN_PTR(resolveFieldInPool)},
  2671   {CC "resolveFieldInPool",                           CC "(" HS_CONSTANT_POOL "I" HS_RESOLVED_METHOD "B[I)" HS_RESOLVED_KLASS,              FN_PTR(resolveFieldInPool)},
  2621   {CC "resolveInvokeDynamicInPool",                   CC "(" HS_CONSTANT_POOL "I)V",                                                        FN_PTR(resolveInvokeDynamicInPool)},
  2672   {CC "resolveInvokeDynamicInPool",                   CC "(" HS_CONSTANT_POOL "I)V",                                                        FN_PTR(resolveInvokeDynamicInPool)},
  2622   {CC "resolveInvokeHandleInPool",                    CC "(" HS_CONSTANT_POOL "I)V",                                                        FN_PTR(resolveInvokeHandleInPool)},
  2673   {CC "resolveInvokeHandleInPool",                    CC "(" HS_CONSTANT_POOL "I)V",                                                        FN_PTR(resolveInvokeHandleInPool)},
  2642   {CC "getLocalVariableTableLength",                  CC "(" HS_RESOLVED_METHOD ")I",                                                       FN_PTR(getLocalVariableTableLength)},
  2693   {CC "getLocalVariableTableLength",                  CC "(" HS_RESOLVED_METHOD ")I",                                                       FN_PTR(getLocalVariableTableLength)},
  2643   {CC "reprofile",                                    CC "(" HS_RESOLVED_METHOD ")V",                                                       FN_PTR(reprofile)},
  2694   {CC "reprofile",                                    CC "(" HS_RESOLVED_METHOD ")V",                                                       FN_PTR(reprofile)},
  2644   {CC "invalidateHotSpotNmethod",                     CC "(" HS_NMETHOD ")V",                                                               FN_PTR(invalidateHotSpotNmethod)},
  2695   {CC "invalidateHotSpotNmethod",                     CC "(" HS_NMETHOD ")V",                                                               FN_PTR(invalidateHotSpotNmethod)},
  2645   {CC "readUncompressedOop",                          CC "(J)" OBJECTCONSTANT,                                                              FN_PTR(readUncompressedOop)},
  2696   {CC "readUncompressedOop",                          CC "(J)" OBJECTCONSTANT,                                                              FN_PTR(readUncompressedOop)},
  2646   {CC "collectCounters",                              CC "()[J",                                                                            FN_PTR(collectCounters)},
  2697   {CC "collectCounters",                              CC "()[J",                                                                            FN_PTR(collectCounters)},
       
  2698   {CC "getCountersSize",                              CC "()I",                                                                             FN_PTR(getCountersSize)},
       
  2699   {CC "setCountersSize",                              CC "(I)V",                                                                            FN_PTR(setCountersSize)},
  2647   {CC "allocateCompileId",                            CC "(" HS_RESOLVED_METHOD "I)I",                                                      FN_PTR(allocateCompileId)},
  2700   {CC "allocateCompileId",                            CC "(" HS_RESOLVED_METHOD "I)I",                                                      FN_PTR(allocateCompileId)},
  2648   {CC "isMature",                                     CC "(" METASPACE_METHOD_DATA ")Z",                                                    FN_PTR(isMature)},
  2701   {CC "isMature",                                     CC "(" METASPACE_METHOD_DATA ")Z",                                                    FN_PTR(isMature)},
  2649   {CC "hasCompiledCodeForOSR",                        CC "(" HS_RESOLVED_METHOD "II)Z",                                                     FN_PTR(hasCompiledCodeForOSR)},
  2702   {CC "hasCompiledCodeForOSR",                        CC "(" HS_RESOLVED_METHOD "II)Z",                                                     FN_PTR(hasCompiledCodeForOSR)},
  2650   {CC "getSymbol",                                    CC "(J)" STRING,                                                                      FN_PTR(getSymbol)},
  2703   {CC "getSymbol",                                    CC "(J)" STRING,                                                                      FN_PTR(getSymbol)},
  2651   {CC "iterateFrames",                                CC "([" RESOLVED_METHOD "[" RESOLVED_METHOD "I" INSPECTED_FRAME_VISITOR ")" OBJECT,   FN_PTR(iterateFrames)},
  2704   {CC "iterateFrames",                                CC "([" RESOLVED_METHOD "[" RESOLVED_METHOD "I" INSPECTED_FRAME_VISITOR ")" OBJECT,   FN_PTR(iterateFrames)},
  2700   {CC "asReflectionField",                            CC "(" HS_RESOLVED_KLASS "I)" REFLECTION_FIELD,                                       FN_PTR(asReflectionField)},
  2753   {CC "asReflectionField",                            CC "(" HS_RESOLVED_KLASS "I)" REFLECTION_FIELD,                                       FN_PTR(asReflectionField)},
  2701   {CC "getFailedSpeculations",                        CC "(J[[B)[[B",                                                                       FN_PTR(getFailedSpeculations)},
  2754   {CC "getFailedSpeculations",                        CC "(J[[B)[[B",                                                                       FN_PTR(getFailedSpeculations)},
  2702   {CC "getFailedSpeculationsAddress",                 CC "(" HS_RESOLVED_METHOD ")J",                                                       FN_PTR(getFailedSpeculationsAddress)},
  2755   {CC "getFailedSpeculationsAddress",                 CC "(" HS_RESOLVED_METHOD ")J",                                                       FN_PTR(getFailedSpeculationsAddress)},
  2703   {CC "releaseFailedSpeculations",                    CC "(J)V",                                                                            FN_PTR(releaseFailedSpeculations)},
  2756   {CC "releaseFailedSpeculations",                    CC "(J)V",                                                                            FN_PTR(releaseFailedSpeculations)},
  2704   {CC "addFailedSpeculation",                         CC "(J[B)Z",                                                                          FN_PTR(addFailedSpeculation)},
  2757   {CC "addFailedSpeculation",                         CC "(J[B)Z",                                                                          FN_PTR(addFailedSpeculation)},
       
  2758   {CC "callSystemExit",                               CC "(I)V",                                                                            FN_PTR(callSystemExit)},
  2705 };
  2759 };
  2706 
  2760 
  2707 int CompilerToVM::methods_count() {
  2761 int CompilerToVM::methods_count() {
  2708   return sizeof(methods) / sizeof(JNINativeMethod);
  2762   return sizeof(methods) / sizeof(JNINativeMethod);
  2709 }
  2763 }