1 /*
   2  * Copyright (c) 2003, 2015, 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.hpp"
  28 #include "assembler_zero.inline.hpp"
  29 #include "code/debugInfoRec.hpp"
  30 #include "code/icBuffer.hpp"
  31 #include "code/vtableStubs.hpp"
  32 #include "interpreter/interpreter.hpp"
  33 #include "oops/compiledICHolder.hpp"
  34 #include "runtime/interfaceSupport.inline.hpp"
  35 #include "runtime/sharedRuntime.hpp"
  36 #include "runtime/vframeArray.hpp"
  37 #include "vmreg_zero.inline.hpp"
  38 
  39 #ifdef COMPILER1
  40 #include "c1/c1_Runtime1.hpp"
  41 #endif
  42 #ifdef COMPILER2
  43 #include "opto/runtime.hpp"
  44 #endif
  45 
  46 
  47 static address zero_null_code_stub() {
  48   address start = ShouldNotCallThisStub();
  49   return start;
  50 }
  51 
  52 int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
  53                                            VMRegPair *regs,
  54                                            int total_args_passed,
  55                                            int is_outgoing) {
  56   return 0;
  57 }
  58 
  59 AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(
  60                         MacroAssembler *masm,
  61                         int total_args_passed,
  62                         int comp_args_on_stack,
  63                         const BasicType *sig_bt,
  64                         const VMRegPair *regs,
  65                         AdapterFingerPrint *fingerprint) {
  66   return AdapterHandlerLibrary::new_entry(
  67     fingerprint,
  68     CAST_FROM_FN_PTR(address,zero_null_code_stub),
  69     CAST_FROM_FN_PTR(address,zero_null_code_stub),
  70     CAST_FROM_FN_PTR(address,zero_null_code_stub));
  71 }
  72 
  73 nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
  74                                                 const methodHandle& method,
  75                                                 int compile_id,
  76                                                 BasicType *sig_bt,
  77                                                 VMRegPair *regs,
  78                                                 BasicType ret_type,
  79                                                 address critical_entry) {
  80   ShouldNotCallThis();
  81   return NULL;
  82 }
  83 
  84 int Deoptimization::last_frame_adjust(int callee_parameters,
  85                                       int callee_locals) {
  86   return 0;
  87 }
  88 
  89 uint SharedRuntime::out_preserve_stack_slots() {
  90   ShouldNotCallThis();
  91   return 0;
  92 }
  93 
  94 JRT_LEAF(void, zero_stub())
  95   ShouldNotCallThis();
  96 JRT_END
  97 
  98 static RuntimeStub* generate_empty_runtime_stub(const char* name) {
  99   return CAST_FROM_FN_PTR(RuntimeStub*,zero_stub);
 100 }
 101 
 102 static SafepointBlob* generate_empty_safepoint_blob() {
 103   return CAST_FROM_FN_PTR(SafepointBlob*,zero_stub);
 104 }
 105 
 106 static DeoptimizationBlob* generate_empty_deopt_blob() {
 107   return CAST_FROM_FN_PTR(DeoptimizationBlob*,zero_stub);
 108 }
 109 
 110 
 111 void SharedRuntime::generate_deopt_blob() {
 112   _deopt_blob = generate_empty_deopt_blob();
 113 }
 114 
 115 SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_type) {
 116   return generate_empty_safepoint_blob();
 117 }
 118 
 119 RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const char* name) {
 120   return generate_empty_runtime_stub("resolve_blob");
 121 }
 122 
 123 size_t SharedRuntime::trampoline_size() {
 124   ShouldNotCallThis();
 125   return 0;
 126 }
 127 
 128 void SharedRuntime::generate_trampoline(MacroAssembler *masm, address destination) {
 129   ShouldNotCallThis();
 130   return;
 131 }
 132 
 133 int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
 134                                          VMRegPair *regs,
 135                                          VMRegPair *regs2,
 136                                          int total_args_passed) {
 137   ShouldNotCallThis();
 138   return 0;
 139 }