]> git.kaiwu.me - njs.git/commitdiff
Native function local data size has been moved to njs_function_t.
authorIgor Sysoev <igor@sysoev.ru>
Wed, 20 Jan 2016 17:35:00 +0000 (20:35 +0300)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 20 Jan 2016 17:35:00 +0000 (20:35 +0300)
njs/njs_vm.c
njs/njs_vm.h

index f6c306464aeefb3ca872a0a47538ce7bd7a53d0e..e5d278face39ff08b9759385143ce1668f0f1231 100644 (file)
@@ -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;
index ec61ae78a6e22fbc9ddb96cd1b2ab7cce226646d..b7b59f3355cb21a47dc062412f55b510cf1fc2db 100644 (file)
@@ -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,                                            \
         }                                                                     \