2103 // CALL Java_To_Interpreter 2104 // This is the instruction starting address for relocation info. 2105 cbuf.set_insts_mark(); 2106 $$$emit8$primary; 2107 // CALL directly to the runtime 2108 emit_d32_reloc(cbuf, 2109 (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4), 2110 runtime_call_Relocation::spec(), 2111 RELOC_DISP32); 2112 %} 2113 2114 enc_class Java_Static_Call(method meth) 2115 %{ 2116 // JAVA STATIC CALL 2117 // CALL to fixup routine. Fixup routine uses ScopeDesc info to 2118 // determine who we intended to call. 2119 cbuf.set_insts_mark(); 2120 $$$emit8$primary; 2121 2122 if (!_method) { 2123 emit_d32_reloc(cbuf, 2124 (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4), 2125 runtime_call_Relocation::spec(), 2126 RELOC_DISP32); 2127 } else if (_optimized_virtual) { 2128 emit_d32_reloc(cbuf, 2129 (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4), 2130 opt_virtual_call_Relocation::spec(), 2131 RELOC_DISP32); 2132 } else { 2133 emit_d32_reloc(cbuf, 2134 (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4), 2135 static_call_Relocation::spec(), 2136 RELOC_DISP32); 2137 } 2138 if (_method) { 2139 // Emit stubs for static call. 2140 address mark = cbuf.insts_mark(); 2141 address stub = CompiledStaticCall::emit_to_interp_stub(cbuf, mark); 2142 if (stub == NULL) { 2143 ciEnv::current()->record_failure("CodeCache is full"); 2144 return; 2145 } 2146 } 2147 %} 2148 2149 enc_class Java_Dynamic_Call(method meth) %{ 2150 MacroAssembler _masm(&cbuf); 2151 __ ic_call((address)$meth$$method); 2152 %} 2153 2154 enc_class Java_Compiled_Call(method meth) 2155 %{ 2156 // JAVA COMPILED CALL 2157 int disp = in_bytes(Method:: from_compiled_offset()); 2158 2159 // XXX XXX offset is 128 is 1.5 NON-PRODUCT !!! 2160 // assert(-0x80 <= disp && disp < 0x80, "compiled_code_offset isn't small"); 2161 2162 // callq *disp(%rax) 2163 cbuf.set_insts_mark(); 2164 $$$emit8$primary; 2165 if (disp < 0x80) { 2166 emit_rm(cbuf, 0x01, $secondary, RAX_enc); // R/M byte 2167 emit_d8(cbuf, disp); // Displacement 2168 } else { 2169 emit_rm(cbuf, 0x02, $secondary, RAX_enc); // R/M byte 2170 emit_d32(cbuf, disp); // Displacement 2171 } | 2103 // CALL Java_To_Interpreter 2104 // This is the instruction starting address for relocation info. 2105 cbuf.set_insts_mark(); 2106 $$$emit8$primary; 2107 // CALL directly to the runtime 2108 emit_d32_reloc(cbuf, 2109 (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4), 2110 runtime_call_Relocation::spec(), 2111 RELOC_DISP32); 2112 %} 2113 2114 enc_class Java_Static_Call(method meth) 2115 %{ 2116 // JAVA STATIC CALL 2117 // CALL to fixup routine. Fixup routine uses ScopeDesc info to 2118 // determine who we intended to call. 2119 cbuf.set_insts_mark(); 2120 $$$emit8$primary; 2121 2122 if (!_method) { 2123 emit_d32_reloc(cbuf, (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4), 2124 runtime_call_Relocation::spec(), 2125 RELOC_DISP32); 2126 } else { 2127 int method_index = resolved_method_index(cbuf); 2128 RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index) 2129 : static_call_Relocation::spec(method_index); 2130 emit_d32_reloc(cbuf, (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4), 2131 rspec, RELOC_DISP32); 2132 // Emit stubs for static call. 2133 address mark = cbuf.insts_mark(); 2134 address stub = CompiledStaticCall::emit_to_interp_stub(cbuf, mark); 2135 if (stub == NULL) { 2136 ciEnv::current()->record_failure("CodeCache is full"); 2137 return; 2138 } 2139 } 2140 %} 2141 2142 enc_class Java_Dynamic_Call(method meth) %{ 2143 MacroAssembler _masm(&cbuf); 2144 __ ic_call((address)$meth$$method, resolved_method_index(cbuf)); 2145 %} 2146 2147 enc_class Java_Compiled_Call(method meth) 2148 %{ 2149 // JAVA COMPILED CALL 2150 int disp = in_bytes(Method:: from_compiled_offset()); 2151 2152 // XXX XXX offset is 128 is 1.5 NON-PRODUCT !!! 2153 // assert(-0x80 <= disp && disp < 0x80, "compiled_code_offset isn't small"); 2154 2155 // callq *disp(%rax) 2156 cbuf.set_insts_mark(); 2157 $$$emit8$primary; 2158 if (disp < 0x80) { 2159 emit_rm(cbuf, 0x01, $secondary, RAX_enc); // R/M byte 2160 emit_d8(cbuf, disp); // Displacement 2161 } else { 2162 emit_rm(cbuf, 0x02, $secondary, RAX_enc); // R/M byte 2163 emit_d32(cbuf, disp); // Displacement 2164 } |