summary refs log tree commit diff stats
path: root/compiler/ccgcalls.nim
Commit message (Collapse)AuthorAgeFilesLines
* fixes #18558 again (#18586)Andreas Rumpf2021-07-261-0/+2
|
* fixes #18558 (#18563)Andreas Rumpf2021-07-231-16/+28
| | | | | * fixes #18558 * better fix
* cString => cSourceString; tyCString => tyCstring so that error msgs show ↵Timothee Cour2021-04-171-1/+1
| | | | cstring, not cString (#17744)
* fix #17512 (#17520)flywind2021-03-301-1/+8
|
* fixes #17170 (#17171)Andreas Rumpf2021-02-241-0/+1
|
* ARC Analysis in one pass v3 (#17068)Clyybber2021-02-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Analyse last reads all at once * Integrate firstWrite analysis * Small cleanup * Use sets instead of seqs * Remove instrTargets * Reap the benefits * Implement error diagnostics * Operate on DFA index for lastRead analysis * Use mgetOrPut * Cache alias results This improves performance by a lot, since many CFG locations map to a single PNode * Improve performance * Improve performance * Cleanup * Fix #17025 * Grammar * Expand testcase
* Revert "ARC: Analysis in one pass v2 (#17000)" (#17046)Clyybber2021-02-151-2/+2
| | | This reverts commit 216be4060a853b3425501318537d598c4842eefc.
* ARC: Analysis in one pass v2 (#17000)Clyybber2021-02-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Analyse last reads all at once * Integrate firstWrite analysis * Small cleanup * Use sets instead of seqs * Remove instrTargets * Reap the benefits * Implement error diagnostics * Operate on DFA index for lastRead analysis * Use mgetOrPut * Cache alias results This improves performance by a lot, since many CFG locations map to a single PNode * Improve performance * Improve performance * Cleanup
* Revert "ARC Analysis in one pass (#16849)" (#16984)Clyybber2021-02-091-2/+2
| | | This reverts commit ab740cb5b9bfbacece26956fa2444763a790ccd1.
* ARC Analysis in one pass (#16849)Clyybber2021-02-091-2/+2
| | | | | | | | | | | | | | | | | | | * Analyse last reads all at once * Integrate firstWrite analysis * Small cleanup * Use sets instead of seqs * Remove instrTargets * Reap the benefits * Implement error diagnostics * Operate on DFA index for lastRead analysis * Use mgetOrPut
* fixes https://github.com/status-im/nimbus-eth2/issues/1549 (#16146)Andreas Rumpf2020-11-261-6/+8
| | | | | * fixes https://github.com/status-im/nimbus-eth2/issues/1549 [backport:1.4] * test fixup
* fixes a C code generator regression, no need to backport, only the 1.4 line ↵Andreas Rumpf2020-10-141-1/+1
| | | | is affected (#15569)
* better support for view types (#15436)Andreas Rumpf2020-09-301-2/+4
| | | | | * you can put borrows into tables * enforces mutating views only mutate mutable data
* produce runtime type information for reified openArrays (#15415)Andreas Rumpf2020-09-271-2/+5
| | | | | * produce runtime type information for reified openArrays * added a test case
* better support for slices as views (#15414)Andreas Rumpf2020-09-271-37/+48
| | | | | | * moved view tests to tests/views * refactoring * more refactorings * better support for system.toOpenArray for first class view types
* borrow checking (#15282)Andreas Rumpf2020-09-091-3/+18
| | | | | | | | | | | * refactoring: move procs to typeallowed.nim * frontend preparations for first class openArray support * prepare the code generator for first class openArray * code generation for first class openArray; WIP * code generation for open arrays, progress * added isViewType proc * preparations for borrow checking * added borrow checking to the front end
* Fix #14396 (#14793)Clyybber2020-07-041-44/+101
| | | | | | | | | | | | | | | | | | | | | | * Correct Left-To-Right evaluation of proc args * Fix CPP backend * Add testcase * closes #14396 * closes #14345 * Improve test and optimize * Improve testcase and optimize literals * Fix bug * Expand testcase and use DFA to optimize * Turn genParams into proc * Turn withTmpIfNeeded into a proc * Cleanup * Fix crash * Better analysis * Cleanup * Trailing newline.. * Fix build * Tiny cleanup Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* scoped memory management (#14790)Andreas Rumpf2020-07-041-0/+26
| | | | | | | * fixes the regressions * closes #13936 * scope based memory management implemented * enabled tcontrolflow.nim test case * final cleanups
* init checks and 'out' parameters (#14521)Andreas Rumpf2020-06-231-7/+7
| | | | | | | | | | | * I don't care about observable stores * enforce explicit initializations * cleaner code for the stdlib * stdlib: use explicit initializations * make tests green * algorithm.nim: set result explicitly * remove out parameters and bring the PR into a mergable state * updated the changelog
* more precise analysis about 'observable stores' [backport:1.2] (#14582)Andreas Rumpf2020-06-061-3/+9
|
* fixes #14514 [backport:1.2] (#14533)Andreas Rumpf2020-06-011-1/+3
|
* warn about observerable stores but don't prevent them for 1.2.2 ↵Andreas Rumpf2020-05-301-2/+3
| | | | [backport:1.2]; refs https://github.com/nim-lang/RFCs/issues/230 (#14510)
* fixes #14126 [backport:1.2] (#14390)Andreas Rumpf2020-05-201-5/+24
| | | | | * fixes #14126 [backport:1.2] * used more logic to optimize it further; updated Nimble version
* fixes #14003 (#14006) [backport:1.2]cooldome2020-04-171-6/+12
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* fixes #13782 (#13834)Andreas Rumpf2020-04-011-19/+56
|
* enable --tlsEmulation:on for --gc:arc (#13685)Andreas Rumpf2020-03-181-1/+1
| | | | * enable --tlsEmulation:on for --gc:arc * make -d:useMalloc work with --gc:arc --threads:on
* rename sfAlwaysReturn to sfNeverRaisesAraq2020-03-161-1/+1
|
* catchable defects (#13626)Andreas Rumpf2020-03-121-2/+14
| | | | | | | | | | * allow defects to be caught even for --exceptions:goto (WIP) * implemented the new --panics:on|off switch; refs https://github.com/nim-lang/RFCs/issues/180 * new implementation for integer overflow checking * produce a warning if a user-defined exception type inherits from Exception directly * applied Timothee's suggestions; improved the documentation and replace the term 'checked runtime check' by 'panic' * fixes #13627 * don't inherit from Exception directly
* --exception:goto switch for deterministic exception handling (#12977)Andreas Rumpf2020-01-011-0/+4
| | | | | This implements "deterministic" exception handling for Nim based on goto instead of setjmp. This means raising an exception is much cheaper than in C++'s table based implementations. Supports hard realtime systems. Default for --gc:arc and the C target because it's generally a good idea and arc is all about deterministic behavior. Note: This implies that fatal runtime traps are not catchable anymore! This needs to be documented.
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-129/+125
| | | | | | | | | | | | | | | | | | * Cleanup compiler code base * Unify add calls * Unify len invocations * Unify range operators * Fix oversight * Remove {.procvar.} pragma * initCandidate -> newCandidate where reasonable * Unify safeLen calls
* no commas for empty importcpp splat params (#12183)Jasper Jenkins2019-09-121-5/+8
|
* Small ast.nim cleanup (#12156)Clyybber2019-09-091-16/+16
| | | | | * Remove sonsLen * Use Indexable
* hashes: implement murmur3 (#12022)Miran2019-09-011-6/+8
| | | | | | | | * hashes: implement murmur3 * refactoring; there is only one murmurHash and it works at compile-time via VM hooks * fixes JS tests * makes toOpenArrayByte work with C++ * make it bootstrap in C++ mode for 0.20
* fixes #12042 (#12083)Andreas Rumpf2019-08-291-1/+11
| | | | | | * fixes #12042 * make tests green again
* - adding _actual as a suffix only for calls to an actual proc and not ↵Viktor Kirilov2019-08-231-3/+3
| | | | | | through a global function pointer - fixes https://github.com/nim-lang/Nim/issues/11996 (#12007) - adding forward declarations for reloadable functions within a module - fix compilation errors when 2 such functions reference each other - fixes https://github.com/nim-lang/Nim/issues/11608 - preserve permissions of copied executable binaries
* int128 on firstOrd, lastOrd and lengthOrd (#11701)Arne Döring2019-08-071-1/+1
| | | | * fixes #11847
* styleCheck: make the compiler and large parts of the stdlib compatible with ↵Araq2019-07-101-1/+1
| | | | --styleCheck:error
* fixes #11412Araq2019-06-061-3/+3
|
* Replace countup(x, y-1) with x ..< yClyybber2019-05-071-4/+4
|
* revert discardable transformation (#10905)Andreas Rumpf2019-04-211-7/+17
| | | | | | | | | | * Revert "Properly wrap discarded statements (#10322)" This reverts commit 15584879b91e14565156ca140eef1dc100cf34c4. * add test for implicit discard after defer * enable t10241 again * make C++ tests green again
* fewer ropes (#11037)Arne Döring2019-04-191-3/+9
|
* preparations for --newruntime owned refs/callbacksAraq2019-04-111-3/+3
|
* fixes #10942. Lent T bug (#10946)cooldome2019-04-031-1/+1
| | | | | | | | * fixes #10942 * add test * bug build
* improvements on the hot code reloading support (#10892)Viktor Kirilov2019-03-231-1/+9
| | | | | | | | * calling the "_actual" versions of functions when defined within the same module - slowdown for the snappy compression is now down from x6 to x4-x5 when HCR is ON * dynamically linking to the runtime for VS when HCR is on - binaries are smaller * compilerProcs are also called using the _actual direct version within the module they are defined (system)! * updated comments & goals * handling VS-compatible compilers on Windows in a cleaner way * now the .dll/.so files end up in the nimcache even when --nimcache isn't explicitly stated
* Lineinfo fix (#10871)Arne Döring2019-03-211-0/+1
|
* Initial version of the hot-code reloading support for native targets (#10729)zah2019-02-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * squashed work by Zahary * squashing a ton of useful history... otherwise rebasing on top of upstream Nim after commit 82c009a2cbc5d07ab9a847f1c58228a20efaf219 would be impossible. * Code review changes; Working test suite (without code reloading enabled) * - documentation - implemented the HCR test - almost works... - fix the issue on Unix where for executable targets the source file for the main module of a project in nimcache was being overwritten with the binary itself (and thus the actual source code was lost) - fixing embedded paths to shared objects on unix (the "lib" prefix was being prepended to the entire path instead of just the filename) - other fixes - removing unnecessary includes since that file is already included in chcks.nim which is in turn included in system.nim (and previously was getting imported in chcks.nim but then system.nim improts something... and that breaks HCR (perhaps it could be fixed but it would be nice not to import anything in system)) * fix for clang & C++ - explicitly casting a function pointer to void* more stable mangling of parameter names when HCR is on the length of the static arrays in the DatInit functions is now part of the name of the variables, so when they get resized they get also recreated more stable mangling for inline functions - no longer depends on the module which first used them work on the new complicated HCR test - turned surprisingly complex - WIP test now successfully passes even when re-running `koch test` (previously when the nimcache wasn't cold that lead to errors) better documentation calling setStackBottomWith for PreMain passes over the HcrInit/DatInit/Init calls of all modules are now in the proper order (first all of one type, then all of the next). Also typeinfo globals are registered (created) in a single pass before the DatInit pass (because of the way generic instantiations are handled) Fix the test suite execution on macOs fix for being able to query the program arguments when using HCR on posix! other fixes * Bugfix: Fix a compilation error in C++ mode when a function pointer is converted to a raw pointer * basic documentation for the new hot code reloading semantics * Add change log entry * Don't re-execute the top-level statements while reloading JS code * fix a number of tests broken in a recent bugfix * Review changes * Added {.executeOnReload.} pragma that indicates top-level statements that should be executed on each reload. To make this work, I've modified the way the `if (hcr_init_) {...}` guards are produced in the init code. This still needs more work as the new guards seem to be inserted within the previously generated guards. This change also removes the need for `lastRegistedGlobal` in nimhcr. * Implemented the `signatureHash` magic and the `hasModuleChanged` API depending on it (the actual logic is not imlemented yet). * Add the "hcr" prefix to all HCR-related symbols in the system module. Added a new `hotcodereloading` module exporting the high-level API to the user. Besides being more hygienic, this was also required in order to make it possible to use macros in the high-level API. Without the split, `system` would have to import `macros`, which was going to produce the well-known init problems. * Attempted to solve the "GC markers problem". Crashes were expected with the previous code, because the GC markers were compiled as normal procs are registered in the GC. When their module is unloaded, dangling pointers will remain in the GC tables. To solve this issue, I don't register any GC markers when HCR is on, but I add them to the HCR globals metadata and I use a single marker registed in nimhcr during the initialization of the system module that will be responsible for marking all globals. * fix a compilation error * - implemented the hasModuleChanged functionality - tuples can be returned and broken into different vars in global scope - added comments for the closnig scopes of the if statements in the init proc - the new executeOnReload pragma works now! - other fixes * finally! fixing this hack in a proper way - declaring the destructor out of line (out of the class body) - we no longer need to forward-declare popCurrentExceptionEx * Force full module parsing This is a temporary hack that breaks some tests. I'll investigate later how these can be fixed. * tuples are now properly handled when global! * these comments mess up the codegen in debug mode when $n is not actually a new line (or something like that) - these labels are intended only for GOTO labels anyway... * "solved" the issue with the .pdb locks on windows when a binary is being debugged and hot code reloading is used at the same time * fixes after rebasing... * small fixes for the test * better handling of globals! no more compiler crashes for locals with the global pragma, also simplified code around loops in global scope which have local vars (actually globals) * we can now use the global pragma even for ... globals! * the right output * lets try those boehm GC tests * after the test is ran it will be at its starting state - no git modifications * clarification in the docs * removed unnecessary line directives for forward declarations of functions - they were causing trouble with hot code reloading when no semantic change propagates to the main module but a line directive got changed and thus the main module had to be recompiled since the .c code had changed * fixed bug! was inserting duplicate keys into the table and later was removing only 1 copy of all the duplicates (after a few reloads) * no longer breaking into DatInit code when not supposed to * fixes after rebasing * yet more fixes after rebasing * Update jssys.nim * Rework the HCR path-handling logic After reviewing the code more carefully, I've noticed that the old logic will be broken when the user overrides the '--out:f' compiler option. Besides fixing this issues, I took the opportunity to implement the missing '--outdir:d' option. Other changes: * ./koch test won't overwrite any HCR and RTL builds located in nim/lib * HCR and RTL are compiled with --threads:on by default * Clean up the globals registration logic * Handle non-flattened top-level stmtlists in JS as well * The HCR is not supported with the Boehm GC yet Also fixes some typos and the expected output of the HCR integration test * The GC marker procs are now properly used as trampolines * Fix the HCR integration test in release builds * Fix ./koch tools * this forward declaration doesn't seem to be necessary, and in fact breaks HCR because a 2nd function pointer is emitted for this externed/rtl func * the forward declaration I removed in the last commit was actually necessary * Attempt to make all tests green * Fix tgenscript * BAT file for running the HCR integration test on Windows [skip ci] * Fix the docgen tests * A final fix for Travis (hopefully)
* daily cruft removalJacek Sieka2018-12-081-20/+0
|
* Add `toOpenArray[T](ptr UncheckedArray[T])` for clarity. (#9316)c-blake2018-10-121-1/+1
| | | | | | | | | | | * Add `toOpenArray[T](ptr UncheckedArray[T])` for clarity. `ptr array[0,T]` for some unchecked type already works but A) `UncheckedArray` seems to be the intended future way for this kind of access, and B) essentially all use cases will have a `ptr` for that kind of array source and this call signature lets callers drop the trailing `[]` corresponding to that `ptr` deref. This PR relates to issue https://github.com/nim-lang/Nim/issues/9001 . * Add a test for toOpenArray() for UncheckedArray[T]s.
* make tests green againAraq2018-08-211-1/+1
|
* fixes merge conflictAndreas Rumpf2018-08-191-2/+2
|\