diff options
author | Erlang/OTP <[email protected]> | 2010-03-22 14:51:35 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-03-22 15:56:43 +0100 |
commit | a4b4d36cdbbd692123443a1d3f19f1c452963201 (patch) | |
tree | 218002c4a2b38f69eb67d6388c8034820812fd47 /erts/emulator/beam/beam_bif_load.c | |
parent | 835dba95f810cc925ac856171014b9dbea8c90be (diff) | |
parent | 24095d93fb28bdd60abe771a426e39c6ff0f72c7 (diff) | |
download | otp-a4b4d36cdbbd692123443a1d3f19f1c452963201.tar.gz otp-a4b4d36cdbbd692123443a1d3f19f1c452963201.tar.bz2 otp-a4b4d36cdbbd692123443a1d3f19f1c452963201.zip |
Merge branch 'pan/otp_8332_halfword' into dev
* pan/otp_8332_halfword:
Teach testcase in driver_suite the new prototype for driver_async
wx: Correct usage of driver callbacks from wx thread
Adopt the new (R13B04) Nif functionality to the halfword codebase
Support monitoring and demonitoring from driver threads
Fix further test-suite problems
Correct the VM to work for more test suites
Teach {wordsize,internal|external} to system_info/1
Make tracing and distribution work
Turn on instruction packing in the loader and virtual machine
Add the BeamInstr data type for loaded BEAM code
Fix the BEAM dissambler for the half-word emulator
Store pointers to heap data in 32-bit words
Add a custom mmap wrapper to force heaps into the lower address range
Fit all heap data into the 32-bit address range
Diffstat (limited to 'erts/emulator/beam/beam_bif_load.c')
-rw-r--r-- | erts/emulator/beam/beam_bif_load.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c index b1feec7074..8462f1c7fd 100644 --- a/erts/emulator/beam/beam_bif_load.c +++ b/erts/emulator/beam/beam_bif_load.c @@ -39,10 +39,10 @@ static Eterm check_process_code(Process* rp, Module* modp); static void delete_code(Process *c_p, ErtsProcLocks c_p_locks, Module* modp); static void delete_export_references(Eterm module); static int purge_module(int module); -static int is_native(Eterm* code); +static int is_native(BeamInstr* code); static int any_heap_ref_ptrs(Eterm* start, Eterm* end, char* mod_start, Uint mod_size); static int any_heap_refs(Eterm* start, Eterm* end, char* mod_start, Uint mod_size); -static void remove_from_address_table(Eterm* code); +static void remove_from_address_table(BeamInstr* code); Eterm load_module_2(BIF_ALIST_2) @@ -344,8 +344,8 @@ BIF_RETTYPE finish_after_on_load_2(BIF_ALIST_2) modp->code[MI_ON_LOAD_FUNCTION_PTR] = 0; set_default_trace_pattern(BIF_ARG_1); } else if (BIF_ARG_2 == am_false) { - Eterm* code; - Eterm* end; + BeamInstr* code; + BeamInstr* end; /* * The on_load function failed. Remove the loaded code. @@ -354,7 +354,7 @@ BIF_RETTYPE finish_after_on_load_2(BIF_ALIST_2) */ erts_total_code_size -= modp->code_length; code = modp->code; - end = (Eterm *)((char *)code + modp->code_length); + end = (BeamInstr *)((char *)code + modp->code_length); erts_cleanup_funs_on_purge(code, end); beam_catches_delmod(modp->catches, code, modp->code_length); erts_free(ERTS_ALC_T_CODE, (void *) code); @@ -397,10 +397,10 @@ set_default_trace_pattern(Eterm module) static Eterm check_process_code(Process* rp, Module* modp) { - Eterm* start; + BeamInstr* start; char* mod_start; Uint mod_size; - Eterm* end; + BeamInstr* end; Eterm* sp; #ifndef HYBRID /* FIND ME! */ ErlFunThing* funp; @@ -418,7 +418,7 @@ check_process_code(Process* rp, Module* modp) * Pick up limits for the module. */ start = modp->old_code; - end = (Eterm *)((char *)start + modp->old_code_length); + end = (BeamInstr *)((char *)start + modp->old_code_length); mod_start = (char *) start; mod_size = modp->old_code_length; @@ -472,11 +472,11 @@ check_process_code(Process* rp, Module* modp) #ifndef HYBRID /* FIND ME! */ rescan: for (funp = MSO(rp).funs; funp; funp = funp->next) { - Eterm* fun_code; + BeamInstr* fun_code; fun_code = funp->fe->address; - if (INSIDE((Eterm *) funp->fe->address)) { + if (INSIDE((BeamInstr *) funp->fe->address)) { if (done_gc) { return am_true; } else { @@ -576,7 +576,7 @@ any_heap_ref_ptrs(Eterm* start, Eterm* end, char* mod_start, Uint mod_size) switch (primary_tag(val)) { case TAG_PRIMARY_BOXED: case TAG_PRIMARY_LIST: - if (in_area(val, mod_start, mod_size)) { + if (in_area(EXPAND_POINTER(val), mod_start, mod_size)) { return 1; } break; @@ -596,7 +596,7 @@ any_heap_refs(Eterm* start, Eterm* end, char* mod_start, Uint mod_size) switch (primary_tag(val)) { case TAG_PRIMARY_BOXED: case TAG_PRIMARY_LIST: - if (in_area(val, mod_start, mod_size)) { + if (in_area(EXPAND_POINTER(val), mod_start, mod_size)) { return 1; } break; @@ -617,8 +617,8 @@ any_heap_refs(Eterm* start, Eterm* end, char* mod_start, Uint mod_size) static int purge_module(int module) { - Eterm* code; - Eterm* end; + BeamInstr* code; + BeamInstr* end; Module* modp; /* @@ -653,7 +653,7 @@ purge_module(int module) ASSERT(erts_total_code_size >= modp->old_code_length); erts_total_code_size -= modp->old_code_length; code = modp->old_code; - end = (Eterm *)((char *)code + modp->old_code_length); + end = (BeamInstr *)((char *)code + modp->old_code_length); erts_cleanup_funs_on_purge(code, end); beam_catches_delmod(modp->old_catches, code, modp->old_code_length); erts_free(ERTS_ALC_T_CODE, (void *) code); @@ -665,7 +665,7 @@ purge_module(int module) } static void -remove_from_address_table(Eterm* code) +remove_from_address_table(BeamInstr* code) { int i; @@ -738,11 +738,11 @@ delete_export_references(Eterm module) Export *ep = export_list(i); if (ep != NULL && (ep->code[0] == module)) { if (ep->address == ep->code+3 && - (ep->code[3] == (Eterm) em_apply_bif)) { + (ep->code[3] == (BeamInstr) em_apply_bif)) { continue; } ep->address = ep->code+3; - ep->code[3] = (Uint) em_call_error_handler; + ep->code[3] = (BeamInstr) em_call_error_handler; ep->code[4] = 0; MatchSetUnref(ep->match_prog_set); ep->match_prog_set = NULL; @@ -774,7 +774,7 @@ beam_make_current_old(Process *c_p, ErtsProcLocks c_p_locks, Eterm module) } static int -is_native(Eterm* code) +is_native(BeamInstr* code) { return ((Eterm *)code[MI_FUNCTIONS])[1] != 0; } |