From 135e23094c42b33acdd05dd522bbe0fd691b9eee Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 26 Mar 2024 14:02:48 -0400 Subject: Improve codegen for table/array iteration by inlining the iteration macros --- builtins/array.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'builtins/array.h') diff --git a/builtins/array.h b/builtins/array.h index df66e636..b538be30 100644 --- a/builtins/array.h +++ b/builtins/array.h @@ -51,13 +51,6 @@ .data_refcount=1}; }) #define $ARRAY_INCREF(arr) (arr).data_refcount |= ((arr).data_refcount << 1) | 1 #define $ARRAY_DECREF(arr) (arr).data_refcount &= 2 -#define $ARRAY_FOREACH(arr_expr, i, item_type, x, body, else_body) {\ - array_t $arr = arr_expr; \ - $ARRAY_INCREF($arr); \ - if ($arr.length == 0) else_body \ - else for (int64_t i = 1; i <= $arr.length; i++) { item_type x = *(item_type*)($arr.data + (i-1)*$arr.stride); body } \ - $ARRAY_DECREF($arr); \ - } #define Array__insert_value(arr, item_expr, index, type) ({ __typeof(item_expr) $item = item_expr; Array__insert(arr, &$item, index, type); }) void Array__insert(array_t *arr, const void *item, int64_t index, const TypeInfo *type); -- cgit v1.2.3