Commit Graph

43560 Commits

Author SHA1 Message Date
Jonas Maebe
a76bbf363d * synchronised with trunk r29513
git-svn-id: branches/blocks@29514 -
2015-01-21 23:18:29 +00:00
Jonas Maebe
2bc8afaa63 + support for calling a method via a block: we capture the method as a
procvar in the local state of the block, and then call it insde the
    generated invoke routine. We can't call it directly there, because
    due to visibility reasons it may not be accessible from a regular
    procedure (e.g. if it is a strict private method)

git-svn-id: branches/blocks@28234 -
2014-07-18 09:15:35 +00:00
Jonas Maebe
c730e16031 * changed the syntax for block procvars from "xxx is block" to
"reference to ...; cdecl;". The "reference to ..." syntax is what Delphi
    uses for anonymous function references. The "cdecl;" indicates that this
    is for the C-variant of such references, which is what blocks are

git-svn-id: branches/blocks@28233 -
2014-07-18 09:15:29 +00:00
Jonas Maebe
bd09b88a5b + support for http://en.wikipedia.org/wiki/Blocks_(C_language_extension)
o blocks are implemented as a variation of procedure variables
   o declaration of a block variable: "test: procedure(c: char) is block;"
     (C equivalent: (void)(^test)(char c) )
   o the compiler automatically converts procedures/functions whose address
     is passed to a block parameter or assigned to a block variable into
     a "block". This consists of
    1) generating a block descriptor (containing the size of the "block
       literal" (see below) and the signature of the invocation function
       encoded as an Objective-C selector)
    2) generating a wrapper function around the original funcion (with C
       calling convention), that has an extra first hidden parameter
       (marked as vo_is_parentfp in the compiler) whose type is a pointer
       to the describing "block literal"
    3) generating the "block literal", which contains a pointer to an
       external variable indicating whether this block captures context or
       not, some flags (see compiler/blockutl.get_block_literal_flags for
       info), a pointer to the wrapper function and a pointer to the
       descriptor. In the future, it will also contain captured variables.
   o right now, only global procedures/functions can be converted to blocks
     (because they don't require state capturing). The next steps are (Object
     Pascal) methods (not Objective-C methods, because Objective-C method
     procvars don't exist) and finally nested functions
   o on Mac OS X, the functionality will only work on Mac OS X 10.7 and later,
     because we have to use the so-called "ABI.2010.3.16" to ensure that
     our blocks aren't called as variadic functions by the runtime (which
     came out after the Mac OS X 10.6 release)
   o while the currently implemented functionality does not require any
     library support at all, there's no use enabling it on other platforms
     because unless it has been confirmed to work with a blocks runtime,
     there's no point in using blocks (they're just somewhat bulky procvars
     right now). Enabling it on other platforms (in combination with the
     GNUStep Objective-C run time), should simply be a matter of adding
     the right {$linklib xxx} statement to rtl/inc/blockrtl.pp file, adding
     that file to Makefile.fpc for that platform and adding that platform
     to the compiler/systems.systems_blocks_supported set

git-svn-id: branches/blocks@28232 -
2014-07-18 09:15:22 +00:00
Jonas Maebe
f29a7b827e * initialise doconv after comparing procvars, and in particular set it to
tc_proc_to_procvar in case the comparison returns something different
    from te_equal (so that not just the resulttype is changed of the
    existing type conversion node, but a new typeconversion node is created
    and processed)

git-svn-id: branches/blocks@28231 -
2014-07-18 09:15:15 +00:00
Jonas Maebe
d238a148d6 Create branch blocks
git-svn-id: branches/blocks@28230 -
2014-07-18 09:13:34 +00:00
Jonas Maebe
4ff597afae * call "message" rather than "cgmessage" when throwing fatal errors, because
cgmessage won't do anything in case cgerror is already set (and in several
    places we assume that the compiler will immediately abort after throwing a
    fatal error)

git-svn-id: trunk@28229 -
2014-07-18 09:09:21 +00:00
Jonas Maebe
9e29fd424d * changed the "laststatement" parameter of internalstatements() from "var"
to "out"

git-svn-id: trunk@28228 -
2014-07-18 09:09:16 +00:00
Jonas Maebe
627c83e828 * when creating a bare procdef copy, don't copy the funcret parameter.
This is useful if you want to change the calling convention of the copy.
   o call insert_funcret_para() after creating a bare copy
  * don't copy aliasnames of copied procdefs either (can at best result
    in duplicate symbol errors)

git-svn-id: trunk@28227 -
2014-07-18 09:09:11 +00:00
Jonas Maebe
256f2fcf69 * fixed finish_copied_procdef() in case newstruct is nil after support for
generics was added to it

git-svn-id: trunk@28226 -
2014-07-18 09:09:03 +00:00
nickysn
6d54046300 * output a proper error message in case number+nil is encountered (just like
it's already done for nil+number and nil-number)

git-svn-id: trunk@28225 -
2014-07-15 22:26:58 +00:00
reiniero
0cb92962e3 * fcld-db: oracle: cosmetic
git-svn-id: trunk@28224 -
2014-07-15 11:35:29 +00:00
reiniero
0ebd33180e * fcl-db: oracle connection: speed up getting indexes in TOracleConnection.UpdateIndexDefs; issue #25247
git-svn-id: trunk@28223 -
2014-07-15 11:28:07 +00:00
reiniero
cc90409dc9 * fcl-db: cosmetic: Oracle connection description/copyright
git-svn-id: trunk@28222 -
2014-07-15 11:13:40 +00:00
marco
9c5e150965 * patch from #26485, haiku builds character units (and dependencies)
git-svn-id: trunk@28221 -
2014-07-15 10:27:22 +00:00
nickysn
9b3d41d9c7 * the default value of tpointerdef.pointer_subtraction_result_type changed to
ptrsinttype

git-svn-id: trunk@28220 -
2014-07-15 06:51:56 +00:00
nickysn
d86a8ebc99 * defutil.get_int_result_type_from_pointer_subtraction moved to a virtual
method tpointerdef.pointer_subtraction_result_type

git-svn-id: trunk@28219 -
2014-07-14 23:30:29 +00:00
nickysn
99c555cea8 + implemented huge pointer subtraction
* the result of far pointer subtraction changed to word (for TP7 compatibility)

git-svn-id: trunk@28218 -
2014-07-13 23:40:43 +00:00
nickysn
200df7a136 * set expectloc correctly for far pointer comparison as well
git-svn-id: trunk@28217 -
2014-07-13 16:25:20 +00:00
nickysn
04234c733f * set expectloc correctly (LOC_JUMP instead of LOC_FLAGS) for non-normalized
huge pointer comparison

git-svn-id: trunk@28216 -
2014-07-13 15:20:58 +00:00
nickysn
6770301fe7 + added a normalized huge pointer comparison test
git-svn-id: trunk@28215 -
2014-07-13 13:07:01 +00:00
nickysn
5818451bb5 * non-normalized huge pointer comparison made unsigned
git-svn-id: trunk@28214 -
2014-07-13 12:54:12 +00:00
nickysn
ba1ee49b64 + added non-normalized huge pointer comparison test
git-svn-id: trunk@28213 -
2014-07-13 12:39:24 +00:00
michael
a89a52310c * Introduce class method to register a web module
git-svn-id: trunk@28200 -
2014-07-12 19:26:18 +00:00
michael
74955c4e20 * No longer needed, all tests are in tczipper
git-svn-id: trunk@28199 -
2014-07-11 12:44:39 +00:00
michael
c281c4d036 * Patch from Reinier Olislagers to let filenames conform to standard / (bug id 26468)
git-svn-id: trunk@28198 -
2014-07-11 12:41:22 +00:00
joost
e81593d34b * Fixed make install: fpdispextdirect.pp does not have a resource-file
git-svn-id: trunk@28197 -
2014-07-11 11:19:14 +00:00
michael
c204153604 * Improved exception handling. Introduced StatusCode/Text in EHTTPError, is used to set HTTP status code/text when sending the response.
git-svn-id: trunk@28196 -
2014-07-11 08:19:23 +00:00
michael
6013e4d8c7 * Added copyright notice
git-svn-id: trunk@28195 -
2014-07-11 07:34:11 +00:00
michael
15ef9a2599 * Cleaner design refactoring: Separate out ExtDirect support in non-http part and http part
git-svn-id: trunk@28194 -
2014-07-11 07:32:01 +00:00
michael
ad574ca377 * Allow selectively adding handlers to reported API
git-svn-id: trunk@28193 -
2014-07-11 07:09:36 +00:00
michael
7db9fbc234 * APIString virtual, allow formatting
git-svn-id: trunk@28192 -
2014-07-11 06:58:35 +00:00
michael
0a220476a3 * Introduce ExecuteHandler in dispatcher, allows overriding
git-svn-id: trunk@28191 -
2014-07-11 06:55:36 +00:00
michael
c3f24cc775 * Added small improvement to JSONRPCHandlermanager to ease creating descendents with customized behaviour:
moved creation of defs to virtual procedure. Uses a global classvar to determine default item type.
* Implemented GetClassNames and GetMethodsOfClass
* Added Clear.

git-svn-id: trunk@28190 -
2014-07-11 06:49:19 +00:00
sergei
e65c4e13e0 * m68k: updated/fixed dllprt0.as, now able to link a shared library.
git-svn-id: trunk@28189 -
2014-07-09 22:59:13 +00:00
Tomas Hajny
82d62aa883 * added description for option @ and missing bracket at the end of list for -P
git-svn-id: trunk@28188 -
2014-07-08 22:33:18 +00:00
Tomas Hajny
109d890adf * added description for option @ and missing bracket at the end of list for -P
git-svn-id: trunk@28187 -
2014-07-08 22:33:00 +00:00
Tomas Hajny
dfb44e1642 * improve identation of long options and add support for displaying parameter @
git-svn-id: trunk@28186 -
2014-07-08 22:30:43 +00:00
sergei
b7da785688 * m68k: support stack cleanup at caller side, fixed calculation of pushed parameters size and offsets and cleaned out another pile of junk.
* Parameter offsets are now calculated similar to other targets, target_info,first_parm_offset is applied only to callee side, while at caller side offsets start from 0.
* For cdecl procedures, parameters are removed by caller, for the rest it's still done by callee (resembles i386 target, except there is no 'register' calling convention).

git-svn-id: trunk@28185 -
2014-07-08 19:08:56 +00:00
sergei
6bcaa88c3a * m68k: "or" without suffix is not accepted, must be "or.l"
git-svn-id: trunk@28184 -
2014-07-08 18:48:57 +00:00
sergei
cfe13734e0 * m68k: Fixed damage caused by r27573 and r28177:
* longjmp: restored loading of function result (d0) which got removed in r28177.
  * While at the point, added test for zero, because longjmp must never return zero values.
  * Assembler reader: 'fp' refers to frame pointer, not the stack pointer.

git-svn-id: trunk@28183 -
2014-07-08 15:04:54 +00:00
marco
3a7cde492e * finance functions by wp, mantis #26459
git-svn-id: trunk@28182 -
2014-07-08 12:45:11 +00:00
sergei
15ff2c1236 * m68k: Fixed name of ELF interpreter, and updated cprt0.as to somewhat working state. Now a "hello world" program using libc can be linked and launched, but anything more complex needs another round of fixing the parameter passing code, in order to get the stack properly balanced.
git-svn-id: trunk@28181 -
2014-07-07 20:08:50 +00:00
nickysn
16c5849fc6 + added HexStr() overload for huge pointers
git-svn-id: trunk@28180 -
2014-07-07 15:13:29 +00:00
nickysn
8604372da3 + implemented far pointer comparison operating only on the offset (+ added test)
git-svn-id: trunk@28179 -
2014-07-06 22:45:19 +00:00
nickysn
13646c7afe + added rtl helper for huge pointer subtraction
git-svn-id: trunk@28178 -
2014-07-06 19:15:14 +00:00
Károly Balogh
f98cd634fb m68k: reworked/cleaned setjmp/longjmp code to use the movem instruction with register lists
git-svn-id: trunk@28177 -
2014-07-06 13:18:56 +00:00
sergei
df60309d96 * m68k: fixed the last remaining warning and removed "$WARNINGS OFF" directive.
git-svn-id: trunk@28176 -
2014-07-06 11:36:33 +00:00
sergei
e4fea2ebc8 * Dummy implementations of a_bit_scan_reg_reg and g_stackpointer_alloc in tcg, removes the need to override these methods in every descendant code generator solely to avoid "constructing a class with abstract method" warning.
git-svn-id: trunk@28175 -
2014-07-06 11:34:04 +00:00
Károly Balogh
e5656a6f7e m68k assembler reader: fixed parsing of slash-separated movem/fmovem register lists. only the first register was stored.
git-svn-id: trunk@28174 -
2014-07-06 11:29:45 +00:00