Mercurial > hg > truffle
comparison src/cpu/ppc/vm/templateTable_ppc_64.cpp @ 20710:c5e86c5cd22e
8066964: ppc64: argument and return type profiling, fix problem with popframe
Reviewed-by: roland, kvn
author | goetz |
---|---|
date | Fri, 12 Dec 2014 08:48:56 +0100 |
parents | f6bde7889409 |
children |
comparison
equal
deleted
inserted
replaced
20709:28f116adb50c | 20710:c5e86c5cd22e |
---|---|
3232 // Calc vtable addr scale the vtable index by 8. | 3232 // Calc vtable addr scale the vtable index by 8. |
3233 __ sldi(Rindex, Rindex, exact_log2(vtableEntry::size() * wordSize)); | 3233 __ sldi(Rindex, Rindex, exact_log2(vtableEntry::size() * wordSize)); |
3234 // Load target. | 3234 // Load target. |
3235 __ addi(Rrecv_klass, Rrecv_klass, base + vtableEntry::method_offset_in_bytes()); | 3235 __ addi(Rrecv_klass, Rrecv_klass, base + vtableEntry::method_offset_in_bytes()); |
3236 __ ldx(Rtarget_method, Rindex, Rrecv_klass); | 3236 __ ldx(Rtarget_method, Rindex, Rrecv_klass); |
3237 // Argument and return type profiling. | |
3238 __ profile_arguments_type(Rtarget_method, Rrecv_klass /* scratch1 */, Rtemp /* scratch2 */, true); | |
3237 __ call_from_interpreter(Rtarget_method, Rret, Rrecv_klass /* scratch1 */, Rtemp /* scratch2 */); | 3239 __ call_from_interpreter(Rtarget_method, Rret, Rrecv_klass /* scratch1 */, Rtemp /* scratch2 */); |
3238 } | 3240 } |
3239 | 3241 |
3240 // Virtual or final call. Final calls are rewritten on the fly to run through "fast_finalcall" next time. | 3242 // Virtual or final call. Final calls are rewritten on the fly to run through "fast_finalcall" next time. |
3241 void TemplateTable::invokevirtual(int byte_no) { | 3243 void TemplateTable::invokevirtual(int byte_no) { |
3315 // Load receiver and receiver NULL check. | 3317 // Load receiver and receiver NULL check. |
3316 __ load_receiver(Rnum_params, Rrecv); | 3318 __ load_receiver(Rnum_params, Rrecv); |
3317 __ null_check_throw(Rrecv, -1, Rscratch1); | 3319 __ null_check_throw(Rrecv, -1, Rscratch1); |
3318 | 3320 |
3319 __ profile_final_call(Rrecv, Rscratch1); | 3321 __ profile_final_call(Rrecv, Rscratch1); |
3322 // Argument and return type profiling. | |
3323 __ profile_arguments_type(Rmethod, Rscratch1, Rscratch2, true); | |
3320 | 3324 |
3321 // Do the call. | 3325 // Do the call. |
3322 __ call_from_interpreter(Rmethod, Rret_addr, Rscratch1, Rscratch2); | 3326 __ call_from_interpreter(Rmethod, Rret_addr, Rscratch1, Rscratch2); |
3323 } | 3327 } |
3324 | 3328 |
3336 | 3340 |
3337 // Receiver NULL check. | 3341 // Receiver NULL check. |
3338 __ null_check_throw(Rreceiver, -1, R11_scratch1); | 3342 __ null_check_throw(Rreceiver, -1, R11_scratch1); |
3339 | 3343 |
3340 __ profile_call(R11_scratch1, R12_scratch2); | 3344 __ profile_call(R11_scratch1, R12_scratch2); |
3345 // Argument and return type profiling. | |
3346 __ profile_arguments_type(Rmethod, R11_scratch1, R12_scratch2, false); | |
3341 __ call_from_interpreter(Rmethod, Rret_addr, R11_scratch1, R12_scratch2); | 3347 __ call_from_interpreter(Rmethod, Rret_addr, R11_scratch1, R12_scratch2); |
3342 } | 3348 } |
3343 | 3349 |
3344 void TemplateTable::invokestatic(int byte_no) { | 3350 void TemplateTable::invokestatic(int byte_no) { |
3345 assert(byte_no == f1_byte, "use this argument"); | 3351 assert(byte_no == f1_byte, "use this argument"); |
3350 Rflags = R5_ARG3; | 3356 Rflags = R5_ARG3; |
3351 | 3357 |
3352 prepare_invoke(byte_no, R19_method, Rret_addr, noreg, noreg, Rflags, R11_scratch1); | 3358 prepare_invoke(byte_no, R19_method, Rret_addr, noreg, noreg, Rflags, R11_scratch1); |
3353 | 3359 |
3354 __ profile_call(R11_scratch1, R12_scratch2); | 3360 __ profile_call(R11_scratch1, R12_scratch2); |
3361 // Argument and return type profiling. | |
3362 __ profile_arguments_type(R19_method, R11_scratch1, R12_scratch2, false); | |
3355 __ call_from_interpreter(R19_method, Rret_addr, R11_scratch1, R12_scratch2); | 3363 __ call_from_interpreter(R19_method, Rret_addr, R11_scratch1, R12_scratch2); |
3356 } | 3364 } |
3357 | 3365 |
3358 void TemplateTable::invokeinterface_object_method(Register Rrecv_klass, | 3366 void TemplateTable::invokeinterface_object_method(Register Rrecv_klass, |
3359 Register Rret, | 3367 Register Rret, |
3371 | 3379 |
3372 Register Rscratch = Rflags; // Rflags is dead now. | 3380 Register Rscratch = Rflags; // Rflags is dead now. |
3373 | 3381 |
3374 // Final call case. | 3382 // Final call case. |
3375 __ profile_final_call(Rtemp1, Rscratch); | 3383 __ profile_final_call(Rtemp1, Rscratch); |
3384 // Argument and return type profiling. | |
3385 __ profile_arguments_type(Rindex, Rscratch, Rrecv_klass /* scratch */, true); | |
3376 // Do the final call - the index (f2) contains the method. | 3386 // Do the final call - the index (f2) contains the method. |
3377 __ call_from_interpreter(Rindex, Rret, Rscratch, Rrecv_klass /* scratch */); | 3387 __ call_from_interpreter(Rindex, Rret, Rscratch, Rrecv_klass /* scratch */); |
3378 | 3388 |
3379 // Non-final callc case. | 3389 // Non-final callc case. |
3380 __ bind(LnotFinal); | 3390 __ bind(LnotFinal); |
3422 __ lookup_interface_method(Rrecv_klass, Rinterface_klass, Rindex, Rindex, Rscratch1, Rscratch2, Lthrow_icc); | 3432 __ lookup_interface_method(Rrecv_klass, Rinterface_klass, Rindex, Rindex, Rscratch1, Rscratch2, Lthrow_icc); |
3423 | 3433 |
3424 __ cmpdi(CCR0, Rindex, 0); | 3434 __ cmpdi(CCR0, Rindex, 0); |
3425 __ beq(CCR0, Lthrow_ame); | 3435 __ beq(CCR0, Lthrow_ame); |
3426 // Found entry. Jump off! | 3436 // Found entry. Jump off! |
3437 // Argument and return type profiling. | |
3438 __ profile_arguments_type(Rindex, Rscratch1, Rscratch2, true); | |
3427 __ call_from_interpreter(Rindex, Rret_addr, Rscratch1, Rscratch2); | 3439 __ call_from_interpreter(Rindex, Rret_addr, Rscratch1, Rscratch2); |
3428 | 3440 |
3429 // Vtable entry was NULL => Throw abstract method error. | 3441 // Vtable entry was NULL => Throw abstract method error. |
3430 __ bind(Lthrow_ame); | 3442 __ bind(Lthrow_ame); |
3431 __ mr(Rrecv_klass, Rscratch4); | 3443 __ mr(Rrecv_klass, Rscratch4); |
3475 // Off we go. With the new method handles, we don't jump to a method handle | 3487 // Off we go. With the new method handles, we don't jump to a method handle |
3476 // entry any more. Instead, we pushed an "appendix" in prepare invoke, which happens | 3488 // entry any more. Instead, we pushed an "appendix" in prepare invoke, which happens |
3477 // to be the callsite object the bootstrap method returned. This is passed to a | 3489 // to be the callsite object the bootstrap method returned. This is passed to a |
3478 // "link" method which does the dispatch (Most likely just grabs the MH stored | 3490 // "link" method which does the dispatch (Most likely just grabs the MH stored |
3479 // inside the callsite and does an invokehandle). | 3491 // inside the callsite and does an invokehandle). |
3492 // Argument and return type profiling. | |
3493 __ profile_arguments_type(Rmethod, Rscratch1, Rscratch2, false); | |
3480 __ call_from_interpreter(Rmethod, Rret_addr, Rscratch1 /* scratch1 */, Rscratch2 /* scratch2 */); | 3494 __ call_from_interpreter(Rmethod, Rret_addr, Rscratch1 /* scratch1 */, Rscratch2 /* scratch2 */); |
3481 } | 3495 } |
3482 | 3496 |
3483 void TemplateTable::invokehandle(int byte_no) { | 3497 void TemplateTable::invokehandle(int byte_no) { |
3484 transition(vtos, vtos); | 3498 transition(vtos, vtos); |
3501 __ null_check_throw(Rrecv, -1, Rscratch2); | 3515 __ null_check_throw(Rrecv, -1, Rscratch2); |
3502 | 3516 |
3503 __ profile_final_call(Rrecv, Rscratch1); | 3517 __ profile_final_call(Rrecv, Rscratch1); |
3504 | 3518 |
3505 // Still no call from handle => We call the method handle interpreter here. | 3519 // Still no call from handle => We call the method handle interpreter here. |
3520 // Argument and return type profiling. | |
3521 __ profile_arguments_type(Rmethod, Rscratch1, Rscratch2, true); | |
3506 __ call_from_interpreter(Rmethod, Rret_addr, Rscratch1 /* scratch1 */, Rscratch2 /* scratch2 */); | 3522 __ call_from_interpreter(Rmethod, Rret_addr, Rscratch1 /* scratch1 */, Rscratch2 /* scratch2 */); |
3507 } | 3523 } |
3508 | 3524 |
3509 // ============================================================================= | 3525 // ============================================================================= |
3510 // Allocation | 3526 // Allocation |