Commit Graph

15535 Commits

Author SHA1 Message Date
florian
38f3448e22 * applied patch by Cyrax to fix #24722, revertes partially r25054 which was wrong
git-svn-id: trunk@25282 -
2013-08-18 16:05:43 +00:00
paul
dc95ba5b07 compiler: handle other places where we check current_procdef for self node
git-svn-id: trunk@25281 -
2013-08-18 13:09:32 +00:00
paul
4b76782691 compiler: fix property access from a nested routine of the static class method and extend a test
git-svn-id: trunk@25280 -
2013-08-18 12:36:04 +00:00
sergei
38058505ba * Changed linking infrastructure to look like assembler one:
* Changed direct references to linker classes in TSystemInfo records to enumerated ids.
  * RegisterExtennalLinker and RegisterInternalLinker procedures replaced by single RegisterLinker procedure and moved to link.pas.
  - TAbstractLinker is no longer necessary, removed.

This change allows to register linker once per id, rather than once per target, and also allows TSystemInfo records to be read-only.

git-svn-id: trunk@25279 -
2013-08-18 12:01:21 +00:00
sergei
9e3d17778d - Removed TAbstractAssembler and TAbstractAssemblerClass, they are not used anymore.
git-svn-id: trunk@25278 -
2013-08-18 11:03:30 +00:00
sergei
eec8129738 * TInternalLinker.Load_ReadStaticLibrary: exit if error has occurred while opening a static library or dynamic object, continuing can cause other errors/crashes in this case.
* t_linux.pas: use sysrootpath when specifying dynamic interpreter (for cross-linking).

git-svn-id: trunk@25277 -
2013-08-18 09:14:16 +00:00
nickysn
088c06d308 * fixed class VMT generation for the i8086 medium memory model (near code, far data) by setting correctly the Tasmsymtype to each symbol according to whether it points to code or data
git-svn-id: trunk@25276 -
2013-08-18 00:03:55 +00:00
Jonas Maebe
57cdd8c106 * set symbol type/binding of data referred by ppc and arm/darwin stubs (part
of r25264, fixes internalerror 2013081601 after r25266)

git-svn-id: trunk@25275 -
2013-08-17 16:26:37 +00:00
paul
5c33644e5c compiler: fix calling class methods from a nested routine of a static class method (mantis #0024865)
git-svn-id: trunk@25274 -
2013-08-17 04:44:19 +00:00
paul
89e154bc10 compiler: if method has no self node then load it as a usual identifier (issue #0024871)
git-svn-id: trunk@25273 -
2013-08-17 02:54:55 +00:00
sergei
d11ec8ac47 - Reverted r25269 and commented out r25261. The former one is wrong because it changes unit initialization order. The latter one causes RTL build failures on some targets, needs testing and likely RTL/makefiles patching.
git-svn-id: trunk@25271 -
2013-08-16 15:17:25 +00:00
sergei
e1ddd914ac * Do not implicitly load Variants unit when compiling units. Doing so is mostly waste of time, and introduces unwanted build dependencies. It is enough to set uf_uses_variants flag for units, and examine these flags when compiling program/library. Resolves #24880.
git-svn-id: trunk@25269 -
2013-08-16 12:42:47 +00:00
Jonas Maebe
da6d9cf3f3 * give an internalerror when we try to change the type of an asmsymbol from
anything but none (= undefined) to local

git-svn-id: trunk@25266 -
2013-08-16 10:10:38 +00:00
Jonas Maebe
d8c84706dd * use Tai_symbol.Create_global() when emitting a global symbol for an
abstract method wrapper (tai_symbol.create() currently overrides the
    symbol type from global to local; will fix in next commit)
  * only generate global abstract method wrappers for the class in which
    the abstract method is declared to prevent duplicate symbol errors
    after the above fix

git-svn-id: trunk@25265 -
2013-08-16 10:09:37 +00:00
Jonas Maebe
3b9b6a0cd7 * explicitly define the asmsymbols for Darwin call stubs as local
git-svn-id: trunk@25264 -
2013-08-16 10:07:46 +00:00
sergei
c558991d8f * Implicitly use Variants unit when (ole)Variant type appears as a function/operator result and nowhere else. Mantis #24863.
git-svn-id: trunk@25261 -
2013-08-16 08:38:21 +00:00
sergei
92811d09c1 * Generate stub bodies for abstract methods, so corresponding symbols can be referenced from code. Resolves #24536.
git-svn-id: trunk@25260 -
2013-08-15 10:04:37 +00:00
sergei
3a12e94d21 * TVMTWriter.writeinterfaceids: pass target asmlist as parameter.
* Changed section type for interface GUID and name from sec_rodata to sec_rodata_norel, because GUIDs and strings are not relocatable.

git-svn-id: trunk@25259 -
2013-08-14 11:54:00 +00:00
florian
d23a5b7c7d * store break/continue usage in a variable
git-svn-id: trunk@25247 -
2013-08-11 21:13:24 +00:00
florian
cfcb4cab26 * simplify body of for loop before unrolling
git-svn-id: trunk@25246 -
2013-08-11 21:13:22 +00:00
florian
5d4a094799 * calculate complexity of exit nodes correctly
git-svn-id: trunk@25245 -
2013-08-11 21:13:20 +00:00
florian
0a22199738 * always use the varrec size retrieved from the system unit when advancing to the next element
git-svn-id: trunk@25244 -
2013-08-11 20:13:57 +00:00
nickysn
fe4cac96be + added overloads to tai_const.Createname and Create_type_name, which take a Tasmsymtype parameter; to be used for declaring external symbols which reside in the data segment with AT_DATA, which is necessary for i8086 medium and compact memory models (where code and data pointers are of different size)
git-svn-id: trunk@25243 -
2013-08-11 19:46:17 +00:00
nickysn
7ae9c5b668 + added optional Tasmsymtype parameter to TAsmData.RefAsmSymbol and WeakRefAsmSymbol to allow specifying things like AT_DATA for external symbols that reside in the data segment, which is needed for i8086 medium and compact memory models
git-svn-id: trunk@25242 -
2013-08-11 19:24:54 +00:00
florian
3d90ac82f8 * disable regable 4 bytes records on 16 bit alu targets, to enable them, location handling should be rewritten else gen_load_cgpara_loc gets even more messy
git-svn-id: trunk@25239 -
2013-08-11 16:12:41 +00:00
florian
11ff8a4ec1 + support register parameters with multiple locations
git-svn-id: trunk@25238 -
2013-08-11 16:12:39 +00:00
florian
86c36995dd * i8086 has no 32 bit rol/ror support so disabled inlined ror/rol for now
git-svn-id: trunk@25237 -
2013-08-11 16:12:37 +00:00
svenbarth
ff3bb9322a Fix for Mantis #24848.
ngenutil.pas, AddToStructsInit:
  * don't add class constructors/destructors to the init table if they belong to a generic type

+ test

git-svn-id: trunk@25234 -
2013-08-11 11:20:12 +00:00
nickysn
a5517cd3d4 * SI and DI removed from the i8086 saved_standard_registers list, because they are volatile in TP7's default calling convention
git-svn-id: trunk@25231 -
2013-08-09 12:21:30 +00:00
florian
57d4185d44 * allocate/deallocate cpu registers as late/early as possible, this gives the reg. allocator more flexibility
git-svn-id: trunk@25229 -
2013-08-08 20:55:45 +00:00
sergei
e1550e1aed * Restore registers in correct order (for push/pop it *does* matter), fixes crashes caused by r25224.
git-svn-id: trunk@25228 -
2013-08-08 05:35:51 +00:00
masta
b81f746e05 Inline Length(DynamicArray)
Up until now a helperfunction was called at runtime. This change inlines
the whole code in the same way Length(AnsiString) works. As dynamic
arrays do not record their length but their highest index, an additional
"OP_ADD" is this case.

git-svn-id: trunk@25227 -
2013-08-07 22:07:08 +00:00
Jonas Maebe
2ba22f666e + support for R_SUBMMX and R_SUBMMY in generic_regname()
git-svn-id: trunk@25225 -
2013-08-07 12:41:47 +00:00
sergei
5c4abfa75a + Implemented saving/restoring registers using PUSH/POP instructions on i386 targets with non-fixed stack. Provides some advantage in code size (e.g. the compiler becomes about 20KBytes smaller).
* This should be applicable to i8086 targets as well (but needs testing), by copying changes from i386/cgcpu.pas to i8086/cgcpu.pas and removing "$ifdef i386" lines in cgx86.pas.

git-svn-id: trunk@25224 -
2013-08-07 09:59:07 +00:00
Jonas Maebe
1ce93f7430 * when automatically generating an overriding getter/setter method (because
a property in a child class has a higher visibility than the getter/
    setter), ensure that we call the inherited method and not the method
    itself (causing a stack overflow due to infinite recursion)

git-svn-id: trunk@25223 -
2013-08-06 21:50:56 +00:00
sergei
a21a20d559 + i8086-specific version of g_stackpointer_alloc.
git-svn-id: trunk@25219 -
2013-08-06 08:11:39 +00:00
sergei
1f72143eef * In preparation for fixing Mantis #24791: Copy related code from tcgx86.g_proc_entry to tcgx86_64.g_proc_entry, and remove win64-specific stuff from tcgx86 version.
git-svn-id: trunk@25218 -
2013-08-06 07:34:50 +00:00
sergei
ea65e272dd * Changed global variable into field.
git-svn-id: trunk@25217 -
2013-08-05 16:32:37 +00:00
florian
912268b1b9 * make loop unrolling dependent on the cpu optimization type instead of the instruction set
git-svn-id: trunk@25211 -
2013-08-03 20:49:20 +00:00
nickysn
db541b59fa - disallow calling tai_symbol_end.Createname with a symbol name that isn't yet defined
git-svn-id: trunk@25210 -
2013-08-03 12:27:43 +00:00
florian
b262b4d76b * fix loop unrolling of for in loops
git-svn-id: trunk@25209 -
2013-08-02 21:21:14 +00:00
Jonas Maebe
fb8fb29574 * record/use the code page of string constants typecasted to an ansistring
type with a non-default code page
   TODO: ensure that string constants typecasted to ansistring become
     ansistrings rather than typeless string constants

git-svn-id: trunk@25207 -
2013-08-02 13:23:32 +00:00
nickysn
d0fa5fff8c * use Tai_const.Create_nil_dataptr in TVMTWriter.intf_gen_intf_ref for writing the nil value for the GUID ptr of Corba interfaces
git-svn-id: trunk@25201 -
2013-07-31 15:18:13 +00:00
nickysn
875e676441 * use Create_nil_dataptr in objectdef_rtti_class_full() when writing the current vmt address for objects that have no vmt
git-svn-id: trunk@25200 -
2013-07-31 15:10:46 +00:00
nickysn
a000d65447 * use Taiconst.Create_nil_codeptr when writing nil values for abstract methods in TVMTWriter.do_gen_published_methods
git-svn-id: trunk@25199 -
2013-07-31 14:51:18 +00:00
nickysn
259bb5421e * tobjectdef.vmtmethodoffset updated to take into account the current i8086 memory model code pointer size
git-svn-id: trunk@25195 -
2013-07-30 23:26:34 +00:00
nickysn
b85f87620c * use Tai_const.Create_nil_dataptr for creating the nil pointers located before the method table in the class vmt
git-svn-id: trunk@25194 -
2013-07-30 23:09:52 +00:00
nickysn
0bdd9db7a2 * terminate the list of virtual method pointers in the vmt with Tai_const.Create_nil_codeptr
git-svn-id: trunk@25193 -
2013-07-30 23:04:25 +00:00
nickysn
9b364f4989 * use Tai_const.Create_nil_dataptr instead of Tai_const.Create_sym(nil) when writing nil for the parent vmt pointer
git-svn-id: trunk@25191 -
2013-07-30 22:48:05 +00:00
Károly Balogh
614afca755 ARM: try to inline 64bit multiplication for the most common cases instead of calling FPC_MUL_ helpers (results in 5-10x speedup)
git-svn-id: trunk@25189 -
2013-07-30 14:40:50 +00:00