From 4509371f7c1533f7c3f3295052132979585370fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Sun, 29 May 2016 04:55:11 +0200 Subject: [PATCH] VM: shorter definition of emit_check --- vm/inline_cache.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/vm/inline_cache.cpp b/vm/inline_cache.cpp index 064d318707..506b2e153d 100644 --- a/vm/inline_cache.cpp +++ b/vm/inline_cache.cpp @@ -47,13 +47,8 @@ struct inline_cache_jit : public jit { /* Allocates memory */ void inline_cache_jit::emit_check(cell klass) { - cell code_template; - if (TAG(klass) == FIXNUM_TYPE) - code_template = parent->special_objects[PIC_CHECK_TAG]; - else - code_template = parent->special_objects[PIC_CHECK_TUPLE]; - - emit_with_literal(code_template, klass); + cell i = TAG(klass) == FIXNUM_TYPE ? PIC_CHECK_TAG : PIC_CHECK_TUPLE; + emit_with_literal(parent->special_objects[i], klass); } /* index: 0 = top of stack, 1 = item underneath, etc