comparison src/cpu/x86/vm/templateTable_x86.cpp @ 13581:c6b48833776d

8187625: [MVT] Interpreter cleanup Reviewed-by: dsimms
author fparain
date Mon, 18 Sep 2017 10:34:11 -0400
parents bc075a2f87ad
children
comparison
equal deleted inserted replaced
28:b749467a73ec 30:e0202cf6c6fd
2872 const Register index = rdx; 2872 const Register index = rdx;
2873 const Register obj = LP64_ONLY(c_rarg3) NOT_LP64(rcx); 2873 const Register obj = LP64_ONLY(c_rarg3) NOT_LP64(rcx);
2874 const Register off = rbx; 2874 const Register off = rbx;
2875 const Register flags = rax; 2875 const Register flags = rax;
2876 const Register bc = LP64_ONLY(c_rarg3) NOT_LP64(rcx); // uses same reg as obj, so don't mix them 2876 const Register bc = LP64_ONLY(c_rarg3) NOT_LP64(rcx); // uses same reg as obj, so don't mix them
2877 const Register flags2 = rdx;
2877 2878
2878 resolve_cache_and_index(byte_no, cache, index, sizeof(u2)); 2879 resolve_cache_and_index(byte_no, cache, index, sizeof(u2));
2879 jvmti_post_field_access(cache, index, is_static, false); 2880 jvmti_post_field_access(cache, index, is_static, false);
2880 load_field_cp_cache_entry(obj, cache, index, off, flags, is_static); 2881 load_field_cp_cache_entry(obj, cache, index, off, flags, is_static);
2881 2882
2882 const Address field(obj, off, Address::times_1, 0*wordSize); 2883 const Address field(obj, off, Address::times_1, 0*wordSize);
2883 NOT_LP64(const Address hi(obj, off, Address::times_1, 1*wordSize)); 2884 NOT_LP64(const Address hi(obj, off, Address::times_1, 1*wordSize));
2884 2885
2885 Label Done, notByte, notBool, notInt, notShort, notChar, notLong, notFloat, notObj, notValueType, notDouble; 2886 Label Done, notByte, notBool, notInt, notShort, notChar, notLong, notFloat, notObj, notValueType, notDouble;
2887
2888 __ movl(flags2, flags);
2886 2889
2887 __ shrl(flags, ConstantPoolCacheEntry::tos_state_shift); 2890 __ shrl(flags, ConstantPoolCacheEntry::tos_state_shift);
2888 // Make sure we don't need to mask edx after the above shift 2891 // Make sure we don't need to mask edx after the above shift
2889 assert(btos == 0, "change code, btos != 0"); 2892 assert(btos == 0, "change code, btos != 0");
2890 2893
2910 Label initialized; 2913 Label initialized;
2911 // Issue below if the static field has not been initialized yet 2914 // Issue below if the static field has not been initialized yet
2912 __ load_heap_oop(rax, field); 2915 __ load_heap_oop(rax, field);
2913 __ testptr(rax, rax); 2916 __ testptr(rax, rax);
2914 __ jcc(Assembler::notZero, initialized); 2917 __ jcc(Assembler::notZero, initialized);
2918 __ andl(flags2, ConstantPoolCacheEntry::field_index_mask);
2915 __ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::initialize_static_value_field), 2919 __ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::initialize_static_value_field),
2916 obj, off); 2920 obj, flags2);
2917 __ verify_oop(rax); 2921 __ verify_oop(rax);
2918 __ bind(initialized); 2922 __ bind(initialized);
2919 __ push(qtos); 2923 __ push(qtos);
2920 } else { 2924 } else {
2921 pop_and_check_object(obj); 2925 pop_and_check_object(obj);
2926 __ andl(flags2, ConstantPoolCacheEntry::field_index_mask);
2922 call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::qgetfield), 2927 call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::qgetfield),
2923 obj, off); 2928 obj, flags2);
2924 __ verify_oop(rax); 2929 __ verify_oop(rax);
2925 __ push(qtos); 2930 __ push(qtos);
2926 // Bytecode rewrite? 2931 // Bytecode rewrite?
2927 } 2932 }
2928 __ jmp(Done); 2933 __ jmp(Done);
3173 const Register index = rdx; 3178 const Register index = rdx;
3174 const Register obj = rcx; 3179 const Register obj = rcx;
3175 const Register off = rbx; 3180 const Register off = rbx;
3176 const Register flags = rax; 3181 const Register flags = rax;
3177 const Register bc = LP64_ONLY(c_rarg3) NOT_LP64(rcx); 3182 const Register bc = LP64_ONLY(c_rarg3) NOT_LP64(rcx);
3183 const Register flags2 = rdx;
3178 3184
3179 resolve_cache_and_index(byte_no, cache, index, sizeof(u2)); 3185 resolve_cache_and_index(byte_no, cache, index, sizeof(u2));
3180 jvmti_post_field_mod(cache, index, is_static); 3186 jvmti_post_field_mod(cache, index, is_static);
3181 load_field_cp_cache_entry(obj, cache, index, off, flags, is_static); 3187 load_field_cp_cache_entry(obj, cache, index, off, flags, is_static);
3182 3188
3183 // [jk] not needed currently 3189 // [jk] not needed currently
3184 // volatile_barrier(Assembler::Membar_mask_bits(Assembler::LoadStore | 3190 // volatile_barrier(Assembler::Membar_mask_bits(Assembler::LoadStore |
3185 // Assembler::StoreStore)); 3191 // Assembler::StoreStore));
3186 3192
3187 Label notVolatile, Done; 3193 Label notVolatile, Done;
3188 __ movl(rdx, flags); 3194
3189 __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift); 3195 __ movl(flags2, flags);
3190 __ andl(rdx, 0x1);
3191 3196
3192 // field addresses 3197 // field addresses
3193 const Address field(obj, off, Address::times_1, 0*wordSize); 3198 const Address field(obj, off, Address::times_1, 0*wordSize);
3194 NOT_LP64( const Address hi(obj, off, Address::times_1, 1*wordSize);) 3199 NOT_LP64( const Address hi(obj, off, Address::times_1, 1*wordSize);)
3195 3200
3252 // qtos 3257 // qtos
3253 { 3258 {
3254 __ pop(qtos); // => rax == value 3259 __ pop(qtos); // => rax == value
3255 if (!is_static) { 3260 if (!is_static) {
3256 // value types in non-static fields are embedded 3261 // value types in non-static fields are embedded
3257 __ movl(rcx, off);
3258 pop_and_check_object(rbx); 3262 pop_and_check_object(rbx);
3259 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::qputfield), 3263 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::qputfield),
3260 rbx, rax, rcx); 3264 rbx, rax, flags2);
3261 __ jmp(notVolatile); // value types are never volatile 3265 __ jmp(notVolatile); // value types are never volatile
3262 } else { 3266 } else {
3263 // Store into the static field 3267 // Store into the static field
3264 // Value types in static fields are currently handled with indirection 3268 // Value types in static fields are currently handled with indirection
3265 // but a copy to the Java heap might be required if the value is currently 3269 // but a copy to the Java heap might be required if the value is currently
3266 // stored in a thread local buffer 3270 // stored in a thread local buffer
3267 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::qputstatic), rax); 3271 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::qputstatic), rax, off, obj);
3268 } 3272 }
3269 __ jmp(Done); 3273 __ jmp(Done);
3270 } 3274 }
3271 3275
3272 __ bind(notValueType); 3276 __ bind(notValueType);
3399 __ stop("Bad state"); 3403 __ stop("Bad state");
3400 #endif 3404 #endif
3401 3405
3402 __ bind(Done); 3406 __ bind(Done);
3403 3407
3408 __ shrl(flags2, ConstantPoolCacheEntry::is_volatile_shift);
3409 __ andl(flags2, 0x1);
3410
3404 // Check for volatile store 3411 // Check for volatile store
3405 __ testl(rdx, rdx); 3412 __ testl(flags2, flags2);
3406 __ jcc(Assembler::zero, notVolatile); 3413 __ jcc(Assembler::zero, notVolatile);
3407 volatile_barrier(Assembler::Membar_mask_bits(Assembler::StoreLoad | 3414 volatile_barrier(Assembler::Membar_mask_bits(Assembler::StoreLoad |
3408 Assembler::StoreStore)); 3415 Assembler::StoreStore));
3409 __ bind(notVolatile); 3416 __ bind(notVolatile);
3410 } 3417 }