[njs] Removed function call flag.

Dmitry Volyntsev xeioex at nginx.com
Sat Jul 27 08:59:30 UTC 2019


details:   https://hg.nginx.org/njs/rev/98c4858be02a
branches:  
changeset: 1073:98c4858be02a
user:      hongzhidao <hongzhidao at gmail.com>
date:      Fri Jul 26 22:37:38 2019 -0400
description:
Removed function call flag.

diffstat:

 njs/njs_function.c |  2 --
 njs/njs_function.h |  2 --
 njs/njs_vmcode.c   |  6 +++---
 3 files changed, 3 insertions(+), 7 deletions(-)

diffs (54 lines):

diff -r dace17533126 -r 98c4858be02a njs/njs_function.c
--- a/njs/njs_function.c	Sat Jul 27 03:51:48 2019 +0300
+++ b/njs/njs_function.c	Fri Jul 26 22:37:38 2019 -0400
@@ -568,8 +568,6 @@ njs_function_lambda_call(njs_vm_t *vm)
         }
     }
 
-    frame->native.call = 1;
-
     vm->active_frame = frame;
 
     return njs_vmcode_interpreter(vm, lambda->start);
diff -r dace17533126 -r 98c4858be02a njs/njs_function.h
--- a/njs/njs_function.h	Sat Jul 27 03:51:48 2019 +0300
+++ b/njs/njs_function.h	Fri Jul 26 22:37:38 2019 -0400
@@ -89,8 +89,6 @@ struct njs_native_frame_s {
 
     /* Skip the Function.call() and Function.apply() methods frames. */
     uint8_t                        skip;              /* 1 bit  */
-
-    uint8_t                        call;              /* 1 bit */
 };
 
 
diff -r dace17533126 -r 98c4858be02a njs/njs_vmcode.c
--- a/njs/njs_vmcode.c	Sat Jul 27 03:51:48 2019 +0300
+++ b/njs/njs_vmcode.c	Fri Jul 26 22:37:38 2019 -0400
@@ -87,7 +87,7 @@ njs_vmcode_interpreter(njs_vm_t *vm, u_c
     uint32_t                     u32;
     njs_ret_t                    ret;
     nxt_uint_t                   hint;
-    nxt_bool_t                   valid, call;
+    nxt_bool_t                   valid, lambda_call;
     njs_value_t                  *retval, *value1, *value2, *src, *s1, *s2;
     njs_value_t                  numeric1, numeric2, primitive1, primitive2,
                                  dst;
@@ -855,7 +855,7 @@ error:
             break;
         }
 
-        call = frame->native.call;
+        lambda_call = (frame == vm->active_frame);
 
         njs_vm_scopes_restore(vm, frame, previous);
 
@@ -864,7 +864,7 @@ error:
             nxt_mp_free(vm->mem_pool, frame);
         }
 
-        if (call) {
+        if (lambda_call) {
             break;
         }
     }


More information about the nginx-devel mailing list