Return-Path: X-Original-To: apmail-lucy-dev-archive@www.apache.org Delivered-To: apmail-lucy-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 06D7D9B7D for ; Mon, 23 Apr 2012 04:16:21 +0000 (UTC) Received: (qmail 57846 invoked by uid 500); 23 Apr 2012 04:16:20 -0000 Delivered-To: apmail-lucy-dev-archive@lucy.apache.org Received: (qmail 57641 invoked by uid 500); 23 Apr 2012 04:16:15 -0000 Mailing-List: contact dev-help@lucy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucy.apache.org Delivered-To: mailing list dev@lucy.apache.org Received: (qmail 57591 invoked by uid 99); 23 Apr 2012 04:16:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Apr 2012 04:16:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.210.50] (HELO mail-pz0-f50.google.com) (209.85.210.50) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Apr 2012 04:16:06 +0000 Received: by dakh32 with SMTP id h32so14793326dak.23 for ; Sun, 22 Apr 2012 21:15:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding :x-gm-message-state; bh=olKUbr2aEOrYXbZ00Y/WMM5mmvdICW6Y+QRpg5U0pLo=; b=bnpwMR4szvdWLOVGHunjl+QM7970Yic9eu9eBJncwTDc+P/WeeXgaEzgwrQTv9o5HH BNOdpbxHFziAqyxWUZnenAOChBan9yzRT1gW5OYY/XLP9BJwEA8X9gcBer55M8l9vT02 0CiWG5k0xFvvBl5/fP/I9xymvH2xmfihp0s/gpelBAHnUmSdWREIBDOOylvdO5I80tSK pxA4NczLDy8z4nZ7LSky20zjDyCKr6PUValI7YHLAyQVGWI8/aH4lnm5nCcjfvxdpgu0 vI7cATZg/lsCQ2iqxc/JzlV6UJeCyA3fGOMDT6409FIhziAzSUjt0gF40uPgyB38Dx8D tQAg== MIME-Version: 1.0 Received: by 10.68.221.98 with SMTP id qd2mr33235759pbc.3.1335154545896; Sun, 22 Apr 2012 21:15:45 -0700 (PDT) Received: by 10.142.239.16 with HTTP; Sun, 22 Apr 2012 21:15:45 -0700 (PDT) X-Originating-IP: [99.46.94.139] In-Reply-To: <4F941F97.4090504@aevum.de> References: <4F903955.5020608@aevum.de> <4F913440.10100@aevum.de> <4F941F97.4090504@aevum.de> Date: Sun, 22 Apr 2012 21:15:45 -0700 Message-ID: From: Marvin Humphrey To: dev@lucy.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQkzvX6D7gK10iaQy4WHUrACbGnrfSTbgugNFtAjKbCLD0rQnOfI2a1loReovjGotKt4F4g4 X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [lucy-dev] OFFSET globals On Sun, Apr 22, 2012 at 8:11 AM, Nick Wellnhofer wrot= e: > On 20/04/2012 19:44, Marvin Humphrey wrote: >> Creating OFFSET vars for every invocant/method-name combo solved that >> problem, though at the cost of considerable DLL symbol proliferation. >> However, as you point out, a mechanism to propagate the offsets was neve= r >> introduced. > > OK, I see. Then I would propose the following solution: We go back to > defining offsets only for novel methods. But we define the offset variabl= es > per-parcel even for included classes. Then we lookup the offsets of inclu= ded > methods by method name at run-time. We'll have to store a bit of method > metadata to make this work. Patch 03 in LUCY-231 already goes in that > direction. > > So a compiled extension would have something like the following in parcel= .c: > > size_t ext_Hash_fetch_OFFSET; > > ... > > void > ext_bootstrap_parcel() { > =A0 =A0ext_Hash_fetch_OFFSET > =A0 =A0 =A0 =A0=3D cfish_VTable_find_offset(LUCY_HASH, "Fetch"); > =A0 =A0... > } It's a provocative idea -- I definitely had not considered such an approach= ! > Note that the offsets of included classes are also prefixed with "ext_", = not > "lucy_". I think you need both prefixes: "Ext_Lucy_Hash_Fetch_OFFSET", or after Hash moves under Clownfish, "Ext_Cfish_Hash_Fetch_OFFSET". Otherwise you couldn't have a class named "Hash" in your extension. > Every extension will use its own private copy. This makes it possible to > hide the offset variables in the DLL. OK, so this means... * A novel method will spawn one variable for each extension, rather than = one variable for each subclass. * Or to think of it another way, each extension will duplicate the vars f= or all of its direct dependencies. (I don't believe an extension needs to dupe the vars of indirect dependencies.) * Lookups of OFFSET vars will not go through the GOT (global offset table= ). * Generating headers suddenly get more complicated, because the content derived from each .cfh file will be different for each target parcel! Plus, things like METHOD and SUPER_METHOD will require parcel-specific implementations... I think this means Lucy, which will have at least t= wo parcels eventually including a separate parcel for tests, will need to = run CFC multiple times and output into different dirs... Sounds like this would be a significant improvment in terms of DSO symbol economy over the current system. I'm wincing at how messy CFC would have to become to pull it off, though. Marvin Humphrey