Mercurial > hg > truffle
comparison src/cpu/x86/vm/templateTable_x86_32.cpp @ 3275:bbe95b4337f1
7036960: TemplateTable::fast_aldc in templateTable_x86_64.cpp uses movptr instead of load_klass
Reviewed-by: kvn, iveresov
author | twisti |
---|---|
date | Mon, 18 Apr 2011 06:50:57 -0700 |
parents | 38fea01eb669 |
children | 08ccee2c4dbf |
comparison
equal
deleted
inserted
replaced
3274:2a23b1b5a0a8 | 3275:bbe95b4337f1 |
---|---|
411 __ verify_oop(rax); | 411 __ verify_oop(rax); |
412 } | 412 } |
413 | 413 |
414 Label L_done, L_throw_exception; | 414 Label L_done, L_throw_exception; |
415 const Register con_klass_temp = rcx; // same as Rcache | 415 const Register con_klass_temp = rcx; // same as Rcache |
416 __ movptr(con_klass_temp, Address(rax, oopDesc::klass_offset_in_bytes())); | 416 __ load_klass(con_klass_temp, rax); |
417 __ cmpptr(con_klass_temp, ExternalAddress((address)Universe::systemObjArrayKlassObj_addr())); | 417 __ cmpptr(con_klass_temp, ExternalAddress((address)Universe::systemObjArrayKlassObj_addr())); |
418 __ jcc(Assembler::notEqual, L_done); | 418 __ jcc(Assembler::notEqual, L_done); |
419 __ cmpl(Address(rax, arrayOopDesc::length_offset_in_bytes()), 0); | 419 __ cmpl(Address(rax, arrayOopDesc::length_offset_in_bytes()), 0); |
420 __ jcc(Assembler::notEqual, L_throw_exception); | 420 __ jcc(Assembler::notEqual, L_throw_exception); |
421 __ xorptr(rax, rax); | 421 __ xorptr(rax, rax); |
422 __ jmp(L_done); | 422 __ jmp(L_done); |
423 | 423 |
424 // Load the exception from the system-array which wraps it: | 424 // Load the exception from the system-array which wraps it: |
425 __ bind(L_throw_exception); | 425 __ bind(L_throw_exception); |
426 __ movptr(rax, Address(rax, arrayOopDesc::base_offset_in_bytes(T_OBJECT))); | 426 __ load_heap_oop(rax, Address(rax, arrayOopDesc::base_offset_in_bytes(T_OBJECT))); |
427 __ jump(ExternalAddress(Interpreter::throw_exception_entry())); | 427 __ jump(ExternalAddress(Interpreter::throw_exception_entry())); |
428 | 428 |
429 __ bind(L_done); | 429 __ bind(L_done); |
430 } | 430 } |
431 | 431 |
935 // do array store check - check for NULL value first | 935 // do array store check - check for NULL value first |
936 __ testptr(rax, rax); | 936 __ testptr(rax, rax); |
937 __ jcc(Assembler::zero, is_null); | 937 __ jcc(Assembler::zero, is_null); |
938 | 938 |
939 // Move subklass into EBX | 939 // Move subklass into EBX |
940 __ movptr(rbx, Address(rax, oopDesc::klass_offset_in_bytes())); | 940 __ load_klass(rbx, rax); |
941 // Move superklass into EAX | 941 // Move superklass into EAX |
942 __ movptr(rax, Address(rdx, oopDesc::klass_offset_in_bytes())); | 942 __ load_klass(rax, rdx); |
943 __ movptr(rax, Address(rax, sizeof(oopDesc) + objArrayKlass::element_klass_offset_in_bytes())); | 943 __ movptr(rax, Address(rax, sizeof(oopDesc) + objArrayKlass::element_klass_offset_in_bytes())); |
944 // Compress array+index*wordSize+12 into a single register. Frees ECX. | 944 // Compress array+index*wordSize+12 into a single register. Frees ECX. |
945 __ lea(rdx, element_address); | 945 __ lea(rdx, element_address); |
946 | 946 |
947 // Generate subtype check. Blows ECX. Resets EDI to locals. | 947 // Generate subtype check. Blows ECX. Resets EDI to locals. |
1990 assert(_desc->calls_vm(), "inconsistent calls_vm information"); // call in remove_activation | 1990 assert(_desc->calls_vm(), "inconsistent calls_vm information"); // call in remove_activation |
1991 | 1991 |
1992 if (_desc->bytecode() == Bytecodes::_return_register_finalizer) { | 1992 if (_desc->bytecode() == Bytecodes::_return_register_finalizer) { |
1993 assert(state == vtos, "only valid state"); | 1993 assert(state == vtos, "only valid state"); |
1994 __ movptr(rax, aaddress(0)); | 1994 __ movptr(rax, aaddress(0)); |
1995 __ movptr(rdi, Address(rax, oopDesc::klass_offset_in_bytes())); | 1995 __ load_klass(rdi, rax); |
1996 __ movl(rdi, Address(rdi, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc))); | 1996 __ movl(rdi, Address(rdi, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc))); |
1997 __ testl(rdi, JVM_ACC_HAS_FINALIZER); | 1997 __ testl(rdi, JVM_ACC_HAS_FINALIZER); |
1998 Label skip_register_finalizer; | 1998 Label skip_register_finalizer; |
1999 __ jcc(Assembler::zero, skip_register_finalizer); | 1999 __ jcc(Assembler::zero, skip_register_finalizer); |
2000 | 2000 |
2937 __ bind(notFinal); | 2937 __ bind(notFinal); |
2938 | 2938 |
2939 // get receiver klass | 2939 // get receiver klass |
2940 __ null_check(recv, oopDesc::klass_offset_in_bytes()); | 2940 __ null_check(recv, oopDesc::klass_offset_in_bytes()); |
2941 // Keep recv in rcx for callee expects it there | 2941 // Keep recv in rcx for callee expects it there |
2942 __ movptr(rax, Address(recv, oopDesc::klass_offset_in_bytes())); | 2942 __ load_klass(rax, recv); |
2943 __ verify_oop(rax); | 2943 __ verify_oop(rax); |
2944 | 2944 |
2945 // profile this call | 2945 // profile this call |
2946 __ profile_virtual_call(rax, rdi, rdx); | 2946 __ profile_virtual_call(rax, rdi, rdx); |
2947 | 2947 |
3017 invokevirtual_helper(rbx, rcx, rdx); | 3017 invokevirtual_helper(rbx, rcx, rdx); |
3018 __ bind(notMethod); | 3018 __ bind(notMethod); |
3019 | 3019 |
3020 // Get receiver klass into rdx - also a null check | 3020 // Get receiver klass into rdx - also a null check |
3021 __ restore_locals(); // restore rdi | 3021 __ restore_locals(); // restore rdi |
3022 __ movptr(rdx, Address(rcx, oopDesc::klass_offset_in_bytes())); | 3022 __ load_klass(rdx, rcx); |
3023 __ verify_oop(rdx); | 3023 __ verify_oop(rdx); |
3024 | 3024 |
3025 // profile this call | 3025 // profile this call |
3026 __ profile_virtual_call(rdx, rsi, rdi); | 3026 __ profile_virtual_call(rdx, rsi, rdi); |
3027 | 3027 |
3101 // %%% should make a type profile for any invokedynamic that takes a ref argument | 3101 // %%% should make a type profile for any invokedynamic that takes a ref argument |
3102 // profile this call | 3102 // profile this call |
3103 __ profile_call(rsi); | 3103 __ profile_call(rsi); |
3104 } | 3104 } |
3105 | 3105 |
3106 __ movptr(rcx_method_handle, Address(rax_callsite, __ delayed_value(java_lang_invoke_CallSite::target_offset_in_bytes, rcx))); | 3106 __ load_heap_oop(rcx_method_handle, Address(rax_callsite, __ delayed_value(java_lang_invoke_CallSite::target_offset_in_bytes, rcx))); |
3107 __ null_check(rcx_method_handle); | 3107 __ null_check(rcx_method_handle); |
3108 __ prepare_to_jump_from_interpreted(); | 3108 __ prepare_to_jump_from_interpreted(); |
3109 __ jump_to_method_handle_entry(rcx_method_handle, rdx); | 3109 __ jump_to_method_handle_entry(rcx_method_handle, rdx); |
3110 } | 3110 } |
3111 | 3111 |
3247 } else { | 3247 } else { |
3248 __ movptr(Address(rax, oopDesc::mark_offset_in_bytes ()), | 3248 __ movptr(Address(rax, oopDesc::mark_offset_in_bytes ()), |
3249 (int32_t)markOopDesc::prototype()); // header | 3249 (int32_t)markOopDesc::prototype()); // header |
3250 __ pop(rcx); // get saved klass back in the register. | 3250 __ pop(rcx); // get saved klass back in the register. |
3251 } | 3251 } |
3252 __ movptr(Address(rax, oopDesc::klass_offset_in_bytes()), rcx); // klass | 3252 __ store_klass(rax, rcx); // klass |
3253 | 3253 |
3254 { | 3254 { |
3255 SkipIfEqual skip_if(_masm, &DTraceAllocProbes, 0); | 3255 SkipIfEqual skip_if(_masm, &DTraceAllocProbes, 0); |
3256 // Trigger dtrace event for fastpath | 3256 // Trigger dtrace event for fastpath |
3257 __ push(atos); | 3257 __ push(atos); |
3322 __ bind(quicked); | 3322 __ bind(quicked); |
3323 __ mov(rdx, rax); // Save object in EDX; EAX needed for subtype check | 3323 __ mov(rdx, rax); // Save object in EDX; EAX needed for subtype check |
3324 __ movptr(rax, Address(rcx, rbx, Address::times_ptr, sizeof(constantPoolOopDesc))); | 3324 __ movptr(rax, Address(rcx, rbx, Address::times_ptr, sizeof(constantPoolOopDesc))); |
3325 | 3325 |
3326 __ bind(resolved); | 3326 __ bind(resolved); |
3327 __ movptr(rbx, Address(rdx, oopDesc::klass_offset_in_bytes())); | 3327 __ load_klass(rbx, rdx); |
3328 | 3328 |
3329 // Generate subtype check. Blows ECX. Resets EDI. Object in EDX. | 3329 // Generate subtype check. Blows ECX. Resets EDI. Object in EDX. |
3330 // Superklass in EAX. Subklass in EBX. | 3330 // Superklass in EAX. Subklass in EBX. |
3331 __ gen_subtype_check( rbx, ok_is_subtype ); | 3331 __ gen_subtype_check( rbx, ok_is_subtype ); |
3332 | 3332 |
3365 __ jcc(Assembler::equal, quicked); | 3365 __ jcc(Assembler::equal, quicked); |
3366 | 3366 |
3367 __ push(atos); | 3367 __ push(atos); |
3368 call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc) ); | 3368 call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc) ); |
3369 __ pop_ptr(rdx); | 3369 __ pop_ptr(rdx); |
3370 __ movptr(rdx, Address(rdx, oopDesc::klass_offset_in_bytes())); | 3370 __ load_klass(rdx, rdx); |
3371 __ jmp(resolved); | 3371 __ jmp(resolved); |
3372 | 3372 |
3373 // Get superklass in EAX and subklass in EDX | 3373 // Get superklass in EAX and subklass in EDX |
3374 __ bind(quicked); | 3374 __ bind(quicked); |
3375 __ movptr(rdx, Address(rax, oopDesc::klass_offset_in_bytes())); | 3375 __ load_klass(rdx, rax); |
3376 __ movptr(rax, Address(rcx, rbx, Address::times_ptr, sizeof(constantPoolOopDesc))); | 3376 __ movptr(rax, Address(rcx, rbx, Address::times_ptr, sizeof(constantPoolOopDesc))); |
3377 | 3377 |
3378 __ bind(resolved); | 3378 __ bind(resolved); |
3379 | 3379 |
3380 // Generate subtype check. Blows ECX. Resets EDI. | 3380 // Generate subtype check. Blows ECX. Resets EDI. |