public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Panicz Maciej Godek <godek.maciek@gmail.com>
To: Per Bothner <per@bothner.com>
Cc: kawa@sourceware.org
Subject: Re: Building for Android
Date: Mon, 24 Oct 2022 14:01:06 +0200	[thread overview]
Message-ID: <CAMFYt2Yy0waxcsiomWC-_91eJYeYeZhJ_3wVNei_-3vb6LkOww@mail.gmail.com> (raw)
In-Reply-To: <2dfbac8a-f12f-afdb-486e-191c61eebe52@bothner.com>

[-- Attachment #1: Type: text/plain, Size: 1517 bytes --]

pon., 24 paź 2022 o 12:48 Per Bothner <per@bothner.com> napisał(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.

  reply	other threads:[~2022-10-24 12:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 14:57 Panicz Maciej Godek
2022-10-18 15:25 ` Per Bothner
2022-10-18 18:25   ` Panicz Maciej Godek
2022-10-19  9:15     ` Panicz Maciej Godek
2022-10-19 16:05       ` Per Bothner
2022-10-19 17:09         ` Panicz Maciej Godek
2022-10-20  5:35           ` Panicz Maciej Godek
2022-10-20 20:48             ` Panicz Maciej Godek
2022-10-21  5:14               ` Panicz Maciej Godek
2022-10-21 13:59                 ` Panicz Maciej Godek
2022-10-21 18:11                   ` Per Bothner
2022-10-21 19:19                     ` Panicz Maciej Godek
2022-10-21 19:31                       ` Per Bothner
2022-10-21 19:45                         ` Panicz Maciej Godek
2022-10-21 20:13                           ` Panicz Maciej Godek
2022-10-22  6:26                           ` Per Bothner
2022-10-22  9:31                             ` Panicz Maciej Godek
2022-10-22 12:08                               ` Panicz Maciej Godek
2022-10-24  7:22                                 ` Panicz Maciej Godek
2022-10-24 10:48                                   ` Per Bothner
2022-10-24 12:01                                     ` Panicz Maciej Godek [this message]
2022-10-21 18:00           ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMFYt2Yy0waxcsiomWC-_91eJYeYeZhJ_3wVNei_-3vb6LkOww@mail.gmail.com \
    --to=godek.maciek@gmail.com \
    --cc=kawa@sourceware.org \
    --cc=per@bothner.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).