aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2012-01-24 17:08:40 +0100
committerSverker Eriksson <[email protected]>2012-02-21 12:23:04 +0100
commit88c771c1d69c98169ef9bc10c27ed4378854d368 (patch)
treec8eceae647344e35a2fd54c2982fd3db0053824a /erts/emulator/beam
parenta23f25a3014dbad01d2016dc4e6d6df9d59ba64c (diff)
downloadotp-88c771c1d69c98169ef9bc10c27ed4378854d368.tar.gz
otp-88c771c1d69c98169ef9bc10c27ed4378854d368.tar.bz2
otp-88c771c1d69c98169ef9bc10c27ed4378854d368.zip
erts: Cleanup code loading
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/beam_catches.h2
-rw-r--r--erts/emulator/beam/beam_load.c4
-rw-r--r--erts/emulator/beam/erl_init.c2
-rw-r--r--erts/emulator/beam/export.c9
4 files changed, 8 insertions, 9 deletions
diff --git a/erts/emulator/beam/beam_catches.h b/erts/emulator/beam/beam_catches.h
index 309b5cc857..4a0e070c69 100644
--- a/erts/emulator/beam/beam_catches.h
+++ b/erts/emulator/beam/beam_catches.h
@@ -20,7 +20,7 @@
#ifndef __BEAM_CATCHES_H
#define __BEAM_CATCHES_H
-#include "global.h" /*SVERK the code_ix stuff */
+#include "code_ix.h"
#define BEAM_CATCHES_NIL (-1)
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index d393ff6a34..4ac426fc9e 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -1240,7 +1240,7 @@ load_import_table(LoaderState* stp)
* If the export entry refers to a BIF, get the pointer to
* the BIF function.
*/
- if ((e = erts_active_export_entry(mod, func, arity)) != NULL) { /*SVERK does it matter which one we use? */
+ if ((e = erts_active_export_entry(mod, func, arity)) != NULL) {
if (e->code[3] == (BeamInstr) em_apply_bif) {
stp->import[i].bf = (BifFunction) e->code[4];
if (func == am_load_nif && mod == am_erlang && arity == 2) {
@@ -5952,7 +5952,7 @@ static erts_smp_atomic32_t the_loader_code_index;
static erts_smp_mtx_t sverk_code_ix_lock; /*SVERK FIXME */
static erts_smp_rwmtx_t the_old_code_rwlocks[ERTS_NUM_CODE_IX];
-#ifdef DEBUG
+#if 0
# define CIX_TRACE(text) erts_fprintf(stderr, "CIX_TRACE: " text " act=%u load=%u\r\n", erts_active_code_ix(), erts_staging_code_ix())
#else
# define CIX_TRACE(text)
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c
index 1184cb28fa..2d192b3fc4 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -236,7 +236,7 @@ void erl_error(char *fmt, va_list args)
static int early_init(int *argc, char **argv);
void
-erts_short_init_SVERK_SAYS_NOT_USED(void)
+erts_short_init(void)
{
int ncpu = early_init(NULL, NULL);
erl_init(ncpu);
diff --git a/erts/emulator/beam/export.c b/erts/emulator/beam/export.c
index b9dcb1fb47..4a2a77a527 100644
--- a/erts/emulator/beam/export.c
+++ b/erts/emulator/beam/export.c
@@ -274,9 +274,8 @@ erts_find_function(Eterm m, Eterm f, unsigned int a, ErtsCodeIndex code_ix)
* Returns a pointer to an existing export entry for a MFA,
* or creates a new one and returns the pointer.
*
- * This function provides unlocked write access to the main export
- * table. It should only be used during start up or when
- * all other threads are blocked.
+ * This function acts on the staging export table. It should only be used
+ * to load new code.
*/
Export*
@@ -318,11 +317,11 @@ erts_export_get_or_make_stub(Eterm mod, Eterm func, unsigned int arity)
ep = erts_find_export_entry(mod, func, arity, code_ix);
if (ep == 0) {
/*
- * The code is not loaded (yet). Put the export in the loader
+ * The code is not loaded (yet). Put the export in the staging
* export table, to avoid having to lock the active export table.
*/
export_write_lock();
- if (erts_active_code_ix() == code_ix) { /*SVERK barrier? */
+ if (erts_active_code_ix() == code_ix) {
struct export_templ templ;
struct export_entry* entry;