Commit Graph

229 Commits

Author SHA1 Message Date
Jonas Maebe
d0be4f11b8 * "on" nodes inherit the exception catching state from the "try"
git-svn-id: branches/debug_eh@42194 -
2019-06-08 20:17:01 +00:00
Jonas Maebe
e720a1f306 * moved tcgexceptionstatehandler to a new cgexcept unit
* fixed llvm cycle by overriding additional eh-related tcgprocinfo methods

git-svn-id: branches/debug_eh@41519 -
2019-02-27 21:13:45 +00:00
florian
12a53ad454 * reduce number of (redundant) landing pads
* reduce number of (redundant) action lists

git-svn-id: branches/debug_eh@41470 -
2019-02-25 20:49:18 +00:00
florian
82e1ce8e4a * if a subroutine has an lsda record, the actions have to cover all code
* cleanup

git-svn-id: branches/debug_eh@41453 -
2019-02-24 20:04:43 +00:00
florian
3c61bb9c5d * some safecall issues fixed
git-svn-id: branches/debug_eh@41406 -
2019-02-20 21:53:27 +00:00
florian
4b66dc0a94 * few fixes to psabieh, mainly related to nested exception handling
git-svn-id: branches/debug_eh@41385 -
2019-02-19 22:20:16 +00:00
florian
9514bd9162 * refactored psabieh handling, most code is now in psabiehpi
git-svn-id: branches/debug_eh@41367 -
2019-02-17 21:20:40 +00:00
florian
5587c878e6 * small fixes for pseabieh
+ raise node support for pseabieh

git-svn-id: branches/debug_eh@41355 -
2019-02-17 20:12:51 +00:00
florian
a3594574ca * in case of finally nodes of implicit frames with a third=nil, exit has to load 0 into the exception value, so an explicit exit call is not handled as an exception
git-svn-id: branches/debug_eh@41318 -
2019-02-14 22:30:40 +00:00
florian
6b0c2a45f5 * compilation fixes
git-svn-id: branches/debug_eh@41290 -
2019-02-10 19:33:14 +00:00
florian
65aebd22b0 + initial implementation of dwarf/eh_frame based exception handling for i386-linux, basic stuff works, open todos
* nested exception handling statments in one procedure need to be fixed
  * clean up, finally factor out tcgprocinfo from psub at least
  * extensive testing

git-svn-id: branches/debug_eh@41289 -
2019-02-10 18:07:33 +00:00
Jonas Maebe
9f928b2805 * fix exception handling code generator memory leaks
git-svn-id: branches/debug_eh@40734 -
2019-01-01 16:24:42 +00:00
Jonas Maebe
11511e13d5 * synchronised with trunk till r40723
git-svn-id: branches/debug_eh@40724 -
2019-01-01 13:22:17 +00:00
Jonas Maebe
dee1056546 * fixed wrong change of jumpalignmax from 10 to 16 in previous commit
o renamed jumpalignmax and coalescealignmax to jumpalignskipmax/
     coalescealignskipmax to better reflex the meaning of these setting
     (and the difference in meaning to e.g. constalignmax)

git-svn-id: trunk@40682 -
2018-12-28 13:22:50 +00:00
Jonas Maebe
df0a126064 * abstracted rest of the generic exception handling code through the
texceptionstatehandler class + llvm overrides
  + added FPC_DummyPotentialRaise routine that gets called at the begin and end
    of try-blocks to be able to catch hardware exceptions to a limited extent
    with LLVM

git-svn-id: branches/debug_eh@40418 -
2018-11-29 21:31:40 +00:00
Jonas Maebe
01ddde2283 * refactored jumping out of exception frames so it can be overridden by descendents
git-svn-id: branches/debug_eh@40406 -
2018-11-29 21:31:02 +00:00
florian
cefb38b605 * better alignment of while loop heads
git-svn-id: trunk@40340 -
2018-11-17 15:08:24 +00:00
florian
a092da723a + new fields for more precise control of alignment
+ support of new alignment control values for GNU AS writer
+ support of new alignment control values for binary writer
* better alignment settings on i386-win32
* improved inserted align directives for if nodes

git-svn-id: trunk@40159 -
2018-11-01 20:49:17 +00:00
Jonas Maebe
0cd85d73e4 * ttryfinallynode now inherits from tbinarynode instead of tloopnode, as its
t1 field was always set to tnothingnode

git-svn-id: trunk@40142 -
2018-11-01 13:19:33 +00:00
florian
f08d3fdf8f * moved execution weight calculation into a separate pass, so the info is available already available before the code generation pass if needed
git-svn-id: trunk@38717 -
2018-04-08 20:51:27 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
yury
5405a4727a * Removed unused vars.
git-svn-id: trunk@35535 -
2017-03-07 08:56:07 +00:00
florian
5aa32a1bbe * align more jump targets
git-svn-id: trunk@35223 -
2017-01-03 16:43:24 +00:00
florian
2e16628db1 * warning fixed
git-svn-id: trunk@35168 -
2016-12-18 20:27:13 +00:00
Jonas Maebe
746de569d5 - removed unused local variable
git-svn-id: trunk@35159 -
2016-12-18 13:57:36 +00:00
Jonas Maebe
b14c037533 * record in the flowcontrol flags whether we are currently in a block whose
exceptions are caught in the current routine (fc_catching_exceptions),
    so that for LLVM we will be able to use "invoke" instead of "call" in that
    case

git-svn-id: trunk@35158 -
2016-12-18 13:57:33 +00:00
Jonas Maebe
6a1c4f9b75 * replaced cg.a_label/a_jmp_always with hlcg.* calls (only for consistency,
does not change anything in practice)

git-svn-id: trunk@35157 -
2016-12-18 13:57:29 +00:00
Jonas Maebe
3ae1f6664a * extracted exception state handling helpers into a utility class so
they can be overridden

git-svn-id: trunk@35156 -
2016-12-18 13:57:25 +00:00
Jonas Maebe
c0f4e4db34 * group emitting a label of a try-block and restoring the control flow flags
in a single routine, so that both happen at the same time (needed for LLVM
    where inside a try-block all calls need to be performed using "invoke"
    and refer to the current try-block/catching label)

git-svn-id: trunk@35144 -
2016-12-16 22:41:30 +00:00
Jonas Maebe
a1c0d1a1ff * moved exception handling helpers from ncgutil to ncgflw as they are only
used there (could be turned into protected methods if they are ever needed
    by child classes)

git-svn-id: trunk@35143 -
2016-12-16 22:41:28 +00:00
Jonas Maebe
d6ccd54da5 - removed unused doexceptlabel
git-svn-id: trunk@35139 -
2016-12-16 22:38:07 +00:00
Jonas Maebe
a25ebbba3e + added volatility information to all memory references
o separate information for reading and writing, because e.g. in a
     try-block, only the writes to local variables and parameters are
     volatile (they have to be committed immediately in case the next
     instruction causes an exception)
   o for now, only references to absolute memory addresses are marked
     as volatile
   o the volatily information is (should be) properly maintained throughout
     all code generators for all archictures with this patch
   o no optimizers or other compiler infrastructure uses the volatility
     information yet
   o this functionality is not (yet) exposed at the language level, it
     is only for internal code generator use right now

git-svn-id: trunk@34996 -
2016-11-27 18:17:37 +00:00
Jonas Maebe
48ef33a8b3 * fixed interprocedural gotos for llvm
o ensure that the label's local "jumpbuf" variable gets moved to the
     parentfpstruct soon enough
   o don't generate global symbols for interprocedural labels: they're not
     necessary if they are only used via setjmp/longjmp (all references are
     local in that case), and if they are referenced via an assembler block
     then we'll have to handle them by passing a blockaddress() expression
     as parameter to that assembler block (which does not require a global
     symbol, but which is not yet implemented)

git-svn-id: trunk@34946 -
2016-11-21 07:39:13 +00:00
florian
834d58f54c * better execution weighting for while loops: the condition must be evaluated with an increased execution weight as well
* ensure that the weight is always increased

git-svn-id: trunk@34799 -
2016-11-05 23:06:01 +00:00
florian
0610187878 + transform for loop into equivalent while loop during pass 1 to simplify code generation
git-svn-id: trunk@34788 -
2016-11-05 23:05:43 +00:00
svenbarth
70fbe50bac * reference the extern assembler symbol of the VMT when catching an exception if it's from another unit
git-svn-id: trunk@34336 -
2016-08-19 12:41:06 +00:00
svenbarth
7dadd44ba7 Merged revision(s) 32500 from branches/svenbarth/packages:
Use indirect references for "on".

ncgflw.pas, tcgonnode:
  * pass_generate_code: if the target supports packages then we need to load the VMT using an indirect symbol

........

git-svn-id: trunk@34228 -
2016-07-29 14:58:40 +00:00
Károly Balogh
56fea8d047 * have regvars in address registers for defs which are address types. improves code with reference bases in regvars on m68k. and also reduces data register pressure.
git-svn-id: trunk@33591 -
2016-05-01 11:33:37 +00:00
Jonas Maebe
118f3c8049 * fixed type of stored exception class instance in on-node
git-svn-id: trunk@32421 -
2015-11-21 12:37:33 +00:00
Jonas Maebe
f0c6d40336 * converted loading for fpc_catches parameter to hlcg
git-svn-id: trunk@32300 -
2015-11-12 22:00:31 +00:00
sergei
e542800ea9 * Win64 SEH: Track control flow out of unwind-protected regions in a more precise way and don't generate expensive calls to __fpc_local_unwind when not necessary.
git-svn-id: trunk@31582 -
2015-09-09 18:43:46 +00:00
Jonas Maebe
0fc1fd6ac1 * replaced current_procinfo.currtrue/falselabel with storing the true/false
labels of LOC_JUMP in the node's location. This generates some extra jumps
    for short circuit boolean and/or-expressions if optimizations are off, but
    with optimisations enabled the generated code is the same (except for JVM
    because the jump threading optimisation isn't enabled there yet).

git-svn-id: trunk@31431 -
2015-08-27 18:28:57 +00:00
Jeppe Johansen
c5b24c5ce3 Changed cast to allow more loop iterations than the native bit-ness of the architecture.
git-svn-id: trunk@31029 -
2015-06-13 12:20:12 +00:00
Jonas Maebe
61e4a1b811 + added tasmlist parameter to getintparaloc() (needed for llvm)
git-svn-id: trunk@30429 -
2015-04-04 14:29:16 +00:00
Jonas Maebe
8064adec38 * converted tcgtryexceptnode.pass_generate_code() and
tcgtryfinallynode.pass_generate_code() to thlcg

git-svn-id: branches/hlcgllvm@28482 -
2014-08-19 20:22:27 +00:00
Jonas Maebe
a637fbe596 * moved all g_exception_*() methods to hlcgobj and cleaned them up (no more
hardcoded registers for the most part)
  + added extra g_exception_discard_reason() that can be called when we only
    want to get rid of the currently pushed exception reason, and don't have
    to load it (so it can do nothing on platforms that don't use push/pop)

git-svn-id: branches/hlcgllvm@28481 -
2014-08-19 20:22:24 +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
nickysn
a79a891940 * handle the result of FPC_CATCHES via the high level code generator (which makes it i8086 far pointer safe)
git-svn-id: trunk@27451 -
2014-04-02 14:25:19 +00:00
Jonas Maebe
73a3f5ced4 * moved ncgutil.maybechangeloadnodereg() to hlcg.maybe_change_load_node_reg()
and moved ifdef'd jvm code to overridden method

git-svn-id: trunk@27153 -
2014-03-16 11:24:40 +00:00
sergei
e26ce9e442 * Fix code generation of for-loops. Keeping a copy of to-value in register during pass 2 is basically a hack, because register may be destroyed if an exception is raised and handled in loop body. This went unnoticed because generic setjmp-based exception handling is restoring registers to the state at entry to try block, and Win64 SEH also has some register-preserving features. However, for Win32 SEH it is not true.
Instead, to-value is now copied to a temp during pass 1, and this temp is forced into memory if loop body contains try..finally or try..except block.

git-svn-id: trunk@26192 -
2013-12-07 09:18:18 +00:00