From 0b27c0ce578db5266dbaaa50a6d116836a03aa94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 10 Nov 2011 14:42:47 +0100 Subject: BEAM loader: Refactor code loading into separate functions Break apart code loading into the three functions: erts_alloc_loader_state() erts_prepare_loading() erts_finish_loading() The erts_alloc_loader_state() and erts_prepare_loading() can be executed with all schedulers running. Only erts_finish_loading() needs to be run in a single-scheduling system. --- erts/emulator/beam/global.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'erts/emulator/beam/global.h') diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h index 6c75c3876b..9f19172e08 100644 --- a/erts/emulator/beam/global.h +++ b/erts/emulator/beam/global.h @@ -866,8 +866,14 @@ typedef struct { Eterm* fname_ptr; /* Pointer to fname table */ } FunctionInfo; +struct LoaderState* erts_alloc_loader_state(void); +Eterm erts_prepare_loading(struct LoaderState*, Process *c_p, + Eterm group_leader, Eterm* modp, + byte* code, Uint size); +Eterm erts_finish_loading(struct LoaderState* stp, Process* c_p, + ErtsProcLocks c_p_locks, Eterm* modp); Eterm erts_load_module(Process *c_p, ErtsProcLocks c_p_locks, - Eterm group_leader, Eterm* mod, byte* code, int size); + Eterm group_leader, Eterm* mod, byte* code, Uint size); void init_load(void); BeamInstr* find_function_from_pc(BeamInstr* pc); Eterm* erts_build_mfa_item(FunctionInfo* fi, Eterm* hp, -- cgit v1.2.3