Commit Graph

218 Commits

Author SHA1 Message Date
michael
a8978361dd * Fix signatures on all platforms
git-svn-id: trunk@31468 -
2015-08-31 19:36:15 +00:00
Jonas Maebe
89418d23e5 * regenerated Makefiles with Linux/AArch64 support
git-svn-id: trunk@30891 -
2015-05-20 20:15:10 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
Jonas Maebe
ff020a3be4 + "Utf8CodePointLen(pansichar,MaxLookAhead,IncludeCombiningDiacriticalMarks):
sizeint"  function that returns:
   <0: invalid sequence detected after processing "-result" bytes
   0:  incomplete (may still be valid if MaxLookAhead is increased)
   >0: sequence of result bytes forms a codepoint (+ combining diacritical
       marks if that parameter was true)

git-svn-id: trunk@30047 -
2015-03-01 17:12:17 +00:00
Tomas Hajny
db7a9950d1 * unit name changed to System (starting with uppercase 'S') for improved compatibility to Delphi - see test tobject5.pp
git-svn-id: trunk@30025 -
2015-02-27 19:00:50 +00:00
Jonas Maebe
fa328436ab * regenerated for iphonesim/x86-64
git-svn-id: trunk@29974 -
2015-02-23 22:56:41 +00:00
Jonas Maebe
3d01d4ceb1 * regenerated with Darwin/AArch64 support
git-svn-id: trunk@29950 -
2015-02-23 22:54:53 +00:00
marco
d407b668d1 * version updated to 3.1.1
git-svn-id: trunk@29399 -
2015-01-04 21:09:04 +00:00
pierre
90537e94a0 Call Errno2noutres if system call to close the handle fails in do_close for win and unix
git-svn-id: trunk@29095 -
2014-11-20 22:00:35 +00:00
michael
3563944752 * Patch to allow changing TVarRec data (bug ID 26773)
git-svn-id: trunk@28995 -
2014-11-05 22:17:54 +00:00
Jonas Maebe
079b0167fc * synchronised with latest changes to equivalent files in rtl/inc, in
particular the setstring changes

git-svn-id: trunk@28825 -
2014-10-15 20:50:07 +00:00
Jonas Maebe
8504ef3e87 * "public, alias" doesn't do anything (yet) for the jvm target, but the
original routine names are used as they appear in the Pascal code in the
     Java byte code -> fixed external reference to fpc_do_exit after r26029

git-svn-id: branches/hlcgllvm@28170 -
2014-07-05 21:30:40 +00:00
Jonas Maebe
7949bebb8d * synchronised with r28168 of trunk
git-svn-id: branches/hlcgllvm@28169 -
2014-07-05 21:30:28 +00:00
Jonas Maebe
5bc6a2e934 * synchronised JVM versions of generic include files with current generic
versions

git-svn-id: trunk@27839 -
2014-06-01 14:13:40 +00:00
Jonas Maebe
bacd303208 * synchronized with trunk up to r27758
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
pierre
3d34a8a3b0 Makefiles updated with fpcmake rev 27428
git-svn-id: trunk@27508 -
2014-04-10 09:58:17 +00:00
sergei
217bac7a0b - Removed fpc_pi_real compilerproc, it is no longer used. At least two releases (2.6.2 and 2.6.4) emit Pi directly as a constant.
git-svn-id: trunk@27500 -
2014-04-07 09:16:24 +00:00
Jonas Maebe
49ccedbff1 * r27142 for the JVM target, so its system unit compiles again
git-svn-id: trunk@27381 -
2014-03-30 16:54:59 +00:00
Jonas Maebe
e9268a0a14 * synchronised with trunk up till r26975
git-svn-id: branches/hlcgllvm@26976 -
2014-03-06 21:36:58 +00:00
sergei
d004607876 * fpc_raiseexception does not return a result.
git-svn-id: trunk@26837 -
2014-02-22 15:18:31 +00:00
yury
73c26bd6be * mipsel-android: Regenerated makefiles. From now the mipsel-android target can be built and used.
git-svn-id: trunk@26705 -
2014-02-07 12:37:17 +00:00
marco
dea2c743d5 * Initial active version of
rtl-extra : objects matrix ucomplex
   rtl-objpas: convutil(s) dateutil(s) stdconvs variants varutils
   

git-svn-id: trunk@26398 -
2014-01-05 19:20:15 +00:00
sergei
f42c1b3720 * Return dynamic arrays in parameter, this was the only managed type still returned in register. Returning managed types in registers requires catching and re-raising exceptions at callee side in order to finalize result and avoid memory leaks. While such behavior makes little difference with generic setjmp-based exception handling, it becomes very inefficient as SEH-styled exception handling is being introduced.
The new behavior is also Delphi-compatible.

git-svn-id: trunk@26180 -
2013-12-04 13:43:22 +00:00
Jonas Maebe
9e6764e443 * converted program termination to compilerproc/hlcg
git-svn-id: branches/hlcgllvm@26029 -
2013-11-11 11:14:43 +00:00
Jonas Maebe
cd92791d09 * converted unit initialization to compilerproc/hlcg
git-svn-id: branches/hlcgllvm@26028 -
2013-11-11 11:14:38 +00:00
Jonas Maebe
d4b6406e62 * fixed compilation of new str<->float code on the JVM target (patch by
Max Nazhalov) and use that code by default on the JVM target
  * adapted JVM tests for the new str<->float code similar to how the
    generic tests were adapted

git-svn-id: trunk@25954 -
2013-11-06 16:13:50 +00:00
Jonas Maebe
ee0d80ac19 * force use of real2str.inc after r25888 because it doesn't compile (yet?)
for the jvm target (mantis #25267)

git-svn-id: trunk@25910 -
2013-11-01 19:20:47 +00:00
sergei
9ad98a2c4d * Handle "SarInt64" always as internal procedure, introduced virtual method tinlinenode.first_sar that by default converts it into call to "fpc_sarint64" unless target CPU is 64-bit. This provides a point to insert target-specific optimizations.
git-svn-id: trunk@25876 -
2013-10-28 14:31:36 +00:00
nickysn
1bea98995b * regenerated fpcmake makefiles after r25642
git-svn-id: trunk@25644 -
2013-10-05 10:11:27 +00:00
sergei
b99cf8d680 * RTL: Changed 'shift' parameter of 64-bit shift helpers to CPU-native size, it doesn't have to be 64-bit because only its lower 6 bits are used. Not using 64 bit parameter improves code quality a bit.
git-svn-id: trunk@25478 -
2013-09-13 08:32:45 +00:00
Jonas Maebe
3c3ad705f1 * changed fpc_(u)char_to_shortstr() from a procedure into a function, like
the other fpc_(u)char_to_*str() routines (exception dates back to the
    time calls to these routines were still inserted "manually" in the
    compiler). Fixes the compilation of "shortstr:=widecharconstant" after
    r23613 and simplifies other code calling this helper + test

git-svn-id: branches/cpstrrtl@25428 -
2013-09-06 08:02:46 +00:00
Jonas Maebe
1a560e9875 * when concatenating ansistrings, do not map CP_NONE (rawbytestring) to
CP_ACP (defaultsystemcodepage), because if all input strings have the
    same code page then the result should also have that code page if it's
    assigned to a rawbytestring rather than getting defaultsystemcodepage
  * do not consider empty strings to determine the code page of the result
    in fpc_AnsiStr_Concat_multi(), because that will cause a different
    result than when using a sequence of fpc_AnsiStr_Concat() calls (it
    ignores empty strings to determine the result code page) and it's also
    slower
  * do not consider the run time code page of the destination string in
    fpc_AnsiStr_Concat(_multi)() because Delphi does not do so either. This
    was introduced in r19118, probably to hide another bug
  + test

git-svn-id: branches/cpstrrtl@25143 -
2013-07-19 16:33:14 +00:00
Jonas Maebe
aaa5bb48de + ToSingleByteFileSystemEncodedFileName(array of widechar) overload for more
efficient operation in certain platform's dos units (avoid
    array-of-widechar -> unicodestring conversion)

git-svn-id: branches/cpstrrtl@25138 -
2013-07-19 16:31:21 +00:00
Jonas Maebe
a5273abc9c + support for CP_OEMCP
* changed all mappings from CP_ACP to DefaultSystemCodePage to calls to the
    new TranslatePlaceholderCP() routine (which also handles CP_OEMCP)
  * removed unnecessary CP_ACP adaptations in fpc_AnsiStr_Concat_multi()
    for JVM target (now handled in the ansistring to unicodestring conversion
    routine)

git-svn-id: branches/cpstrrtl@25091 -
2013-07-12 17:18:24 +00:00
Jonas Maebe
8a4b092ab9 * made ToSingleByteFileSystemEncodedFileName(unicodestring) overridable by
target-specific code and implemented a JVM-compatible version

git-svn-id: branches/cpstrrtl@25001 -
2013-06-27 21:38:17 +00:00
Jonas Maebe
da7a67bc74 + FPCRTL_FILESYSTEM_SINGLE_BYTE_API define that is set for targets where we
use a single byte API for file system operations
  + FPCRTL_FILESYSTEM_TWO_BYTE_API define that is set for targets where we
    use a single byte API for file system operations
   o in principle, both can be set if both are supprted and implemented in
     the RTL in order to minimise conversions depending on the scenario

git-svn-id: branches/cpstrrtl@24991 -
2013-06-27 21:37:39 +00:00
Jonas Maebe
ecd3cba02b * synchronised with trunk up to r24912
o resolved conflict in updated morphos sysutils unit
   o moved code that had been added to the now deleted  sysunix.inc to the
     unix-specific block of the fpwidestring unit's init code

git-svn-id: branches/cpstrrtl@24913 -
2013-06-17 20:50:02 +00:00
paul
d90445e5ee compiler, rtl, tests: write Delphi compatible (more or less) type information for Class Reference and Pointer types (mantis #0024367)
git-svn-id: trunk@24421 -
2013-05-04 12:47:05 +00:00
pierre
78a7043352 Regenerate all Makefiles with an up-to-date fpcmake binary (dummy commit)
git-svn-id: trunk@24367 -
2013-04-29 12:30:54 +00:00
florian
3d7033d81e * Makefiles regenerated
git-svn-id: trunk@24325 -
2013-04-25 20:25:57 +00:00
Jonas Maebe
e1e11f81e3 * fixed using readstr/writestr inside routines called from the parameter
list of another readstr/writestr expression (mantis #23912)

git-svn-id: trunk@23888 -
2013-03-17 14:23:33 +00:00
florian
21c154d60a Merged r22903
git-svn-id: trunk@23757 -
2013-03-09 20:56:07 +00:00
yury
22116ce9be * Revert changes to java-related files by r23604.
git-svn-id: trunk@23606 -
2013-02-13 13:13:21 +00:00
yury
2fc220cc6c * Regenerated makefiles.
git-svn-id: branches/targetandroid@23410 -
2013-01-16 14:52:36 +00:00
yury
d26f0552a0 * Sync with trunk r23404.
* Regenerated makefiles.

git-svn-id: branches/targetandroid@23405 -
2013-01-16 13:21:51 +00:00
Jonas Maebe
9777699c70 * fixed compilation for targets with internal stack checking after r23325
* added (commented out) fpc_stackcheck() compilerproc to java version of
    compproc.inc

git-svn-id: trunk@23326 -
2013-01-06 15:51:46 +00:00
Jonas Maebe
69c29a415f * pass the procdef to getintparaloc instead of only the proccalloption, so
that the type of the parameters can be determined automatically
   o added compilerproc declarations for all helpers called in the compiler
     via their assembler name, so we can look up the corresponding procdef

git-svn-id: trunk@23325 -
2013-01-06 15:05:40 +00:00
Jonas Maebe
7c578c3541 * made the pascal name of the string range checking helpers match
their assembler name

git-svn-id: trunk@23324 -
2013-01-06 15:05:33 +00:00
Jonas Maebe
4ea78538e4 * enabled threading feature for jvm target so that rtl/inc/genmath.inc
compiles again there (it's possible to take the address of arbitrary
    threadvars on the jvm platform, but not of arbitrary other variables)
  - disabled inclusion of generic thread manager and threadvar support
    on the jvm target if the threading feature is enabled

git-svn-id: trunk@23322 -
2013-01-06 15:05:24 +00:00
Jonas Maebe
fe5a4baa15 - removed FPC 2.4 bootstrapping support
git-svn-id: trunk@23321 -
2013-01-06 15:05:20 +00:00
Jonas Maebe
14b1c8a99c * moved fpc_threadvar_relocate_proc from systemh.inc to thread.inc
and gave it the correct type (TRelocateThreadVarHandler)
  * changed parameter type of InitThread also to TRelocateThreadVarHandler

git-svn-id: trunk@23130 -
2012-12-09 22:42:46 +00:00
Jeppe Johansen
3ee29eb219 Fixed ARMv7-EM code generation and RTL compilation
Added LM4F120H5 controller type and startup code

git-svn-id: branches/laksen/arm-embedded@22903 -
2012-11-01 17:25:01 +00:00
Jonas Maebe
d40d207552 * workaround because "public,alias" isn't supported yet on JVM targets
git-svn-id: trunk@22495 -
2012-09-28 08:15:05 +00:00
Jonas Maebe
21e162604c * fixed "make install" for jvm targets
+ implemented top level "make (cross)zipinstall" for jvm targets
    (mantis #23005)

git-svn-id: trunk@22493 -
2012-09-27 21:35:17 +00:00
Jonas Maebe
598d2feeb6 + rtldefs.inc file for every target that contains defines shared by multiple
RTL units. Comes with a FPCRTL_FILESYSTEM_UTF8 define that can be
    activated for targets whose single byte filesystem interface enforces
    UTF-8; included in inc/systemh.inc and unix/cwstring.pp until now
  + DefaultFileSystemCodePage variable that holds the code page used for
    communicating with the OS single byte file system APIs, and for the
    strings returned by those same APIs. Initialized with
   o the result of GetACP in the system unit of Windows platforms, except for
     WinCE which uses UTF-8 since its file system OS API calls already use
     the UTF-16 versions
   o CP_UTF8 on Unix platforms with FPCRTL_FILESYSTEM_UTF8 defined, and with
     DefaultSystemCodePage on other Unix platforms
   o DefaultSystemCodePage on Java/Android JVM targets
  + DefaultRTLFileSystemCodePage variable that holds the code page used to
    encode strings returned by RTL routines that return filenames obtained
    from OS API calls. By default the same as DefaultFileSystemCodePage on
    all platforms. Separate from DefaultFileSystemCodePage for clarity on
    platforms that may use either utf-16 or single byte OS API calls to
    send/receive file names (such as most Windows platforms)
  + new scpFileSystemSingleByte enum that can be passed to
    GetStandardCodePage() to get the default code page for OS single byte file
    system APIs, with implementations for Unix and Windows
  + SetMultiByteFileSystemCodePage() procedure to override the value of
    DefaultFileSystemCodePage

  In principle, in the long run unchanged programs only using generic
  ansistrings and unicodestrings should (mostly) behave the same as in
  FPC 2.6.0 as far as RTL-level file system APIs are concerned if
  they set DefaultFileSystemCodePage and DefaultRTLFileSystemCodePage
  to DefaultSystemCodePage at the start of their execution

git-svn-id: branches/cpstrrtl@22466 -
2012-09-27 07:54:06 +00:00
Jonas Maebe
91d92c4732 * make ansistring unique when changing the code page without conversion
(like on other platforms)

git-svn-id: trunk@22463 -
2012-09-26 19:48:37 +00:00
Jonas Maebe
f2e1ec2771 * merged changes to systemh.inc/compproc.inc from r22289/r22290/r22310
git-svn-id: trunk@22349 -
2012-09-06 21:41:35 +00:00
florian
9be3ca04ad * split FPC_HAS_INTERNAL_BSX_* defines into FPC_HAS_INTERNAL_BSF_* and FPC_HAS_INTERNAL_BSR_*
git-svn-id: trunk@22308 -
2012-09-04 12:56:18 +00:00
Jonas Maebe
060e3ed4ee * changes from r21697, 21707, 21843, 21861, 21701, 21887, 21899 and 21900
to systemh.inc/system.inc/compproc.inc 'merged' into as of yet still
    JVM-specific copies of those files

git-svn-id: trunk@22125 -
2012-08-19 13:51:15 +00:00
Jonas Maebe
504544e173 * fixed null-termination in StringToWideChar() if the buffer is larger than
the string (mantis #22669)

git-svn-id: trunk@22124 -
2012-08-19 13:48:02 +00:00
tom_at_work
f252fd369e Tried to reorganize the ARM define mess in rtl/arm/arm.inc. Instead of requiring to enumerate all possible ARM variants each time a CPU feature is used, add a define of the format CPUARM_HAS_XXX and use that. Note that a better solution would be to properly implement the compiler cpuinfo infrastructure, however that is much more work.
+ CPUARM_HAS_BX is defined if the CPU supports the BX* instruction
  + CPUARM_HAS_REV is defined if the CPU supports the REV instruction. Note that you still have to check for compiler versions > 2.6.0 since the assembler reader of 2.6.0 does not understand that instruction.
  + CPUARM_HAS_IDIV is defined if the CPU supports the sdiv, udiv instructions. Use of this fixes a bug where previously these instruction were only used for armv7-m, while cortex3m cpus also support it.
  + CPUARM_HAS_LDREX is defined if the CPU supports the ldrex/strex instructions. Use of this fixes a bug with armv7(-a) cpus where this path has not been used.
  + SYSTEM_HAS_KUSER_CMPXCHG is defined if the system (mainly OS) support the kuser_cmpxchg functions. Use of this fixes a bug where ARMHF systems did not use it for synchronization (although ARMHF is armv7+ only, i.e. the LDREX path is used anyway)

git-svn-id: trunk@22081 -
2012-08-14 19:45:03 +00:00
tom_at_work
810adb2f65 Merge with trunk r22040. Regenerated makefiles.
git-svn-id: branches/targetandroid@22046 -
2012-08-09 08:12:34 +00:00
Jonas Maebe
56fcc87cb2 * add get_frame as an internal symbol for the jvm target because that target
defines INTERNAL_BACKTRACE (which assumes get_frame to be internal rather
    than a system unit procedure)
  * changed fpc_assert() declaration for jvm to be the same as for other
    targets, so the same code can be used to call it in ninl now that's
    called from the first pass

git-svn-id: trunk@21903 -
2012-07-12 13:25:02 +00:00
Jonas Maebe
596d359e02 * use current code page when converting ansichar to unicodestring
git-svn-id: trunk@21877 -
2012-07-11 15:22:31 +00:00
Jonas Maebe
aba6923187 * moved g_test_self() from cgobj to hlcgobj
git-svn-id: trunk@21861 -
2012-07-11 08:25:51 +00:00
Jonas Maebe
595f28e6fa + AnsistringClass.Create(unicodestring) constructor that implicitly selects
the DefaultSystemCodePage for use from Java code

git-svn-id: trunk@21724 -
2012-06-27 16:13:47 +00:00
pierre
8469741700 + Added additional addr pointer parameter to
get_caller_frame, get_caller_addr and dump_stack
  with default NIL value to systemh.inc.
  + Added new get_addr function.
  system.inc: Use get_addr and get_frame to call
  HandleErrorAddrFrame instead of HandleErrorFrame
  in several error functions.
  Modify dump_stack to use frame and addr parameters.
  Provide a dummy get_addr function returning nil.
  i386/i386.inc, x86_64./x86_64.inc: Provide real
  implementation of get_addr function.

git-svn-id: trunk@21697 -
2012-06-24 21:22:09 +00:00
Jonas Maebe
7a0ae38700 + also specify the parameter def when allocating a parameter via
getintparaloc + adapted all call sites of getintparaloc. This
    led to a number of additional, related changes:
   o corrected the type information for some getintparaloc parameters
   o don't allocate some intparalocs in cases they aren't used
   o changed "const tvardata" parameter into "constref tvardata" for
     fpc_variant_copy_overwrite to make pass-by-reference semantics
     explicit
   o moved a number of routines that now have to call find_system_type()
     from cgobj to hlcgobj so that cgobj doesn't have to start depending
     on the symtable unit
   o added versions of the cpureg alloc/dealloc methods to hlcgobj that
     call through to their cgobj counter parts, so we can call save/restore
     the cpu registers before/after calling system helpers from hlcgobj
     (not implemented in hlcgobj itself, because all basic register
      allocator functionality is still part of cgobj/cgcpu)

git-svn-id: trunk@21696 -
2012-06-24 15:02:12 +00:00
masta
3d9d484bfd Remove redundant CPU-Check for FPC_HAS_INTERNAL_ABS_LONG
compiler/options.pas only defines FPC_HAS_INTERNAL_ABS_LONG for cpus
which support the intrinsic. No need to check again in the rtl.

git-svn-id: trunk@21677 -
2012-06-21 20:12:31 +00:00
pierre
212d04a69e * Avoid line longer than 255
git-svn-id: trunk@21600 -
2012-06-13 22:34:49 +00:00
Jonas Maebe
8234a842e6 * fixed conversion of empty ansistring/widestring constants to pchar on
the jvm target + test

git-svn-id: trunk@21391 -
2012-05-26 11:32:20 +00:00
Jonas Maebe
834026bfb5 * synchronised with trunk up to r21067
git-svn-id: branches/jvmbackend@21068 -
2012-04-26 21:24:20 +00:00
Jonas Maebe
0659058e44 * fixed ansistring -> pchar type conversion on JVM target now that empty
ansistrings are represented by nil
  * fixed type conversion of constant empty ansistring/unicodestring to
    pchar/pwidechar on the JVM target

git-svn-id: branches/jvmbackend@21055 -
2012-04-25 22:29:20 +00:00
Jonas Maebe
8e3d7fe8d3 * fixed genmultistringadd() optimization for jvm and enabled it
* created separate version of fpc_AnsiStr_Concat_multi() after all
    because it contains a punicodechar(unicodestring) typecast, which
    can't be supported on the JVM target (and splitting it out in the
    generic code seems like a bit overkill), and restored original
    generic version of fpc_AnsiStr_Concat_multi() (slightly faster
    than version partially adapted for jvm)

git-svn-id: branches/jvmbackend@20903 -
2012-04-16 20:51:51 +00:00
Jonas Maebe
1efee1d2eb * set destination codepage in widestringmanager.Unicode2AnsiMoveProc() like
on other platforms, rather than explicitly setting it afterwards
    everywhere

git-svn-id: branches/jvmbackend@20902 -
2012-04-16 20:51:46 +00:00
Jonas Maebe
aee5380ae0 * merged trunk up to r20882
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 -
2012-04-15 15:54:10 +00:00
Jonas Maebe
85ef5e109c + assert() support for the JVM target (currently ignores the Java classloader
assertionStatus setting)

git-svn-id: branches/jvmbackend@20388 -
2012-02-20 11:28:59 +00:00
Jonas Maebe
8b4b081ed5 * fixed fpc_tcon_shortint_array_from_string() in case the length of the array
to initialize was odd

git-svn-id: branches/jvmbackend@20210 -
2012-02-01 18:03:58 +00:00
Jonas Maebe
0d5b2b84a8 + Android/JVM target, including a translation of the Android r14 SDK
(= 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 -
2011-12-12 02:34:34 +00:00
Jonas Maebe
0e65d01274 * renamed java-specific compproc.inc to jcompproc.inc to prevent timestamp
conflicts when the compiler finds inc/compproc.inc while compiling other
   units later on

git-svn-id: branches/jvmbackend@19828 -
2011-12-12 02:34:04 +00:00
Jonas Maebe
c9e6bc8d49 + support for building jvm-java compiler/rtl via top-level
make CPU_TARGET=jvm OS_TARGET=java all
    ("make install" does not yet fully work: the classes under
     rtl/units/jvm-java/org/freepascal/rtl aren't installed yet)

git-svn-id: branches/jvmbackend@19747 -
2011-12-04 15:33:55 +00:00
Jonas Maebe
74510f9069 + generic infrastructure for target-specific switches
+ -CTcompactintarrayinit command line option to change the code generation
    for typed array of some kind of integer-type initialization so that it
    takes up less space in the bytecode (because the bytecode for all
    routines, including the class initialization code that contains the
    typed constant init code, is limited 64kb, large array or multiple
    array constants could fairly easily bump into that limit)

git-svn-id: branches/jvmbackend@19638 -
2011-11-14 22:57:41 +00:00
Jonas Maebe
c42e4178c5 * fixed copy(unicodestring,x,y) with x<>1 (second parameter of
JLString.subString() is end index, not total length to copy)

git-svn-id: branches/jvmbackend@19618 -
2011-11-10 18:53:39 +00:00
Jonas Maebe
f96f5f9e94 + {$VARPARACOPYOUTCHECK+/-} / -Cv switch to enable checking
var-parameters on the JVM target for changes to the value passed
    as var-parameter during the function call (because they are handled
    via copy-in/copy-out, this may indicate unexpected bahviour later on).

    out-parameters are checked in the same way, except if the out-parameter
    is a local variable because then reading it before the call may result
    in a bytecode verification error (since the variable may not yet be
    initialized)

git-svn-id: branches/jvmbackend@19153 -
2011-09-19 19:59:26 +00:00
Jonas Maebe
fdab7122dd * catch JLRInvocationTargetException raised when using JLRMthod.invoke() to
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: branches/jvmbackend@19030 -
2011-09-08 15:03:55 +00:00
Jonas Maebe
ab7f0a4461 * changed the parameters of the fpc_pchar_ansistr_intern_charmove() added in
r18906 from byte into sizeint (copy/paste error from the similar shortstring
    helper, where both source and destination are shortstrings)

git-svn-id: branches/jvmbackend@18939 -
2011-09-01 18:27:06 +00:00
Jonas Maebe
816f9c20c7 * part of r18925, forgot to commit
git-svn-id: branches/jvmbackend@18926 -
2011-08-31 20:14:21 +00:00
Jonas Maebe
a4cf406189 * use generic string concatentation and comparison infrastructure for the
JVM target (and also the generic routines in case of shortstrings)

git-svn-id: branches/jvmbackend@18910 -
2011-08-29 22:59:25 +00:00
Jonas Maebe
5496436349 * the generic astrings.inc is now also used to the extent possible on
the JVM target, and pos/insert/delete/val/str/uniquestring/setstring/
    stringofchar/... are now also available for ansistrings on the JVM
    target

git-svn-id: branches/jvmbackend@18906 -
2011-08-29 22:59:03 +00:00
Jonas Maebe
7c56dbee12 * make sure that when making an ansistring shorter using setlength(),
it remains null-terminated

git-svn-id: branches/jvmbackend@18883 -
2011-08-28 19:22:29 +00:00
Jonas Maebe
3a423b331c * full implementation of all routines in rtl/inc/ustringh.inc (except for
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: branches/jvmbackend@18882 -
2011-08-28 19:22:22 +00:00
Jonas Maebe
1f96763b9d * renamed Java-specific sstrings.inc/sstringh.inc to jsstrings.inc/
jsstringh.inc -> use generic inc/sstrings.inc
  * added a bunch of extra {$ifdef FPC_HAS_XXX} protections around
    routines in inc/sstrings.inc and implemented those routines for
    the JVM target in java/jsstrings.inc
  * use the majority of the generic routine in sstrings.inc now also
    for the JVM target! Only a few changes were needed:
   o in a few places, calls to move() for copying shortstring->shortstring
     or shortstring->chararray were replaced with calls to a new inline
     helper that calls move() in the version in inc/sstrings.inc, and
     JLSystem.arraycopt() in in the version in java/jsstrings.inc
   o changed the currency argument to str() for the JVM target to constref
     so its address can be taken (has to be typecasted to int64 without
     changing the value), and similarly changed the temporary result
     inside that routine to an array of 1 elements so the address can be
     taken
   o don't typecast the real value to a record type in str_real for the
     JVM target, but work via an int64 instead to extract sign/mantissa/exp
   o everything else compiled and worked as is!!
  -> val, str, hexstr/octstr/binstr, delete, pos, insert, setstring and
     comparetext now all work for shortstrings on the JVM target

git-svn-id: branches/jvmbackend@18836 -
2011-08-24 22:11:43 +00:00
Jonas Maebe
56e724cea6 * moved general system includes accidentally put in jdynarr.inc to
system.pp

git-svn-id: branches/jvmbackend@18835 -
2011-08-24 22:11:36 +00:00
Jonas Maebe
eb268fb2c4 + tcallnode.createinternmethodres() that allows specifying a forced
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 -
2011-08-24 22:11:16 +00:00
Jonas Maebe
77e913f60f + a bunch of fillchar implementations for different kinds of arrays
git-svn-id: branches/jvmbackend@18830 -
2011-08-24 22:10:59 +00:00
Jonas Maebe
04478c5f33 * enabled overloads that were disabled on the JVM target because of
signature conflicts by declaring them as "external", so that they
    map to exactly that routine they would normally conflict with

git-svn-id: branches/jvmbackend@18824 -
2011-08-23 22:02:37 +00:00
Jonas Maebe
336420ef46 * only make clone method accessible once if needed
git-svn-id: branches/jvmbackend@18821 -
2011-08-23 20:30:20 +00:00
Jonas Maebe
a2a0436347 + support for threadvars in the JVM based on JLThreadLocal; see
rtl/java/jtvarh.inc for the details

git-svn-id: branches/jvmbackend@18820 -
2011-08-23 17:45:01 +00:00
Jonas Maebe
72d6d9ac97 * moved JLRField from jdk15 to the system unit
* 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: branches/jvmbackend@18816 -
2011-08-23 16:07:13 +00:00
Jonas Maebe
79e971ea12 * fixed fpc_dynarr_copy() for making copies of arrays of implicit pointer
types (the elements have to be cloned)

git-svn-id: branches/jvmbackend@18810 -
2011-08-23 15:25:42 +00:00