aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2010-10-01 23:47:29 +0200
committerMike Pall <mike>2010-10-01 23:47:29 +0200
commite396bef7d8a346c6ea54191d658209ee90047276 (patch)
treee8cc05ff57a5a10942587576e080d36a54494df3 /src
parent05099f07642874dd9375259cb7c7e87ba68a4581 (diff)
downloadluajit-e396bef7d8a346c6ea54191d658209ee90047276.tar.gz
luajit-e396bef7d8a346c6ea54191d658209ee90047276.tar.bz2
luajit-e396bef7d8a346c6ea54191d658209ee90047276.zip
PPC: Add pcall() and xpcall() fast functions.
Diffstat (limited to 'src')
-rw-r--r--src/buildvm_ppc.dasc26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/buildvm_ppc.dasc b/src/buildvm_ppc.dasc
index 2fbd181f..d69d77ab 100644
--- a/src/buildvm_ppc.dasc
+++ b/src/buildvm_ppc.dasc
@@ -1032,11 +1032,31 @@ static void build_subroutines(BuildCtx *ctx)
1032 | 1032 |
1033 |//-- Base library: catch errors ---------------------------------------- 1033 |//-- Base library: catch errors ----------------------------------------
1034 | 1034 |
1035 |.ffunc_1 pcall 1035 |.ffunc pcall
1036 | NYI 1036 | cmplwi NARGS8:RC, 8
1037 | lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH)
1038 | blt ->fff_fallback
1039 | mr TMP2, BASE
1040 | la BASE, 8(BASE)
1041 | // Remember active hook before pcall.
1042 | rlwinm TMP3, TMP3, 32-HOOK_ACTIVE_SHIFT, 31, 31
1043 | subi NARGS8:RC, NARGS8:RC, 8
1044 | addi PC, TMP3, 8+FRAME_PCALL
1045 | b ->vm_call_dispatch
1037 | 1046 |
1038 |.ffunc_2 xpcall 1047 |.ffunc_2 xpcall
1039 | NYI 1048 | lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH)
1049 | mr TMP2, BASE
1050 | checkfunc CARG2 // Traceback must be a function.
1051 | checkfail ->fff_fallback
1052 | la BASE, 16(BASE)
1053 | // Remember active hook before pcall.
1054 | rlwinm TMP3, TMP3, 32-HOOK_ACTIVE_SHIFT, 31, 31
1055 | evstdd CARG2, 0(TMP2) // Swap function and traceback.
1056 | subi NARGS8:RC, NARGS8:RC, 16
1057 | evstdd CARG1, 8(TMP2)
1058 | addi PC, TMP3, 16+FRAME_PCALL
1059 | b ->vm_call_dispatch
1040 | 1060 |
1041 |//-- Coroutine library -------------------------------------------------- 1061 |//-- Coroutine library --------------------------------------------------
1042 | 1062 |