From d8b74ab21a2e3d9be28de33d6871b61d4b732fea Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Wed, 20 Jan 2016 20:35:00 +0300 Subject: [PATCH] Native function local data size has been moved to njs_function_t. --- njs/njs_vm.c | 2 +- njs/njs_vm.h | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/njs/njs_vm.c b/njs/njs_vm.c index f6c30646..e5d278fa 100644 --- a/njs/njs_vm.c +++ b/njs/njs_vm.c @@ -2175,7 +2175,7 @@ njs_vmcode_method_frame(njs_vm_t *vm, njs_value_t *name, njs_value_t *object) } this = njs_function_native_frame(vm, function->u.native, - prop->value.data.string_size, + function->local_state_size, &method->code); if (nxt_slow_path(this == NULL)) { return NXT_ERROR; diff --git a/njs/njs_vm.h b/njs/njs_vm.h index ec61ae78..b7b59f33 100644 --- a/njs/njs_vm.h +++ b/njs/njs_vm.h @@ -130,10 +130,12 @@ typedef struct { njs_object_t object; #if (NXT_64BIT) - uint32_t native; + uint8_t native; + uint8_t local_state_size; uint32_t args_offset; #else uint8_t native; + uint8_t local_state_size; uint16_t args_offset; #endif @@ -176,11 +178,7 @@ union njs_value_s { uint8_t external0; uint8_t _spare; - /* - * A long string size. - * Besides this field is used in native reentrant methods to - * store size of local state data allocated on stack frame. - */ + /* A long string size. */ uint32_t string_size; union { @@ -254,9 +252,9 @@ union njs_value_s { .data = { \ .type = NJS_FUNCTION, \ .truth = 1, \ - .string_size = _local_size, \ .u.function = & (njs_function_t) { \ .native = 1, \ + .local_state_size = _local_size, \ .args_offset = 1, \ .u.native = _function, \ } \ -- 2.47.3