7 Commits

Author SHA1 Message Date
John Alanbrook
7af8ffe4e0 attempt 2025-12-31 16:01:02 -06:00
John Alanbrook
8abee37622 persistent current frame 2025-12-31 14:28:43 -06:00
John Alanbrook
7c3cce1ce2 works 2025-12-31 12:45:32 -06:00
John Alanbrook
334f3a789b runs 2025-12-31 11:09:18 -06:00
John Alanbrook
e21cd4e70b tail call 2025-12-31 09:19:39 -06:00
John Alanbrook
41eb4bf6f7 bench 2025-12-30 22:56:31 -06:00
John Alanbrook
5f761cc7af wire callinternal to use trampoline 2025-12-30 16:58:06 -06:00
3 changed files with 749 additions and 288 deletions

View File

@@ -28,6 +28,10 @@
#include <stddef.h>
#endif
#ifndef NDEBUG
#include <assert.h>
#endif
struct list_head {
struct list_head *prev;
struct list_head *next;
@@ -82,6 +86,29 @@ static inline int list_empty(struct list_head *el)
return el->next == el;
}
/* Move all elements from 'src' to 'dst', leaving 'src' empty.
'dst' must be empty before this call. */
static inline void list_splice(struct list_head *dst, struct list_head *src)
{
#ifndef NDEBUG
assert(dst != src);
assert(list_empty(dst));
#endif
if (!list_empty(src)) {
struct list_head *first = src->next;
struct list_head *last = src->prev;
/* Link dst to src's elements */
dst->next = first;
dst->prev = last;
first->prev = dst;
last->next = dst;
/* Reinitialize src as empty */
init_list_head(src);
}
}
#define list_for_each(el, head) \
for(el = (head)->next; el != (head); el = el->next)

File diff suppressed because it is too large Load Diff

View File

@@ -145,26 +145,6 @@ return {
if (!caught) throw "string + boolean should throw"
},
test_null_plus_string_throws: function() {
var caught = false
try {
var x = null + "hello"
} catch (e) {
caught = true
}
if (!caught) throw "null + string should throw"
},
test_string_plus_null_throws: function() {
var caught = false
try {
var x = "hello" + null
} catch (e) {
caught = true
}
if (!caught) throw "string + null should throw"
},
// ============================================================================
// COMPARISON OPERATORS
// ============================================================================