manuel-serrano / bigloo

a practical Scheme compiler
http://www-sop.inria.fr/indes/fp/Bigloo
Other
135 stars 19 forks source link

Address invalid class name issues with new versions of the JVM #62

Closed donaldsonjw closed 3 years ago

donaldsonjw commented 3 years ago

3 changes were made to address the stricter enforcement of the identifier rules in the JLS by newer jvms. The exact rules can be found at https://docs.oracle.com/javase/specs/jls/se11/html/jls-3.html#jls-3.8.

  1. jfile was modified to produce mangled qualified types when the source file name contains identifiers not supported by the JLS. Note, we are currently only doing the mangling for the base name sans extension and not all directory components.

  2. The jvm backend was modified to honor the qualified type names provided by jfile. Before this, the resulting class file was always the base name of the source file with a .class extension.

  3. When no jfile information is provided, we mangle the auto-produced qualified name, if needed.

The changes above provide the following behavior. Assuming a source file name test-case.scm containing a module named test-name with a -pbase of bigloo.test, jfile will produces the .jfile below

((test-case "bigloo.test.BgL_testzd2casezd2"))

and the class file will be bigloo/test/BgL_testzd2casezd2.class.

For the same example src file when no .jfile is provided, the jvm backend will generate a class file named BgL_testzd2casezd2.class