Mercurial > hg > truffle
comparison src/cpu/x86/vm/templateTable_x86_32.cpp @ 4762:069ab3f976d3
7118863: Move sizeof(klassOopDesc) into the *Klass::*_offset_in_bytes() functions
Summary: Moved sizeof(klassOopDesc), changed the return type to ByteSize and removed the _in_bytes suffix.
Reviewed-by: never, bdelsart, coleenp, jrose
author | stefank |
---|---|
date | Wed, 07 Dec 2011 11:35:03 +0100 |
parents | fdb992d83a87 |
children | 22cee0ee8927 |
comparison
equal
deleted
inserted
replaced
4761:65149e74c706 | 4762:069ab3f976d3 |
---|---|
978 | 978 |
979 // Move subklass into EBX | 979 // Move subklass into EBX |
980 __ load_klass(rbx, rax); | 980 __ load_klass(rbx, rax); |
981 // Move superklass into EAX | 981 // Move superklass into EAX |
982 __ load_klass(rax, rdx); | 982 __ load_klass(rax, rdx); |
983 __ movptr(rax, Address(rax, sizeof(oopDesc) + objArrayKlass::element_klass_offset_in_bytes())); | 983 __ movptr(rax, Address(rax, objArrayKlass::element_klass_offset())); |
984 // Compress array+index*wordSize+12 into a single register. Frees ECX. | 984 // Compress array+index*wordSize+12 into a single register. Frees ECX. |
985 __ lea(rdx, element_address); | 985 __ lea(rdx, element_address); |
986 | 986 |
987 // Generate subtype check. Blows ECX. Resets EDI to locals. | 987 // Generate subtype check. Blows ECX. Resets EDI to locals. |
988 // Superklass in EAX. Subklass in EBX. | 988 // Superklass in EAX. Subklass in EBX. |
2031 | 2031 |
2032 if (_desc->bytecode() == Bytecodes::_return_register_finalizer) { | 2032 if (_desc->bytecode() == Bytecodes::_return_register_finalizer) { |
2033 assert(state == vtos, "only valid state"); | 2033 assert(state == vtos, "only valid state"); |
2034 __ movptr(rax, aaddress(0)); | 2034 __ movptr(rax, aaddress(0)); |
2035 __ load_klass(rdi, rax); | 2035 __ load_klass(rdi, rax); |
2036 __ movl(rdi, Address(rdi, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc))); | 2036 __ movl(rdi, Address(rdi, Klass::access_flags_offset())); |
2037 __ testl(rdi, JVM_ACC_HAS_FINALIZER); | 2037 __ testl(rdi, JVM_ACC_HAS_FINALIZER); |
2038 Label skip_register_finalizer; | 2038 Label skip_register_finalizer; |
2039 __ jcc(Assembler::zero, skip_register_finalizer); | 2039 __ jcc(Assembler::zero, skip_register_finalizer); |
2040 | 2040 |
2041 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), rax); | 2041 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), rax); |
3186 __ movptr(rcx, Address(rcx, rdx, Address::times_ptr, sizeof(constantPoolOopDesc))); | 3186 __ movptr(rcx, Address(rcx, rdx, Address::times_ptr, sizeof(constantPoolOopDesc))); |
3187 __ push(rcx); // save the contexts of klass for initializing the header | 3187 __ push(rcx); // save the contexts of klass for initializing the header |
3188 | 3188 |
3189 // make sure klass is initialized & doesn't have finalizer | 3189 // make sure klass is initialized & doesn't have finalizer |
3190 // make sure klass is fully initialized | 3190 // make sure klass is fully initialized |
3191 __ cmpl(Address(rcx, instanceKlass::init_state_offset_in_bytes() + sizeof(oopDesc)), instanceKlass::fully_initialized); | 3191 __ cmpl(Address(rcx, instanceKlass::init_state_offset()), instanceKlass::fully_initialized); |
3192 __ jcc(Assembler::notEqual, slow_case); | 3192 __ jcc(Assembler::notEqual, slow_case); |
3193 | 3193 |
3194 // get instance_size in instanceKlass (scaled to a count of bytes) | 3194 // get instance_size in instanceKlass (scaled to a count of bytes) |
3195 __ movl(rdx, Address(rcx, Klass::layout_helper_offset_in_bytes() + sizeof(oopDesc))); | 3195 __ movl(rdx, Address(rcx, Klass::layout_helper_offset())); |
3196 // test to see if it has a finalizer or is malformed in some way | 3196 // test to see if it has a finalizer or is malformed in some way |
3197 __ testl(rdx, Klass::_lh_instance_slow_path_bit); | 3197 __ testl(rdx, Klass::_lh_instance_slow_path_bit); |
3198 __ jcc(Assembler::notZero, slow_case); | 3198 __ jcc(Assembler::notZero, slow_case); |
3199 | 3199 |
3200 // | 3200 // |
3291 | 3291 |
3292 // initialize object header only. | 3292 // initialize object header only. |
3293 __ bind(initialize_header); | 3293 __ bind(initialize_header); |
3294 if (UseBiasedLocking) { | 3294 if (UseBiasedLocking) { |
3295 __ pop(rcx); // get saved klass back in the register. | 3295 __ pop(rcx); // get saved klass back in the register. |
3296 __ movptr(rbx, Address(rcx, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); | 3296 __ movptr(rbx, Address(rcx, Klass::prototype_header_offset())); |
3297 __ movptr(Address(rax, oopDesc::mark_offset_in_bytes ()), rbx); | 3297 __ movptr(Address(rax, oopDesc::mark_offset_in_bytes ()), rbx); |
3298 } else { | 3298 } else { |
3299 __ movptr(Address(rax, oopDesc::mark_offset_in_bytes ()), | 3299 __ movptr(Address(rax, oopDesc::mark_offset_in_bytes ()), |
3300 (int32_t)markOopDesc::prototype()); // header | 3300 (int32_t)markOopDesc::prototype()); // header |
3301 __ pop(rcx); // get saved klass back in the register. | 3301 __ pop(rcx); // get saved klass back in the register. |