4102 store_klass(t2, top); |
4102 store_klass(t2, top); |
4103 verify_oop(top); |
4103 verify_oop(top); |
4104 |
4104 |
4105 ld_ptr(G2_thread, in_bytes(JavaThread::tlab_start_offset()), t1); |
4105 ld_ptr(G2_thread, in_bytes(JavaThread::tlab_start_offset()), t1); |
4106 sub(top, t1, t1); // size of tlab's allocated portion |
4106 sub(top, t1, t1); // size of tlab's allocated portion |
4107 incr_allocated_bytes(t1, 0, t2); |
4107 incr_allocated_bytes(t1, t2, t3); |
4108 |
4108 |
4109 // refill the tlab with an eden allocation |
4109 // refill the tlab with an eden allocation |
4110 bind(do_refill); |
4110 bind(do_refill); |
4111 ld_ptr(G2_thread, in_bytes(JavaThread::tlab_size_offset()), t1); |
4111 ld_ptr(G2_thread, in_bytes(JavaThread::tlab_size_offset()), t1); |
4112 sll_ptr(t1, LogHeapWordSize, t1); |
4112 sll_ptr(t1, LogHeapWordSize, t1); |
4136 verify_tlab(); |
4136 verify_tlab(); |
4137 br(Assembler::always, false, Assembler::pt, retry); |
4137 br(Assembler::always, false, Assembler::pt, retry); |
4138 delayed()->nop(); |
4138 delayed()->nop(); |
4139 } |
4139 } |
4140 |
4140 |
4141 void MacroAssembler::incr_allocated_bytes(Register var_size_in_bytes, |
4141 void MacroAssembler::incr_allocated_bytes(RegisterOrConstant size_in_bytes, |
4142 int con_size_in_bytes, |
4142 Register t1, Register t2) { |
4143 Register t1) { |
|
4144 // Bump total bytes allocated by this thread |
4143 // Bump total bytes allocated by this thread |
4145 assert(t1->is_global(), "must be global reg"); // so all 64 bits are saved on a context switch |
4144 assert(t1->is_global(), "must be global reg"); // so all 64 bits are saved on a context switch |
4146 assert_different_registers(var_size_in_bytes, t1); |
4145 assert_different_registers(size_in_bytes.register_or_noreg(), t1, t2); |
4147 // v8 support has gone the way of the dodo |
4146 // v8 support has gone the way of the dodo |
4148 ldx(G2_thread, in_bytes(JavaThread::allocated_bytes_offset()), t1); |
4147 ldx(G2_thread, in_bytes(JavaThread::allocated_bytes_offset()), t1); |
4149 if (var_size_in_bytes->is_valid()) { |
4148 add(t1, ensure_simm13_or_reg(size_in_bytes, t2), t1); |
4150 add(t1, var_size_in_bytes, t1); |
|
4151 } else { |
|
4152 add(t1, con_size_in_bytes, t1); |
|
4153 } |
|
4154 stx(t1, G2_thread, in_bytes(JavaThread::allocated_bytes_offset())); |
4149 stx(t1, G2_thread, in_bytes(JavaThread::allocated_bytes_offset())); |
4155 } |
4150 } |
4156 |
4151 |
4157 Assembler::Condition MacroAssembler::negate_condition(Assembler::Condition cond) { |
4152 Assembler::Condition MacroAssembler::negate_condition(Assembler::Condition cond) { |
4158 switch (cond) { |
4153 switch (cond) { |