< prev index next >

src/hotspot/cpu/arm/stubGenerator_arm.cpp

Print this page




 470       __ ldrex(newval, Address(dest));
 471       __ add(newval, addval, newval);
 472       __ strex(ok, newval, Address(dest));
 473       __ cmp(ok, 0);
 474       __ b(retry, ne);
 475       __ mov (R0, newval);
 476       __ membar(MEMBAR_ATOMIC_OP_POST, prev);
 477     } else {
 478       __ bind(retry);
 479       __ ldr (prev, Address(dest));
 480       __ add(newval, addval, prev);
 481       __ atomic_cas_bool(prev, newval, dest, 0, noreg/*ignored*/);
 482       __ b(retry, ne);
 483       __ mov (R0, newval);
 484     }
 485     __ bx(LR);
 486 
 487     return start;
 488   }
 489 
 490   // Support for jint Atomic::xchg(jint exchange_value, volatile jint *dest)
 491   //
 492   // Arguments :
 493   //
 494   //      exchange_value: R0
 495   //      dest:           R1
 496   //
 497   // Results:
 498   //
 499   //     R0: the value previously stored in dest
 500   //
 501   // Overwrites:
 502   //
 503   //     R1, R2, R3
 504   //
 505   address generate_atomic_xchg() {
 506     address start;
 507 
 508     StubCodeMark mark(this, "StubRoutines", "atomic_xchg");
 509     start = __ pc();
 510     Register newval    = R0;




 470       __ ldrex(newval, Address(dest));
 471       __ add(newval, addval, newval);
 472       __ strex(ok, newval, Address(dest));
 473       __ cmp(ok, 0);
 474       __ b(retry, ne);
 475       __ mov (R0, newval);
 476       __ membar(MEMBAR_ATOMIC_OP_POST, prev);
 477     } else {
 478       __ bind(retry);
 479       __ ldr (prev, Address(dest));
 480       __ add(newval, addval, prev);
 481       __ atomic_cas_bool(prev, newval, dest, 0, noreg/*ignored*/);
 482       __ b(retry, ne);
 483       __ mov (R0, newval);
 484     }
 485     __ bx(LR);
 486 
 487     return start;
 488   }
 489 
 490   // Support for jint Atomic::xchg(volatile jint *dest, jint exchange_value)
 491   //
 492   // Arguments :
 493   //
 494   //      exchange_value: R0
 495   //      dest:           R1
 496   //
 497   // Results:
 498   //
 499   //     R0: the value previously stored in dest
 500   //
 501   // Overwrites:
 502   //
 503   //     R1, R2, R3
 504   //
 505   address generate_atomic_xchg() {
 506     address start;
 507 
 508     StubCodeMark mark(this, "StubRoutines", "atomic_xchg");
 509     start = __ pc();
 510     Register newval    = R0;


< prev index next >