Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
  • Loading branch information
sverker committed Feb 15, 2024
2 parents 94cc745 + 1e9f6c2 commit e584384
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 13 deletions.
22 changes: 18 additions & 4 deletions erts/emulator/beam/jit/arm/beam_asm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,24 @@ struct BeamAssembler : public BeamAssemblerCommon {
/* Store HTOP and E in one go. */
ERTS_CT_ASSERT_FIELD_PAIR(Process, htop, stop);
a.stp(HTOP, E, arm::Mem(c_p, offsetof(Process, htop)));
} else if (Spec & Update::eStack) {
a.str(E, arm::Mem(c_p, offsetof(Process, stop)));
} else if (Spec & Update::eHeap) {
a.str(HTOP, arm::Mem(c_p, offsetof(Process, htop)));
} else {
if (Spec & Update::eStack) {
a.str(E, arm::Mem(c_p, offsetof(Process, stop)));
} else {
#ifdef DEBUG
/* Store some garbage in the process structure to catch missing
* updates. */
a.str(active_code_ix, arm::Mem(c_p, offsetof(Process, stop)));
#endif
}

if (Spec & Update::eHeap) {
a.str(HTOP, arm::Mem(c_p, offsetof(Process, htop)));
} else {
#ifdef DEBUG
a.str(active_code_ix, arm::Mem(c_p, offsetof(Process, htop)));
#endif
}
}

if (Spec & Update::eReductions) {
Expand Down
4 changes: 2 additions & 2 deletions erts/emulator/beam/jit/arm/beam_asm_global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,15 @@ void BeamModuleAssembler::emit_raise_exception(Label I,
}

void BeamGlobalAssembler::emit_process_exit() {
emit_enter_runtime();
emit_enter_runtime<Update::eHeapAlloc | Update::eReductions>();

a.mov(ARG1, c_p);
mov_imm(ARG2, 0);
mov_imm(ARG4, 0);
load_x_reg_array(ARG3);
runtime_call<4>(handle_error);

emit_leave_runtime();
emit_leave_runtime<Update::eHeapAlloc | Update::eReductions>();

a.cbz(ARG1, labels[do_schedule]);
a.udf(0xdead);
Expand Down
24 changes: 20 additions & 4 deletions erts/emulator/beam/jit/x86/beam_asm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,26 @@ struct BeamAssembler : public BeamAssemblerCommon {
a.movups(x86::xmmword_ptr(c_p, offsetof(Process, htop)),
x86::xmm0);
}
} else if (Spec & Update::eHeap) {
a.mov(x86::qword_ptr(c_p, offsetof(Process, htop)), HTOP);
} else if (Spec & Update::eStack) {
a.mov(x86::qword_ptr(c_p, offsetof(Process, stop)), E);
} else {
if (Spec & Update::eHeap) {
a.mov(x86::qword_ptr(c_p, offsetof(Process, htop)), HTOP);
} else {
#ifdef DEBUG
/* Store some garbage in the process structure to catch
* missing updates. */
a.mov(x86::qword_ptr(c_p, offsetof(Process, htop)),
active_code_ix);
#endif
}

if (Spec & Update::eStack) {
a.mov(x86::qword_ptr(c_p, offsetof(Process, stop)), E);
} else {
#ifdef DEBUG
a.mov(x86::qword_ptr(c_p, offsetof(Process, stop)),
active_code_ix);
#endif
}
}

#ifdef NATIVE_ERLANG_STACK
Expand Down
4 changes: 2 additions & 2 deletions erts/emulator/beam/jit/x86/beam_asm_global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,15 +275,15 @@ void BeamModuleAssembler::emit_raise_exception(x86::Gp I,
}

void BeamGlobalAssembler::emit_process_exit() {
emit_enter_runtime();
emit_enter_runtime<Update::eHeapAlloc | Update::eReductions>();

a.mov(ARG1, c_p);
mov_imm(ARG2, 0);
mov_imm(ARG4, 0);
load_x_reg_array(ARG3);
runtime_call<4>(handle_error);

emit_leave_runtime();
emit_leave_runtime<Update::eHeapAlloc | Update::eReductions>();

a.test(RET, RET);
a.je(labels[do_schedule]);
Expand Down
2 changes: 1 addition & 1 deletion erts/emulator/test/long_timers_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ start_node(Name) ->

stop_node(Node) ->
monitor_node(Node, true),
spawn(Node, fun () -> halt() end),
spawn(Node, fun erlang:halt/0),
receive {nodedown, Node} -> ok end.

load_driver(Dir, Driver) ->
Expand Down

0 comments on commit e584384

Please sign in to comment.