From 239e9771dfc0a9138b8e8b9906aabf30b079713c Mon Sep 17 00:00:00 2001 From: "Emilio G. Cota" Date: Mon, 5 Mar 2018 03:22:14 -0500 Subject: [PATCH] tcg: define TCG_HIGHWATER Will come in handy very soon. Backports commit a505785cd221994dd3713bde860861869a059940 from qemu --- qemu/tcg/tcg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qemu/tcg/tcg.c b/qemu/tcg/tcg.c index 338cf5ef..4a2ca5b5 100644 --- a/qemu/tcg/tcg.c +++ b/qemu/tcg/tcg.c @@ -113,6 +113,8 @@ static int tcg_target_const_match(tcg_target_long val, TCGType type, static bool tcg_out_ldst_finalize(TCGContext *s); #endif +#define TCG_HIGHWATER 1024 + #if TCG_TARGET_INSN_UNIT_SIZE == 1 static QEMU_UNUSED_FUNC inline void tcg_out8(TCGContext *s, uint8_t v) { @@ -424,7 +426,7 @@ void tcg_prologue_init(TCGContext *s) /* Compute a high-water mark, at which we voluntarily flush the buffer and start over. The size here is arbitrary, significantly larger than we expect the code generation for any one opcode to require. */ - s->code_gen_highwater = s->code_gen_buffer + (total_size - 1024); + s->code_gen_highwater = s->code_gen_buffer + (total_size - TCG_HIGHWATER); // Unicorn: commented out // tcg_register_jit(s->code_gen_buffer, total_size);