aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-07-26 10:19:31 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-08-01 10:58:59 +0200
commita2359927ca4e7c315e9849deec3375b1f2ae4170 (patch)
tree02858a93132a7da7acbd1487877259f63955445c /erts/emulator/beam/erl_process.c
parent8d4560198239256587ccc55895eb8fe2b214e971 (diff)
downloadotp-a2359927ca4e7c315e9849deec3375b1f2ae4170.tar.gz
otp-a2359927ca4e7c315e9849deec3375b1f2ae4170.tar.bz2
otp-a2359927ca4e7c315e9849deec3375b1f2ae4170.zip
erts: Remove the need for copying of literals
* Literals are not copied between processes for messages or spawn Increases performance of message sent and processes spawned when literals are involved in messages or arguments.
Diffstat (limited to 'erts/emulator/beam/erl_process.c')
-rw-r--r--erts/emulator/beam/erl_process.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index b5d8c5bc75..d6037e9f5d 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -11099,6 +11099,9 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
#ifdef SHCOPY_SPAWN
erts_shcopy_t info;
INITIALIZE_SHCOPY(info);
+#else
+ Eterm *lit_purge_ptr = erts_clrange.ptr;
+ Uint lit_purge_sz = erts_clrange.sz;
#endif
erts_smp_proc_lock(parent, ERTS_PROC_LOCKS_ALL_MINOR);
@@ -11157,7 +11160,7 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
#ifdef SHCOPY_SPAWN
arg_size = copy_shared_calculate(args, &info);
#else
- arg_size = size_object(args);
+ arg_size = size_object_litopt(args, lit_purge_ptr, lit_purge_sz);
#endif
heap_need = arg_size;
@@ -11181,7 +11184,7 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
}
p->schedule_count = 0;
ASSERT(p->min_heap_size == erts_next_heap_size(p->min_heap_size, 0));
-
+
p->u.initial[INITIAL_MOD] = mod;
p->u.initial[INITIAL_FUN] = func;
p->u.initial[INITIAL_ARI] = (Uint) arity;
@@ -11239,7 +11242,8 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
p->arg_reg[2] = copy_shared_perform(args, arg_size, &info, &p->htop, &p->off_heap);
DESTROY_SHCOPY(info);
#else
- p->arg_reg[2] = copy_struct(args, arg_size, &p->htop, &p->off_heap);
+ p->arg_reg[2] = copy_struct_litopt(args, arg_size, &p->htop, &p->off_heap,
+ lit_purge_ptr, lit_purge_sz);
#endif
p->arity = 3;