diff options
Diffstat (limited to 'src/bytecode.c')
| -rw-r--r-- | src/bytecode.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/bytecode.c b/src/bytecode.c index e116936e55d..c3fc3100e21 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -449,6 +449,20 @@ valid_sp (struct bc_thread_state *bc, Lisp_Object *sp) | |||
| 449 | return sp < (Lisp_Object *)fp && sp + 1 >= fp->saved_fp->next_stack; | 449 | return sp < (Lisp_Object *)fp && sp + 1 >= fp->saved_fp->next_stack; |
| 450 | } | 450 | } |
| 451 | 451 | ||
| 452 | /* GCC seems to have difficulty putting important variables in | ||
| 453 | registers, so give it some heavy-handed assistance by specifying | ||
| 454 | which ones to use. Use callee-saved registers to reduce spill/fill. */ | ||
| 455 | #if __GNUC__ && !__clang__ && defined __x86_64__ | ||
| 456 | #define BC_REG_TOP asm ("rbx") | ||
| 457 | #define BC_REG_PC asm ("r12") | ||
| 458 | #elif __GNUC__ && !__clang__ && defined __aarch64__ | ||
| 459 | #define BC_REG_TOP asm ("x19") | ||
| 460 | #define BC_REG_PC asm ("x20") | ||
| 461 | #else | ||
| 462 | #define BC_REG_TOP | ||
| 463 | #define BC_REG_PC | ||
| 464 | #endif | ||
| 465 | |||
| 452 | /* Execute the byte-code in FUN. ARGS_TEMPLATE is the function arity | 466 | /* Execute the byte-code in FUN. ARGS_TEMPLATE is the function arity |
| 453 | encoded as an integer (the one in FUN is ignored), and ARGS, of | 467 | encoded as an integer (the one in FUN is ignored), and ARGS, of |
| 454 | size NARGS, should be a vector of the actual arguments. The | 468 | size NARGS, should be a vector of the actual arguments. The |
| @@ -466,8 +480,8 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, | |||
| 466 | struct bc_thread_state *bc = ¤t_thread->bc; | 480 | struct bc_thread_state *bc = ¤t_thread->bc; |
| 467 | 481 | ||
| 468 | /* Values used for the first stack record when called from C. */ | 482 | /* Values used for the first stack record when called from C. */ |
| 469 | Lisp_Object *top = NULL; | 483 | register Lisp_Object *top BC_REG_TOP = NULL; |
| 470 | unsigned char const *pc = NULL; | 484 | register unsigned char const *pc BC_REG_PC = NULL; |
| 471 | 485 | ||
| 472 | Lisp_Object bytestr = AREF (fun, CLOSURE_CODE); | 486 | Lisp_Object bytestr = AREF (fun, CLOSURE_CODE); |
| 473 | 487 | ||