From nobody Mon Feb 9 02:22:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499587218837781.3607938925896; Sun, 9 Jul 2017 01:00:18 -0700 (PDT) Received: from localhost ([::1]:35285 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dU78b-0003aj-I0 for importer@patchew.org; Sun, 09 Jul 2017 04:00:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dU6zJ-0004R6-5U for qemu-devel@nongnu.org; Sun, 09 Jul 2017 03:50:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dU6zE-0002zw-G5 for qemu-devel@nongnu.org; Sun, 09 Jul 2017 03:50:41 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:53541) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dU6zE-0002zH-5C for qemu-devel@nongnu.org; Sun, 09 Jul 2017 03:50:36 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2CB2320911; Sun, 9 Jul 2017 03:50:34 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Sun, 09 Jul 2017 03:50:34 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id EA6B524254; Sun, 9 Jul 2017 03:50:33 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=MBw CryoarOodoGlSXewqYblfwB6sB5V64KMvf3BIgqg=; b=P3PTMIs/ErIzoU1M7HC dPD1LvegdWTqeV3EKW7C/MLlytXQkCSRdcieJpOGL18Ih73MjAYj+0aiRGcfK68d 9w5FRlb7TtIOEQYHa1eKcn+4eznhc1AHvFib2YNkxQUqNhoUuEWLOnB2jqwfczso A05vlJcWyQf1fKE/tUl7uoys= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=MBwCryoarOodoGlSXewqYblfwB6sB5V64KMvf3BIg qg=; b=QejWjmwvYfWCotXowr9FKdpzNQQyJvIjUiokDthQDXCreEMTJDntmLnGs 8dVC3MQ0/NbB9EYfuhhOD5uf7X5C6546GsrEOrpX2c9zx3dU70wgL6iPYOKO1uK8 6OYdpL0p6iABHInqmAyIYXCyar4nId0o4GHxAj0rZJla3MQXn/XtXtN75Z297nQw qqhIIgV1bNJJ9Iu9WD4lIrIyyQ2fv7apsZmwbgEXOOSew4fcDfMv2BdYNCdtqFvl piwMOmQlIrgeg0/pXvHH4FiCaNUp2qBYadVkwZ3L6z/SMCEGkwuciJXA3levzxuF 4OsMhTSeJ0kJVuSXxdXogrMu9riUQ== X-ME-Sender: X-Sasl-enc: UBHdqEOcYC6QTk6pBTbvQ84DZxJZjLIOl1qu6FTY3Tj0 1499586633 From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Sun, 9 Jul 2017 03:50:06 -0400 Message-Id: <1499586614-20507-15-git-send-email-cota@braap.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499586614-20507-1-git-send-email-cota@braap.org> References: <1499586614-20507-1-git-send-email-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.27 Subject: [Qemu-devel] [PATCH 14/22] tcg: take .helpers out of TCGContext X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Before TCGContext is made thread-local. The hash table becomes read-only after it is filled in, so we can save space by keeping just a global pointer to it. Signed-off-by: Emilio G. Cota Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- tcg/tcg.h | 2 -- tcg/tcg.c | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tcg/tcg.h b/tcg/tcg.h index ad2d959..4f57878 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -663,8 +663,6 @@ struct TCGContext { =20 tcg_insn_unit *code_ptr; =20 - GHashTable *helpers; - #ifdef CONFIG_PROFILER /* profiling info */ int64_t tb_count1; diff --git a/tcg/tcg.c b/tcg/tcg.c index 3559829..d9b083a 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -319,6 +319,7 @@ typedef struct TCGHelperInfo { static const TCGHelperInfo all_helpers[] =3D { #include "exec/helper-tcg.h" }; +static GHashTable *helper_table; =20 static int indirect_reg_alloc_order[ARRAY_SIZE(tcg_target_reg_alloc_order)= ]; static void process_op_defs(TCGContext *s); @@ -329,7 +330,6 @@ void tcg_context_init(TCGContext *s) TCGOpDef *def; TCGArgConstraint *args_ct; int *sorted_args; - GHashTable *helper_table; =20 memset(s, 0, sizeof(*s)); s->nb_globals =3D 0; @@ -357,7 +357,7 @@ void tcg_context_init(TCGContext *s) =20 /* Register helpers. */ /* Use g_direct_hash/equal for direct pointer comparisons on func. */ - s->helpers =3D helper_table =3D g_hash_table_new(NULL, NULL); + helper_table =3D g_hash_table_new(NULL, NULL); =20 for (i =3D 0; i < ARRAY_SIZE(all_helpers); ++i) { g_hash_table_insert(helper_table, (gpointer)all_helpers[i].func, @@ -761,7 +761,7 @@ void tcg_gen_callN(TCGContext *s, void *func, TCGArg re= t, unsigned sizemask, flags; TCGHelperInfo *info; =20 - info =3D g_hash_table_lookup(s->helpers, (gpointer)func); + info =3D g_hash_table_lookup(helper_table, (gpointer)func); flags =3D info->flags; sizemask =3D info->sizemask; =20 @@ -990,8 +990,8 @@ static char *tcg_get_arg_str_idx(TCGContext *s, char *b= uf, static inline const char *tcg_find_helper(TCGContext *s, uintptr_t val) { const char *ret =3D NULL; - if (s->helpers) { - TCGHelperInfo *info =3D g_hash_table_lookup(s->helpers, (gpointer)= val); + if (helper_table) { + TCGHelperInfo *info =3D g_hash_table_lookup(helper_table, (gpointe= r)val); if (info) { ret =3D info->name; } --=20 2.7.4