2296 ) {
2297 b(slow_case);
2298 }
2299
2300 void MacroAssembler::tlab_allocate(
2301 Register obj, // result: pointer to object after successful allocation
2302 Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise
2303 int con_size_in_bytes, // object size in bytes if known at compile time
2304 Register t1, // temp register
2305 Label& slow_case // continuation point if fast allocation fails
2306 ) {
2307 // make sure arguments make sense
2308 assert_different_registers(obj, var_size_in_bytes, t1);
2309 assert(0 <= con_size_in_bytes && is_simm13(con_size_in_bytes), "illegal object size");
2310 assert((con_size_in_bytes & MinObjAlignmentInBytesMask) == 0, "object size is not multiple of alignment");
2311
2312 const Register new_top = t1;
2313 //verify_tlab(); not implemented
2314
2315 ld(obj, in_bytes(JavaThread::tlab_top_offset()), R16_thread);
2316 ld(R0, in_bytes(JavaThread::tlab_end_offset()), R16_thread);
2317 if (var_size_in_bytes == noreg) {
2318 addi(new_top, obj, con_size_in_bytes);
2319 } else {
2320 add(new_top, obj, var_size_in_bytes);
2321 }
2322 cmpld(CCR0, new_top, R0);
2323 bc_far_optimized(Assembler::bcondCRbiIs1, bi0(CCR0, Assembler::greater), slow_case);
2324
2325 #ifdef ASSERT
2326 // make sure new free pointer is properly aligned
2327 {
2328 Label L;
2329 andi_(R0, new_top, MinObjAlignmentInBytesMask);
2330 beq(CCR0, L);
2331 stop("updated TLAB free is not properly aligned", 0x934);
2332 bind(L);
2333 }
2334 #endif // ASSERT
2335
2336 // update the tlab top pointer
|
2296 ) {
2297 b(slow_case);
2298 }
2299
2300 void MacroAssembler::tlab_allocate(
2301 Register obj, // result: pointer to object after successful allocation
2302 Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise
2303 int con_size_in_bytes, // object size in bytes if known at compile time
2304 Register t1, // temp register
2305 Label& slow_case // continuation point if fast allocation fails
2306 ) {
2307 // make sure arguments make sense
2308 assert_different_registers(obj, var_size_in_bytes, t1);
2309 assert(0 <= con_size_in_bytes && is_simm13(con_size_in_bytes), "illegal object size");
2310 assert((con_size_in_bytes & MinObjAlignmentInBytesMask) == 0, "object size is not multiple of alignment");
2311
2312 const Register new_top = t1;
2313 //verify_tlab(); not implemented
2314
2315 ld(obj, in_bytes(JavaThread::tlab_top_offset()), R16_thread);
2316 ld(R0, in_bytes(JavaThread::tlab_fast_path_end_offset()), R16_thread);
2317 if (var_size_in_bytes == noreg) {
2318 addi(new_top, obj, con_size_in_bytes);
2319 } else {
2320 add(new_top, obj, var_size_in_bytes);
2321 }
2322 cmpld(CCR0, new_top, R0);
2323 bc_far_optimized(Assembler::bcondCRbiIs1, bi0(CCR0, Assembler::greater), slow_case);
2324
2325 #ifdef ASSERT
2326 // make sure new free pointer is properly aligned
2327 {
2328 Label L;
2329 andi_(R0, new_top, MinObjAlignmentInBytesMask);
2330 beq(CCR0, L);
2331 stop("updated TLAB free is not properly aligned", 0x934);
2332 bind(L);
2333 }
2334 #endif // ASSERT
2335
2336 // update the tlab top pointer
|