they don't have explicit side-effects, and if -Oodeadvalues (part of -O4)
is active (because it can result in the removal of range check errors,
segmentation faults, etc)
git-svn-id: trunk@22254 -
like field reordering (possible problems cracker classes) or using ebp as normal register (broken
stack traces from dump_stack)
+ niln is also valid in a cse domain
* parameters passed by reference shall have a complexity >1
* load nodes from outer scopes shall have a complexity >1
* better cse debugging
+ more node types added to cse
* consider parameters passed by reference in cse
* take care of cse in parameters in simple cases
git-svn-id: trunk@22050 -
procdef, so that the unit containing it is marked as "used" (mantis #15966)
Even better would be if the unit containing the originally found procsym
were not also marked as used, but that would require a significant
rewrite (all symbols found using symboltable helpers are automatically
marked by those routines)
git-svn-id: trunk@21501 -
and also use this code to trash local variables in inlined routines
o fixes mantis #22088
o makes it possible to also implement it for the jvm target in the future
git-svn-id: trunk@21393 -
+ implement trashing of local variables if subroutine is inlined
* fix some errors releated to interproc. gotos and inlining
+ node_count function
* inline cannot be used with iochecking and safecall calling conventions
* track inherited usage
* don't inline if inherited is used
git-svn-id: trunk@21335 -
o support for the new codepage-aware ansistrings in the jvm branch
o empty ansistrings are now always represented by a nil pointer rather than
by an empty string, because an empty string also has a code page which
can confuse code (although this will make ansistrings harder to use
in Java code)
o more string helpers code shared between the general and jvm rtl
o support for indexbyte/word in the jvm rtl (warning: first parameter
is an open array rather than an untyped parameter there, so
indexchar(pcharvar^,10,0) will be equivalent to
indexchar[pcharvar^],10,0) there, which is different from what is
intended; changing it to an untyped parameter wouldn't help though)
o default() support is not yet complete
o calling fpcres is currently broken due to limitations in
sysutils.executeprocess() regarding handling unix quoting and
the compiler using the same command lines for scripts and directly
calling external programs
o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1
to the make command line
git-svn-id: branches/jvmbackend@20887 -
copied before funcretnode because it may contain tempdeletenodes
that turn a temp to "delete on next use", with the use in the
funcretnode)
git-svn-id: branches/jvmbackend@20141 -
(= Android 4.0) java headers: java.*, javax.*, org.*, junit.*, android.*).
The RTL can also be used to target earlier versions of the Android
platform, but you manually have to take care of not using APIs that
weren't available yet. Adding separate units for separate platform
versions would only partly solve the problem, because some of the
classes used inside the system unit have also changed across
versions.
Use -Tandroid while compiling to select the Android OS as target
platform.
git-svn-id: branches/jvmbackend@19830 -
using the type name of the interface/protcol/category (they are not
entities themselves on which you can invoke those methods,
mantis #20661)
git-svn-id: trunk@19651 -
U compiler\pdecsub.pas
U compiler\symdef.pas
U compiler\pdecobj.pas
U compiler\htypechk.pas
U compiler\ncal.pas
U compiler\symtable.pas
--- Recording mergeinfo for merge of r19281 into '.':
U .
--- Merging r19282 into '.':
A tests\webtbf\tw19975.pp
--- Recording mergeinfo for merge of r19282 into '.':
G .
git-svn-id: trunk@19343 -
complex parameters passed to inlined routines on the JVM target, because
it is not possible to take the address of any kind of node on the JVM
target (temp-reference nodes work for any kind of LOC_(C)REFERENCE, but
are currently only implemented for the JVM platform)
git-svn-id: branches/jvmbackend@18905 -
their address is taken if they are normally passed by reference (since then
taking this address in the callee normally also gets the address of the
original variable rather than of a copy)
git-svn-id: branches/jvmbackend@18834 -
resultdef for internally generated method calls
* force the resulttype of methods used to build non-unicode string
constants on the JVM platform to the stringconstn's resultdef
git-svn-id: branches/jvmbackend@18832 -
a generalized version of the formal var/out/constref support (this
also fixes passing string[xyz] expressions to non-formal var/out/constref
parameters)
git-svn-id: branches/jvmbackend@18774 -
o primitive types are first boxed
o the parameter is passed inside an array of one class instance
o changing the parameter inside the routine (by assigning a value to it
like in Delphi.NET and different from regular Pascal code) will replace
this class instance (again boxing the value if required)
o on return, the class instance is extracted, unboxed if required, and
assigned back to the original location
o formal const parameters are handled without the extra array indirection,
since they cannot be changed
TODO: while writing tjvmcallparanode.handleformalcopyoutpara() I forgot that
calling getcopy on ttemprefnodes whose ttempcreatenode hasn't been copied
yet works fine, so that code is more complex than needed. Still have to
fix.
git-svn-id: branches/jvmbackend@18675 -
* use this counter to mark classes containing abstract methods as
"abstract" in the bytecode per the JVM spec
* also use the counter to short-circuit printing of all abstract
methods in a class when creating a new instance (we build the list
of abstract methods every time a new instance is created, which is
a waste of time if there are none in the first place)
git-svn-id: branches/jvmbackend@18635 -
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 -
a new customprocname() method and tprocnameoption flags (add parameter
names, add "function"/"procedure", add name of owning struct or not,
don't add the "class" prefix for class methods)
Reason: for internal use by the compiler so it can output the procdef
into something that can be fed back to the parser for reuse (seems
easier than manually constructing a new procdef, or duplicating it
inside of another objectdef)
git-svn-id: branches/jvmbackend@18426 -
since the definition-specific adorning of JVM mangled names is Jasmin-
specific, and such code has no place in symdef
* moved code to adorn JVM mangled names for Jasmin definitions to agjasmin
git-svn-id: branches/jvmbackend@18346 -
o handle them like for regular classes (return a class instance,
although this is technically not true since they don't return
anything; will be changed in the future)
o because of the previous point, make sure that we handle the
"function result" properly and don't pop too many values from
the evaluation stack when calling one constructor from another
o added "extra_pre_call_code" method used by njvmcal to insert
the "new" opcode to create the new class instance before
calling a constructor
o when a constructor does not call any other constructor (inherited
or otherwise), automatically insert a call to the inherited
parameterless constructor as required by the jvm standard)
TODO: check that *if* an inherited or other constructor is called
from another constructor, that it does so as the first statement/
call
git-svn-id: branches/jvmbackend@18328 -
support), passed through to original ncgutils version in thlcg2ll
+ thlcgobj.location_force_mem() implementation
* order parameters for jvm similar to those for i386 without fixed_stack,
so we don't need temporary paralocations
* converted most of ncgcal to thlcg
* disabled special handling for virtual methods for jvm in ncgcal, as all
invocations are name-based there
+ njvmcal with special jvm callnode support:
o always move the function result into a memory temp
o when freeing an unused function result, use a_pop(2) and adjust
the internal evaluation stack height counter
o after the call instruction, adjust the evaluation stack height counter
by subtracting the number of the pushed parameter slots, adjusted for
the slots taken up by the function result
git-svn-id: branches/jvmbackend@18325 -
whether the mangled name is for defining a symbol, or for referencing
it later (e.g. for a call or load of its address). The reason is that
on the JVM both cases are different.
+ jvmdef unit to encode types according to the JVM rules
+ tprocdef.jvmmangledname() to encode a procdef's JVM mangled name
(the common part of defining/referencing it; tprocdef.mangledname
afterwards adorns it as required)
git-svn-id: branches/jvmbackend@18288 -
overridden method, rather than to any method that can accept similar
parameters as the current one (Delphi-compatible, and corresponds to
what is described in our documentation)
* do not flag "inherited" call nodes that are not "anonymous inherited"
calls using the cnf_anon_inherited flag
git-svn-id: trunk@18162 -
the methodpointer of a call, transform it into a call to the classclass
method because otherwise it can be used before the first call to any
method of the class (such as in the packages/cocoaint/src/IvarSize test)
and this can result in crashes
git-svn-id: trunk@18124 -