mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-05 08:09:49 +01:00
o these classes get an "enum" flag in the class files
o these classes get a class field (whose type is that same enum
class) per enum in the type, which also gets the "enum" flag
o those class fields are initialised in the class constructor
with the name of the enum and their order in the declaration
o if the enum has jumps in FPC (lowest value is not 0, or not
all values are contiguous), then we add an extra field
to hold the FPC ordinal value of the enum
o these classes get a class field valled $VALUES that contains
a reference to the aforementioned class fields in order of
declaration (= ordinal->instance mapping, JDK-mandated)
o apart from the JDK-mandated instance methods (values, valueOf),
also add FPCOrdinal (returns FPC ordinal value; same as order
of declaration in case of no jumps) instance method and FPCValueOf
(returns enum corresponding to FPC ordinal value) static class
method
o the mapping between FPC ordinals and enum instances in case of
jumps is stored in a hashmap whose size is the next prime number
greater or equal than the number of enum elements
o moved several extra JDK types to the system unit for the enum
support, and for future boxing and Java set support
o several new synthetic method identifiers to generate the enum class
methods/constructor/class constructor
o enums with jumps are ordered by FPC ordinal value in the JVM
$VALUES array so that the java.lang.Enum.doCompare() method
will properly compare them
git-svn-id: branches/jvmbackend@18616 -
|
||
|---|---|---|
| .. | ||
| astringh.inc | ||
| astrings.inc | ||
| compproc.inc | ||
| java_sys.inc | ||
| java_sysh.inc | ||
| jdk15.inc | ||
| jdk15.pas | ||
| jdynarrh.inc | ||
| jint64.inc | ||
| jmathh.inc | ||
| jrec.inc | ||
| jrech.inc | ||
| Makefile | ||
| Makefile.fpc | ||
| objpas.pp | ||
| rtl.cfg | ||
| rtti.inc | ||
| sstringh.inc | ||
| sstrings.inc | ||
| system.pp | ||
| ustringh.inc | ||
| ustrings.inc | ||