]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/vm.hpp
webapps.wiki: adding search bar
[factor.git] / vm / vm.hpp
index 2911e0b4537c2d5ace82111113eb9ebd28630a50..4bacc4c077322eac297a761837c6ae5b6bf421bc 100644 (file)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -35,7 +35,7 @@ struct factor_vm {
   cell signal_handler_addr;
 
   // are we handling a memory error? used to detect double faults
-  cell faulting_p;
+  bool faulting_p;
 
   // Various special objects, accessed by special-object and
   // set-special-object primitives
@@ -70,7 +70,7 @@ struct factor_vm {
   c_to_factor_func_type c_to_factor_func;
 
   // Is profiling enabled?
-  volatile cell sampling_profiler_p;
+  volatile bool sampling_profiler_p;
   fixnum samples_per_second;
 
   // Global variables used to pass fault handler state from signal handler
@@ -86,7 +86,7 @@ struct factor_vm {
 
   // State kept by the sampling profiler
   std::vector<profiling_sample> samples;
-  volatile profiling_sample_count sample_counts;
+  volatile profiling_sample current_sample;
 
   // GC is off during heap walking
   bool gc_off;
@@ -102,7 +102,7 @@ struct factor_vm {
 
   // Only set if we're performing a GC
   gc_state* current_gc;
-  volatile cell current_gc_p;
+  volatile bool current_gc_p;
 
   // Set if we're in the jit
   volatile fixnum current_jit_count;
@@ -146,7 +146,7 @@ struct factor_vm {
   static bool fatal_erroring_p;
 
   // Two fep_p variants, one might be redundant.
-  volatile cell safepoint_fep_p;
+  volatile bool safepoint_fep_p;
 
   // Allow Ctrl-Break a busy loop in the Listener, only used on Windows
   volatile bool stop_on_ctrl_break;
@@ -189,8 +189,8 @@ struct factor_vm {
   void record_sample(bool prolog_p);
   void start_sampling_profiler(fixnum rate);
   void end_sampling_profiler();
-  void set_sampling_profiler(fixnum rate);
-  void primitive_sampling_profiler();
+  void set_profiling(fixnum rate);
+  void primitive_set_profiling();
   void primitive_get_samples();
   array* allot_growarr();
   void growarr_add(array *growarr_, cell value);
@@ -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);
@@ -531,7 +529,7 @@ struct factor_vm {
   size_t safe_fread(void* ptr, size_t size, size_t nitems, FILE* stream);
   void safe_fputc(int c, FILE* stream);
   size_t safe_fwrite(void* ptr, size_t size, size_t nitems, FILE* stream);
-  int safe_ftell(FILE* stream);
+  off_t safe_ftell(FILE* stream);
   void safe_fseek(FILE* stream, off_t offset, int whence);
   void safe_fflush(FILE* stream);
   void primitive_fopen();
@@ -607,6 +605,7 @@ struct factor_vm {
   void primitive_innermost_stack_frame_executing();
   void primitive_innermost_stack_frame_scan();
   void primitive_set_innermost_stack_frame_quotation();
+  void primitive_callstack_bounds();
 
   template <typename Iterator, typename Fixup>
   void iterate_callstack(context* ctx, Iterator& iterator, Fixup& fixup);