From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: Note on 109327 Date: Wed, 01 Aug 2012 08:34:55 +0400 Message-ID: <5018B1EF.8010909@yandex.ru> References: <5017D1D4.2050601@yandex.ru> <5017DCBE.6020606@yandex.ru> <877gtk12e1.fsf@fleche.redhat.com> <5017E2B3.1060608@yandex.ru> <87obmv1u3i.fsf@zigzag.favinet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1343795705 21811 80.91.229.3 (1 Aug 2012 04:35:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 1 Aug 2012 04:35:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thien-Thi Nguyen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 01 06:35:03 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SwQeF-0001GU-Id for ged-emacs-devel@m.gmane.org; Wed, 01 Aug 2012 06:35:03 +0200 Original-Received: from localhost ([::1]:47377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwQeE-000542-G0 for ged-emacs-devel@m.gmane.org; Wed, 01 Aug 2012 00:35:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwQeB-00053W-RT for emacs-devel@gnu.org; Wed, 01 Aug 2012 00:35:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwQeA-0005vS-Vz for emacs-devel@gnu.org; Wed, 01 Aug 2012 00:34:59 -0400 Original-Received: from forward10.mail.yandex.net ([77.88.61.49]:50193) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwQeA-0005vO-Nd for emacs-devel@gnu.org; Wed, 01 Aug 2012 00:34:58 -0400 Original-Received: from smtp6.mail.yandex.net (smtp6.mail.yandex.net [77.88.61.56]) by forward10.mail.yandex.net (Yandex) with ESMTP id 0BAD41021BA1; Wed, 1 Aug 2012 08:34:57 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1343795697; bh=1pKEiI7dmV7Q/0O98sxlaBMWZNyyKSOoxl0Dy2hoIlA=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=uma0s3NaSCXvDgLzJ08j9axbr0YpyCpSy8MAx5fhoAzL4xcM8As5e3u2UMTCvVIkj ltZNYS5s7WiAYw0qsPPISsyhQdsCzZzdl1rDDqLNUeGT6qgQqOJ1qCgxYA1jb2xHsl 7f5GEp0I+WOPyRbdvlK6PNHmPDzRCYqxqvZvZ+JY= Original-Received: from smtp6.mail.yandex.net (localhost [127.0.0.1]) by smtp6.mail.yandex.net (Yandex) with ESMTP id DBE65164075E; Wed, 1 Aug 2012 08:34:56 +0400 (MSK) Original-Received: from 231.gprs.mts.ru (231.gprs.mts.ru [213.87.133.231]) by smtp6.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Ytrm7CVm-YurO7mE3; Wed, 1 Aug 2012 08:34:56 +0400 X-Yandex-Rcpt-Suid: ttn@gnuvola.org X-Yandex-Rcpt-Suid: emacs-devel@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1343795696; bh=1pKEiI7dmV7Q/0O98sxlaBMWZNyyKSOoxl0Dy2hoIlA=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=npJiAIsZWZ82H7wGkVMbzblId5oZ77XJxSD2bWcYp7HNlY2L+tGZZiqHsY68GPn33 0pT95MlzJyOZiwqeaqDk8mL9Qa090MAGn2npKmXc5ZMbqQrZlSRThorxpQUIHed/7c Yw5o/3O63u8CQikhZoj/oqlO8bxrz0YPFqpHJIdk= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: <87obmv1u3i.fsf@zigzag.favinet> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 77.88.61.49 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152062 Archived-At: On 08/01/2012 01:47 AM, Thien-Thi Nguyen wrote: > > I think to do this well you will need separate macros for getting= > > and setting. > > Sure, but it's almost impossible to do this at once. > > Why? As an exercise, try this for 'contents' member of Lisp_Vector. > > At the very beginning, it's possible to "overestimate" barrier > assuming that each XVAR (obj, field) changes FIELD in OBJ; in the > future, reads and writes may be separated, thus giving a precise > write barrier. > > I think you're saying that you prefer to do: > > a1. substitute object access (whether LHS or RHS) w/ XVAR (obj, field) > a2. distinguish LHS (which could benefit from optimization) from RHS > a3. substitue LHS =E2=80=98XVAR (...) =3D value=E2=80=99 w/ SETVAR (obj= , field, value) > > instead of: > > b1. distinguish LHS (which could benefit from optimization) from RHS > b2. substitute LHS object access w/ SETVAR (obj, field, value) > b3. substitute RHS object access w/ XVAR (obj, field) > > Is my understanding correct? a1) is definitely the first, since this gives a base to design an "overestimated" write barrier (each XVAR (obj, field) issues the barrier). Next, it should be possible to implement generational pass for GC (which collects only an objects changed since the last collection). This is expected to be very inefficient because write barrier is hugely overestimated. Finally, it's time for a3) or b2), i.e. removing the barrier from XVAR (obj, field) and installing it only at XSETVAR (obj, field, value), thus reducing "overestimation" of the barrier. Dmitry