}
+nxt_noinline njs_ret_t
+njs_function_frame(njs_vm_t *vm, njs_function_t *function, njs_value_t *this,
+ njs_value_t *args, nxt_uint_t nargs, nxt_bool_t ctor)
+{
+ size_t size;
+ nxt_uint_t n, max_args;
+ njs_value_t *value, *bound;
+ njs_frame_t *frame;
+ njs_native_frame_t *native_frame;
+
+ max_args = nxt_max(nargs, function->u.lambda->nargs);
+
+ size = NJS_FRAME_SIZE
+ + (function->args_offset + max_args) * sizeof(njs_value_t)
+ + function->u.lambda->local_size;
+
+ native_frame = njs_function_frame_alloc(vm, size);
+ if (nxt_slow_path(native_frame == NULL)) {
+ return NXT_ERROR;
+ }
+
+ native_frame->function = function;
+ native_frame->nargs = nargs;
+ native_frame->ctor = ctor;
+
+ value = (njs_value_t *) ((u_char *) native_frame + NJS_FRAME_SIZE);
+
+ bound = function->bound;
+
+ if (bound == NULL) {
+ *value++ = *this;
+
+ } else {
+ n = function->args_offset;
+
+ do {
+ *value++ = *bound++;
+ n--;
+ } while (n != 0);
+ }
+
+ native_frame->arguments = value;
+ vm->scopes[NJS_SCOPE_CALLEE_ARGUMENTS] = value;
+
+ if (args != NULL) {
+ while (nargs != 0) {
+ *value++ = *args++;
+ max_args--;
+ nargs--;
+ }
+ }
+
+ while (max_args != 0) {
+ *value++ = njs_value_void;
+ max_args--;
+ }
+
+ frame = (njs_frame_t *) native_frame;
+ frame->local = value;
+
+ memcpy(frame->local, function->u.lambda->local_scope,
+ function->u.lambda->local_size);
+
+ return NXT_OK;
+}
+
+
nxt_noinline njs_native_frame_t *
njs_function_frame_alloc(njs_vm_t *vm, size_t size)
{
}
-njs_ret_t
-njs_function_constructor(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs,
- njs_index_t unused)
-{
- return NXT_ERROR;
-}
-
-
nxt_noinline njs_ret_t
njs_function_apply(njs_vm_t *vm, njs_function_t *function, njs_value_t *args,
nxt_uint_t nargs, njs_index_t retval)
}
-nxt_noinline njs_ret_t
-njs_function_frame(njs_vm_t *vm, njs_function_t *function, njs_value_t *this,
- njs_value_t *args, nxt_uint_t nargs, nxt_bool_t ctor)
-{
- size_t size;
- nxt_uint_t n, max_args;
- njs_value_t *value, *bound;
- njs_frame_t *frame;
- njs_native_frame_t *native_frame;
-
- max_args = nxt_max(nargs, function->u.lambda->nargs);
-
- size = NJS_FRAME_SIZE
- + (function->args_offset + max_args) * sizeof(njs_value_t)
- + function->u.lambda->local_size;
-
- native_frame = njs_function_frame_alloc(vm, size);
- if (nxt_slow_path(native_frame == NULL)) {
- return NXT_ERROR;
- }
-
- native_frame->function = function;
- native_frame->nargs = nargs;
- native_frame->ctor = ctor;
-
- value = (njs_value_t *) ((u_char *) native_frame + NJS_FRAME_SIZE);
-
- bound = function->bound;
-
- if (bound == NULL) {
- *value++ = *this;
-
- } else {
- n = function->args_offset;
-
- do {
- *value++ = *bound++;
- n--;
- } while (n != 0);
- }
-
- native_frame->arguments = value;
- vm->scopes[NJS_SCOPE_CALLEE_ARGUMENTS] = value;
-
- if (args != NULL) {
- while (nargs != 0) {
- *value++ = *args++;
- max_args--;
- nargs--;
- }
- }
-
- while (max_args != 0) {
- *value++ = njs_value_void;
- max_args--;
- }
-
- frame = (njs_frame_t *) native_frame;
- frame->local = value;
-
- memcpy(frame->local, function->u.lambda->local_scope,
- function->u.lambda->local_size);
-
- return NXT_OK;
-}
-
-
nxt_noinline njs_ret_t
njs_function_call(njs_vm_t *vm, njs_index_t retval, size_t advance)
{
}
+njs_ret_t
+njs_function_constructor(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs,
+ njs_index_t unused)
+{
+ return NXT_ERROR;
+}
+
+
static const njs_object_prop_t njs_function_constructor_properties[] =
{
/* Function.name == "Function". */