Mercurial > hg > truffle
comparison src/cpu/x86/vm/assembler_x86.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 | 65149e74c706 |
children | 40c2484c09e1 |
comparison
equal
deleted
inserted
replaced
4761:65149e74c706 | 4762:069ab3f976d3 |
---|---|
4918 xorl(swap_reg, tmp_reg); | 4918 xorl(swap_reg, tmp_reg); |
4919 if (swap_reg_contains_mark) { | 4919 if (swap_reg_contains_mark) { |
4920 null_check_offset = offset(); | 4920 null_check_offset = offset(); |
4921 } | 4921 } |
4922 movl(tmp_reg, klass_addr); | 4922 movl(tmp_reg, klass_addr); |
4923 xorl(swap_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); | 4923 xorl(swap_reg, Address(tmp_reg, Klass::prototype_header_offset())); |
4924 andl(swap_reg, ~((int) markOopDesc::age_mask_in_place)); | 4924 andl(swap_reg, ~((int) markOopDesc::age_mask_in_place)); |
4925 if (need_tmp_reg) { | 4925 if (need_tmp_reg) { |
4926 pop(tmp_reg); | 4926 pop(tmp_reg); |
4927 } | 4927 } |
4928 if (counters != NULL) { | 4928 if (counters != NULL) { |
5005 if (need_tmp_reg) { | 5005 if (need_tmp_reg) { |
5006 push(tmp_reg); | 5006 push(tmp_reg); |
5007 } | 5007 } |
5008 get_thread(tmp_reg); | 5008 get_thread(tmp_reg); |
5009 movl(swap_reg, klass_addr); | 5009 movl(swap_reg, klass_addr); |
5010 orl(tmp_reg, Address(swap_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); | 5010 orl(tmp_reg, Address(swap_reg, Klass::prototype_header_offset())); |
5011 movl(swap_reg, saved_mark_addr); | 5011 movl(swap_reg, saved_mark_addr); |
5012 if (os::is_MP()) { | 5012 if (os::is_MP()) { |
5013 lock(); | 5013 lock(); |
5014 } | 5014 } |
5015 cmpxchgptr(tmp_reg, Address(obj_reg, 0)); | 5015 cmpxchgptr(tmp_reg, Address(obj_reg, 0)); |
5043 movl(swap_reg, saved_mark_addr); | 5043 movl(swap_reg, saved_mark_addr); |
5044 if (need_tmp_reg) { | 5044 if (need_tmp_reg) { |
5045 push(tmp_reg); | 5045 push(tmp_reg); |
5046 } | 5046 } |
5047 movl(tmp_reg, klass_addr); | 5047 movl(tmp_reg, klass_addr); |
5048 movl(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); | 5048 movl(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset())); |
5049 if (os::is_MP()) { | 5049 if (os::is_MP()) { |
5050 lock(); | 5050 lock(); |
5051 } | 5051 } |
5052 cmpxchgptr(tmp_reg, Address(obj_reg, 0)); | 5052 cmpxchgptr(tmp_reg, Address(obj_reg, 0)); |
5053 if (need_tmp_reg) { | 5053 if (need_tmp_reg) { |
8232 if (L_success == NULL) { L_success = &L_fallthrough; label_nulls++; } | 8232 if (L_success == NULL) { L_success = &L_fallthrough; label_nulls++; } |
8233 if (L_failure == NULL) { L_failure = &L_fallthrough; label_nulls++; } | 8233 if (L_failure == NULL) { L_failure = &L_fallthrough; label_nulls++; } |
8234 if (L_slow_path == NULL) { L_slow_path = &L_fallthrough; label_nulls++; } | 8234 if (L_slow_path == NULL) { L_slow_path = &L_fallthrough; label_nulls++; } |
8235 assert(label_nulls <= 1, "at most one NULL in the batch"); | 8235 assert(label_nulls <= 1, "at most one NULL in the batch"); |
8236 | 8236 |
8237 int sc_offset = (klassOopDesc::header_size() * HeapWordSize + | 8237 int sc_offset = in_bytes(Klass::secondary_super_cache_offset()); |
8238 Klass::secondary_super_cache_offset_in_bytes()); | 8238 int sco_offset = in_bytes(Klass::super_check_offset_offset()); |
8239 int sco_offset = (klassOopDesc::header_size() * HeapWordSize + | |
8240 Klass::super_check_offset_offset_in_bytes()); | |
8241 Address super_check_offset_addr(super_klass, sco_offset); | 8239 Address super_check_offset_addr(super_klass, sco_offset); |
8242 | 8240 |
8243 // Hacked jcc, which "knows" that L_fallthrough, at least, is in | 8241 // Hacked jcc, which "knows" that L_fallthrough, at least, is in |
8244 // range of a jccb. If this routine grows larger, reconsider at | 8242 // range of a jccb. If this routine grows larger, reconsider at |
8245 // least some of these. | 8243 // least some of these. |
8333 if (L_success == NULL) { L_success = &L_fallthrough; label_nulls++; } | 8331 if (L_success == NULL) { L_success = &L_fallthrough; label_nulls++; } |
8334 if (L_failure == NULL) { L_failure = &L_fallthrough; label_nulls++; } | 8332 if (L_failure == NULL) { L_failure = &L_fallthrough; label_nulls++; } |
8335 assert(label_nulls <= 1, "at most one NULL in the batch"); | 8333 assert(label_nulls <= 1, "at most one NULL in the batch"); |
8336 | 8334 |
8337 // a couple of useful fields in sub_klass: | 8335 // a couple of useful fields in sub_klass: |
8338 int ss_offset = (klassOopDesc::header_size() * HeapWordSize + | 8336 int ss_offset = in_bytes(Klass::secondary_supers_offset()); |
8339 Klass::secondary_supers_offset_in_bytes()); | 8337 int sc_offset = in_bytes(Klass::secondary_super_cache_offset()); |
8340 int sc_offset = (klassOopDesc::header_size() * HeapWordSize + | |
8341 Klass::secondary_super_cache_offset_in_bytes()); | |
8342 Address secondary_supers_addr(sub_klass, ss_offset); | 8338 Address secondary_supers_addr(sub_klass, ss_offset); |
8343 Address super_cache_addr( sub_klass, sc_offset); | 8339 Address super_cache_addr( sub_klass, sc_offset); |
8344 | 8340 |
8345 // Do a linear scan of the secondary super-klass chain. | 8341 // Do a linear scan of the secondary super-klass chain. |
8346 // This code is rarely used, so simplicity is a virtue here. | 8342 // This code is rarely used, so simplicity is a virtue here. |
9008 assert (Universe::heap() != NULL, "java heap should be initialized"); | 9004 assert (Universe::heap() != NULL, "java heap should be initialized"); |
9009 movl(dst, Address(src, oopDesc::klass_offset_in_bytes())); | 9005 movl(dst, Address(src, oopDesc::klass_offset_in_bytes())); |
9010 if (Universe::narrow_oop_shift() != 0) { | 9006 if (Universe::narrow_oop_shift() != 0) { |
9011 assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); | 9007 assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); |
9012 if (LogMinObjAlignmentInBytes == Address::times_8) { | 9008 if (LogMinObjAlignmentInBytes == Address::times_8) { |
9013 movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); | 9009 movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset())); |
9014 } else { | 9010 } else { |
9015 // OK to use shift since we don't need to preserve flags. | 9011 // OK to use shift since we don't need to preserve flags. |
9016 shlq(dst, LogMinObjAlignmentInBytes); | 9012 shlq(dst, LogMinObjAlignmentInBytes); |
9017 movq(dst, Address(r12_heapbase, dst, Address::times_1, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); | 9013 movq(dst, Address(r12_heapbase, dst, Address::times_1, Klass::prototype_header_offset())); |
9018 } | 9014 } |
9019 } else { | 9015 } else { |
9020 movq(dst, Address(dst, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); | 9016 movq(dst, Address(dst, Klass::prototype_header_offset())); |
9021 } | 9017 } |
9022 } else | 9018 } else |
9023 #endif | 9019 #endif |
9024 { | 9020 { |
9025 movptr(dst, Address(src, oopDesc::klass_offset_in_bytes())); | 9021 movptr(dst, Address(src, oopDesc::klass_offset_in_bytes())); |
9026 movptr(dst, Address(dst, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); | 9022 movptr(dst, Address(dst, Klass::prototype_header_offset())); |
9027 } | 9023 } |
9028 } | 9024 } |
9029 | 9025 |
9030 void MacroAssembler::store_klass(Register dst, Register src) { | 9026 void MacroAssembler::store_klass(Register dst, Register src) { |
9031 #ifdef _LP64 | 9027 #ifdef _LP64 |