bugKawa - Bugs: bug #36847, CharSequence#hashCode

 
 

bug #36847: CharSequence#hashCode

Submitter:  Helmut Eller <ellerh>
Submitted:  Sat 14 Jul 2012 05:36:18 PM UTC
   
 
Category:  Code generation Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  bothner
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 16 Jul 2012 11:47:19 PM UTC, comment #1: 

The JVM (and the JVM Spec) allows using invokeinterface on java.lang.CharSequence.hashCode, but it looks like Dalvik doesn't.  However, javac doesn't generate invokeinterface, and it seems reasonable to follow javac here.  Fix checked in.

Per Bothner <bothner>
Group administrator
Sat 14 Jul 2012 05:36:18 PM UTC, original submission:  

This example doesn't work on Android:

 (import (only (rnrs hashtables) string-hash))
 (string-hash "foo")


The log contains this message:

I/dalvikvm(10717): Could not find method java.lang.CharSequence.hashCode, referenced from method kawa.lib.rnrs.hashtables.stringHash


The problem seems to be caused by this:

  1: invokeinterface (1 args) <InterfaceMethod java.lang.CharSequence.hashCode ()int>


CharSequence is an interface that doesn't epxlicitly define hashCode
but hashCode is defined on Object.  I guess Kawa could just as well
use invokevirtual Object#hashCode.


Helmut Eller <ellerh>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bothner (Posted a comment)
  • -email is unavailable- added by ellerh (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-07-16 bothner StatusNone Fixed
        Assigned toNone bothner
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code