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: GC and stack marking Date: Wed, 21 May 2014 20:06:55 +0400 Message-ID: <537CCF1F.4040807@yandex.ru> References: <83a9add91p.fsf@gnu.org> <8338g4bd7m.fsf@gnu.org> <83wqdgntan.fsf@gnu.org> <83ppj7oniv.fsf@gnu.org> <838upvnnsq.fsf@gnu.org> <537CCCF6.6020509@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1400688484 8179 80.91.229.3 (21 May 2014 16:08:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 May 2014 16:08:04 +0000 (UTC) Cc: fabrice.popineau@gmail.com, Stefan Monnier , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 21 18:07:56 2014 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 1Wn93Y-0002rV-8C for ged-emacs-devel@m.gmane.org; Wed, 21 May 2014 18:07:52 +0200 Original-Received: from localhost ([::1]:60717 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn93X-0007lx-Hq for ged-emacs-devel@m.gmane.org; Wed, 21 May 2014 12:07:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn92u-00079l-VI for emacs-devel@gnu.org; Wed, 21 May 2014 12:07:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wn92o-0003Ar-Ux for emacs-devel@gnu.org; Wed, 21 May 2014 12:07:12 -0400 Original-Received: from forward8l.mail.yandex.net ([84.201.143.141]:49693) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn92h-00039C-Rr; Wed, 21 May 2014 12:07:00 -0400 Original-Received: from smtp9.mail.yandex.net (smtp9.mail.yandex.net [77.88.61.35]) by forward8l.mail.yandex.net (Yandex) with ESMTP id C2BF01A41890; Wed, 21 May 2014 20:06:56 +0400 (MSK) Original-Received: from smtp9.mail.yandex.net (localhost [127.0.0.1]) by smtp9.mail.yandex.net (Yandex) with ESMTP id 452B01520595; Wed, 21 May 2014 20:06:56 +0400 (MSK) Original-Received: from unknown (unknown [37.139.80.10]) by smtp9.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id QW6mepxs0A-6txOUmZl; Wed, 21 May 2014 20:06:55 +0400 (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client certificate not present) X-Yandex-Uniq: 62f29384-de32-4ee6-b7cd-f7a4c6901896 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1400688415; bh=uJjFxBgWSaeuPqf72HJ6XWyNwitqL46hB86It60K6Xc=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=HHxx6gCu2LTz+zTjbLChc4hb6XTVH7VG/9NJ4D1U2iMruNsRyn1dTgLK1GEPsyFxE fy9wnW24+kEgVgfliI3IheSUEVatXXvQlyU47jtzzlPO6wtAyKLLxOS4rUpNbsk/En TuzdFoLb6bOVmBOwnBQEFivUb0yRWC6MwdCP6RDU= Authentication-Results: smtp9.mail.yandex.net; dkim=pass header.i=@yandex.ru User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: <537CCCF6.6020509@yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 84.201.143.141 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:171995 Archived-At: On 05/21/2014 07:57 PM, Dmitry Antipov wrote: > 1) Yes, but you need ABI- and machine-specific tricks to find the stack frame boundaries. I.e. > while in mark_stack, there is no easy way to find start and end of Fgarbage_collect's stack frame. > > 2) But see GCC's __builtin_frame_address, https://gcc.gnu.org/onlinedocs/gcc/Return-Address.html. > > 3) But even if 2) works on all platforms we have to support, I don't see a reasons to complicate > GC just to avoid scanning a few tens of bytes of an extra stack frame. 4) mark_stack calls __builtin_unwind_init to save registers onto the stack. So if you stop at Fgarbage_collect's stack frame, you don't scan the frame of mark_stack too and may loose Lisp_Objects accessible from registers. Dmitry