comparison src/cpu/sparc/vm/templateTable_sparc.cpp @ 17628:add2caa66e7e

8026253: New type profiling points: sparc support Summary: c1 and interpreter support for new type profiling on sparc Reviewed-by: kvn, twisti
author roland
date Tue, 14 Jan 2014 14:51:47 +0100
parents bd3237e0e18d
children d8041d695d19 32b682649973
comparison
equal deleted inserted replaced
17627:d7773b29c65a 17628:add2caa66e7e
2940 } 2940 }
2941 } 2941 }
2942 2942
2943 2943
2944 void TemplateTable::generate_vtable_call(Register Rrecv, Register Rindex, Register Rret) { 2944 void TemplateTable::generate_vtable_call(Register Rrecv, Register Rindex, Register Rret) {
2945 Register Rtemp = G4_scratch;
2946 Register Rcall = Rindex; 2945 Register Rcall = Rindex;
2947 assert_different_registers(Rcall, G5_method, Gargs, Rret); 2946 assert_different_registers(Rcall, G5_method, Gargs, Rret);
2948 2947
2949 // get target Method* & entry point 2948 // get target Method* & entry point
2950 __ lookup_virtual_method(Rrecv, Rindex, G5_method); 2949 __ lookup_virtual_method(Rrecv, Rindex, G5_method);
2950 __ profile_arguments_type(G5_method, Rcall, Gargs, true);
2951 __ call_from_interpreter(Rcall, Gargs, Rret); 2951 __ call_from_interpreter(Rcall, Gargs, Rret);
2952 } 2952 }
2953 2953
2954 void TemplateTable::invokevirtual(int byte_no) { 2954 void TemplateTable::invokevirtual(int byte_no) {
2955 transition(vtos, vtos); 2955 transition(vtos, vtos);
3020 3020
3021 // receiver NULL check 3021 // receiver NULL check
3022 __ null_check(O0); 3022 __ null_check(O0);
3023 3023
3024 __ profile_final_call(O4); 3024 __ profile_final_call(O4);
3025 __ profile_arguments_type(G5_method, Rscratch, Gargs, true);
3025 3026
3026 // get return address 3027 // get return address
3027 AddressLiteral table(Interpreter::invoke_return_entry_table()); 3028 AddressLiteral table(Interpreter::invoke_return_entry_table());
3028 __ set(table, Rtemp); 3029 __ set(table, Rtemp);
3029 __ srl(Rret, ConstantPoolCacheEntry::tos_state_shift, Rret); // get return type 3030 __ srl(Rret, ConstantPoolCacheEntry::tos_state_shift, Rret); // get return type
3049 prepare_invoke(byte_no, G5_method, Rret, noreg, O0_recv); // get receiver also for null check 3050 prepare_invoke(byte_no, G5_method, Rret, noreg, O0_recv); // get receiver also for null check
3050 __ null_check(O0_recv); 3051 __ null_check(O0_recv);
3051 3052
3052 // do the call 3053 // do the call
3053 __ profile_call(O4); 3054 __ profile_call(O4);
3055 __ profile_arguments_type(G5_method, Rscratch, Gargs, false);
3054 __ call_from_interpreter(Rscratch, Gargs, Rret); 3056 __ call_from_interpreter(Rscratch, Gargs, Rret);
3055 } 3057 }
3056 3058
3057 3059
3058 void TemplateTable::invokestatic(int byte_no) { 3060 void TemplateTable::invokestatic(int byte_no) {
3064 3066
3065 prepare_invoke(byte_no, G5_method, Rret); // get f1 Method* 3067 prepare_invoke(byte_no, G5_method, Rret); // get f1 Method*
3066 3068
3067 // do the call 3069 // do the call
3068 __ profile_call(O4); 3070 __ profile_call(O4);
3071 __ profile_arguments_type(G5_method, Rscratch, Gargs, false);
3069 __ call_from_interpreter(Rscratch, Gargs, Rret); 3072 __ call_from_interpreter(Rscratch, Gargs, Rret);
3070 } 3073 }
3071 3074
3072 void TemplateTable::invokeinterface_object_method(Register RKlass, 3075 void TemplateTable::invokeinterface_object_method(Register RKlass,
3073 Register Rcall, 3076 Register Rcall,
3089 __ profile_final_call(O4); 3092 __ profile_final_call(O4);
3090 3093
3091 // do the call - the index (f2) contains the Method* 3094 // do the call - the index (f2) contains the Method*
3092 assert_different_registers(G5_method, Gargs, Rcall); 3095 assert_different_registers(G5_method, Gargs, Rcall);
3093 __ mov(Rindex, G5_method); 3096 __ mov(Rindex, G5_method);
3097 __ profile_arguments_type(G5_method, Rcall, Gargs, true);
3094 __ call_from_interpreter(Rcall, Gargs, Rret); 3098 __ call_from_interpreter(Rcall, Gargs, Rret);
3095 __ bind(notFinal); 3099 __ bind(notFinal);
3096 3100
3097 __ profile_virtual_call(RKlass, O4); 3101 __ profile_virtual_call(RKlass, O4);
3098 generate_vtable_call(RKlass, Rindex, Rret); 3102 generate_vtable_call(RKlass, Rindex, Rret);
3195 } 3199 }
3196 3200
3197 Register Rcall = Rinterface; 3201 Register Rcall = Rinterface;
3198 assert_different_registers(Rcall, G5_method, Gargs, Rret); 3202 assert_different_registers(Rcall, G5_method, Gargs, Rret);
3199 3203
3204 __ profile_arguments_type(G5_method, Rcall, Gargs, true);
3200 __ call_from_interpreter(Rcall, Gargs, Rret); 3205 __ call_from_interpreter(Rcall, Gargs, Rret);
3201 } 3206 }
3202 3207
3203 void TemplateTable::invokehandle(int byte_no) { 3208 void TemplateTable::invokehandle(int byte_no) {
3204 transition(vtos, vtos); 3209 transition(vtos, vtos);
3224 // Note: G4_mtype is already pushed (if necessary) by prepare_invoke 3229 // Note: G4_mtype is already pushed (if necessary) by prepare_invoke
3225 3230
3226 // do the call 3231 // do the call
3227 __ verify_oop(G4_mtype); 3232 __ verify_oop(G4_mtype);
3228 __ profile_final_call(O4); // FIXME: profile the LambdaForm also 3233 __ profile_final_call(O4); // FIXME: profile the LambdaForm also
3234 __ profile_arguments_type(G5_method, Rscratch, Gargs, true);
3229 __ call_from_interpreter(Rscratch, Gargs, Rret); 3235 __ call_from_interpreter(Rscratch, Gargs, Rret);
3230 } 3236 }
3231 3237
3232 3238
3233 void TemplateTable::invokedynamic(int byte_no) { 3239 void TemplateTable::invokedynamic(int byte_no) {
3260 // profile this call 3266 // profile this call
3261 __ profile_call(O4); 3267 __ profile_call(O4);
3262 3268
3263 // do the call 3269 // do the call
3264 __ verify_oop(G4_callsite); 3270 __ verify_oop(G4_callsite);
3271 __ profile_arguments_type(G5_method, Rscratch, Gargs, false);
3265 __ call_from_interpreter(Rscratch, Gargs, Rret); 3272 __ call_from_interpreter(Rscratch, Gargs, Rret);
3266 } 3273 }
3267 3274
3268 3275
3269 //---------------------------------------------------------------------------------------------------- 3276 //----------------------------------------------------------------------------------------------------