1.1 --- a/src/cpu/mips/vm/macroAssembler_mips.cpp Mon Aug 06 13:27:17 2018 +0800 1.2 +++ b/src/cpu/mips/vm/macroAssembler_mips.cpp Fri Jul 27 15:17:45 2018 +0800 1.3 @@ -1983,6 +1983,10 @@ 1.4 //st_ptr(t1, top, oopDesc::klass_offset_in_bytes()); 1.5 store_klass(top, t1); 1.6 1.7 + ld_ptr(t1, thread_reg, in_bytes(JavaThread::tlab_start_offset())); 1.8 + subu(t1, top, t1); 1.9 + incr_allocated_bytes(thread_reg, t1, 0); 1.10 + 1.11 // refill the tlab with an eden allocation 1.12 bind(do_refill); 1.13 ld_ptr(t1, thread_reg, in_bytes(JavaThread::tlab_size_offset())); 1.14 @@ -2015,6 +2019,29 @@ 1.15 delayed()->nop(); 1.16 } 1.17 1.18 +void MacroAssembler::incr_allocated_bytes(Register thread, 1.19 + Register var_size_in_bytes, 1.20 + int con_size_in_bytes, 1.21 + Register t1) { 1.22 + if (!thread->is_valid()) { 1.23 +#ifndef OPT_THREAD 1.24 + assert(t1->is_valid(), "need temp reg"); 1.25 + thread = t1; 1.26 + get_thread(thread); 1.27 +#else 1.28 + thread = TREG; 1.29 +#endif 1.30 + } 1.31 + 1.32 + ld_ptr(AT, thread, in_bytes(JavaThread::allocated_bytes_offset())); 1.33 + if (var_size_in_bytes->is_valid()) { 1.34 + addu(AT, AT, var_size_in_bytes); 1.35 + } else { 1.36 + addiu(AT, AT, con_size_in_bytes); 1.37 + } 1.38 + st_ptr(AT, thread, in_bytes(JavaThread::allocated_bytes_offset())); 1.39 +} 1.40 + 1.41 static const double pi_4 = 0.7853981633974483; 1.42 1.43 // the x86 version is to clumsy, i dont think we need that fuss. maybe i'm wrong, FIXME