]> gitweb.factorcode.org Git - factor.git/commitdiff
VM: the unimplemented error isn't used anymore
authorBjörn Lindqvist <bjourne@gmail.com>
Wed, 23 Nov 2016 09:20:09 +0000 (10:20 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Wed, 23 Nov 2016 09:24:52 +0000 (10:24 +0100)
Cause all the primitives are implemented so it can never ever be
thrown. Probably requires new boot images.

basis/bootstrap/image/primitives/primitives.factor
basis/debugger/debugger-docs.factor
basis/debugger/debugger.factor
core/kernel/kernel-tests.factor
core/kernel/kernel.factor
vm/errors.cpp
vm/errors.hpp
vm/primitives.hpp
vm/vm.hpp

index 918dab13614a82610547a10f5c643147556e292a..d28a096808b3a2164c5453e4053d7a803e59c072 100644 (file)
@@ -357,10 +357,6 @@ CONSTANT: all-primitives {
                 "strip-stack-traces" ( -- ) "strip_stack_traces"
                 { } { } f
             }
-            {
-                "unimplemented" ( -- * ) "unimplemented"
-                { } { } f
-            }
         }
     }
     {
index 995cab178df65566fef812bb67b3c91c61010f7f..1da63ab4ecba979ae795a59f1dff82fad8364423 100644 (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." } ;
index 9609782772ffc478af88ac7b1b08a97dc377eabd..2a01a839438e2b4e88524c359342b270ce97526a 100755 (executable)
@@ -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.            ]
index 356982e068e4eb1e8c513865677ed419c7c39132..f5c19123ab5f8eca9cdb972a7580d58907b33661 100644 (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
index 74790c3d4a40d7f5ea17eac125e5ec093b171238..4471432dfccc25466d58fe062ae9c5d8c5f4f2cb 100644 (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>
 
index 54b1f63f681982a792f15798ab8badafc1179e5b..74ba10056c095bb1476e0e5aeaa37de025f8ff1d 100644 (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();
index 068fa104f96dab717c24b47de742f6e60e060bd1..af62306a46f8dab4d9a5d0d4494bf8f67f8e8e38 100644 (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,
index b664a11c466fb566b10ca5adbe79ad8f403146af..a0a0c4c22a50858827c90453e075a3cb04c80da8 100644 (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)
 
index 2911e0b4537c2d5ace82111113eb9ebd28630a50..cab80caa29d65c0f03135b7217be186689a21d70 100644 (file)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -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);