Commit Graph

8897 Commits

Author SHA1 Message Date
Jonas Maebe
2c313e397e + support for regular arrays and open arrays
o support for copying value parameters at the callee side if they were
     passed by reference in hlcg
   o JVM g_concatcopy() implementation for arrays
   o moved code to get length of an array from njvminl to hlcgcpu so it can
     be reused elsewhere as well
   o export array copy helpers from system unit for use when assigning one
     array to another
   o some generic support for types that are normally not implicit pointers,
     but which are for the JVM target (such as normal arrays)
  * handle assigning nil to a dynamic array by generating a setlength(x,0)
    node instead of by hardcoding a call to fpc_dynarray_clear, so
    target-specific code can handle it if required
  * hook up gethltemp() for JVM ttgjvm so array temps are properly
    allocated

git-svn-id: branches/jvmbackend@18388 -
2011-08-20 07:55:27 +00:00
Jonas Maebe
0a3a62811b + try/except and try/finally support for JVM target:
o always create exceptvarsym entry for on-nodes (on all targets) to remove
     some special cases when an unnamed exception was caught
   o the JVM tryfinally node generates the finally code twice: once for the
     case where no exception occurs, and once when it does occur. The reason
     is that the JVM's static bytecode verification otherwise cannot prove
     that we will only reraise the caught exception when we caught one in
     the first place (the old "jsr" opcode to de-duplicate finally code
     is no longer used in JDK 1.6 because it suffered from the same problem,
     see Sun Java bug
     http://webcache.googleusercontent.com/search?q=cache:ZJFtvxuyhfMJ:bugs.sun.com/bugdatabase/view_bug.do%3Fbug_id%3D6491544 )

git-svn-id: branches/jvmbackend@18387 -
2011-08-20 07:55:21 +00:00
Jonas Maebe
9a3714ce42 * changed identifier of system unit from "System" into "system" to prevent name
clash with Java's "System" (from e.g. System.out.println())

git-svn-id: branches/jvmbackend@18386 -
2011-08-20 07:55:15 +00:00
Jonas Maebe
ee8b662fa1 + dynamic array support for the JVM target: setlength(), length(), high():
o since the JVM does not support call-by-reference, setlength() works
     by taking an argument pointing to the old array and one to the new
     array (the latter is always created in advance on the caller side,
     even if not strictly required, because we cannot easily create it
     on the callee side in an efficient way). Then we copy parts of the
     old array to the new array as necessary
   o to represent creating a new dynamic array, the JVM target uses
     an in_new_x tinlinenode
  + tasnode support for the JVM. Special: it can also be used to convert
    java.lang.Object to dynamic arrays, and dynamic arrays of java.lang.Object
    to dynamic arrays with more dimensions (arrays are special JVM objects,
    and such support is required for the setlength support)
  + check whether explicit type conversions are valid, and if so, add the
    necessary conversion code since we cannot simply reinterpret bit patterns
    in most cases in the JVM:
   o in case of class and/or dynamic array types, convert to an as-node
   o in case of int-to-float or float-to-int, use java.lang.Float/Double
     helpers (+ added the definitions of these helpers to the system unit)

git-svn-id: branches/jvmbackend@18378 -
2011-08-20 07:54:17 +00:00
Jonas Maebe
34674eee5e * pred(length(dynarr)) -> high(dynarr)
git-svn-id: branches/jvmbackend@18371 -
2011-08-20 07:53:14 +00:00
Jonas Maebe
ca98c329b3 + (dynamic) array helper routines
git-svn-id: branches/jvmbackend@18357 -
2011-08-20 07:51:19 +00:00
Jonas Maebe
0dc5baa681 * regenerated so it doesn't set an -XP parameter by default
git-svn-id: branches/jvmbackend@18351 -
2011-08-20 07:50:24 +00:00
Jonas Maebe
505660262d + sqr(float) and trunc() support
git-svn-id: branches/jvmbackend@18342 -
2011-08-20 07:48:47 +00:00
Jonas Maebe
817ebe5d8d + aliases for Java primitive types (jbyte, jshort, jint, jlong, jchar,
jsingle, jdouble, jboolean)

git-svn-id: branches/jvmbackend@18321 -
2011-08-20 07:45:39 +00:00
Jonas Maebe
d840d99231 + minimal Java rtl (based on embedded rtl, but with all code and most
declarations removed)

git-svn-id: branches/jvmbackend@18320 -
2011-08-20 07:45:34 +00:00
florian
41f25c2b21 * fixes cmem.malloc et al. for windows as proposed by Ludo Brands, resolves #15571
git-svn-id: trunk@18256 -
2011-08-18 08:47:44 +00:00
florian
859757003f * fix SafeLoadLibrary: fixed defines, sse control word should be stored as well
git-svn-id: trunk@18255 -
2011-08-18 08:37:15 +00:00
florian
3e4469937c * fix Types.UnionRect as proposed by Piotr Karasinski, resolves #20006
git-svn-id: trunk@18246 -
2011-08-17 12:01:23 +00:00
florian
4c95e9fce5 * commented pdata type as proposed in #20004 by Michalis Kamburelis, resolves #20004
git-svn-id: trunk@18244 -
2011-08-17 11:47:41 +00:00
florian
ae8c250c3e * fix indention
git-svn-id: trunk@18238 -
2011-08-17 09:20:28 +00:00
florian
9b88297389 * patch by Michalis Kamburelis to keep the ending of TFPSList filled with zeros (space between count and capacity), resolves #20005
git-svn-id: trunk@18237 -
2011-08-17 09:05:58 +00:00
florian
0cc53cc5df + patch from Benito van der Zander to enable heaptrc to dump leaked or faulty memory blocks (function disabled by default), resolves #19691
git-svn-id: trunk@18231 -
2011-08-16 20:47:15 +00:00
pierre
1c2a5f9819 + Update all Makefile's modified by
change in utils/fpcm/fpcmake.ini in prevous commit.

  Adapt also other files to that change:

  * compiler/globals.pas: Replace $FPCTARGET by os_string if
  tf_use_8_3 flag is set for target_info also.

  * tests/Makefile.fpc: Modify TEST_TARGETSUFFIX in the same way
  as TARGETSUFFIX was modified in previous commit.

  * tests/utils/dotest.pp:
    + New variable UseOSOnly, set to true if only target OS name
    should be used for subdirectories.

git-svn-id: trunk@18228 -
2011-08-16 20:10:19 +00:00
florian
c32bc3a22a * patch by Nikolay Nikolov to support Alt-Tab and Ctrl-Tab on the linux console, resolves #19247
git-svn-id: trunk@18225 -
2011-08-16 18:58:50 +00:00
florian
b5ebe6307f * fix got loading si_c32, resolves #19520 (still uses the call/pop approach because it is faster on modern CPUs)
git-svn-id: trunk@18224 -
2011-08-16 18:45:39 +00:00
florian
6cb6d9ffaf * patch by Michalis Kamburelis to make FGL lists First and Last properties that are settable, resolves #19874
git-svn-id: trunk@18223 -
2011-08-16 17:11:48 +00:00
pierre
04a2d0bc94 * Handle -1 return if GetFileAttr call inside DirectoryExists
git-svn-id: trunk@18220 -
2011-08-16 15:01:20 +00:00
florian
8833c1cfa3 * patch by Petr-K to fix 3*3 matrix inversion, resolves #19828
+ tests

git-svn-id: trunk@18213 -
2011-08-14 21:46:47 +00:00
florian
e18aa6e208 * version update
git-svn-id: trunk@18212 -
2011-08-14 21:42:50 +00:00
florian
3787ed993c * made some fields in fgl.pp private as proposed by Michalis Kamburelis, resolves #19873
git-svn-id: trunk@18210 -
2011-08-14 19:52:01 +00:00
florian
63403e5199 * *Dir(<ansistring>) functions need to check io result as well, resolves #19977
git-svn-id: trunk@18209 -
2011-08-14 19:00:07 +00:00
florian
4a34192510 * fix TFPGList.Extract to return the correct values by a patch by Michalis Kamburelis, resolves #19960
git-svn-id: trunk@18205 -
2011-08-14 13:57:33 +00:00
michael
64514714c2 * Added invalid stream operation string constant
git-svn-id: trunk@18200 -
2011-08-13 21:19:45 +00:00
michael
96e5333dc2 * Added fakeSeekForward for benefit of descendant streams.
* Override GetSize/Position for memory/stringstream for efficiency
* Added InvalidSeek exception throwing. Should be overridden to throw custom exceptions.

git-svn-id: trunk@18190 -
2011-08-13 18:45:48 +00:00
Tomas Hajny
6992049034 * fix for a silly typo in the previous revision
git-svn-id: trunk@18189 -
2011-08-13 18:18:15 +00:00
marco
bb2e98c4f1 * load listseparator from locale. Patch by Bart B. Mantis 19976
git-svn-id: trunk@18188 -
2011-08-13 09:16:46 +00:00
Tomas Hajny
867ad94115 * fix for DirectoryExists - proper handling of root directory
git-svn-id: trunk@18186 -
2011-08-13 00:06:14 +00:00
pierre
9d763ec052 * Avoid warnings about pointer to signed integers typecasts
+ Accept on trailing directory seperator for DirectoryExists
    and handle 'X:' directory separately by calling
    GetDir(drive,dir) to find the current directory of the drive
    considered.

git-svn-id: trunk@18176 -
2011-08-12 08:35:55 +00:00
florian
883eab626d * inline Types.Point(...)
git-svn-id: trunk@18174 -
2011-08-11 20:53:59 +00:00
pierre
9b79c280be Add stdconvs unit for go32v2 target
git-svn-id: trunk@18167 -
2011-08-11 12:05:16 +00:00
pierre
59720fa55a * Fix error in last commit for quoted args.
end_of_args needs to be reset for even if
    curent_arg is empty.

git-svn-id: trunk@18160 -
2011-08-10 15:34:08 +00:00
pierre
1dfa5c2e74 + Implement !proxy support for long command line
this allows passing command lines longer than 126 chars to
    Free Pascal or go32v2 programs.

    By default only command lines longer than 126 chars are
    passed using !proxy method,
    it is however possible to disable this conversion completely by
    set Use_go32v2_proxy boolean variable to false (true by fdefault).
    In that case, command lines longer than 126 will be truncated, but
    a warning is echoed to stderr.
    For testing purposes, it is possible to set the boolean variable
    force_go32v2_proxy to true to force systematic use of this
    conversion.

    This is set by default if the RTL is compiled with
    SYSTEM_DEBUG_STARTUP conditional set.

    To allow use by sysutils unit, a new procedure:
    exec_ansistring(path : string;comline : ansistring);

    has been added to the interface, which is now called instead
    of Dos.Exec from Sysutils.ExecuteProcess

git-svn-id: trunk@18159 -
2011-08-10 14:27:24 +00:00
florian
abd5ca46c8 + build unit and lazarus project for the embedded target
git-svn-id: trunk@18151 -
2011-08-08 20:10:19 +00:00
florian
144e59a1a7 * indention fixed
git-svn-id: trunk@18150 -
2011-08-08 20:09:39 +00:00
Jonas Maebe
0a88009059 * comment and formatting fixes by Christian Budde (mantis #19919)
git-svn-id: trunk@18134 -
2011-08-07 10:10:51 +00:00
florian
28126cf0d5 * convert disk full to run time error 101
git-svn-id: trunk@18131 -
2011-08-07 09:15:42 +00:00
Jonas Maebe
e0e326be8e + add {$packrecords c} to all units importing Objective-C records since
that's the alignment used by the system headers

git-svn-id: trunk@18115 -
2011-08-06 13:16:03 +00:00
marco
b59c42f2c7 * removed exporting a non standard strtotime, which was a workaround for missing
formatsettings/locale versions. Patch by Lacak2, Mantis #19870 (3rd)

git-svn-id: trunk@18110 -
2011-08-06 12:19:44 +00:00
marco
bf65638891 * strtodatetime adapted to new strtotime regime. Take separator from formatsettings.
Second patch fo Mantis #19870

git-svn-id: trunk@18100 -
2011-08-05 13:37:16 +00:00
marco
52afb619aa * add overloaded strtotime, patch by Lacak2, Mantis #19870
git-svn-id: trunk@18093 -
2011-08-04 17:01:34 +00:00
marco
043e9b2ec2 * Trunk version to 2.7.1
git-svn-id: trunk@18075 -
2011-08-03 13:59:33 +00:00
marco
39d7bb511d * Regenned all makefiles before 2.6.x branching.
git-svn-id: trunk@18073 -
2011-08-03 13:41:52 +00:00
marco
079831b50e * Deref old content of node in FPSList.put. Mantis #19854
git-svn-id: trunk@18063 -
2011-08-02 15:15:27 +00:00
marco
7eeb4ab539 * also return fasymbolic if dir is found.
* update getattr to also return fasymbolic
  Patch by Dimitri B. Mantis #16817	

git-svn-id: trunk@18043 -
2011-08-01 11:36:28 +00:00
marco
2c00a2a0b3 * fixed FPC_USE_LIBC building for Linux and exception handling (mantis #13450)
- fixed a platform modifier in ipc.pp
   - fixed different layout sigaction record in libc. (field order)
   - fixed many bad use_libc fixes in linux. Most of these were only checked
      for compilation, not linking. (e.g. futex doesn't link)

git-svn-id: trunk@18042 -
2011-07-31 23:36:17 +00:00