Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/sharedRuntime_x86_64.cpp @ 11173:6b0fd0964b87
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 31 Jul 2013 11:00:54 +0200 |
parents | 0b1b5356b566 e7f5651d459c |
children | 02f27ecb4f3a |
comparison
equal
deleted
inserted
replaced
10912:4ea54634f03e | 11173:6b0fd0964b87 |
---|---|
1441 assert(!body_arg.first()->is_Register() || body_arg.first()->as_Register() != tmp_reg, | 1441 assert(!body_arg.first()->is_Register() || body_arg.first()->as_Register() != tmp_reg, |
1442 "possible collision"); | 1442 "possible collision"); |
1443 assert(!length_arg.first()->is_Register() || length_arg.first()->as_Register() != tmp_reg, | 1443 assert(!length_arg.first()->is_Register() || length_arg.first()->as_Register() != tmp_reg, |
1444 "possible collision"); | 1444 "possible collision"); |
1445 | 1445 |
1446 __ block_comment("unpack_array_argument {"); | |
1447 | |
1446 // Pass the length, ptr pair | 1448 // Pass the length, ptr pair |
1447 Label is_null, done; | 1449 Label is_null, done; |
1448 VMRegPair tmp; | 1450 VMRegPair tmp; |
1449 tmp.set_ptr(tmp_reg->as_VMReg()); | 1451 tmp.set_ptr(tmp_reg->as_VMReg()); |
1450 if (reg.first()->is_stack()) { | 1452 if (reg.first()->is_stack()) { |
1465 // Pass zeros | 1467 // Pass zeros |
1466 __ xorptr(tmp_reg, tmp_reg); | 1468 __ xorptr(tmp_reg, tmp_reg); |
1467 move_ptr(masm, tmp, body_arg); | 1469 move_ptr(masm, tmp, body_arg); |
1468 move32_64(masm, tmp, length_arg); | 1470 move32_64(masm, tmp, length_arg); |
1469 __ bind(done); | 1471 __ bind(done); |
1472 | |
1473 __ block_comment("} unpack_array_argument"); | |
1470 } | 1474 } |
1471 | 1475 |
1472 | 1476 |
1473 // Different signatures may require very different orders for the move | 1477 // Different signatures may require very different orders for the move |
1474 // to avoid clobbering other arguments. There's no simple way to | 1478 // to avoid clobbering other arguments. There's no simple way to |
2206 default: | 2210 default: |
2207 move32_64(masm, in_regs[i], out_regs[c_arg]); | 2211 move32_64(masm, in_regs[i], out_regs[c_arg]); |
2208 } | 2212 } |
2209 } | 2213 } |
2210 | 2214 |
2211 // point c_arg at the first arg that is already loaded in case we | 2215 int c_arg; |
2212 // need to spill before we call out | |
2213 int c_arg = total_c_args - total_in_args; | |
2214 | 2216 |
2215 // Pre-load a static method's oop into r14. Used both by locking code and | 2217 // Pre-load a static method's oop into r14. Used both by locking code and |
2216 // the normal JNI call code. | 2218 // the normal JNI call code. |
2217 if (method->is_static() && !is_critical_native) { | 2219 if (!is_critical_native) { |
2218 | 2220 // point c_arg at the first arg that is already loaded in case we |
2219 // load oop into a register | 2221 // need to spill before we call out |
2220 __ movoop(oop_handle_reg, JNIHandles::make_local(method->method_holder()->java_mirror())); | 2222 c_arg = total_c_args - total_in_args; |
2221 | 2223 |
2222 // Now handlize the static class mirror it's known not-null. | 2224 if (method->is_static()) { |
2223 __ movptr(Address(rsp, klass_offset), oop_handle_reg); | 2225 |
2224 map->set_oop(VMRegImpl::stack2reg(klass_slot_offset)); | 2226 // load oop into a register |
2225 | 2227 __ movoop(oop_handle_reg, JNIHandles::make_local(method->method_holder()->java_mirror())); |
2226 // Now get the handle | 2228 |
2227 __ lea(oop_handle_reg, Address(rsp, klass_offset)); | 2229 // Now handlize the static class mirror it's known not-null. |
2228 // store the klass handle as second argument | 2230 __ movptr(Address(rsp, klass_offset), oop_handle_reg); |
2229 __ movptr(c_rarg1, oop_handle_reg); | 2231 map->set_oop(VMRegImpl::stack2reg(klass_slot_offset)); |
2230 // and protect the arg if we must spill | 2232 |
2231 c_arg--; | 2233 // Now get the handle |
2234 __ lea(oop_handle_reg, Address(rsp, klass_offset)); | |
2235 // store the klass handle as second argument | |
2236 __ movptr(c_rarg1, oop_handle_reg); | |
2237 // and protect the arg if we must spill | |
2238 c_arg--; | |
2239 } | |
2240 } else { | |
2241 // For JNI critical methods we need to save all registers in save_args. | |
2242 c_arg = 0; | |
2232 } | 2243 } |
2233 | 2244 |
2234 // Change state to native (we save the return address in the thread, since it might not | 2245 // Change state to native (we save the return address in the thread, since it might not |
2235 // be pushed on the stack when we do a a stack traversal). It is enough that the pc() | 2246 // be pushed on the stack when we do a a stack traversal). It is enough that the pc() |
2236 // points into the right code segment. It does not have to be the correct return pc. | 2247 // points into the right code segment. It does not have to be the correct return pc. |