diff options
author | Richard Henderson | 2014-03-31 00:36:56 +0200 |
---|---|---|
committer | Richard Henderson | 2015-02-13 06:21:38 +0100 |
commit | fe700adb3db5b028b504423b946d4ee5200a8f2f (patch) | |
tree | 09389b35e12808f2eb2e2f9754e50842b7b5a799 /tcg | |
parent | tcg: Move emit of INDEX_op_end into gen_tb_end (diff) | |
download | qemu-fe700adb3db5b028b504423b946d4ee5200a8f2f.tar.gz qemu-fe700adb3db5b028b504423b946d4ee5200a8f2f.tar.xz qemu-fe700adb3db5b028b504423b946d4ee5200a8f2f.zip |
tcg: Introduce tcg_op_buf_count and tcg_op_buf_full
The method by which we count the number of ops emitted
is going to change. Abstract that away into some inlines.
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg')
-rw-r--r-- | tcg/tcg.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -537,6 +537,18 @@ struct TCGContext { extern TCGContext tcg_ctx; +/* The number of opcodes emitted so far. */ +static inline int tcg_op_buf_count(void) +{ + return tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; +} + +/* Test for whether to terminate the TB for using too many opcodes. */ +static inline bool tcg_op_buf_full(void) +{ + return tcg_op_buf_count() >= OPC_MAX_SIZE; +} + /* pool based memory allocation */ void *tcg_malloc_internal(TCGContext *s, int size); |