From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by sourceware.org (Postfix) with ESMTPS id 1864238561A2 for ; Mon, 24 Oct 2022 12:01:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1864238561A2 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vs1-xe35.google.com with SMTP id x66so7623527vsb.3 for ; Mon, 24 Oct 2022 05:01:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QE6v9ZK0c3WxCD4Ol9nidmVz+o/NwU163ODK0boqKDc=; b=WstSgoD/sP2JWcKV5weDiMMFqLrXm1eWG4Yt8DOxRH0jW0A3GHImlRzC5Tpk2eCIhK /zs22zk3+DdoVsLo2xjRFxlDNGaHFHghqASYOQUhKKOXKwbr8fhUOagCj8t/EWHBcTxR 7jlPUEJREuhGW9A5dFRPKBHOmyledp0srOxDG/dFxeV1aeBuvJdtG/5Y+ZCABBjeN6MB 5tqTt2M0y8OZ4PlJkPQ22EO/b8koKJEHFzFM+84eYvW/mEJhW343bb/3Z2WyYBwe0XLZ UWIUc3J0D8Rlei56lKPy0eFteHTPYG1mJEKUv8RmxbIo9qMM0XGqxOh/SItR999LTO/V Rk2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QE6v9ZK0c3WxCD4Ol9nidmVz+o/NwU163ODK0boqKDc=; b=S1tvf7s+N0zMo0mop7YWQPx01+7lLsb7INPgg6Kn+OxwMsZ5t5a1QGr9JrzfniCrqM UZt9NkxOysrM1Zjq3PFocqWDl6KHT3B3ugheeOhoQV7EPbtLUQ4+jVrXZLwKvXcIJDNb ulecNQCqUwSN2fHhR1hKGKG3gATVhKx2p4pvfeN6HOjdhJ4ZQaAYCGFR6bECIONriqwX NMUIt9jQooqxYQdS5ojfg6qPakRj8QfwW57sHLkO3VnQO33+gOfKeed0uDaQlKBIBjP0 ITvvidqFNsyEeIpFs1q6Q/IjvZtdvRdTm58QzQWke8Ip5FKo+vYhMuSMlMgceHcATMXq hDDg== X-Gm-Message-State: ACrzQf0TQFT+nLcuSDsTxh2VBB3xqFK+ipwK46Ha8PYt4XJLOyqaxNPq NAvDjYN4noM14cGYZ4g+OTmvgOya20202J5BKcm6QvwN X-Google-Smtp-Source: AMsMyM5QEbhmPlUQ17Sv34hdz5CzFC12AtSlu8ZGwOixCcw+y8DL6NLnLQkZrm8hu0MOpxOOHQixVhDaBAcc/gI5gJ0= X-Received: by 2002:a67:fd63:0:b0:3a7:7415:5070 with SMTP id h3-20020a67fd63000000b003a774155070mr15821913vsa.78.1666612879301; Mon, 24 Oct 2022 05:01:19 -0700 (PDT) MIME-Version: 1.0 References: <0986a08f-c28f-882c-8236-f5f3ecc5cb6a@bothner.com> <3077976f-5161-3069-f540-5fb79ef95665@bothner.com> <2dfbac8a-f12f-afdb-486e-191c61eebe52@bothner.com> In-Reply-To: <2dfbac8a-f12f-afdb-486e-191c61eebe52@bothner.com> From: Panicz Maciej Godek Date: Mon, 24 Oct 2022 14:01:06 +0200 Message-ID: Subject: Re: Building for Android To: Per Bothner Cc: kawa@sourceware.org Content-Type: multipart/alternative; boundary="000000000000a61ffa05ebc68c94" X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000a61ffa05ebc68c94 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable pon., 24 pa=C5=BA 2022 o 12:48 Per Bothner napisa=C5=82(a= ): > > > On 10/24/22 00:22, Panicz Maciej Godek wrote: > > I've noticed that, in my code, I've been using the names "hash-code" and > "java.lang.System:identity-hash-code". > > I think it is best to use Java names (such as identityHashCode) for things > that come from Java. > (I haven't always been consistent about that.) > It seems reasonable in principle. When I was writing that code, I read about name mangling in Kawa's documentation, and I didn't know whether I'm supposed to use Java names, mangled names or whether both forms were acceptable. So I made a guess, it worked and I left it the way it was. And, it would be reasonable to expect hash-code to be mangled as hash$Mncode in the Android build. And it would be reasonable to expect that replacing hash-code with hashCode would fix the issue - but it doesn not. It seems that: - Kawa's stack trace points to the proper hashCode function's position - but instead of simply calling the overridden hashCode method (which is implemented as (java.lang.System:identityHashCode (this))), it calls some methods from gnu.lists.AbstractSequence. I suppose there might be some inlining occurring along the way. My current bets are that either Kawa doesn't actually override the hashCode function and uses the one from AbstractSequence, or it treats some of my code as an application of the "cons" cell, and inserts a call to AbstractSequence's "get" method. --000000000000a61ffa05ebc68c94--