summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/ucode/types.h6
-rw-r--r--types.c14
-rw-r--r--vm.c22
3 files changed, 21 insertions, 21 deletions
diff --git a/include/ucode/types.h b/include/ucode/types.h
index ac7376b..4a3ccd7 100644
--- a/include/ucode/types.h
+++ b/include/ucode/types.h
@@ -165,14 +165,14 @@ typedef struct uc_upval_tref {
bool closed;
uc_value_t *value;
struct uc_upval_tref *next;
-} uc_upval_tref_t;
+} uc_upvalref_t;
typedef struct {
uc_value_t header;
uc_weakref_t ref;
bool is_arrow;
uc_function_t *function;
- uc_upval_tref_t **upvals;
+ uc_upvalref_t **upvals;
} uc_closure_t;
typedef struct uc_vm uc_vm_t;
@@ -247,7 +247,7 @@ struct uc_vm {
uc_stack_t stack;
uc_exception_t exception;
uc_callframes_t callframes;
- uc_upval_tref_t *open_upvals;
+ uc_upvalref_t *open_upvals;
uc_parse_config_t *config;
uc_value_t *globals;
uc_source_t *sources;
diff --git a/types.c b/types.c
index 33a70b5..0c0f40b 100644
--- a/types.c
+++ b/types.c
@@ -118,7 +118,7 @@ ucv_gc_mark(uc_value_t *uv)
{
uc_function_t *function;
uc_closure_t *closure;
- uc_upval_tref_t *upval;
+ uc_upvalref_t *upval;
uc_object_t *object;
uc_array_t *array;
uc_resource_t *resource;
@@ -170,7 +170,7 @@ ucv_gc_mark(uc_value_t *uv)
break;
case UC_UPVALUE:
- upval = (uc_upval_tref_t *)uv;
+ upval = (uc_upvalref_t *)uv;
ucv_gc_mark(upval->value);
break;
@@ -194,7 +194,7 @@ ucv_free(uc_value_t *uv, bool retain)
uc_resource_t *ressource;
uc_function_t *function;
uc_closure_t *closure;
- uc_upval_tref_t *upval;
+ uc_upvalref_t *upval;
uc_regexp_t *regexp;
uc_object_t *object;
uc_array_t *array;
@@ -262,7 +262,7 @@ ucv_free(uc_value_t *uv, bool retain)
break;
case UC_UPVALUE:
- upval = (uc_upval_tref_t *)uv;
+ upval = (uc_upvalref_t *)uv;
ucv_put_value(upval->value, retain);
break;
}
@@ -943,12 +943,12 @@ ucv_closure_new(uc_vm_t *vm, uc_function_t *function, bool arrow_fn)
{
uc_closure_t *closure;
- closure = xalloc(sizeof(*closure) + (sizeof(uc_upval_tref_t *) * function->nupvals));
+ closure = xalloc(sizeof(*closure) + (sizeof(uc_upvalref_t *) * function->nupvals));
closure->header.type = UC_CLOSURE;
closure->header.refcount = 1;
closure->function = function;
closure->is_arrow = arrow_fn;
- closure->upvals = function->nupvals ? (uc_upval_tref_t **)((uintptr_t)closure + ALIGN(sizeof(*closure))) : NULL;
+ closure->upvals = function->nupvals ? (uc_upvalref_t **)((uintptr_t)closure + ALIGN(sizeof(*closure))) : NULL;
if (vm)
ucv_ref(&vm->values, &closure->ref);
@@ -1068,7 +1068,7 @@ ucv_regexp_new(const char *pattern, bool icase, bool newline, bool global, char
uc_value_t *
ucv_upvalref_new(size_t slot)
{
- uc_upval_tref_t *up;
+ uc_upvalref_t *up;
up = xalloc(sizeof(*up));
up->header.type = UC_UPVALUE;
diff --git a/vm.c b/vm.c
index 7d77581..05fa3b1 100644
--- a/vm.c
+++ b/vm.c
@@ -163,7 +163,7 @@ void uc_vm_init(uc_vm_t *vm, uc_parse_config_t *config)
void uc_vm_free(uc_vm_t *vm)
{
- uc_upval_tref_t *ref;
+ uc_upvalref_t *ref;
size_t i;
ucv_put(vm->exception.stacktrace);
@@ -308,7 +308,7 @@ uc_vm_frame_dump(uc_vm_t *vm, uc_callframe_t *frame)
uc_chunk_t *chunk = uc_vm_frame_chunk(frame);
uc_function_t *function;
uc_closure_t *closure;
- uc_upval_tref_t *ref;
+ uc_upvalref_t *ref;
uc_value_t *v;
size_t i;
@@ -1050,7 +1050,7 @@ static void
uc_vm_insn_load_upval(uc_vm_t *vm, uc_vm_insn_t insn)
{
uc_callframe_t *frame = uc_vm_current_frame(vm);
- uc_upval_tref_t *ref = frame->closure->upvals[vm->arg.u32];
+ uc_upvalref_t *ref = frame->closure->upvals[vm->arg.u32];
if (ref->closed)
uc_vm_stack_push(vm, ucv_get(ref->value));
@@ -1066,12 +1066,12 @@ uc_vm_insn_load_local(uc_vm_t *vm, uc_vm_insn_t insn)
uc_vm_stack_push(vm, ucv_get(vm->stack.entries[frame->stackframe + vm->arg.u32]));
}
-static uc_upval_tref_t *
+static uc_upvalref_t *
uc_vm_capture_upval(uc_vm_t *vm, size_t slot)
{
- uc_upval_tref_t *curr = vm->open_upvals;
- uc_upval_tref_t *prev = NULL;
- uc_upval_tref_t *created;
+ uc_upvalref_t *curr = vm->open_upvals;
+ uc_upvalref_t *prev = NULL;
+ uc_upvalref_t *created;
char *s;
while (curr && curr->slot > slot) {
@@ -1089,7 +1089,7 @@ uc_vm_capture_upval(uc_vm_t *vm, size_t slot)
return curr;
}
- created = (uc_upval_tref_t *)ucv_upvalref_new(slot);
+ created = (uc_upvalref_t *)ucv_upvalref_new(slot);
created->next = curr;
if (vm->trace) {
@@ -1109,7 +1109,7 @@ uc_vm_capture_upval(uc_vm_t *vm, size_t slot)
static void
uc_vm_close_upvals(uc_vm_t *vm, size_t slot)
{
- uc_upval_tref_t *ref;
+ uc_upvalref_t *ref;
while (vm->open_upvals && vm->open_upvals->slot >= slot) {
ref = vm->open_upvals;
@@ -1223,7 +1223,7 @@ static void
uc_vm_insn_store_upval(uc_vm_t *vm, uc_vm_insn_t insn)
{
uc_callframe_t *frame = uc_vm_current_frame(vm);
- uc_upval_tref_t *ref = frame->closure->upvals[vm->arg.u32];
+ uc_upvalref_t *ref = frame->closure->upvals[vm->arg.u32];
uc_value_t *val = ucv_get(uc_vm_stack_peek(vm, 0));
if (ref->closed) {
@@ -1476,7 +1476,7 @@ uc_vm_insn_update_upval(uc_vm_t *vm, uc_vm_insn_t insn)
{
uc_callframe_t *frame = uc_vm_current_frame(vm);
size_t slot = vm->arg.u32 & 0x00FFFFFF;
- uc_upval_tref_t *ref = frame->closure->upvals[slot];
+ uc_upvalref_t *ref = frame->closure->upvals[slot];
uc_value_t *inc = uc_vm_stack_pop(vm);
uc_value_t *val;