Commit Graph

106 Commits

Author SHA1 Message Date
nickysn
94bcb9878a * reimplemented r28329 in a different way, as suggested by Jonas
git-svn-id: trunk@28332 -
2014-08-07 19:36:52 +00:00
marco
70088d12a8 * eliminate classes unit from the compiler by copying an array of string based
extractstrings to cclasses.

git-svn-id: trunk@27372 -
2014-03-30 12:03:10 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
svenbarth
68a3827539 Fix for Mantis #21051. Correctly handle specializations that occur during the specialization of methods.
cclasses.pas:
  + TFPHashList & TFPHashObjectList: add WhileEachCall methods that walk the list like ForEachCall does, but uses a while-loop instead of a for-loop
psub.pas, generate_specialization_procs:
  * use WhileEachCall instead of ForEachCall as new defs can be added during the specialization that need to be specialized as well

+ added test

git-svn-id: trunk@25577 -
2013-09-26 08:15:58 +00:00
sergei
1f8a67f552 + Property TObjSymbol.ObjData, allows to access owning TObjData for external/common symbols, i.e. ones with ObjSection=nil.
* For common symbols, report objdata of the original ObjSymbol, not of the resolving one, so the map file shows where it comes from.
+ TElfExeOutput.OrderOrphanSections method, handles object sections not mentioned in script similar to ld.
- t_linux.pas: removed sections that are not part of ld scripts, they are now handled by OrderOrphanSections.

git-svn-id: trunk@25184 -
2013-07-30 09:23:48 +00:00
florian
99f2e57e42 * better error reporting
git-svn-id: trunk@24242 -
2013-04-14 15:51:25 +00:00
masta
d60049a1fd Removing duplicated hash functions in compiler/cclasses.pas
FPHash was duplicated 4 times for different input types. I've
consolidated it to a single function with 3 proxy-functions which can be
inlined.

I've also modified the hash function itself slightly, it now resembled
the original DJB hash and seems to perform a tiny bit better.

git-svn-id: trunk@23850 -
2013-03-16 00:50:45 +00:00
sergei
12ad6704f6 - Removed a number of unused variables, reduces noise at compilation.
git-svn-id: trunk@22880 -
2012-10-30 11:55:59 +00:00
Jonas Maebe
3798b79fd7 + optimization that (re)orders instance fields of Delphi-style classes in
order to minimise memory losses due to alignment padding. Not yet enabled
    by default at any optimization level, but can be (de)activated separately
    via -Oo(no)orderfields
   o added separate tdef.structalignment method that returns the alignment
     of a type when it appears in a record/object/class (factors out
     AIX-specific double alignment in structs)
   o changed the handling of the offset of a delegate interface
     implemented via a field, by taking the field offset on demand
     rather than at declaration time (because the ordering optimization
     causes the offsets of fields to be unknown until the entire
     declaration has been parsed)

git-svn-id: trunk@21947 -
2012-07-22 16:47:19 +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
sergei
aea30f9bb2 * Added a lower limit on tdynamicarray block size. Certain values less than dynamicblockbasesize+alignment, e.g. 8 on x86_64, cause grow() to enter an infinite loop. Such values come e.g. from cloning tdataconstnode, which abuses blocksize argument as data size. Mantis #20929.
git-svn-id: trunk@19873 -
2011-12-18 22:34:56 +00:00
florian
111d05c68f o patch by Alexander Shishkin, resolves #20409
* eliminate warnings in compiler (i386 & i368->x86_64) and minor refactorings
    - comment out unused vars and types
    - comment out unneeded comparisons (Longword <=> 0)
    - suppress some "comparison always true|false" warnings
    - tweak visiblity sections

git-svn-id: trunk@19385 -
2011-10-05 20:11:09 +00:00
paul
4cf5e36ce7 compiler:
- add TTagHashSet class descendant of THashSet with an ability to has also a LongWord value together with key
  - change TAsmData.ConstPools[] to be an indexed property to properly initialize ConstPool class, remove pool initialization from all other units
  - add ansistring constants to pool together with their encoding to distinct the same text constants with different codepage
  + test

git-svn-id: trunk@19261 -
2011-09-28 01:18:43 +00:00
florian
2f4fcf7dee * avoid range check error
git-svn-id: trunk@18786 -
2011-08-20 12:25:58 +00:00
Jonas Maebe
ce88df680b + symansistr conditional define that, when activated, makes the symbol/
mangled name handling ansistring rather than pshortstring based (required
    for JVM target; little effect on speed, some extra memory usage)

git-svn-id: branches/jvmbackend@18597 -
2011-08-20 08:13:50 +00:00
Jonas Maebe
7173b9dfed * fixed (harmless) range check errors
git-svn-id: trunk@17643 -
2011-06-02 20:07:06 +00:00
paul
d21bbc4548 compiler: reduce amount of hints and warnings
git-svn-id: trunk@17350 -
2011-04-20 02:58:52 +00:00
Jonas Maebe
66258fb0b8 * fixed TCmdStrListItem.GetCopy() (the reference count of the ansistring
field was messed up due to the use of "move()" to copy all field data)

git-svn-id: trunk@17270 -
2011-04-08 08:10:07 +00:00
Jonas Maebe
c072eb5a34 * fixed growing a tbitset when adding an element whose index equals the
datasize (and grow with 16 bytes at a time instead of with only
    exactly as many bytes as required to accomodate the new element)

git-svn-id: trunk@15603 -
2010-07-18 21:58:47 +00:00
Jonas Maebe
434a6f6ee8 * ensure that the power-of-2 size of the hash table is always larger than
the parameter initially passed to TFPHashList.SetCapacity after r15516
    (mantis #16834)

git-svn-id: trunk@15521 -
2010-07-03 18:25:31 +00:00
Jonas Maebe
d432023cf6 * force the size of TFPHashList always to a power of two, and use an "and"
instead of a "div" to truncate the hash to the table size
  * prefetch the string we are looking for
  - removed the optimization whereby the length and the last character are
    checked before the entire string is compared during the hashtable
    searching, because this does not help anymore (our hash funcion is
    better than when this was added, and we also have a special "equals"
    string comparison function nowadays that also first checks the length)

git-svn-id: trunk@15516 -
2010-07-03 13:05:32 +00:00
Jonas Maebe
35bacb55b5 * re-enabled CCLASSESINLINE since it no longer internalerrors the compiler
while compiling the IDE
  - removed "inline" from a lot of methods because they are too large

git-svn-id: trunk@15497 -
2010-06-30 17:41:12 +00:00
paul
c6c15f6533 compiler: revert r14244
git-svn-id: trunk@14257 -
2009-11-23 01:43:42 +00:00
paul
5684e3acc7 compiler: speedup tdynamicarray.read, tdynamicarray.write
git-svn-id: trunk@14244 -
2009-11-21 18:27:37 +00:00
Jonas Maebe
dac2903107 * prefetch next items in TLinkedList.clear, removes most l2 cache misses
git-svn-id: trunk@13706 -
2009-09-13 15:30:53 +00:00
Jonas Maebe
41acad1d11 + keep track of called virtual methods per unit. -Owoptvtms will now replace
vmt entries of virtual methods that can never be called with references
    to FPC_ABSTRACTERROR. Some virtual methods are always considered to be
    reachable: published methods, and methods used as getter/setter for a
    published property.

git-svn-id: trunk@13238 -
2009-06-06 08:24:36 +00:00
Jonas Maebe
9bb0db1a6a * fixed range check error
git-svn-id: trunk@11813 -
2008-09-21 18:52:13 +00:00
peter
e90ce867d9 * fphashlist, update hashcapacity also if capacity is changed
git-svn-id: trunk@11699 -
2008-09-03 21:04:53 +00:00
florian
9955d5b061 o patch from Sergej Gorelkin to improvement code generation for string literals
* Replaces linear search through assembler list by the hash lookup. 
    This considerably improves performance on large projects 
    (one example is winunits-jedi package, in which tcgstringconstnode.pass_generate_code 
     was top #1 in calltree, consuming about 12% IRefs).
  * Enables reusing memory locations for widestring constants 
    (and in general, the same approach may be used for any other type of constants).
  * Saves a sizeof(pointer) bytes per constant, by removing a location 
    which points to the string. This location is necessary for the 
    typed consts which may be modified, but redundant for string literals 
    because the language does not allow to modify string literals in any way. 

git-svn-id: trunk@11657 -
2008-08-27 15:16:45 +00:00
yury
5e11e697b4 * Use unsigned integers for sizes and positions to break 2GB limit in tdynamicarray, object writer, internal linker, coff and PE headers.
git-svn-id: trunk@11480 -
2008-07-28 20:29:25 +00:00
Jonas Maebe
cadcfa76d8 * optimized TLinkedList.clear so it can use regvars for everything in
its loop (helps a lot on ppc)

git-svn-id: trunk@8354 -
2007-09-02 16:16:25 +00:00
florian
a3d906f1ca - removed several ;;
git-svn-id: trunk@7498 -
2007-05-28 15:59:17 +00:00
peter
06698d6e1b * explicitly use shortstring for TFPHashList
git-svn-id: trunk@6303 -
2007-02-02 18:58:29 +00:00
tom_at_work
106fe68ce6 * renamed TStringList to TCmdStrList, in general use TCmdStr instead of shortstrings to fix bug #6351
git-svn-id: trunk@6215 -
2007-01-26 22:29:39 +00:00
peter
a526430509 * add TFPHashList.FindIndexOf
git-svn-id: trunk@5906 -
2007-01-11 21:52:32 +00:00
micha
d9c91a9663 fix TFPList.QuickSort duplicate in compiler cclasses (rtl is also broken)
git-svn-id: trunk@5525 -
2006-12-02 08:03:21 +00:00
peter
129ab85aad * tfphashlist.delete needs to rehash after updating all indexes
git-svn-id: trunk@5362 -
2006-11-13 21:17:59 +00:00
peter
45621c892e * set vs_initialised for typed consts
* delete old symbol when absolute is used

git-svn-id: trunk@5351 -
2006-11-13 07:42:48 +00:00
peter
99662d0bff * fixed insertlistcopy to not reverse the list
git-svn-id: trunk@5288 -
2006-11-08 17:06:26 +00:00
peter
e17b424e28 * refactor procsym procdef list
git-svn-id: trunk@5210 -
2006-11-03 18:44:46 +00:00
peter
47c16e33c1 * disable inline for 2.0.x
git-svn-id: trunk@5206 -
2006-11-03 17:06:57 +00:00
peter
4df4a4f7d1 * dynamic growth of blocks in tdynamicarray
* revert to old expand algorithms for fplist 

git-svn-id: trunk@5204 -
2006-11-03 13:44:44 +00:00
peter
658c46b903 * remove tdictionary and tindexarray
* symtables based on TFPHashObjectList and TFPObjectList
  * rename torddef.typ to torddef.ordtype
  * rename tfloatdef.typ to tfloatdef.floattype
  * rename tdef.deftype to tdef.typ
  * remove obsolete browser code, browcol is kept so the ide
    can still be compiled

git-svn-id: trunk@5192 -
2006-11-03 00:30:30 +00:00
peter
05183ac829 * AsmSymbolDict changed to FPHashObjectList
git-svn-id: trunk@5139 -
2006-11-01 00:22:13 +00:00
peter
ff6c1fa285 * remove tdirectorycache that is now in cfileutils
git-svn-id: trunk@5109 -
2006-10-31 09:07:01 +00:00
peter
cb246eb781 * Remove dos,strings units, use SysUtils instead
* replace split* functions with Extract* functions
  * Add Directory caching

git-svn-id: trunk@5102 -
2006-10-30 23:29:35 +00:00
micha
d704af7216 fix compilation for {$T+} linux/win
git-svn-id: trunk@4794 -
2006-10-04 20:43:55 +00:00
olle
05d6f0e94d macos: added a fake sysutils for use by compiler, and fixed some tests
git-svn-id: trunk@4549 -
2006-09-03 22:30:37 +00:00
peter
bf1c390027 * refactor import library generation
* support variable imports in internal linker

git-svn-id: trunk@4544 -
2006-09-03 19:22:31 +00:00
peter
6dd5ee65f5 * FCachedStr added to TFPHashObject for easier debugging
git-svn-id: trunk@3990 -
2006-06-28 20:26:42 +00:00