separate helper per array element type because there is no generic array
type, and we need to get the length of the arrays
git-svn-id: branches/jvmbackend@18501 -
only JVM constructs that are already implemented, but also ones that
will be supported in the future but that aren't implemented yet (to
make it easier to already adapt code to the future changes)
git-svn-id: branches/jvmbackend@18498 -
because creating a new scanner sets the block_type back to bt_general
(while we want to inject something in the current context)
git-svn-id: branches/jvmbackend@18493 -
current class, since constructors are not automatically inherited in
Java
o tprocdef.getcopy() implementation, which returns an (unfinished) copy
of a tprocdef. Finalise by calling symcreat.finish_copied_procdef()
o made it possible to specify an existing procdef as argument to
read_proc(), in which case it won't try to parse a procedure declaration,
but only a body and associate it with the passed procdef. This is
required for the inherited constructor support, since we cannot generate
a textual representation of inherited constructors that is guaranteed to
parse in the context of the current unit (e.g., if they use types from
a unit that is not in the uses clause of the current unit)
o folded tprocsym.find_procdef_bypara_no_rettype() into
Tprocsym.Find_procdef_bypara, by interpreting specifying nil as
retdef as not having to check the return def (required to compare
parent constructors with child constructors to see whether they
match, since the returndef will always be the current class type)
git-svn-id: branches/jvmbackend@18488 -
the types as declared in the system unit, since they can also be
used with equivalent but different types (e.g., byte vs shortint)
git-svn-id: branches/jvmbackend@18487 -
handles modifiers and adds the procdefinition. This code was
duplicated in several places (for objects and records)
* properly handle introducing artificial class constructors
(the manually constructed procdefs were wrong, now use
str_parse_method_dec)
git-svn-id: branches/jvmbackend@18482 -
parsing a routine if the localst is in fact a localsymtable, otherwise
they can be generated twice for for the staticsymtable (the localst
of the init/final code of a unit is the staticsymtable)
git-svn-id: branches/jvmbackend@18476 -
assignment-nodes. For global typed constants and typed constants/
local variable initialisers in regular functions/procedurs, the
assignments are performed in the unit initialisation code. For
those in object/record definitions and their methods, it's done
in the class constructor. Since we may not yet have parsed all
method implementations when the class constructor is parsed, part
of these may be initialised in a helper routine called from the
class constructor. The ones known when the class constructor is
parsed are inited there, because the ones marked as "final" and
declared as static class fields must be initialised in the class
constructor for Java
o new set systems_typed_constants_node_init in systems unit that
indicates that a target uses node trees to initialise typed consts
instead of an initialised data section
o mark typed constants in {$j-} mode as "final" for JVM
o mangle the name of staticvarsyms inside localtables a bit to avoid
name clashes (only with procedure names for now, no parameters yet
so can still cause problems with overloaded routines)
o after a routine has been parsed, it is now processed by
cnodeutils.wrap_proc_body(), which can add extra nodes before code
generation (used for injected the typed constant node trees)
git-svn-id: branches/jvmbackend@18475 -
* also print staticvarsyms inside localsymtables of procdefs
(used for typed constants and variable initialisers)
git-svn-id: branches/jvmbackend@18473 -
it can either generate an asmlist containing data definitions (like
it does now), or a node tree with explicit initialisation statements
(for the JVM target)
git-svn-id: branches/jvmbackend@18471 -
in a single statement, to be added later)
o the unicodestrings are internally simply java.lang.String instances
o at the language level, the unicodestrings are assignment-compatible
with java.lang.String
o constant strings can be implicitly converted to java.lang.String
o since java.lang.String is immutable, in particular changing a
single character in a string is extremely inefficient. This could
be solved by letting unicodestring map to java.lang.StringBuilder,
but that would make integration with plain Java code harder
git-svn-id: branches/jvmbackend@18470 -
o when allocating array temps for the JVM target, use the specified
"forcesize" for the first dimension, since the arraydef size may
be invalid (e.g., in case it's an array constructor)
git-svn-id: branches/jvmbackend@18468 -
asis_target_specific_typecheck, and if so get the real
definition of its pointedtype rather than of the classrefdef
itself (the latter would never be different from the original
one, since there are no formal external classrefdef definitions)
git-svn-id: branches/jvmbackend@18467 -
JLObject with the method "Free" and a virtual destructor "Destroy"
(and Free is automatically called from the "finalize" method,
which in turn is called by the JVM when the instance is collected;
note that there is no final collection before the JVM shuts down,
so it may never be called if you don't call Free explicitly yourself)
* if you don't specify an explicit ancestor for a Java class, set
the parent to TObject instead of to JLObject (for better compatibility
with regular Pascal code)
git-svn-id: branches/jvmbackend@18466 -
that of the overridden method for Java classes, since the realname
is used as method identifier (and overriding is name-based and
case-sensitive in Java)
git-svn-id: branches/jvmbackend@18464 -
o initialise class vars that need initialisations (records, arrays) in
class constructors
o treat class constructors as having a "void" resultdef rather than the
class type for JVM (maybe has to be done in general?)
o make it possible to specify pno_noleadingdollar to
tprocdef.customprocname() so it can be used for class constructors
(their name is lower cased because it mustn't conflict with other
identifiers, since their name doesn't matter anyway)
o added tsk_empty synthetic procdef kind which, as the name implies,
generates an empty body (for class generated constructors)
+ auto-generate class constructors in case a class has class vars that
need initialisation
git-svn-id: branches/jvmbackend@18462 -
and initialise global variables that are wrapped (records, arrays)
in those sections
o check whether pd.localst is assigned in dbgjasm, because it's
not for the unit initialisation routine
o moved insertbssdata() from ncgutil to ngenutil and override it
njvmutil (it does nothing in the latter, since global variables
are added as fields to the class representing the unit; the
initialisation is done in gen_initialize_code() in thlcgjvm)
o added force_init() and force_final() methods to ngenutil, so
that targets can force init/final routines separate from the
regular managed types infrastructure (used by JVM for forcing
an init section in case of records/arrays)
git-svn-id: branches/jvmbackend@18460 -
makes them uncallable from actual Java code (javac hides them), which
is not the idea (otherwise you can't e.g. create record types in Java)
git-svn-id: branches/jvmbackend@18459 -
fpcbaserecordtype for the JVM target (intercept in ncnv via new
target_specific_general_typeconv helper, handle in as/is code)
* not only check for related types in htypechk in case they are
objdefs, but always do so (records are related to jlobject/fpcbaserecord
on the JVM target)
git-svn-id: branches/jvmbackend@18458 -
use of the register (can happen if the register is unused afterwards;
remove the alloc/dealloc results in no temp being allocated for the
register, so that instruction becomes invalid)
git-svn-id: branches/jvmbackend@18455 -
happens automatically when required (for constructing arrays/records;
reference counted types don't need special treatment since everything
is garbage collected)
git-svn-id: branches/jvmbackend@18453 -