Mercurial > hg > truffle
comparison src/cpu/x86/vm/x86_32.ad @ 10408:836a62f43af9
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 19 Jun 2013 10:45:56 +0200 |
parents | e10e43e58e92 |
children | 190899198332 c9ccd7b85f20 6a936747b569 |
comparison
equal
deleted
inserted
replaced
10086:e0fb8a213650 | 10408:836a62f43af9 |
---|---|
1255 return 4; | 1255 return 4; |
1256 } | 1256 } |
1257 } | 1257 } |
1258 | 1258 |
1259 //============================================================================= | 1259 //============================================================================= |
1260 | |
1261 // emit call stub, compiled java to interpreter | |
1262 void emit_java_to_interp(CodeBuffer &cbuf ) { | |
1263 // Stub is fixed up when the corresponding call is converted from calling | |
1264 // compiled code to calling interpreted code. | |
1265 // mov rbx,0 | |
1266 // jmp -1 | |
1267 | |
1268 address mark = cbuf.insts_mark(); // get mark within main instrs section | |
1269 | |
1270 // Note that the code buffer's insts_mark is always relative to insts. | |
1271 // That's why we must use the macroassembler to generate a stub. | |
1272 MacroAssembler _masm(&cbuf); | |
1273 | |
1274 address base = | |
1275 __ start_a_stub(Compile::MAX_stubs_size); | |
1276 if (base == NULL) return; // CodeBuffer::expand failed | |
1277 // static stub relocation stores the instruction address of the call | |
1278 __ relocate(static_stub_Relocation::spec(mark), RELOC_IMM32); | |
1279 // static stub relocation also tags the Method* in the code-stream. | |
1280 __ mov_metadata(rbx, (Metadata*)NULL); // method is zapped till fixup time | |
1281 // This is recognized as unresolved by relocs/nativeInst/ic code | |
1282 __ jump(RuntimeAddress(__ pc())); | |
1283 | |
1284 __ end_a_stub(); | |
1285 // Update current stubs pointer and restore insts_end. | |
1286 } | |
1287 // size of call stub, compiled java to interpretor | |
1288 uint size_java_to_interp() { | |
1289 return 10; // movl; jmp | |
1290 } | |
1291 // relocation entries for call stub, compiled java to interpretor | |
1292 uint reloc_java_to_interp() { | |
1293 return 4; // 3 in emit_java_to_interp + 1 in Java_Static_Call | |
1294 } | |
1295 | |
1296 //============================================================================= | |
1297 #ifndef PRODUCT | 1260 #ifndef PRODUCT |
1298 void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream* st ) const { | 1261 void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream* st ) const { |
1299 st->print_cr( "CMP EAX,[ECX+4]\t# Inline cache check"); | 1262 st->print_cr( "CMP EAX,[ECX+4]\t# Inline cache check"); |
1300 st->print_cr("\tJNE SharedRuntime::handle_ic_miss_stub"); | 1263 st->print_cr("\tJNE SharedRuntime::handle_ic_miss_stub"); |
1301 st->print_cr("\tNOP"); | 1264 st->print_cr("\tNOP"); |
1907 opt_virtual_call_Relocation::spec(), RELOC_IMM32 ); | 1870 opt_virtual_call_Relocation::spec(), RELOC_IMM32 ); |
1908 } else { | 1871 } else { |
1909 emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4), | 1872 emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4), |
1910 static_call_Relocation::spec(), RELOC_IMM32 ); | 1873 static_call_Relocation::spec(), RELOC_IMM32 ); |
1911 } | 1874 } |
1912 if (_method) { // Emit stub for static call | 1875 if (_method) { // Emit stub for static call. |
1913 emit_java_to_interp(cbuf); | 1876 CompiledStaticCall::emit_to_interp_stub(cbuf); |
1914 } | 1877 } |
1915 %} | 1878 %} |
1916 | 1879 |
1917 enc_class Java_Dynamic_Call (method meth) %{ // JAVA DYNAMIC CALL | 1880 enc_class Java_Dynamic_Call (method meth) %{ // JAVA DYNAMIC CALL |
1918 MacroAssembler _masm(&cbuf); | 1881 MacroAssembler _masm(&cbuf); |