2856 }
2857
2858 {
2859 // Perform the work while holding the lock, but perform any printing outside the lock
2860 MutexLocker mu(AdapterHandlerLibrary_lock);
2861 // See if somebody beat us to it
2862 if (method->code() != NULL) {
2863 return;
2864 }
2865
2866 const int compile_id = CompileBroker::assign_compile_id(method, CompileBroker::standard_entry_bci);
2867 assert(compile_id > 0, "Must generate native wrapper");
2868
2869
2870 ResourceMark rm;
2871 BufferBlob* buf = buffer_blob(); // the temporary code buffer in CodeCache
2872 if (buf != NULL) {
2873 CodeBuffer buffer(buf);
2874 double locs_buf[20];
2875 buffer.insts()->initialize_shared_locs((relocInfo*)locs_buf, sizeof(locs_buf) / sizeof(relocInfo));
2876 MacroAssembler _masm(&buffer);
2877
2878 // Fill in the signature array, for the calling-convention call.
2879 const int total_args_passed = method->size_of_parameters();
2880
2881 BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_args_passed);
2882 VMRegPair* regs = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed);
2883 int i=0;
2884 if (!method->is_static()) // Pass in receiver first
2885 sig_bt[i++] = T_OBJECT;
2886 SignatureStream ss(method->signature());
2887 for (; !ss.at_return_type(); ss.next()) {
2888 sig_bt[i++] = ss.type(); // Collect remaining bits of signature
2889 if (ss.type() == T_LONG || ss.type() == T_DOUBLE)
2890 sig_bt[i++] = T_VOID; // Longs & doubles take 2 Java slots
2891 }
2892 assert(i == total_args_passed, "");
2893 BasicType ret_type = ss.type();
2894
2895 // Now get the compiled-Java layout as input (or output) arguments.
|
2856 }
2857
2858 {
2859 // Perform the work while holding the lock, but perform any printing outside the lock
2860 MutexLocker mu(AdapterHandlerLibrary_lock);
2861 // See if somebody beat us to it
2862 if (method->code() != NULL) {
2863 return;
2864 }
2865
2866 const int compile_id = CompileBroker::assign_compile_id(method, CompileBroker::standard_entry_bci);
2867 assert(compile_id > 0, "Must generate native wrapper");
2868
2869
2870 ResourceMark rm;
2871 BufferBlob* buf = buffer_blob(); // the temporary code buffer in CodeCache
2872 if (buf != NULL) {
2873 CodeBuffer buffer(buf);
2874 double locs_buf[20];
2875 buffer.insts()->initialize_shared_locs((relocInfo*)locs_buf, sizeof(locs_buf) / sizeof(relocInfo));
2876 #if defined(AARCH64)
2877 // On AArch64 with ZGC and nmethod entry barriers, we need all oops to be
2878 // in the constant pool to ensure ordering between the barrier and oops
2879 // accesses. For native_wrappers we need a constant.
2880 buffer.initialize_consts_size(8);
2881 #endif
2882 MacroAssembler _masm(&buffer);
2883
2884 // Fill in the signature array, for the calling-convention call.
2885 const int total_args_passed = method->size_of_parameters();
2886
2887 BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_args_passed);
2888 VMRegPair* regs = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed);
2889 int i=0;
2890 if (!method->is_static()) // Pass in receiver first
2891 sig_bt[i++] = T_OBJECT;
2892 SignatureStream ss(method->signature());
2893 for (; !ss.at_return_type(); ss.next()) {
2894 sig_bt[i++] = ss.type(); // Collect remaining bits of signature
2895 if (ss.type() == T_LONG || ss.type() == T_DOUBLE)
2896 sig_bt[i++] = T_VOID; // Longs & doubles take 2 Java slots
2897 }
2898 assert(i == total_args_passed, "");
2899 BasicType ret_type = ss.type();
2900
2901 // Now get the compiled-Java layout as input (or output) arguments.
|