From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailtransmit05.runbox.com (mailtransmit05.runbox.com [IPv6:2a0c:5a00:149::26]) by sourceware.org (Postfix) with ESMTPS id A7DD73858D20 for ; Tue, 1 Mar 2022 00:20:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A7DD73858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bothner.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bothner.com Received: from mailtransmit02.runbox ([10.9.9.162] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1nOqFJ-007sbg-CB for kawa@sourceware.org; Tue, 01 Mar 2022 01:20:05 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bothner.com ; s=selector1; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID; bh=65T0PGeeeeEmpqsOulLS+MKk186foYIMO3JEf9ZGzW0=; b=FF7+e7mn6MsGy9koA5GoJGZPvP mMXgUGBmGbVJqIVGJVaXUszzjhB9YGvkyHu4yoJZTcnU+TZJX2xVyOJbDOOHwmRLS6qGm0SNveZP7 KRHBVllvBhJ/piO4sOsTAYkI9E61s3fp9sIQvshmt+CNZBw65gGHEowULlWBbf8hn9QAsOWiMxYuu 4LVir6w1cdKJgWMzGpcd1fM4SAAskQ5vsUbuZqIG56AP32H/LusPcItAwxTQsXztyp5bwZui76/5/ Do23BCCdXBhri/GuOko8QUMTAzvMJ7qhROrX2jQw4a64rRSmEWPpSJTiF2BDZNWsyte1odJlldi0Z WoOV4SZw==; Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1nOqFI-0000kc-F7; Tue, 01 Mar 2022 01:20:04 +0100 Received: by submission03.runbox with esmtpsa [Authenticated ID (524175)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1nOqFF-0006jJ-20; Tue, 01 Mar 2022 01:20:01 +0100 Message-ID: Date: Mon, 28 Feb 2022 16:19:59 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: java.lang.RuntimeException: invoke: no method named `$000a' in class gnu.expr.PrimProcedure Content-Language: en-US To: Panicz Maciej Godek , kawa@sourceware.org References: From: Per Bothner In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: kawa@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Kawa mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2022 00:20:10 -0000 On 2/28/22 15:10, Panicz Maciej Godek via Kawa wrote: > I have a new problem. When I invoke a function, I get the following error: > > java.lang.RuntimeException: invoke: no method named `$000a' in class > gnu.expr.PrimProcedure This is an exception thrown by the 'invoke' procedure: https://www.gnu.org/software/kawa/Method-operations.html#idm45230715888224 This is a way to explicitly call a Java method. 'invoke' can appear in user-code, and sometimes the compiler generates call to it. In this case it looks like the compiler has translated some form to the equivalent of (invoke OBJECT '$000a ARGS ...). With appropriate type information about OBJECT and the ARGS, in further steps the compiler can translate this to an inline JVM invokexxx instruction, but when it doesn't have the needed type information it will invoke at run-time. The call to invoke should should up in the --debug-print-final-expr output. Probably for some reason the method $000a isn't being generated or it is generated in the wrong class. > I suppose there could be some bug in the treatment of continuations when > call/cc appears in the body of a method (but it's only a hypothesis). Could well be. Kawa will try to optimze call/cc when invoking and handling the continuation are in the same method, but because Kawa does a lot of inlining and other optimizations it could well have gotten confused. > Anyway, I wonder if Kawa provides a way of performing an early return from > a method (other than call/cc)? Well you could use exceptions: primitive-throw with try-catch. call/cc is basically compiled into that anyway, except when it can be optimized to a goto. -- --Per Bothner per@bothner.com http://per.bothner.com/