Björn Lindqvist
ddc5ece757
alien.*: frontend varargs support! #1677
...
alien-invoke gets an extra parameter indicating if the call uses varargs
or not. In 99.9% of the cases, the parameter should be f, but is t if
varargs are indicated. E.g
: do-printf ( fmt d -- st ) int f "printf" { c-string double } t alien-invoke ;
2016-08-10 21:34:37 +02:00
Björn Lindqvist
00d15b66a6
compiler.tests.alien: tests for varargs calls
2016-08-02 23:36:02 +02:00
Björn Lindqvist
bc7f9ee669
VM: always use undecorated names when loading ffi functions
...
For win32, Factor tries four different function names when loading
stdcall and fastcall functions, in case decorated names are used in the
dll. It seems to not be necessary because a dll meant for 3rd party use
will always export undecorated
names (http://blogs.msdn.com/b/oldnewthing/archive/2004/01/12/57833.aspx ).
2015-09-02 21:54:41 +02:00
John Benediktsson
0216f9f6d1
namespaces: rename namestack* to (get-namestack) for consistency.
2015-08-13 17:53:07 -07:00
Doug Coleman
1e22e9b814
factor: all FUNCTION: rename complete
2015-07-19 22:55:24 -07:00
Doug Coleman
6f6007570a
factor: Fix rename issues.
2015-07-19 19:56:16 -07:00
Doug Coleman
cd8b686639
compiler.tests.alien: Test demonstrates padding bytes breaking struct= on linux32. Disable for now.
2014-11-24 08:20:28 -08:00
Björn Lindqvist
18d7be2c05
compiler.tests.alien: tests to make sure #1021 stays dead
2014-11-12 19:41:32 -08:00
Doug Coleman
466fe4559d
ffi_test: Can actually test 62 and 63 on windows.
2014-11-10 10:30:35 -08:00
Doug Coleman
564a67ce7e
compiler.tests.alien: Don't test ffi calls 61-63 on Windows.
2014-11-09 10:52:16 -08:00
Doug Coleman
1b5711cc42
compiler.tests.alien: Add structs with uint and ulonglong pairs and return them from an FFI call. macosx32 seems to be working, hopefully this will break it or confirm that it's working. Linux32 is broken, hopefully this will show how.
2014-11-08 13:39:47 -08:00
Doug Coleman
e494e3965b
compiler.tests.alien: Check in a failing unit test. Structure is getting returned improperly.
2014-11-07 15:34:10 -08:00
Björn Lindqvist
cb83f3b39b
compiler.tests.alien: use the with-callback combinator to plug the memory leaks in the tests
2014-10-22 07:02:55 -07:00
Björn Lindqvist
be372831f5
compiler.tests.alien: wrap all callback tests in special
...
unit-test-with-destructor blocks, that way they dont leak memory in the
callback heap
2014-09-29 07:30:22 -07:00
Doug Coleman
beb2d1df3a
ffi: Add some tests to ensure that 64bit integers are handled properly.
2014-07-07 17:02:36 -07:00
Doug Coleman
fa0b4c1a5b
compiler: Use lookup-library.
2013-03-23 21:23:23 -07:00
Doug Coleman
51c033a1f6
Fix all failures in the linux64 build email
2011-10-24 19:33:09 -07:00
Slava Pestov
06218d5d12
compiler.cfg.builder.alien: fix compilation of callbacks which unconditionally throw errors
2011-10-02 19:52:12 -07:00
John Benediktsson
4f42c72012
specialized-arrays: performed some cleanup.
...
Specifically,
• Created >c-array to be replacement for >T-array.
• Created cast-array to be generic replacement for all T-array-cast words.
• Created c-array@ to be generic replacement for T-array@ words.
• Replaced usages of <T-array> with T <c-array>
• Replaced usages of <direct-T-array> with T <c-direct-array>
• Replaced usages of >T-array with T >c-array
• Replaced usages of T-array-cast with T cast-array
• Replaced usages of malloc-T-array with T malloc-array.
• Removed malloc-T-array.
• Removed T-array-cast.
• Removed T-array@.
• Removed >T-array.
I also added (but didn't change any code to use):
• T c-array-type, returns T-array
• T c-array?, returns T-array?
• c-array{ T ... }, returns T-array{ ... }
Bootstraps just find on Mac OS X. Also `load-all test-all` works for me.
2011-09-26 11:37:51 -07:00
Doug Coleman
bf2a96e9e0
Remove Windows CE from core/ basis/ and build-support/
...
Rename the winnt singleton to windows in core/ basis/ extra/
Rename boot images winnt -> windows
Fixes #84 .
2011-09-18 23:19:06 -05:00
Slava Pestov
b052aa61cb
compiler.cfg.linear-scan: extend lifetime intervals of base pointers correctly (reported by Anton Gorenko)
2010-09-30 20:49:03 -07:00
Slava Pestov
6b5fffc026
compiler: preliminary implementation of tracking derived pointers in GC maps
2010-09-27 20:12:44 -07:00
Slava Pestov
c677c35de4
compiler.cfg: fix major facepalm with write barrier elimination
2010-09-05 21:39:45 -07:00
Slava Pestov
168dd1f825
FFI rewrite part 7: compile callback bodies with the optimizing compiler
2010-07-28 00:49:26 -04:00
Slava Pestov
b6fe62299e
compiler.cfg.alias-analysis: factor-call-insns which defined values were not handled properly
2010-07-19 19:56:00 -04:00
Slava Pestov
446ee6896d
alien.data: remove second quotation parameter from with-out-parameters, now all values are copied properly and calling 'clone' on structs in this quotation is not necessary
2010-07-16 17:32:05 -04:00
Slava Pestov
5b31cbcb3c
alien.data: document with-scoped-allocation and with-out-parameters, and add initial: syntax
2010-07-16 17:13:38 -04:00
Slava Pestov
c9ad0856d5
cpu.x86.64: callback prologue was clobbering 5th parameter register on x86-64
2010-05-23 03:00:53 -04:00
Slava Pestov
ba7cb61133
Stack allocation improvements
...
- New with-out-parameters combinator
- Inhibit tail call optimization in frames with local allocation, to ensure that passing a stack allocated value to the last word in the quotation works
- local allocations are now aligned properly
- spill slots are now aligned properly aligned in frames which have parameter and local allocation areas
2010-05-22 02:37:00 -04:00
Slava Pestov
9e59192c73
compiler.cfg.builder.alien: use ##local-allot to fix value struct passing on Win64
2010-05-19 01:53:32 -04:00
Slava Pestov
86358b1dc3
alien.data: add with-scoped-allocation combinator for stack-allocating C data
2010-05-19 00:33:36 -04:00
Slava Pestov
1834241e5a
alien.libraries, stack-checker.alien: check user inputs more carefully to ensure that invalid ABI descriptors don't slip through and break random stuff (reported by prunedtree)
2010-05-18 18:46:31 -04:00
Slava Pestov
7316d41226
FFI rewrite part 2: use ##peek and ##replace instructions to access stack
2010-05-09 23:26:43 -04:00
Slava Pestov
c211c3e84e
FFI rewrite part 1: split up ##alien-invoke and friends into smaller instructions
2010-05-09 21:36:52 -04:00
Slava Pestov
88f627a402
compiler.tests.alien: fix tests on Win64
2010-04-13 01:24:04 -05:00
Slava Pestov
918b202b9a
compiler.tests.alien: get it passing when VM is compiled with MINGW by disabling certain tests and using the MINGW ABI for others, and fix fastcall alien-indirect tests for name decoration
2010-04-12 18:14:18 -05:00
Slava Pestov
145e6428ba
Fixing load errors
2010-04-10 17:24:44 -07:00
Slava Pestov
0aab7aa872
compiler.tests.alien: fix typo
2010-04-10 00:41:20 -07:00
Joe Groff
3e0d86f355
Merge branch 'master' of git://factorcode.org/git/factor into abi-symbols
...
Conflicts:
basis/compiler/tests/alien.factor
2010-04-06 12:30:15 -07:00
Joe Groff
1c5f718e80
add tests for fastcall callbacks
2010-04-02 00:23:39 -07:00
Joe Groff
47f3ace5ac
test fastcall indirect struct return
2010-04-02 00:00:34 -07:00
Joe Groff
43d73dcd4d
remove fastcall struct param tests because GCC appears to behave differently from VC++ here and again, who cares
2010-04-01 23:54:08 -07:00
Joe Groff
5dcfb383a6
add tests for struct returns from fastcall
2010-04-01 23:52:56 -07:00
Joe Groff
69abcd4b9b
test indirect fastcalls
2010-04-01 23:43:55 -07:00
Joe Groff
fd0569e553
compiler.tests.alien: add back fastcall float and struct tests
2010-04-01 22:47:16 -07:00
Joe Groff
88da92543c
add a test that multiple stdcalls or fastcalls in the same word behave correctly
2010-04-01 18:48:12 -07:00
Joe Groff
553b9fcd93
make "fastcall" symbol private since it doesn't really work in all cases
2010-04-01 18:34:15 -07:00
Joe Groff
9c1a9158be
retire mixed int/float fastcall tests because who cares
2010-04-01 18:25:56 -07:00
Slava Pestov
eceabbc57e
compiler: new set-special-object intrinsic; more efficient special-object intrinsic
2010-04-01 20:09:14 -04:00
Joe Groff
c743608456
check gc after fastcall ffi tests like stdcall tests
2010-04-01 14:15:34 -07:00