VM: the unimplemented error isn't used anymore

Cause all the primitives are implemented so it can never ever be
thrown. Probably requires new boot images.
char-rename
Björn Lindqvist 2016-11-23 10:20:09 +01:00
parent 0590ebf914
commit d73666b9d0
9 changed files with 3 additions and 30 deletions

View File

@ -357,10 +357,6 @@ CONSTANT: all-primitives {
"strip-stack-traces" ( -- ) "strip_stack_traces"
{ } { } f
}
{
"unimplemented" ( -- * ) "unimplemented"
{ } { } f
}
}
}
{

View File

@ -147,6 +147,3 @@ HELP: retainstack-overflow.
HELP: memory-error.
{ $error-description "Thrown by the Factor VM if an invalid memory access occurs." }
{ $notes "This can be a result of incorrect usage of C library interface words, a bug in the compiler, or a bug in the VM." } ;
HELP: primitive-error.
{ $error-description "Thrown by the Factor VM if an unsupported primitive word is called." } ;

View File

@ -134,9 +134,6 @@ HOOK: signal-error. os ( obj -- )
: memory-error. ( error -- )
"Memory protection fault at address " write third .h ;
: primitive-error. ( error -- )
"Unimplemented primitive" print drop ;
: fp-trap-error. ( error -- )
"Floating point trap" print drop ;
@ -158,7 +155,7 @@ PREDICATE: vm-error < array
second {
[ expired-error. ]
[ io-error. ]
[ primitive-error. ]
[ drop ]
[ type-check-error. ]
[ divide-by-zero-error. ]
[ signal-error. ]

View File

@ -140,11 +140,6 @@ IN: kernel.tests
[ loop ] must-fail
! Discovered on Windows
: total-failure-1 ( -- a ) "" [ ] map unimplemented ;
[ total-failure-1 ] must-fail
{ 1 1 2 2 3 3 } [ 1 2 3 [ dup ] tri@ ] unit-test
{ 1 4 9 } [ 1 2 3 [ sq ] tri@ ] unit-test
[ [ sq ] tri@ ] must-infer

View File

@ -56,7 +56,6 @@ PRIMITIVE: signal-handler ( -- )
PRIMITIVE: special-object ( n -- obj )
PRIMITIVE: strip-stack-traces ( -- )
PRIMITIVE: tag ( object -- n )
PRIMITIVE: unimplemented ( -- * )
PRIMITIVE: unwind-native-frames ( -- )
PRIVATE>

View File

@ -93,11 +93,6 @@ void factor_vm::type_error(cell type, cell tagged) {
general_error(ERROR_TYPE, tag_fixnum(type), tagged);
}
// Allocates memory
void factor_vm::not_implemented_error() {
general_error(ERROR_NOT_IMPLEMENTED, false_object, false_object);
}
void factor_vm::set_memory_protection_error(cell fault_addr, cell fault_pc) {
// Called from the OS-specific top halves of the signal handlers to
// make sure it's safe to dispatch to memory_signal_handler_impl.
@ -118,10 +113,6 @@ void factor_vm::divide_by_zero_error() {
general_error(ERROR_DIVIDE_BY_ZERO, false_object, false_object);
}
// For testing purposes
// Allocates memory
void factor_vm::primitive_unimplemented() { not_implemented_error(); }
// Allocates memory
void memory_signal_handler_impl() {
factor_vm* vm = current_vm();

View File

@ -8,7 +8,7 @@ namespace factor {
enum vm_error_type {
ERROR_EXPIRED = 0,
ERROR_IO,
ERROR_NOT_IMPLEMENTED,
ERROR_UNUSED,
ERROR_TYPE,
ERROR_DIVIDE_BY_ZERO,
ERROR_SIGNAL,

View File

@ -36,7 +36,7 @@ namespace factor {
_(set_datastack) _(set_innermost_stack_frame_quotation) \
_(set_retainstack) _(set_slot) _(set_special_object) \
_(set_string_nth_fast) _(size) _(sleep) _(special_object) _(string) \
_(strip_stack_traces) _(tuple) _(tuple_boa) _(unimplemented) \
_(strip_stack_traces) _(tuple) _(tuple_boa) \
_(uninitialized_byte_array) _(word) _(word_code) _(word_optimized_p) \
_(wrapper)

View File

@ -198,10 +198,8 @@ struct factor_vm {
// errors
void general_error(vm_error_type error, cell arg1, cell arg2);
void type_error(cell type, cell tagged);
void not_implemented_error();
void set_memory_protection_error(cell fault_addr, cell fault_pc);
void divide_by_zero_error();
void primitive_unimplemented();
// bignum
int bignum_equal_p(bignum* x, bignum* y);