From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.devel Subject: Re: Is byte-compiled code supposed to call `make-byte-code'? Date: Wed, 25 May 2016 10:53:36 +0200 Message-ID: References: <87iny3rw6r.fsf@linux-m68k.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1464166440 30620 80.91.229.3 (25 May 2016 08:54:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 May 2016 08:54:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 25 10:53:55 2016 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 1b5UZc-00035Q-Ml for ged-emacs-devel@m.gmane.org; Wed, 25 May 2016 10:53:52 +0200 Original-Received: from localhost ([::1]:58275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5UZb-0003QG-9o for ged-emacs-devel@m.gmane.org; Wed, 25 May 2016 04:53:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5UZP-0003NG-7x for emacs-devel@gnu.org; Wed, 25 May 2016 04:53:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5UZN-0004kI-GE for emacs-devel@gnu.org; Wed, 25 May 2016 04:53:38 -0400 Original-Received: from mail-oi0-x22d.google.com ([2607:f8b0:4003:c06::22d]:35085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5UZN-0004jm-AZ for emacs-devel@gnu.org; Wed, 25 May 2016 04:53:37 -0400 Original-Received: by mail-oi0-x22d.google.com with SMTP id w184so60993768oiw.2 for ; Wed, 25 May 2016 01:53:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=yKQ/zmS0E6tefMSp4HhaifWqiqfQtq1ENC50x1Kt9zE=; b=BFeQbH5uuv59veOZN3L7UFbNFnIxGeeIfByA48aBO3WxNsFjvaPkSdQjP8rkMAOvlS OOCmZHrRgGZLhgg8MhS6Yde8gpNfWKYFivYScK+3/MoAIc6lTbbcpfBR38oe0k6s5sn6 gW+X9+6iv/lIsql9i4ea9WG5qaILXol2xZ3z2XkGxlClT6SYwSfVsb0wzVZD6WT5z4Kp IHxl0q7FJYgm3RnfI72yejQbn8RrlvQsQDlUYl+S6sbI8oSdlWdDdIF6kx4lBELc/qFS t8B1L7DC1lmvrbE4tGy7hsSZ0+NLljGqWPAi6gaD9H5Z5OSiFUGmh1K7oH7I7vUTpthr Evcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=yKQ/zmS0E6tefMSp4HhaifWqiqfQtq1ENC50x1Kt9zE=; b=QcpdXNpUWxvphUf9X4/Eq+IR7LQ1bTFcmMuvEDt6S9wYr/q4tImMHUBwh9egQpVAgd mDVBVHrxoQY/MsxHLEl6SscgeuAB+BxNIrKKFly4nJRi3AB6sZ/630TlQkJ83n49489J Xvrmacb4cY7IX6K9sBpnuFpTuscQmvry+Q3zJ4kP5Yey9GEbxo5UMRXHlK1PO81h74TG Ov5hQ/aipW6pAlDlLujWX8tjaY+QWrFhaJ/tTcmiCcDTrrw9ArVGHzyL3+r/1lNOIkEG n1u+1YHv48iGQamANKIne90ZmI9bRADWroIHu27oB/5gS8RasGVivkl4cETu3KNnEkhS pgAA== X-Gm-Message-State: ALyK8tIt8qTjCn4gbsEDSb9UeSfN8FeKqDMXj+uuYWNNW8NxgGswizVQGU3KkKeb9sGYJ1Tq+cr6fGqm8H2Ypw== X-Received: by 10.202.51.130 with SMTP id z124mr1383033oiz.27.1464166416512; Wed, 25 May 2016 01:53:36 -0700 (PDT) Original-Received: by 10.202.71.150 with HTTP; Wed, 25 May 2016 01:53:36 -0700 (PDT) In-Reply-To: <87iny3rw6r.fsf@linux-m68k.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:203997 Archived-At: Andreas Schwab wrote: > But it isn't a constant, it depends on the function's argument. You are right, didn't think about it. However, given that it is a repetetive process, shouldn't all constant parts of it be moved to C level instead of bytecode, as an optimization? E.g. add (make-closure descriptor &rest constants), where descriptor would include the actual bytecode, arglist, depth and constants inherited from outer closure? Then `xxx' would disassemble to something like 0 constant mapcar 1 constant make-closure 2 constant <> 3 stack-ref <> 5 call 2 6 constant (1 2 3) 7 call 2 9 return Thus, bytecode size would decrease for closure-heavy code and speed likely improve as well. Paul