comparison src/cpu/x86/vm/templateTable_x86_64.cpp @ 13086:096c224171c4

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Wed, 20 Nov 2013 00:10:38 +0100
parents 836a62f43af9 42790b7e4d48
children 58dfd753ada8
comparison
equal deleted inserted replaced
12782:92b7ec34ddfa 13086:096c224171c4
566 locals_index(rbx); 566 locals_index(rbx);
567 __ movptr(rax, aaddress(rbx)); 567 __ movptr(rax, aaddress(rbx));
568 } 568 }
569 569
570 void TemplateTable::locals_index_wide(Register reg) { 570 void TemplateTable::locals_index_wide(Register reg) {
571 __ movl(reg, at_bcp(2)); 571 __ load_unsigned_short(reg, at_bcp(2));
572 __ bswapl(reg); 572 __ bswapl(reg);
573 __ shrl(reg, 16); 573 __ shrl(reg, 16);
574 __ negptr(reg); 574 __ negptr(reg);
575 } 575 }
576 576
1573 InvocationCounter::counter_offset(); 1573 InvocationCounter::counter_offset();
1574 const ByteSize inv_offset = MethodCounters::invocation_counter_offset() + 1574 const ByteSize inv_offset = MethodCounters::invocation_counter_offset() +
1575 InvocationCounter::counter_offset(); 1575 InvocationCounter::counter_offset();
1576 1576
1577 // Load up edx with the branch displacement 1577 // Load up edx with the branch displacement
1578 __ movl(rdx, at_bcp(1)); 1578 if (is_wide) {
1579 __ movl(rdx, at_bcp(1));
1580 } else {
1581 __ load_signed_short(rdx, at_bcp(1));
1582 }
1579 __ bswapl(rdx); 1583 __ bswapl(rdx);
1580 1584
1581 if (!is_wide) { 1585 if (!is_wide) {
1582 __ sarl(rdx, 16); 1586 __ sarl(rdx, 16);
1583 } 1587 }
2978 __ shrl(flags, ConstantPoolCacheEntry::tos_state_shift); 2982 __ shrl(flags, ConstantPoolCacheEntry::tos_state_shift);
2979 // Make sure we don't need to mask flags after the above shift 2983 // Make sure we don't need to mask flags after the above shift
2980 ConstantPoolCacheEntry::verify_tos_state_shift(); 2984 ConstantPoolCacheEntry::verify_tos_state_shift();
2981 // load return address 2985 // load return address
2982 { 2986 {
2983 const address table_addr = (is_invokeinterface || is_invokedynamic) ? 2987 const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code);
2984 (address)Interpreter::return_5_addrs_by_index_table() :
2985 (address)Interpreter::return_3_addrs_by_index_table();
2986 ExternalAddress table(table_addr); 2988 ExternalAddress table(table_addr);
2987 __ lea(rscratch1, table); 2989 __ lea(rscratch1, table);
2988 __ movptr(flags, Address(rscratch1, flags, Address::times_ptr)); 2990 __ movptr(flags, Address(rscratch1, flags, Address::times_ptr));
2989 } 2991 }
2990 2992
3024 // It's final, need a null check here! 3026 // It's final, need a null check here!
3025 __ null_check(recv); 3027 __ null_check(recv);
3026 3028
3027 // profile this call 3029 // profile this call
3028 __ profile_final_call(rax); 3030 __ profile_final_call(rax);
3031 __ profile_arguments_type(rax, method, r13, true);
3029 3032
3030 __ jump_from_interpreted(method, rax); 3033 __ jump_from_interpreted(method, rax);
3031 3034
3032 __ bind(notFinal); 3035 __ bind(notFinal);
3033 3036
3038 // profile this call 3041 // profile this call
3039 __ profile_virtual_call(rax, r14, rdx); 3042 __ profile_virtual_call(rax, r14, rdx);
3040 3043
3041 // get target Method* & entry point 3044 // get target Method* & entry point
3042 __ lookup_virtual_method(rax, index, method); 3045 __ lookup_virtual_method(rax, index, method);
3046 __ profile_arguments_type(rdx, method, r13, true);
3043 #ifdef GRAAL 3047 #ifdef GRAAL
3044 // r14: MethodDataPointer (r14 is callee saved) 3048 // r14: MethodDataPointer (r14 is callee saved)
3045 __ profile_called_method(method, r14, r13); 3049 __ profile_called_method(method, r14, r13);
3046 #endif 3050 #endif
3051
3047 __ jump_from_interpreted(method, rdx); 3052 __ jump_from_interpreted(method, rdx);
3048 } 3053 }
3049 3054
3050 3055
3051 void TemplateTable::invokevirtual(int byte_no) { 3056 void TemplateTable::invokevirtual(int byte_no) {
3071 rcx); // get receiver also for null check 3076 rcx); // get receiver also for null check
3072 __ verify_oop(rcx); 3077 __ verify_oop(rcx);
3073 __ null_check(rcx); 3078 __ null_check(rcx);
3074 // do the call 3079 // do the call
3075 __ profile_call(rax); 3080 __ profile_call(rax);
3081 __ profile_arguments_type(rax, rbx, r13, false);
3076 __ jump_from_interpreted(rbx, rax); 3082 __ jump_from_interpreted(rbx, rax);
3077 } 3083 }
3078 3084
3079 3085
3080 void TemplateTable::invokestatic(int byte_no) { 3086 void TemplateTable::invokestatic(int byte_no) {
3081 transition(vtos, vtos); 3087 transition(vtos, vtos);
3082 assert(byte_no == f1_byte, "use this argument"); 3088 assert(byte_no == f1_byte, "use this argument");
3083 prepare_invoke(byte_no, rbx); // get f1 Method* 3089 prepare_invoke(byte_no, rbx); // get f1 Method*
3084 // do the call 3090 // do the call
3085 __ profile_call(rax); 3091 __ profile_call(rax);
3092 __ profile_arguments_type(rax, rbx, r13, false);
3086 __ jump_from_interpreted(rbx, rax); 3093 __ jump_from_interpreted(rbx, rax);
3087 } 3094 }
3088 3095
3089 void TemplateTable::fast_invokevfinal(int byte_no) { 3096 void TemplateTable::fast_invokevfinal(int byte_no) {
3090 transition(vtos, vtos); 3097 transition(vtos, vtos);
3137 // Note: This should be done more efficiently via a throw_abstract_method_error 3144 // Note: This should be done more efficiently via a throw_abstract_method_error
3138 // interpreter entry point and a conditional jump to it in case of a null 3145 // interpreter entry point and a conditional jump to it in case of a null
3139 // method. 3146 // method.
3140 __ testptr(rbx, rbx); 3147 __ testptr(rbx, rbx);
3141 __ jcc(Assembler::zero, no_such_method); 3148 __ jcc(Assembler::zero, no_such_method);
3149
3150 __ profile_arguments_type(rdx, rbx, r13, true);
3142 3151
3143 // do the call 3152 // do the call
3144 // rcx: receiver 3153 // rcx: receiver
3145 // rbx,: Method* 3154 // rbx,: Method*
3146 #ifdef GRAAL 3155 #ifdef GRAAL
3199 3208
3200 // Note: rax_mtype is already pushed (if necessary) by prepare_invoke 3209 // Note: rax_mtype is already pushed (if necessary) by prepare_invoke
3201 3210
3202 // FIXME: profile the LambdaForm also 3211 // FIXME: profile the LambdaForm also
3203 __ profile_final_call(rax); 3212 __ profile_final_call(rax);
3213 __ profile_arguments_type(rdx, rbx_method, r13, true);
3204 3214
3205 __ jump_from_interpreted(rbx_method, rdx); 3215 __ jump_from_interpreted(rbx_method, rdx);
3206 } 3216 }
3207 3217
3208 3218
3232 // Note: rax_callsite is already pushed by prepare_invoke 3242 // Note: rax_callsite is already pushed by prepare_invoke
3233 3243
3234 // %%% should make a type profile for any invokedynamic that takes a ref argument 3244 // %%% should make a type profile for any invokedynamic that takes a ref argument
3235 // profile this call 3245 // profile this call
3236 __ profile_call(r13); 3246 __ profile_call(r13);
3247 __ profile_arguments_type(rdx, rbx_method, r13, false);
3237 3248
3238 __ verify_oop(rax_callsite); 3249 __ verify_oop(rax_callsite);
3239 3250
3240 __ jump_from_interpreted(rbx_method, rdx); 3251 __ jump_from_interpreted(rbx_method, rdx);
3241 } 3252 }