void factor_vm::verify_memory_protection_error(cell addr) {
/* Called from the OS-specific top halves of the signal handlers to
- make sure it's safe to dispatch to memory_protection_error */
+ make sure it's safe to dispatch to memory_signal_handler_impl. */
if (fatal_erroring_p)
fa_diddly_atal_error();
if (faulting_p && !code->safepoint_p(addr))
fatal_error("Memory protection fault during gc", addr);
}
-/* Allocates memory */
-void factor_vm::memory_protection_error(cell pc, cell addr) {
- if (code->safepoint_p(addr))
- safepoint.handle_safepoint(this, pc);
- else {
- vm_error_type type = ctx->address_to_error(addr);
- general_error(type, from_unsigned_cell(addr), false_object);
- }
-}
-
/* Allocates memory */
void factor_vm::divide_by_zero_error() {
general_error(ERROR_DIVIDE_BY_ZERO, false_object, false_object);
/* Allocates memory */
void factor_vm::memory_signal_handler_impl() {
- memory_protection_error(signal_fault_pc, signal_fault_addr);
+ if (code->safepoint_p(signal_fault_addr)) {
+ safepoint.handle_safepoint(this, signal_fault_pc);
+ }
+ else {
+ vm_error_type type = ctx->address_to_error(signal_fault_addr);
+ cell number = from_unsigned_cell(signal_fault_addr);
+ general_error(type, number, false_object);
+ }
if (!signal_resumable) {
/* In theory we should only get here if the callstack overflowed during a
safepoint */
void type_error(cell type, cell tagged);
void not_implemented_error();
void verify_memory_protection_error(cell addr);
- void memory_protection_error(cell pc, cell addr);
void divide_by_zero_error();
void primitive_unimplemented();
void memory_signal_handler_impl();