Now that NO_OPERANDS and SINGLE_OPERAND emitter share the same function signature we can unify the two.
Signed-off-by: Pekka Enberg <penb...@cs.helsinki.fi> --- arch/x86/emit-code.c | 19 +++++-------------- 1 files changed, 5 insertions(+), 14 deletions(-) diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c index 5939c3a..bde0c75 100644 --- a/arch/x86/emit-code.c +++ b/arch/x86/emit-code.c @@ -2944,20 +2944,13 @@ void emit_jni_trampoline(struct buffer *buf, #endif /* CONFIG_X86_32 */ -typedef void (*emit_no_operands_fn)(struct insn *insn, struct buffer *); +typedef void (*emit_fn)(struct insn *insn, struct buffer *); -static void emit_no_operands(struct emitter *emitter, struct buffer *buf, struct insn *insn) +static void do_emit_insn(struct emitter *emitter, struct buffer *buf, struct insn *insn) { - emit_no_operands_fn emit = emitter->emit_fn; - emit(insn, buf); -} - -typedef void (*emit_single_operand_fn)(struct insn *, struct buffer *); + emit_fn fn = emitter->emit_fn; -static void emit_single_operand(struct emitter *emitter, struct buffer *buf, struct insn *insn) -{ - emit_single_operand_fn emit = emitter->emit_fn; - emit(insn, buf); + fn(insn, buf); } typedef void (*emit_two_operands_fn)(struct buffer *, struct operand *, struct operand *); @@ -2985,10 +2978,8 @@ static void __emit_insn(struct buffer *buf, struct basic_block *bb, emitter = &emitters[insn->type]; switch (emitter->type) { case NO_OPERANDS: - emit_no_operands(emitter, buf, insn); - break; case SINGLE_OPERAND: - emit_single_operand(emitter, buf, insn); + do_emit_insn(emitter, buf, insn); break; case TWO_OPERANDS: emit_two_operands(emitter, buf, insn); -- 1.6.0.4 ------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel