diff options
author | Mike Pall <mike> | 2010-09-13 21:19:33 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2010-09-13 21:19:33 +0200 |
commit | dcfc385bf39747eb90555db8bfe496516ece4dc8 (patch) | |
tree | dedf4d630b048857729cd4394ddc78a61b8f45d1 /src | |
parent | cd6a45760aa977968b4196c60d2d50952d34eb2a (diff) | |
download | luajit-dcfc385bf39747eb90555db8bfe496516ece4dc8.tar.gz luajit-dcfc385bf39747eb90555db8bfe496516ece4dc8.tar.bz2 luajit-dcfc385bf39747eb90555db8bfe496516ece4dc8.zip |
PPC: Fix write barrier and linkage for BC_USETV/BC_USETS.
Some older linkers can't rearrange to accomodate R_PPC_REL14.
Diffstat (limited to 'src')
-rw-r--r-- | src/buildvm_ppc.dasc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/buildvm_ppc.dasc b/src/buildvm_ppc.dasc index 77e9b1ab..6633bb21 100644 --- a/src/buildvm_ppc.dasc +++ b/src/buildvm_ppc.dasc | |||
@@ -1480,24 +1480,25 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1480 | | lbz TMP3, UPVAL:RB->marked | 1480 | | lbz TMP3, UPVAL:RB->marked |
1481 | | lwz CARG2, UPVAL:RB->v | 1481 | | lwz CARG2, UPVAL:RB->v |
1482 | | andi. TMP3, TMP3, LJ_GC_BLACK // isblack(uv) | 1482 | | andi. TMP3, TMP3, LJ_GC_BLACK // isblack(uv) |
1483 | | lbz TMP2, UPVAL:RB->closed | 1483 | | lbz TMP0, UPVAL:RB->closed |
1484 | | evmergehi TMP0, TMP1, TMP1 | 1484 | | evmergehi TMP2, TMP1, TMP1 |
1485 | | evstdd TMP1, 0(CARG2) | 1485 | | evstdd TMP1, 0(CARG2) |
1486 | | cmplwi cr1, TMP2, 0 | 1486 | | cmplwi cr1, TMP0, 0 |
1487 | | cror 4*cr0+eq, 4*cr0+eq, 4*cr1+eq | 1487 | | cror 4*cr0+eq, 4*cr0+eq, 4*cr1+eq |
1488 | | subi TMP0, TMP0, LJ_TISNUM | 1488 | | subi TMP2, TMP2, LJ_TISNUM |
1489 | | bne >2 // Upvalue is closed and black? | 1489 | | bne >2 // Upvalue is closed and black? |
1490 | |1: | 1490 | |1: |
1491 | | ins_next | 1491 | | ins_next |
1492 | | | 1492 | | |
1493 | |2: // Check if new value is collectable. | 1493 | |2: // Check if new value is collectable. |
1494 | | cmplwi TMP0, LJ_TISGCV - LJ_TISNUM | 1494 | | cmplwi TMP2, LJ_TISGCV - LJ_TISNUM |
1495 | | bge <1 // tvisgcv(v) | 1495 | | bge <1 // tvisgcv(v) |
1496 | | lbz TMP3, GCOBJ:TMP1->gch.marked | 1496 | | lbz TMP3, GCOBJ:TMP1->gch.marked |
1497 | | andi. TMP3, TMP3, LJ_GC_WHITES // iswhite(v) | 1497 | | andi. TMP3, TMP3, LJ_GC_WHITES // iswhite(v) |
1498 | | la CARG1, GG_DISP2G(DISPATCH) | 1498 | | la CARG1, GG_DISP2G(DISPATCH) |
1499 | | // Crossed a write barrier. Move the barrier forward. | 1499 | | // Crossed a write barrier. Move the barrier forward. |
1500 | | bnel extern lj_gc_barrieruv // (global_State *g, TValue *tv) | 1500 | | beq <1 |
1501 | | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv) | ||
1501 | | b <1 | 1502 | | b <1 |
1502 | break; | 1503 | break; |
1503 | case BC_USETS: | 1504 | case BC_USETS: |
@@ -1526,7 +1527,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
1526 | | crand 4*cr0+eq, 4*cr0+eq, 4*cr1+eq | 1527 | | crand 4*cr0+eq, 4*cr0+eq, 4*cr1+eq |
1527 | | la CARG1, GG_DISP2G(DISPATCH) | 1528 | | la CARG1, GG_DISP2G(DISPATCH) |
1528 | | // Crossed a write barrier. Move the barrier forward. | 1529 | | // Crossed a write barrier. Move the barrier forward. |
1529 | | bnel extern lj_gc_barrieruv // (global_State *g, TValue *tv) | 1530 | | beq <1 |
1531 | | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv) | ||
1530 | | b <1 | 1532 | | b <1 |
1531 | break; | 1533 | break; |
1532 | case BC_USETN: | 1534 | case BC_USETN: |