summaryrefslogtreecommitdiff
path: root/rtl/java/java_sysh.inc
Commit message (Collapse)AuthorAgeFilesLines
* * Undid last commitmichael2016-09-101-83/+8
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@34479 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Patch from Karl-Michael Schindler to prepend TMP to temp ↵michael2016-09-101-8/+83
| | | | | | filename../inc/iso7185.pp git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@34478 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Avoid line longer than 255pierre2012-06-131-1/+24
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@21600 3ad0048d-3df7-0310-abae-a5850022a9f2
* * merged trunk up to r20882jonas2012-04-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@20887 3ad0048d-3df7-0310-abae-a5850022a9f2
* + assert() support for the JVM target (currently ignores the Java classloaderjonas2012-02-201-6/+11
| | | | | | assertionStatus setting) git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@20388 3ad0048d-3df7-0310-abae-a5850022a9f2
* * catch JLRInvocationTargetException raised when using JLRMthod.invoke() tojonas2011-09-081-0/+5
| | | | | | | | | call a procvar (includes virtual constructors and virtual class methods), and raise its getCause() so that the original exception is propagated to the caller git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@19030 3ad0048d-3df7-0310-abae-a5850022a9f2
* * full implementation of all routines in rtl/inc/ustringh.inc (except forjonas2011-08-281-144/+269
| | | | | | | | | | | | | val/str for enums for now) for the JVM target: insert/delete/pos/... * use generic unicodestring helper routines where possible for the JVM target (not that many as for shortstrings since unicodestring is handled using java.lang.String) + complete widestring manager implementation for the JVM target. It uses a class with virtual methods rather than a record with function pointers for speed reasons though (since no existing widestring manager will be compatible anyway, that shouldn't cause any problems) git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18882 3ad0048d-3df7-0310-abae-a5850022a9f2
* + support for threadvars in the JVM based on JLThreadLocal; seejonas2011-08-231-1/+6
| | | | | | rtl/java/jtvarh.inc for the details git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18820 3ad0048d-3df7-0310-abae-a5850022a9f2
* * moved JLRField from jdk15 to the system unitjonas2011-08-231-6/+6
| | | | | | | | | * fixed FpcBaseProcVarType.clone: create a new method field "pointer" and set it (using the java.lang.reflect interface). Previously, the pointer to the method record was copied via the inherited clone, which meant that the original and new procvar shared it git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18816 3ad0048d-3df7-0310-abae-a5850022a9f2
* * extracted dynarray helpers from system unit into jdynarr.inc (werejonas2011-08-201-6/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the system unit for easier debugging) * disabled a bunch more feature flags by default for the JVM target * incorporate modified version of inc/systemh.inc (split into two parts: jsystemh_types.inc and jsystemh.inc, because some of the types are required for the declaration of the shortstring/ansistring/set/... classes, which in turn are required for the routine declarations) and inc/system.inc (as jsystem.inc) o moved some routines around from old to new locations based on where they appear in the common files o added a number of defines that allow skipping more common implementations in case a platform-specific one is already available * all base classes (AnsistringClass etc) are now descendants of JLObject rather than TObject, because their declaration is now parsed before TObject is known (and there's no need for them to inherit from TObject) * incorporate modified version of inc/system.inc * use the common version of generic.inc, currh.inc, gencurr.inc and genmath.inc (with small modification to those files) + addition of quite a bit of system unit functionality (halt, runerror, random, round, str() for integer types, abs, odd, endian swapping helpers, bit scanning, trigonometric functions, ln, exp, ...) o round()/trunc() for comp-types has been renamed trunc_comp() on the JVM target because their JVM signature conflicts with trunc(currency) o the unsigned versions of swapendian() and other endian helpers are not available on the JVM target because of JVM signature conflicts git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18746 3ad0048d-3df7-0310-abae-a5850022a9f2
* + import java.lang.Math in the system unitjonas2011-08-201-1/+6
| | | | | | | | | | + include mathh.inc in the system unit, implement most routines based on java.lang.Math, and use (an unmodified!) genmath for the rest - removed now obsolete jmathh.inc (was partial copy of mathh.inc) - removed commented out overrides for several math routines in njvminl (doesn't make sense to handle them inline in the compiler) git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18742 3ad0048d-3df7-0310-abae-a5850022a9f2
* * migrated java.lang.NoSuchMethodException to java_sys.incjonas2011-08-201-1/+6
| | | | | | | | | * catch java.lang.NoSuchMethodException exceptions when resolving a procvar, because java.lang.Class.getDeclaredMethod() only searches that particular class itself and not its parents -> in case we get the address of a method that's not overridden in the current class, also search the parent classes git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18730 3ad0048d-3df7-0310-abae-a5850022a9f2
* + support for procedural variables for the JVM targetjonas2011-08-201-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | o every porocedural variable type is represented by a class with one public "invoke" method whose signature matches the signature of the procvar o internally, dispatching happens via java.lang.reflect.Method.invoke(). WARNING: while this allows calling private/protected or other methods that are normally not accessible from another context, a security manger can override this. If such a security manager is installed, most procvars will cause security exceptions o such dispatching also requires that all arguments are wrapped, but that's done in the compiler-generated body of the invoke method, so that procvars can also be called conveniently from Java code o typecasting between a procedure of object and tmethod is supported, as well as Delphi-style replacing of only the method pointer via @procvar1=@procvar2. o nested procvars are not yet supported, but most of the basic infrastructure for them is already present * all units/programs now get an internal __FPC_JVM_Module_Class_Alias$ type when compiled for the JVM target, which is an "external" class that maps to the unit name. This is required to look up the JLRMethod instances for regular functions/procedures + new tabstractprocdef.copyas() method that allows to create a procvar from a procdef and vice versa git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18690 3ad0048d-3df7-0310-abae-a5850022a9f2
* + full support for sets on the JVM targetjonas2011-08-201-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | o sets of enums are handled as JUEnumSet instances, others as JUBitSet derivatives (both smallsets and varsets, to make interoperability with Java easier) o special handling of set constants: these have to be constructed at run time. In case of constants in the code, create an internal constsym to represent them. These and regular constsyms are then aliased by an another internal staticvarsym that is used to initialise them in the unit initialisation code. o until they are constructed at run time, set constants are encoded as constant Java strings (with the characters containing the set bits) o hlcgobj conversion of tcginnode.pass_generate_code() for the genjumps part (that's the only part of the generic code that's used by the JVM target) o as far as explicit typecasting support is concerned, currently the following ones are supported (both from/to setdefs): ordinal types, enums, any other set types (whose size is the same on native targets) o enum setdefs also emit signatures o overloading routines for different ordinal set types, or for different enum set types, is not supported on the JVM target git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18662 3ad0048d-3df7-0310-abae-a5850022a9f2
* * fixed external name for inner classes (must not contain the name forjonas2011-08-201-10/+30
| | | | | | | | the outer class) * migrated some types that will be required for set support from jdk15 to java_sys git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18627 3ad0048d-3df7-0310-abae-a5850022a9f2
* + generate java.lang.Enum descendant classes for Pascal enum typesjonas2011-08-201-54/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18616 3ad0048d-3df7-0310-abae-a5850022a9f2
* + ansistring support. Items of note:jonas2011-08-201-1/+11
| | | | | | | | | | | | | | | | | | | | | | o support for ansistring constants. It's done via a detour because the JVM only supports UTF-16 string constants (no array of byte or anything like that): store every ansicharacter in the lower 8 bits of an UTF-16 constant string, and at run time copy the characters to an ansistring. The alternative is to generate code that stores every character separately to an array. o the base ansistring support is implemented in a class called AnsistringClass, and an ansistring is simply an instance of this class under the hood o the compiler currently does generate nil pointers as empty ansistrings unlike for unicodestrings, where we always explicitly generate an empty string. The reason is that unicodestrings are the same as JLString and hence common for Java interoperation, while ansistrings are unlikely to be used in interaction with external Java code * fixed indentation git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18562 3ad0048d-3df7-0310-abae-a5850022a9f2
* + added several reflection classes for use in array processingjonas2011-08-201-23/+88
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18502 3ad0048d-3df7-0310-abae-a5850022a9f2
* * replaced partial manual declarations of some Java classes withjonas2011-08-201-0/+188
automatically generated full declarations by javapp, using the command line parameters: -protected java.lang.System java.lang.Object java.io.Serializable java.lang.Float java.lang.Double java.lang.String java.lang.StringBuilder java.lang.StringBuffer java.lang.CharSequence java.lang.AbstractStringBuilder java.lang.Appendable java.lang.Number java.lang.IndexOutOfBoundsException java.lang.RuntimeException java.lang.IllegalArgumentException java.lang.Exception java.lang.Throwable java.lang.LinkageError java.lang.Error java.lang.Comparable java.lang.Character java.text.Collator java.lang.Cloneable java.util.Comparator -i -o java_sys git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18422 3ad0048d-3df7-0310-abae-a5850022a9f2