< prev index next >

src/hotspot/share/runtime/sharedRuntime.cpp

Print this page

1974   // Request an async exception.
1975   thread->set_pending_unsafe_access_error();
1976 
1977   // Return address of next instruction to execute.
1978   return next_pc;
1979 }
1980 
1981 #ifdef ASSERT
1982 void SharedRuntime::check_member_name_argument_is_last_argument(const methodHandle& method,
1983                                                                 const BasicType* sig_bt,
1984                                                                 const VMRegPair* regs) {
1985   ResourceMark rm;
1986   const int total_args_passed = method->size_of_parameters();
1987   const VMRegPair*    regs_with_member_name = regs;
1988         VMRegPair* regs_without_member_name = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed - 1);
1989 
1990   const int member_arg_pos = total_args_passed - 1;
1991   assert(member_arg_pos >= 0 && member_arg_pos < total_args_passed, "oob");
1992   assert(sig_bt[member_arg_pos] == T_OBJECT, "dispatch argument must be an object");
1993 
1994   int comp_args_on_stack = java_calling_convention(sig_bt, regs_without_member_name, total_args_passed - 1);
1995 
1996   for (int i = 0; i < member_arg_pos; i++) {
1997     VMReg a =    regs_with_member_name[i].first();
1998     VMReg b = regs_without_member_name[i].first();
1999     assert(a->value() == b->value(), "register allocation mismatch: a=" INTX_FORMAT ", b=" INTX_FORMAT, a->value(), b->value());
2000   }
2001   assert(regs_with_member_name[member_arg_pos].first()->is_valid(), "bad member arg");
2002 }
2003 #endif
2004 
2005 bool SharedRuntime::should_fixup_call_destination(address destination, address entry_point, address caller_pc, Method* moop, CodeBlob* cb) {
2006   if (destination != entry_point) {
2007     CodeBlob* callee = CodeCache::find_blob(destination);
2008     // callee == cb seems weird. It means calling interpreter thru stub.
2009     if (callee != nullptr && (callee == cb || callee->is_adapter_blob())) {
2010       // static call or optimized virtual
2011       if (TraceCallFixup) {
2012         tty->print("fixup callsite           at " INTPTR_FORMAT " to compiled code for", p2i(caller_pc));
2013         moop->print_short_name(tty);
2014         tty->print_cr(" to " INTPTR_FORMAT, p2i(entry_point));

3072       if (PPC64_ONLY(method->is_continuation_enter_intrinsic() &&) true) {
3073         buffer.initialize_consts_size(8 PPC64_ONLY(+ 24));
3074       }
3075 #endif
3076       buffer.stubs()->initialize_shared_locs((relocInfo*)&stubs_locs_buf, sizeof(stubs_locs_buf) / sizeof(relocInfo));
3077       MacroAssembler _masm(&buffer);
3078 
3079       // Fill in the signature array, for the calling-convention call.
3080       const int total_args_passed = method->size_of_parameters();
3081 
3082       VMRegPair stack_regs[16];
3083       VMRegPair* regs = (total_args_passed <= 16) ? stack_regs : NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed);
3084 
3085       AdapterSignatureIterator si(method->signature(), method->constMethod()->fingerprint(),
3086                               method->is_static(), total_args_passed);
3087       BasicType* sig_bt = si.basic_types();
3088       assert(si.slots() == total_args_passed, "");
3089       BasicType ret_type = si.return_type();
3090 
3091       // Now get the compiled-Java arguments layout.
3092       int comp_args_on_stack = SharedRuntime::java_calling_convention(sig_bt, regs, total_args_passed);
3093 
3094       // Generate the compiled-to-native wrapper code
3095       nm = SharedRuntime::generate_native_wrapper(&_masm, method, compile_id, sig_bt, regs, ret_type);
3096 
3097       if (nm != nullptr) {
3098         {
3099           MutexLocker pl(CompiledMethod_lock, Mutex::_no_safepoint_check_flag);
3100           if (nm->make_in_use()) {
3101             method->set_code(method, nm);
3102           }
3103         }
3104 
3105         DirectiveSet* directive = DirectivesStack::getDefaultDirective(CompileBroker::compiler(CompLevel_simple));
3106         if (directive->PrintAssemblyOption) {
3107           nm->print_code();
3108         }
3109         DirectivesStack::release(directive);
3110       }
3111     }
3112   } // Unlock AdapterHandlerLibrary_lock

1974   // Request an async exception.
1975   thread->set_pending_unsafe_access_error();
1976 
1977   // Return address of next instruction to execute.
1978   return next_pc;
1979 }
1980 
1981 #ifdef ASSERT
1982 void SharedRuntime::check_member_name_argument_is_last_argument(const methodHandle& method,
1983                                                                 const BasicType* sig_bt,
1984                                                                 const VMRegPair* regs) {
1985   ResourceMark rm;
1986   const int total_args_passed = method->size_of_parameters();
1987   const VMRegPair*    regs_with_member_name = regs;
1988         VMRegPair* regs_without_member_name = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed - 1);
1989 
1990   const int member_arg_pos = total_args_passed - 1;
1991   assert(member_arg_pos >= 0 && member_arg_pos < total_args_passed, "oob");
1992   assert(sig_bt[member_arg_pos] == T_OBJECT, "dispatch argument must be an object");
1993 
1994   java_calling_convention(sig_bt, regs_without_member_name, total_args_passed - 1);
1995 
1996   for (int i = 0; i < member_arg_pos; i++) {
1997     VMReg a =    regs_with_member_name[i].first();
1998     VMReg b = regs_without_member_name[i].first();
1999     assert(a->value() == b->value(), "register allocation mismatch: a=" INTX_FORMAT ", b=" INTX_FORMAT, a->value(), b->value());
2000   }
2001   assert(regs_with_member_name[member_arg_pos].first()->is_valid(), "bad member arg");
2002 }
2003 #endif
2004 
2005 bool SharedRuntime::should_fixup_call_destination(address destination, address entry_point, address caller_pc, Method* moop, CodeBlob* cb) {
2006   if (destination != entry_point) {
2007     CodeBlob* callee = CodeCache::find_blob(destination);
2008     // callee == cb seems weird. It means calling interpreter thru stub.
2009     if (callee != nullptr && (callee == cb || callee->is_adapter_blob())) {
2010       // static call or optimized virtual
2011       if (TraceCallFixup) {
2012         tty->print("fixup callsite           at " INTPTR_FORMAT " to compiled code for", p2i(caller_pc));
2013         moop->print_short_name(tty);
2014         tty->print_cr(" to " INTPTR_FORMAT, p2i(entry_point));

3072       if (PPC64_ONLY(method->is_continuation_enter_intrinsic() &&) true) {
3073         buffer.initialize_consts_size(8 PPC64_ONLY(+ 24));
3074       }
3075 #endif
3076       buffer.stubs()->initialize_shared_locs((relocInfo*)&stubs_locs_buf, sizeof(stubs_locs_buf) / sizeof(relocInfo));
3077       MacroAssembler _masm(&buffer);
3078 
3079       // Fill in the signature array, for the calling-convention call.
3080       const int total_args_passed = method->size_of_parameters();
3081 
3082       VMRegPair stack_regs[16];
3083       VMRegPair* regs = (total_args_passed <= 16) ? stack_regs : NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed);
3084 
3085       AdapterSignatureIterator si(method->signature(), method->constMethod()->fingerprint(),
3086                               method->is_static(), total_args_passed);
3087       BasicType* sig_bt = si.basic_types();
3088       assert(si.slots() == total_args_passed, "");
3089       BasicType ret_type = si.return_type();
3090 
3091       // Now get the compiled-Java arguments layout.
3092       SharedRuntime::java_calling_convention(sig_bt, regs, total_args_passed);
3093 
3094       // Generate the compiled-to-native wrapper code
3095       nm = SharedRuntime::generate_native_wrapper(&_masm, method, compile_id, sig_bt, regs, ret_type);
3096 
3097       if (nm != nullptr) {
3098         {
3099           MutexLocker pl(CompiledMethod_lock, Mutex::_no_safepoint_check_flag);
3100           if (nm->make_in_use()) {
3101             method->set_code(method, nm);
3102           }
3103         }
3104 
3105         DirectiveSet* directive = DirectivesStack::getDefaultDirective(CompileBroker::compiler(CompLevel_simple));
3106         if (directive->PrintAssemblyOption) {
3107           nm->print_code();
3108         }
3109         DirectivesStack::release(directive);
3110       }
3111     }
3112   } // Unlock AdapterHandlerLibrary_lock
< prev index next >