1 /*
  2  * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
  3  * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
  4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  5  *
  6  * This code is free software; you can redistribute it and/or modify it
  7  * under the terms of the GNU General Public License version 2 only, as
  8  * published by the Free Software Foundation.
  9  *
 10  * This code is distributed in the hope that it will be useful, but WITHOUT
 11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 13  * version 2 for more details (a copy is included in the LICENSE file that
 14  * accompanied this code).
 15  *
 16  * You should have received a copy of the GNU General Public License version
 17  * 2 along with this work; if not, write to the Free Software Foundation,
 18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 19  *
 20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 21  * or visit www.oracle.com if you need additional information or have any
 22  * questions.
 23  *
 24  */
 25 
 26 #include "precompiled.hpp"
 27 #include "asm/assembler.inline.hpp"
 28 #include "code/debugInfoRec.hpp"
 29 #include "code/vtableStubs.hpp"
 30 #include "interpreter/interpreter.hpp"
 31 #include "runtime/interfaceSupport.inline.hpp"
 32 #include "runtime/sharedRuntime.hpp"
 33 #include "runtime/vframeArray.hpp"
 34 #include "vmreg_zero.inline.hpp"
 35 #ifdef COMPILER1
 36 #include "c1/c1_Runtime1.hpp"
 37 #endif
 38 #ifdef COMPILER2
 39 #include "opto/runtime.hpp"
 40 #endif
 41 
 42 
 43 static address zero_null_code_stub() {
 44   address start = ShouldNotCallThisStub();
 45   return start;
 46 }
 47 
 48 int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
 49                                            VMRegPair *regs,
 50                                            int total_args_passed) {
 51   return 0;
 52 }
 53 
 54 AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(
 55                         MacroAssembler *masm,
 56                         int total_args_passed,
 57                         int comp_args_on_stack,
 58                         const BasicType *sig_bt,
 59                         const VMRegPair *regs,
 60                         AdapterFingerPrint *fingerprint) {
 61   return AdapterHandlerLibrary::new_entry(
 62     fingerprint,
 63     CAST_FROM_FN_PTR(address,zero_null_code_stub),
 64     CAST_FROM_FN_PTR(address,zero_null_code_stub),
 65     CAST_FROM_FN_PTR(address,zero_null_code_stub));
 66 }
 67 
 68 nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
 69                                                 const methodHandle& method,
 70                                                 int compile_id,
 71                                                 BasicType *sig_bt,
 72                                                 VMRegPair *regs,
 73                                                 BasicType ret_type) {
 74   ShouldNotCallThis();
 75   return nullptr;
 76 }
 77 
 78 int Deoptimization::last_frame_adjust(int callee_parameters,
 79                                       int callee_locals) {
 80   return 0;
 81 }
 82 
 83 uint SharedRuntime::out_preserve_stack_slots() {
 84   ShouldNotCallThis();
 85   return 0;
 86 }
 87 
 88 JRT_LEAF(void, zero_stub())
 89   ShouldNotCallThis();
 90 JRT_END
 91 
 92 static RuntimeStub* generate_empty_runtime_stub(const char* name) {
 93   return CAST_FROM_FN_PTR(RuntimeStub*,zero_stub);
 94 }
 95 
 96 static SafepointBlob* generate_empty_safepoint_blob() {
 97   return CAST_FROM_FN_PTR(SafepointBlob*,zero_stub);
 98 }
 99 
100 static DeoptimizationBlob* generate_empty_deopt_blob() {
101   return CAST_FROM_FN_PTR(DeoptimizationBlob*,zero_stub);
102 }
103 
104 
105 void SharedRuntime::generate_deopt_blob() {
106   _deopt_blob = generate_empty_deopt_blob();
107 }
108 
109 SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_type) {
110   return generate_empty_safepoint_blob();
111 }
112 
113 RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const char* name) {
114   return generate_empty_runtime_stub("resolve_blob");
115 }
116 
117 int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
118                                          VMRegPair *regs,
119                                          int total_args_passed) {
120   ShouldNotCallThis();
121   return 0;
122 }
123 
124 int SharedRuntime::vector_calling_convention(VMRegPair *regs,
125                                              uint num_bits,
126                                              uint total_args_passed) {
127   ShouldNotCallThis();
128   return 0;
129 }