From patchwork Mon Jun 19 18:18:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9797137 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3AE02600C5 for ; Mon, 19 Jun 2017 18:20:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10A2028456 for ; Mon, 19 Jun 2017 18:20:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0581928464; Mon, 19 Jun 2017 18:20:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BB92728456 for ; Mon, 19 Jun 2017 18:20:19 +0000 (UTC) Received: from localhost ([::1]:43822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dN1HT-0008My-Qr for patchwork-qemu-devel@patchwork.kernel.org; Mon, 19 Jun 2017 14:20:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dN1GB-0008LA-FD for qemu-devel@nongnu.org; Mon, 19 Jun 2017 14:18:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dN1GA-0002CM-LP for qemu-devel@nongnu.org; Mon, 19 Jun 2017 14:18:47 -0400 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:35263) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dN1GA-0002C1-FE for qemu-devel@nongnu.org; Mon, 19 Jun 2017 14:18:46 -0400 Received: by mail-pg0-x244.google.com with SMTP id f127so17441063pgc.2 for ; Mon, 19 Jun 2017 11:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=YWyN5gHo62UjLPOyvnzvpfJTn25ykV5dt8aXb/VMaAY=; b=oT3W9NY8c5Km95mLK7kxQohyHHEabU178YmUjiO+JFSgAV70xZMHH7/hKcHVcIleoM mha3/4M/2fVEh4keyTLiy6dzye/eppywrZFOVZkA78Jze9K4dq2q49ESX2+PsS1IvzUe v/kXSttIzEjynUmGRoxcuwSQrZzQI4yZbkJA0DkXJRFoV1bIiuMqy01Z1GUKMOERbxXH 0B/jovKT4WcbzeuGN1+CBTF6WzTFt6FXWnVXcaz0L5WyA4H827hIVO+Om1d5HRatbJyI irA0EIg2STSPikIuAGJY8kaaZduxcrs59zrZMV8VnUT/etNzjP7t+WH1/RlcBDG5zwf3 skaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=YWyN5gHo62UjLPOyvnzvpfJTn25ykV5dt8aXb/VMaAY=; b=sghNh3fJoMnYl0sM1CbDs+4ATUJNoCp7Kn/XgCcleudPOiRc5JEdhMnqllWHZbWApZ MWcy23NGjafaBVQDJ0XUxaY96y5mKHIhUAFqUFUmRDtRkXiFgfgendGMzHuY2qbSIeTp LkoJp22F1hpF11GQlBMtkfzhgmSETWmNKYStx8x1/clVaOhIVONESzMS2yNjoUIOi3Fg 06Q2Y45div34LwW71HXpDG9HZS3gfTQOUZ+fHbHprQPEeW6Tkyqf21oo/BkfOvczedPJ dsdIZ1u/NmekkSETgRYHMLSq5eK35G0EYoYLXYZCu03yq19gaxMPIvEzr57eGODJalQd SL0A== X-Gm-Message-State: AKS2vOzAAcVrcZCBDptkJbf7tWCp11w53WdP4B/KUjqZRdE+K996guY9 qf5OrYvAOTy3vzfh/a0= X-Received: by 10.84.230.137 with SMTP id e9mr31606380plk.100.1497896325476; Mon, 19 Jun 2017 11:18:45 -0700 (PDT) Received: from pike.twiddle.net (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id e63sm22917171pfb.18.2017.06.19.11.18.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jun 2017 11:18:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 19 Jun 2017 11:18:30 -0700 Message-Id: <20170619181839.25249-4-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170619181839.25249-1-rth@twiddle.net> References: <20170619181839.25249-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::244 Subject: [Qemu-devel] [PULL 03/12] translate-all: consolidate tb init in tb_gen_code 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: peter.maydell@linaro.org, "Emilio G. Cota" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Emilio G. Cota" We are partially initializing tb in tb_alloc. Instead, fully initialize it in tb_gen_code, which is tb_alloc's only caller. This saves an unnecessary write to tb->cflags. Signed-off-by: Emilio G. Cota Message-Id: <1497038122-26364-1-git-send-email-cota@braap.org> Signed-off-by: Richard Henderson --- translate-all.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/translate-all.c b/translate-all.c index bb094ad..46c5592 100644 --- a/translate-all.c +++ b/translate-all.c @@ -843,9 +843,6 @@ static TranslationBlock *tb_alloc(target_ulong pc) ctx->tbs = g_renew(TranslationBlock *, ctx->tbs, ctx->tbs_size); } ctx->tbs[ctx->nb_tbs++] = tb; - tb->pc = pc; - tb->cflags = 0; - tb->invalid = false; return tb; } @@ -1289,9 +1286,11 @@ TranslationBlock *tb_gen_code(CPUState *cpu, gen_code_buf = tcg_ctx.code_gen_ptr; tb->tc_ptr = gen_code_buf; + tb->pc = pc; tb->cs_base = cs_base; tb->flags = flags; tb->cflags = cflags; + tb->invalid = false; #ifdef CONFIG_PROFILER tcg_ctx.tb_count1++; /* includes aborted translations because of