From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: MPS: native comp Date: Mon, 29 Apr 2024 05:24:47 -0400 Message-ID: References: <86le4wsj14.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18212"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 29 11:25:29 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s1NGK-0004Sc-K2 for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Apr 2024 11:25:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1NFl-0007YJ-HS; Mon, 29 Apr 2024 05:24:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1NFh-0007Y8-VA for emacs-devel@gnu.org; Mon, 29 Apr 2024 05:24:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1NFh-0004Pe-MQ; Mon, 29 Apr 2024 05:24:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=WtZTQXL8SU66CkNKCKxRcAncHlx51+PZT4PUcNjZwMk=; b=oq+cahaKAodRB4iDREKO DmK1jwZbSzNUZQ1f2tYRTXhUsRHpK3bQn1DvE02HHZd9I9Sq/wOcfrEBxBv49smTA4gD0f6kjrFWd 7XeKwf25K8wGRYsJA6rnV17xisx2wvXaFHhm/EehoTT+jeujMZ2ASxoaRZffCSaaZqNvQAmJ0vwZZ pmXG7UqxV3UX0YE7zC6U5Vb+713I3AbxUIiN2W38L+yMbyWBXmJUW29jFJ8Rtkr1NAfeNbS1kYZA2 E3tHqZZYGmCTPku5aw0zb7K+G58+jLddOpG9/DtkKZC/JvIBagdNFOwZIty0Aq8qXNJy3mX87v9P1 jFhDb0yvhgscSw==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1s1NFh-0005cs-1l; Mon, 29 Apr 2024 05:24:49 -0400 In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Mon, 29 Apr 2024 11:09:24 +0200") X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:318340 Archived-At: Gerd M=C3=B6llmann writes: > Andrea Corallo writes: > >> Gerd M=C3=B6llmann writes: >> >>> Gerd M=C3=B6llmann writes: >>> >>>> Gerd M=C3=B6llmann writes: >>>> >>>>> Then, in some way Andrea sets up Lisp_Objects for what we have in the >>>>> dylib when it is loaded and these land in data_vec. >>>> >>>> And that's exactly what's going on, from reading the code. >>>> load_static_obj gets a pointer to text represention of Lisp data in the >>>> dylib, and then uses Fread to make Lisp_Objects from that. >>>> >>>> Scratchign head... >>> >>> Hm, maybe... >>> >>> @Andrea: How are the Lisp_Objects created in load_static_obj referenced >>> from the code? There must be a step that puts them into the machine >>> code, right? Probably the "relocs" that are used there. >>> >>> If that's the case (and I'm almost sure), then we need to make these >>> objects immovable. >>> >>> That was a nice puzzle! >> >> Oh yes that's correct! If MPS wants to move objects referenced in ELN >> files it needs to update what every elns has in his own data_relocs >> array! (Or make them immovale indeed). >> >> ATM in the CU we refence those objects only to have the GC not collect >> them. > > struct Lisp_Native_Comp_Unit > { > /* STUFFS WE DO NOT DUMP!! */ > Lisp_Object *data_imp_relocs; > > Are these the ones? Almost, this is a similar class of immediates, but the ones we do not dump. > IIRC, and without looking at the code, this points > into the dylib, right? If that's the case, we could scan them > ambiguously, and they'd be kept alive and wouldn't move. The object we are discussing is part of the class that gets set here: comp.c:5413 for (EMACS_INT i =3D 0; i < d_vec_len; i++ data_relocs[i] =3D AREF (comp_u->data_vec, i); This is the action you correctly imagined of "putting them into the machine code". Andrea