Lines Matching refs:nargs
1497 #define DUK_LFUNC_FLAGS_PACK(magic,length,nargs) \ argument
1498 ((((duk_small_uint_t) (magic)) & 0xffU) << 8) | ((length) << 4) | (nargs)
6390 …RNAL_DECL void duk_push_c_function_builtin(duk_hthread *thr, duk_c_function func, duk_int_t nargs);
6391 …id duk_push_c_function_builtin_noconstruct(duk_hthread *thr, duk_c_function func, duk_int_t nargs);
6534 DUK_INTERNAL_DECL duk_int_t duk_pcall_method_flags(duk_hthread *thr, duk_idx_t nargs, duk_small_uin…
8031 duk_uint16_t nargs; /* number of arguments allocated to regs */ member
8102 duk_int16_t nargs; member
8153 duk_idx_t nargs; member
11206 DUK_INTERNAL_DECL duk_int_t duk_handle_call_unprotected_nargs(duk_hthread *thr, duk_idx_t nargs, du…
12527 …gs,refcount,props,props_enc16,iproto,iproto_enc16,esize,enext,asize,hsize,nativefunc,nargs,magic) \ argument
12528 …(iproto_enc16), (esize), (enext), (asize) }, (nativefunc), (duk_int16_t) (nargs), (duk_int16_t) (m…
12536 …gs,refcount,props,props_enc16,iproto,iproto_enc16,esize,enext,asize,hsize,nativefunc,nargs,magic) \ argument
12537 …roto), (esize), (enext), (asize), (hsize) }, (nativefunc), (duk_int16_t) (nargs), (duk_int16_t) (m…
19799 tmp16 = func->nargs; in duk__dump_func()
19880 …p_uint32_prop(thr, p, bw_ctx, (duk_hobject *) func, DUK_STRIDX_LENGTH, (duk_uint32_t) func->nargs); in duk__dump_func()
19970 h_fun->nargs = DUK_RAW_READINC_U16_BE(p); in duk__load_func()
20331 duk_idx_t nargs; member
20337 duk_idx_t nargs; member
20343 duk_idx_t nargs; member
20352 DUK_LOCAL duk_idx_t duk__call_get_idx_func(duk_hthread *thr, duk_idx_t nargs, duk_idx_t other) { in duk__call_get_idx_func() argument
20359 idx_func = duk_get_top(thr) - nargs - other; in duk__call_get_idx_func()
20360 if (DUK_UNLIKELY((idx_func | nargs) < 0)) { /* idx_func < 0 || nargs < 0; OR sign bits */ in duk__call_get_idx_func()
20372 DUK_LOCAL duk_idx_t duk__call_get_idx_func_unvalidated(duk_hthread *thr, duk_idx_t nargs, duk_idx_t… in duk__call_get_idx_func_unvalidated() argument
20377 DUK_ASSERT(nargs >= 0); in duk__call_get_idx_func_unvalidated()
20380 idx_func = duk_get_top(thr) - nargs - other; in duk__call_get_idx_func_unvalidated()
20389 …L void duk__call_prop_prep_stack(duk_hthread *thr, duk_idx_t normalized_obj_idx, duk_idx_t nargs) { in duk__call_prop_prep_stack() argument
20391 DUK_ASSERT(nargs >= 0); in duk__call_prop_prep_stack()
20394 (long) normalized_obj_idx, (long) nargs, (long) duk_get_top(thr))); in duk__call_prop_prep_stack()
20399 duk_dup(thr, -nargs - 1); /* Note: -nargs alone would fail for nargs == 0, this is OK */ in duk__call_prop_prep_stack()
20411 tv_key = DUK_GET_TVAL_NEGIDX(thr, -nargs - 2); in duk__call_prop_prep_stack()
20421 duk_replace(thr, -nargs - 2); in duk__call_prop_prep_stack()
20426 duk_insert(thr, -nargs - 1); in duk__call_prop_prep_stack()
20431 DUK_EXTERNAL void duk_call(duk_hthread *thr, duk_idx_t nargs) { in duk_call() argument
20437 idx_func = duk__call_get_idx_func(thr, nargs, 1); in duk_call()
20446 DUK_EXTERNAL void duk_call_method(duk_hthread *thr, duk_idx_t nargs) { in duk_call_method() argument
20452 idx_func = duk__call_get_idx_func(thr, nargs, 2); in duk_call_method()
20459 DUK_EXTERNAL void duk_call_prop(duk_hthread *thr, duk_idx_t obj_idx, duk_idx_t nargs) { in duk_call_prop() argument
20470 if (DUK_UNLIKELY(nargs < 0)) { in duk_call_prop()
20475 duk__call_prop_prep_stack(thr, obj_idx, nargs); in duk_call_prop()
20477 duk_call_method(thr, nargs); in duk_call_prop()
20489 idx_func = duk__call_get_idx_func_unvalidated(thr, args->nargs, 1); in duk__pcall_raw()
20501 DUK_EXTERNAL duk_int_t duk_pcall(duk_hthread *thr, duk_idx_t nargs) { in duk_pcall() argument
20506 args.nargs = nargs; in duk_pcall()
20507 if (DUK_UNLIKELY(nargs < 0)) { in duk_pcall()
20513 …return duk_safe_call(thr, duk__pcall_raw, (void *) &args /*udata*/, nargs + 1 /*nargs*/, 1 /*nrets… in duk_pcall()
20526 idx_func = duk__call_get_idx_func_unvalidated(thr, args->nargs, 2); in duk__pcall_method_raw()
20536 DUK_INTERNAL duk_int_t duk_pcall_method_flags(duk_hthread *thr, duk_idx_t nargs, duk_small_uint_t c… in duk_pcall_method_flags() argument
20541 args.nargs = nargs; in duk_pcall_method_flags()
20542 if (DUK_UNLIKELY(nargs < 0)) { in duk_pcall_method_flags()
20548 …return duk_safe_call(thr, duk__pcall_method_raw, (void *) &args /*udata*/, nargs + 2 /*nargs*/, 1 … in duk_pcall_method_flags()
20551 DUK_EXTERNAL duk_int_t duk_pcall_method(duk_hthread *thr, duk_idx_t nargs) { in duk_pcall_method() argument
20554 return duk_pcall_method_flags(thr, nargs, 0); in duk_pcall_method()
20568 duk__call_prop_prep_stack(thr, obj_idx, args->nargs); in duk__pcall_prop_raw()
20570 ret = duk_handle_call_unprotected_nargs(thr, args->nargs, args->call_flags); in duk__pcall_prop_raw()
20576 DUK_EXTERNAL duk_int_t duk_pcall_prop(duk_hthread *thr, duk_idx_t obj_idx, duk_idx_t nargs) { in duk_pcall_prop() argument
20582 args.nargs = nargs; in duk_pcall_prop()
20583 if (DUK_UNLIKELY(nargs < 0)) { in duk_pcall_prop()
20589 …return duk_safe_call(thr, duk__pcall_prop_raw, (void *) &args /*udata*/, nargs + 1 /*nargs*/, 1 /*… in duk_pcall_prop()
20592 …all(duk_hthread *thr, duk_safe_call_function func, void *udata, duk_idx_t nargs, duk_idx_t nrets) { in duk_safe_call() argument
20605 if (DUK_UNLIKELY((nargs | nrets) < 0 || /* nargs < 0 || nrets < 0; OR sign bits */ in duk_safe_call()
20606 … thr->valstack_top < thr->valstack_bottom + nargs || /* nargs too large compared to top */ in duk_safe_call()
20607 …thr->valstack_end + nargs < thr->valstack_top + nrets)) { /* nrets too large compared to reserve … in duk_safe_call()
20611 (long) nargs, in duk_safe_call()
20615 (long) nargs, in duk_safe_call()
20617 (long) nargs, in duk_safe_call()
20627 nargs, /* num_stack_args */ in duk_safe_call()
20633 DUK_EXTERNAL void duk_new(duk_hthread *thr, duk_idx_t nargs) { in duk_new() argument
20638 idx_func = duk__call_get_idx_func(thr, nargs, 1); in duk_new()
20648 duk_idx_t nargs; in duk__pnew_helper() local
20651 nargs = *((duk_idx_t *) udata); in duk__pnew_helper()
20653 duk_new(thr, nargs); in duk__pnew_helper()
20657 DUK_EXTERNAL duk_int_t duk_pnew(duk_hthread *thr, duk_idx_t nargs) { in duk_pnew() argument
20667 if (DUK_UNLIKELY(nargs < 0)) { in duk_pnew()
20672 …rc = duk_safe_call(thr, duk__pnew_helper, (void *) &nargs /*udata*/, nargs + 1 /*nargs*/, 1 /*nret… in duk_pnew()
21900 duk_int_t nargs; in duk_compile_raw() local
21907 nargs = flags & 0x07; in duk_compile_raw()
21908 DUK_ASSERT(nargs == ((flags & DUK_COMPILE_NOSOURCE) ? 0 : 1) + in duk_compile_raw()
21910 rc = duk_safe_call(thr, duk__do_compile, (void *) comp_args, nargs, nrets); in duk_compile_raw()
23447 duk_push_c_function(thr, ent->value, ent->nargs); in duk_put_function_list()
23789 …duk__push_c_function_raw(duk_hthread *thr, duk_c_function func, duk_idx_t nargs, duk_uint_t flags,…
27377 duk_idx_t nargs; in duk__push_func_from_lightfunc() local
27382 nargs = (duk_idx_t) DUK_LFUNC_FLAGS_GET_NARGS(lf_flags); in duk__push_func_from_lightfunc()
27383 if (nargs == DUK_LFUNC_NARGS_VARARGS) { in duk__push_func_from_lightfunc()
27384 nargs = (duk_idx_t) DUK_VARARGS; in duk__push_func_from_lightfunc()
27396 (void) duk__push_c_function_raw(thr, func, nargs, flags, DUK_BIDX_NATIVE_FUNCTION_PROTOTYPE); in duk__push_func_from_lightfunc()
27399 if ((duk_idx_t) lf_len != nargs) { in duk__push_func_from_lightfunc()
28867 DUK_LOCAL duk_idx_t duk__push_c_function_raw(duk_hthread *thr, duk_c_function func, duk_idx_t nargs… in duk__push_c_function_raw() argument
28880 if (nargs >= 0 && nargs < DUK_HNATFUNC_NARGS_MAX) { in duk__push_c_function_raw()
28881 func_nargs = (duk_int16_t) nargs; in duk__push_c_function_raw()
28882 } else if (nargs == DUK_VARARGS) { in duk__push_c_function_raw()
28892 obj->nargs = func_nargs; in duk__push_c_function_raw()
28895 (unsigned long) obj->obj.hdr.h_flags, (long) obj->nargs)); in duk__push_c_function_raw()
28912 DUK_EXTERNAL duk_idx_t duk_push_c_function(duk_hthread *thr, duk_c_function func, duk_int_t nargs) { in duk_push_c_function() argument
28930 return duk__push_c_function_raw(thr, func, nargs, flags, DUK_BIDX_NATIVE_FUNCTION_PROTOTYPE); in duk_push_c_function()
28933 …INTERNAL void duk_push_c_function_builtin(duk_hthread *thr, duk_c_function func, duk_int_t nargs) { in duk_push_c_function_builtin() argument
28949 (void) duk__push_c_function_raw(thr, func, nargs, flags, DUK_BIDX_FUNCTION_PROTOTYPE); in duk_push_c_function_builtin()
28952 …d duk_push_c_function_builtin_noconstruct(duk_hthread *thr, duk_c_function func, duk_int_t nargs) { in duk_push_c_function_builtin_noconstruct() argument
28967 (void) duk__push_c_function_raw(thr, func, nargs, flags, DUK_BIDX_FUNCTION_PROTOTYPE); in duk_push_c_function_builtin_noconstruct()
28970 DUK_EXTERNAL duk_idx_t duk_push_c_lightfunc(duk_hthread *thr, duk_c_function func, duk_idx_t nargs,… in duk_push_c_lightfunc() argument
28978 if (nargs >= DUK_LFUNC_NARGS_MIN && nargs <= DUK_LFUNC_NARGS_MAX) { in duk_push_c_lightfunc()
28980 } else if (nargs == DUK_VARARGS) { in duk_push_c_lightfunc()
28981 nargs = DUK_LFUNC_NARGS_VARARGS; in duk_push_c_lightfunc()
28992 …DUK_LFUNC_FLAGS_PACK((duk_small_int_t) magic, (duk_small_uint_t) length, (duk_small_uint_t) nargs); in duk_push_c_lightfunc()
30615 (unsigned int) (duk_uint16_t) h->nargs,
31282 duk_idx_t nargs; in duk_bi_array_constructor() local
31288 nargs = duk_get_top(thr); in duk_bi_array_constructor()
31290 if (nargs == 1 && duk_is_number(thr, 0)) { in duk_bi_array_constructor()
31309 duk_pack(thr, nargs); in duk_bi_array_constructor()
32087 duk_idx_t nargs; in duk_bi_array_prototype_splice() local
32098 nargs = duk_get_top(thr); in duk_bi_array_prototype_splice()
32099 if (nargs < 2) { in duk_bi_array_prototype_splice()
32101 nargs = 2; in duk_bi_array_prototype_splice()
32135 DUK_ASSERT(nargs >= 2); in duk_bi_array_prototype_splice()
32136 item_count = (duk_int_t) (nargs - 2); in duk_bi_array_prototype_splice()
32157 DUK_ASSERT_TOP(thr, nargs + 3); in duk_bi_array_prototype_splice()
32180 DUK_ASSERT_TOP(thr, nargs + 3); in duk_bi_array_prototype_splice()
32192 DUK_ASSERT_TOP(thr, nargs + 3); in duk_bi_array_prototype_splice()
32200 DUK_ASSERT_TOP(thr, nargs + 3); in duk_bi_array_prototype_splice()
32208 DUK_ASSERT_TOP(thr, nargs + 3); in duk_bi_array_prototype_splice()
32220 DUK_ASSERT_TOP(thr, nargs + 3); in duk_bi_array_prototype_splice()
32228 DUK_ASSERT_TOP(thr, nargs + 3); in duk_bi_array_prototype_splice()
32245 DUK_ASSERT_TOP(thr, nargs + 3); in duk_bi_array_prototype_splice()
32413 duk_idx_t nargs; in duk_bi_array_prototype_unshift() local
32417 nargs = duk_get_top(thr); in duk_bi_array_prototype_unshift()
32425 DUK_ASSERT_TOP(thr, nargs + 2); in duk_bi_array_prototype_unshift()
32432 if (len + (duk_uint32_t) nargs < len) { in duk_bi_array_prototype_unshift()
32439 DUK_ASSERT_TOP(thr, nargs + 2); in duk_bi_array_prototype_unshift()
32446 …duk_put_prop_index(thr, -3, (duk_uarridx_t) (i + (duk_uint32_t) nargs)); /* -> [ ... ToObject(thi… in duk_bi_array_prototype_unshift()
32451 …duk_del_prop_index(thr, -2, (duk_uarridx_t) (i + (duk_uint32_t) nargs)); /* -> [ ... ToObject(thi… in duk_bi_array_prototype_unshift()
32453 DUK_ASSERT_TOP(thr, nargs + 2); in duk_bi_array_prototype_unshift()
32456 for (i = 0; i < (duk_uint32_t) nargs; i++) { in duk_bi_array_prototype_unshift()
32457 DUK_ASSERT_TOP(thr, nargs + 2); in duk_bi_array_prototype_unshift()
32460 DUK_ASSERT_TOP(thr, nargs + 2); in duk_bi_array_prototype_unshift()
32463 DUK_ASSERT_TOP(thr, nargs + 2); in duk_bi_array_prototype_unshift()
32464 duk_push_u32(thr, len + (duk_uint32_t) nargs); in duk_bi_array_prototype_unshift()
32475 duk_idx_t nargs; in duk_bi_array_prototype_indexof_shared() local
32485 nargs = duk_get_top(thr); in duk_bi_array_prototype_indexof_shared()
32509 if (nargs >= 2) { in duk_bi_array_prototype_indexof_shared()
32701 duk_idx_t nargs; in duk_bi_array_prototype_reduce_shared() local
32709 nargs = duk_get_top(thr); in duk_bi_array_prototype_reduce_shared()
32710 DUK_DDD(DUK_DDDPRINT("nargs=%ld", (long) nargs)); in duk_bi_array_prototype_reduce_shared()
32724 if (nargs >= 2) { in duk_bi_array_prototype_reduce_shared()
38584 duk_idx_t nargs; in duk__set_part_helper() local
38589 nargs = duk_get_top(thr); in duk__set_part_helper()
38636 if ((duk_idx_t) i >= nargs) { in duk__set_part_helper()
38705 DUK_LOCAL void duk__set_parts_from_args(duk_hthread *thr, duk_double_t *dparts, duk_idx_t nargs) { in duk__set_parts_from_args() argument
38722 if ((duk_idx_t) i < nargs) { in duk__set_parts_from_args()
38892 duk_idx_t nargs = duk_get_top(thr); in duk_bi_date_constructor() local
38897 DUK_DDD(DUK_DDDPRINT("Date constructor, nargs=%ld, is_cons=%ld", (long) nargs, (long) is_cons)); in duk_bi_date_constructor()
38909 if (nargs == 0 || !is_cons) { in duk_bi_date_constructor()
38918 } else if (nargs == 1) { in duk_bi_date_constructor()
38932 duk__set_parts_from_args(thr, dparts, nargs); in duk_bi_date_constructor()
38946 duk_idx_t nargs = duk_get_top(thr); in duk_bi_date_constructor_utc() local
38954 if (nargs < 2) { in duk_bi_date_constructor_utc()
38957 duk__set_parts_from_args(thr, dparts, nargs); in duk_bi_date_constructor_utc()
40906 duk_idx_t nargs; in duk_bi_function_constructor() local
40915 nargs = duk_get_top(thr); in duk_bi_function_constructor()
40916 for (i = 0; i < nargs; i++) { in duk_bi_function_constructor()
40920 if (nargs == 0) { in duk_bi_function_constructor()
40923 } else if (nargs == 1) { in duk_bi_function_constructor()
40930 duk_join(thr, nargs - 1); in duk_bi_function_constructor()
41092 duk_idx_t nargs; /* bound args, not counting 'this' binding */ in duk_bi_function_prototype_bind() local
41105 nargs = duk_get_top(thr) - 1; /* actual args, not counting 'this' binding */ in duk_bi_function_prototype_bind()
41106 if (nargs < 0) { in duk_bi_function_prototype_bind()
41107 nargs++; in duk_bi_function_prototype_bind()
41110 DUK_ASSERT(nargs >= 0); in duk_bi_function_prototype_bind()
41115 if (nargs > (duk_idx_t) DUK_HBOUNDFUNC_MAX_ARGS) { in duk_bi_function_prototype_bind()
41123 DUK_ASSERT_TOP(thr, nargs + 2); in duk_bi_function_prototype_bind()
41130 DUK_ASSERT(h_bound->nargs == 0); in duk_bi_function_prototype_bind()
41188 n_prevbound = h_boundtarget->nargs; in duk_bi_function_prototype_bind()
41203 bound_nargs = n_prevbound + nargs; in duk_bi_function_prototype_bind()
41210 DUK_ASSERT(h_bound->nargs == 0); in duk_bi_function_prototype_bind()
41212 h_bound->nargs = bound_nargs; in duk_bi_function_prototype_bind()
41216 DUK_ASSERT(nargs >= 0); in duk_bi_function_prototype_bind()
41217 duk_copy_tvals_incref(thr, tv_res + n_prevbound, DUK_GET_TVAL_POSIDX(thr, 1), (duk_size_t) nargs); in duk_bi_function_prototype_bind()
41226 if (bound_len < nargs) { in duk_bi_function_prototype_bind()
41229 bound_len -= nargs; in duk_bi_function_prototype_bind()
41286 func_nargs = h->nargs; in duk_bi_native_function_length()
45713 duk_idx_t nargs; local
45721 nargs = duk_get_top(thr);
45726 for (i = 0; i < nargs; i++) {
45755 for (i = 0; i < nargs; i++) {
45900 duk_idx_t nargs; local
45910 nargs = duk_get_top(thr);
45911 if (nargs == 0) {
46200 duk_idx_t nargs; local
46203 nargs = duk_get_top_require_min(thr, 1 /*min_top*/);
46206 for (idx = 1; idx < nargs; idx++) {
47224 duk_idx_t nargs; local
47227 nargs = duk_get_top_require_min(thr, 2 /*min_top*/);
47230 if (nargs >= 3 && !duk_strict_equals(thr, 0, 2)) {
47267 duk_idx_t nargs; local
47271 nargs = duk_get_top_require_min(thr, 3 /*min_top*/);
47274 if (nargs >= 4 && !duk_strict_equals(thr, 0, 3)) {
50169 DUK__COMMA(); duk_fb_sprintf(fb, "__nargs:%ld", (long) f->nargs);
50180 DUK__COMMA(); duk_fb_sprintf(fb, "__nargs:%ld", (long) f->nargs);
52992 duk__debug_getinfo_prop_int(thr, "nargs", h_fun->nargs);
53010 duk__debug_getinfo_prop_int(thr, "nargs", h_fun->nargs);
53045 duk_debug_write_int(thr, h_bfun->nargs);
56867 duk__mark_tvals(heap, f->args, f->nargs);
59002 duk__decref_tvals_norz(thr, f->args, f->nargs);
61421 DUK_ASSERT(h->nargs == 0 || h->args != NULL);
71112 len = h_bound->nargs;
72179 *out_nargs = ((duk_hcompfunc *) func)->nargs;
72272 *out_nargs = ((duk_hcompfunc *) func)->nargs;
72282 *out_nargs = ((duk_hnatfunc *) func)->nargs;
72482 duk_idx_t nargs; /* # argument registers target function wants (< 0 => "as is") */ local
72629 nargs = 0;
72642 &nargs,
72662 &nargs,
72704 DUK_ASSERT(nregs >= nargs);
72705 duk_set_top_and_wipe(thr, nregs, nargs);
72708 DUK_ASSERT(nregs >= nargs);
72709 duk_set_top_and_wipe(thr, idx_func + 2 + nregs, idx_func + 2 + nargs);
72929 duk_idx_t nargs, argument
72932 DUK_ASSERT(duk_get_top(thr) >= nargs + 2);
72933 idx_func = duk_get_top(thr) - (nargs + 2);
74294 h_res->nargs = (duk_uint16_t) duk_hobject_get_length(thr, func->h_argnames);
74295 DUK_ASSERT(h_res->nregs >= h_res->nargs); /* pass2 allocation handles this */
74363 if (formals_length != (duk_size_t) h_res->nargs) {
76730 duk_int_t nargs = 0; local
76742 if (nargs > 0) {
76760 nargs++;
76762 DUK_DDD(DUK_DDDPRINT("argument #%ld written into reg %ld", (long) nargs, (long) reg_temp));
76770 return nargs;
76923 duk_int_t nargs; local
76962 …nargs = duk__parse_arguments(comp_ctx, res); /* parse args starting from "next temp", reg_target …
76967 nargs = 0;
76972 nargs /*num_args*/,
77413 duk_int_t nargs; local
77513 nargs = duk__parse_arguments(comp_ctx, res); /* parse args starting from "next temp" */
77521 (duk_regconst_t) nargs /*numargs*/,
84237 DUK_LOCAL duk_bool_t duk__executor_handle_call(duk_hthread *thr, duk_idx_t idx, duk_idx_t nargs, du… argument
84240 duk_set_top_unsafe(thr, (duk_idx_t) (idx + nargs + 2)); /* [ ... func this arg1 ... argN ] */
86323 duk_idx_t nargs; local
86333 nargs = (duk_idx_t) DUK_DEC_A(ins);
86337 if (duk__executor_handle_call(thr, idx, nargs, call_flags)) {
86371 duk_uint_fast_t nargs; local
86381 nargs = (duk_uint_fast_t) DUK_DEC_A(ins);
86382 DUK__LOOKUP_INDIRECT(nargs);
86386 if (duk__executor_handle_call(thr, idx, (duk_idx_t) nargs, call_flags)) {
88472 fun_clos->nargs = fun_temp->nargs;
88682 len_value = fun_temp->nargs;