122 // load object
123 movptr(obj, Address(disp_hdr, BasicObjectLock::obj_offset_in_bytes()));
124 }
125 verify_oop(obj);
126 // test if object header is pointing to the displaced header, and if so, restore
127 // the displaced header in the object - if the object header is not pointing to
128 // the displaced header, get the object header instead
129 if (os::is_MP()) MacroAssembler::lock(); // must be immediately before cmpxchg!
130 cmpxchgptr(hdr, Address(obj, hdr_offset));
131 // if the object header was not pointing to the displaced header,
132 // we do unlocking via runtime call
133 jcc(Assembler::notEqual, slow_case);
134 // done
135 bind(done);
136 }
137
138
139 // Defines obj, preserves var_size_in_bytes
140 void C1_MacroAssembler::try_allocate(Register obj, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2, Label& slow_case) {
141 if (UseTLAB) {
142 tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case);
143 } else {
144 eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case);
145 incr_allocated_bytes(noreg, var_size_in_bytes, con_size_in_bytes, t1);
146 }
147 }
148
149
150 void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register len, Register t1, Register t2) {
151 assert_different_registers(obj, klass, len);
152 if (UseBiasedLocking && !len->is_valid()) {
153 assert_different_registers(obj, klass, len, t1, t2);
154 movptr(t1, Address(klass, Klass::prototype_header_offset()));
155 movptr(Address(obj, oopDesc::mark_offset_in_bytes()), t1);
156 } else {
157 // This assumes that all prototype bits fit in an int32_t
158 movptr(Address(obj, oopDesc::mark_offset_in_bytes ()), (int32_t)(intptr_t)markOopDesc::prototype());
159 }
160 #ifdef _LP64
161 if (UseCompressedClassPointers) { // Take care not to kill klass
162 movptr(t1, klass);
163 encode_klass_not_null(t1);
164 movl(Address(obj, oopDesc::klass_offset_in_bytes()), t1);
165 } else
|
122 // load object
123 movptr(obj, Address(disp_hdr, BasicObjectLock::obj_offset_in_bytes()));
124 }
125 verify_oop(obj);
126 // test if object header is pointing to the displaced header, and if so, restore
127 // the displaced header in the object - if the object header is not pointing to
128 // the displaced header, get the object header instead
129 if (os::is_MP()) MacroAssembler::lock(); // must be immediately before cmpxchg!
130 cmpxchgptr(hdr, Address(obj, hdr_offset));
131 // if the object header was not pointing to the displaced header,
132 // we do unlocking via runtime call
133 jcc(Assembler::notEqual, slow_case);
134 // done
135 bind(done);
136 }
137
138
139 // Defines obj, preserves var_size_in_bytes
140 void C1_MacroAssembler::try_allocate(Register obj, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2, Label& slow_case) {
141 if (UseTLAB) {
142 tlab_allocate(noreg, obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case);
143 } else {
144 eden_allocate(noreg, obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case);
145 }
146 }
147
148
149 void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register len, Register t1, Register t2) {
150 assert_different_registers(obj, klass, len);
151 if (UseBiasedLocking && !len->is_valid()) {
152 assert_different_registers(obj, klass, len, t1, t2);
153 movptr(t1, Address(klass, Klass::prototype_header_offset()));
154 movptr(Address(obj, oopDesc::mark_offset_in_bytes()), t1);
155 } else {
156 // This assumes that all prototype bits fit in an int32_t
157 movptr(Address(obj, oopDesc::mark_offset_in_bytes ()), (int32_t)(intptr_t)markOopDesc::prototype());
158 }
159 #ifdef _LP64
160 if (UseCompressedClassPointers) { // Take care not to kill klass
161 movptr(t1, klass);
162 encode_klass_not_null(t1);
163 movl(Address(obj, oopDesc::klass_offset_in_bytes()), t1);
164 } else
|