[pypy-dev] SPy (almost) works in the JVM

Niko Matsakis niko at alum.mit.edu
Sat Mar 8 15:07:02 CET 2008


Just wanted to mention that I fixed several bugs holding SPy  
[Smalltalk in PyPy] back from working in the JVM.  The "mini.image"  
code now runs, but I'm not sure it does precisely the right thing, as  
the number of hash marks ("#") that are output differs in the JVM and  
CLI.  The biggest error was the fact that we were converting byte  
arrays into Java Strings using the default encoding, which I think is  
UTF-8 (or something).  The end result was that we did not read binary  
files correctly (hence the assertion errors in image decoding).

Here is the output of the JVM and the CLI on my machine:

;./targetimageloadingsmalltalk-jvm ../../lang/smalltalk/mini.image
################<pypy.lang.smalltalk.model.W_CompiledMethod object>
Going to execute 78 toplevel bytecodes
#####################################################################################################################################994035 
  bytecodes/sec; 70776 sends/sec

;./targetimageloadingsmalltalk-cli ../../lang/smalltalk/mini.image
################<pypy.lang.smalltalk.model.W_CompiledMethod object>
Going to execute 78 toplevel bytecodes
#################################################################################################################################################################################################2418379 
  bytecodes/sec; 106874 sends/sec

Anyway, getting closer...


Niko



More information about the Pypy-dev mailing list