From a9a2be16c5dc452237da0c8d3ee104108f933de3 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Mon, 11 Sep 2017 19:07:14 -0700 Subject: [PATCH] microcode: Do not save history_register for C_call_scheme. --- src/microcode/interp.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/microcode/interp.h b/src/microcode/interp.h index 2253554f1..163a4ec49 100644 --- a/src/microcode/interp.h +++ b/src/microcode/interp.h @@ -63,6 +63,7 @@ USA. #define CHECK_RETURN_CODE(code, offset) \ ((CONT_RET (offset)) == (MAKE_RETURN_CODE (code))) +#if 0 /* Saving history is required for C_call_scheme to work correctly because the recursive call to Interpret() can rotate the history. */ @@ -72,6 +73,15 @@ USA. PRIMITIVE_APPLY (primitive); \ history_register = APFI_saved_history; \ } while (0) + +#else +/* C_call_scheme must save/restore history_register on/from the stack + so that it will be relocated if the call to Interpret() causes a + garbage collection. */ + +#define APPLY_PRIMITIVE_FROM_INTERPRETER PRIMITIVE_APPLY + +#endif /* Stack manipulation */ -- 2.25.1