on master help sign in
Merge branch 'master' into Reader
292fb31Patrick Hilhorst
.travis.yml+4−1
@@ -1,3 +1,4 @@
1+dist: trusty
1sudo: false
2sudo: false
2
3
3language: c
4language: c
@@ -153,7 +154,9 @@ script:
153 - echo -en 'travis_fold:end:script.tests\\r'
154 - echo -en 'travis_fold:end:script.tests\\r'
154###
155###
155 - echo 'Benchmarks...' && echo -en 'travis_fold:start:script.benchmarks\\r'
156 - echo 'Benchmarks...' && echo -en 'travis_fold:start:script.benchmarks\\r'
157+ - if [[ "$TESTS" == "test_c" ]]; then
156− - cd benchmarks && ./build.pl && ./run.pl && cd ..
158+ cd benchmarks && ./build.pl && ./run.pl && cd ..;
159+ fi
157 - echo -en 'travis_fold:end:script.benchmarks\\r'
160 - echo -en 'travis_fold:end:script.benchmarks\\r'
158###
161###
159# EOF
162# EOF
CHANGELOG.md+2
@@ -7,6 +7,8 @@
7+ New instances:
7+ New instances:
8 + Added `Catchable` for `ReaderT`, `WriterT`, and `RWST`.
8 + Added `Catchable` for `ReaderT`, `WriterT`, and `RWST`.
9 + Added `MonadTrans` for `RWST`.
9 + Added `MonadTrans` for `RWST`.
10++ Added utility functions to `Data.SortedMap` and `Data.SortedSet` (`contrib`),
11+ most notably `merge`, merging two maps by their `Semigroup` op (`<+>`)
10
12
11## Tool Updates
13## Tool Updates
12
14
appveyor.yml+1−1
@@ -1,7 +1,7 @@
1version: 1.0.{build}
1version: 1.0.{build}
2init:
2init:
3- ps: >-
3- ps: >-
4− choco install cabal
4+ choco install cabal --no-progress
5
5
6 mkdir C:\ghc
6 mkdir C:\ghc
7
7
rts/idris_rts.c+9−1
@@ -419,6 +419,13 @@ VAL MKB64(VM* vm, uint64_t bits64) {
419 return cl;
419 return cl;
420}
420}
421
421
422+void idris_trace(VM* vm, const char* func, int line) {
423+ printf("At %s:%d\n", func, line);
424+ dumpStack(vm);
425+ puts("");
426+ fflush(stdout);
427+}
428+
422void dumpStack(VM* vm) {
429void dumpStack(VM* vm) {
423 int i = 0;
430 int i = 0;
424 VAL* root;
431 VAL* root;
@@ -426,7 +433,8 @@ void dumpStack(VM* vm) {
426 for (root = vm->valstack; root < vm->valstack_top; ++root, ++i) {
433 for (root = vm->valstack; root < vm->valstack_top; ++root, ++i) {
427 printf("%d: ", i);
434 printf("%d: ", i);
428 dumpVal(*root);
435 dumpVal(*root);
429− if (*root >= (VAL)(vm->heap.heap) && *root < (VAL)(vm->heap.end)) { printf("OK"); }
436+ if (*root >= (VAL)(vm->heap.heap) && *root < (VAL)(vm->heap.end)) { printf(" OK"); }
437+ if (root == vm->valstack_base) { printf(" <--- base"); }
430 printf("\n");
438 printf("\n");
431 }
439 }
432 printf("RET: ");
440 printf("RET: ");
rts/idris_rts.h+10−1
@@ -235,7 +235,15 @@ typedef intptr_t i_int;
235
235
236// Stack management
236// Stack management
237
237
238+#ifdef IDRIS_TRACE
239+#define TRACE idris_trace(vm, __FUNCTION__, __LINE__);
240+#else
241+#define TRACE
242+#endif
243+
238−#define INITFRAME VAL* myoldbase
244+#define INITFRAME TRACE\
245+ VAL* myoldbase
246+
239#define REBASE vm->valstack_base = oldbase
247#define REBASE vm->valstack_base = oldbase
240#define RESERVE(x) if (vm->valstack_top+(x) > vm->stack_max) { stackOverflow(); } \
248#define RESERVE(x) if (vm->valstack_top+(x) > vm->stack_max) { stackOverflow(); } \
241 else { memset(vm->valstack_top, 0, (x)*sizeof(VAL)); }
249 else { memset(vm->valstack_top, 0, (x)*sizeof(VAL)); }
@@ -348,6 +356,7 @@ VM* idris_getSender(Msg* msg);
348int idris_getChannel(Msg* msg);
356int idris_getChannel(Msg* msg);
349void idris_freeMsg(Msg* msg);
357void idris_freeMsg(Msg* msg);
350
358
359+void idris_trace(VM* vm, const char* func, int line);
351void dumpVal(VAL r);
360void dumpVal(VAL r);
352void dumpStack(VM* vm);
361void dumpStack(VM* vm);
353
362