]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/vm.hpp
vm: strip out call-counting profiler
[factor.git] / vm / vm.hpp
index 6ba860c230b7824b235ebbd60859fc4488916cbc..6836bf11ab65dda6cb89f1b39a1bac5b67280b44 100755 (executable)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -36,8 +36,8 @@ struct factor_vm
        // ^^^^^^
        //
 
-        /* Handle to the main thread we run in */
-        THREADHANDLE thread;
+       /* Handle to the main thread we run in */
+       THREADHANDLE thread;
 
        /* Data stack and retain stack sizes */
        cell datastack_size, retainstack_size, callstack_size;
@@ -64,7 +64,6 @@ struct factor_vm
        c_to_factor_func_type c_to_factor_func;
 
        /* Is profiling enabled? */
-       bool counting_profiler_p;
        volatile cell sampling_profiler_p;
        fixnum samples_per_second;
 
@@ -74,12 +73,13 @@ struct factor_vm
        cell signal_number;
        cell signal_fault_addr;
        unsigned int signal_fpu_status;
-       volatile cell safepoint_fep_p;
+
+       /* Pipe used to notify Factor multiplexer of signals */
+       int signal_pipe_input, signal_pipe_output;
 
        /* State kept by the sampling profiler */
        std::vector<profiling_sample> samples;
        std::vector<cell> sample_callstacks;
-       volatile profiling_sample_count safepoint_sample_counts;
 
        /* GC is off during heap walking */
        bool gc_off;
@@ -144,6 +144,9 @@ struct factor_vm
        /* Are we already handling a fault? Used to catch double memory faults */
        bool faulting_p;
 
+       /* Safepoint state */
+       volatile safepoint_state safepoint;
+
        // contexts
        context *new_context();
        void init_context(context *ctx);
@@ -195,20 +198,13 @@ struct factor_vm
        void primitive_clone();
        void primitive_become();
 
-       // counting_profiler
-       void init_counting_profiler();
-       code_block *compile_counting_profiler_stub(cell word_);
-       void set_counting_profiler(bool counting_profiler);
-       void primitive_counting_profiler();
-
-       /* Sampling profiler */
+       // sampling_profiler
        void clear_samples();
        void record_sample();
        void record_callstack_sample(cell *begin, cell *end);
        void start_sampling_profiler(fixnum rate);
        void end_sampling_profiler();
        void set_sampling_profiler(fixnum rate);
-       void enqueue_safepoint_sample(cell samples, cell pc, bool foreign_thread_p);
        void primitive_sampling_profiler();
        void primitive_get_samples();
        void primitive_clear_samples();
@@ -225,8 +221,6 @@ struct factor_vm
        void memory_signal_handler_impl();
        void synchronous_signal_handler_impl();
        void fp_signal_handler_impl();
-       void enqueue_safepoint_fep();
-       void handle_safepoint();
 
        // bignum
        int bignum_equal_p(bignum * x, bignum * y);
@@ -457,7 +451,6 @@ struct factor_vm
        word *allot_word(cell name_, cell vocab_, cell hashcode_);
        void primitive_word();
        void primitive_word_code();
-       void update_word_entry_point(word *w_);
        void primitive_optimized_p();
        void primitive_wrapper();
        void jit_compile_word(cell word_, cell def_, bool relocating);
@@ -657,10 +650,9 @@ struct factor_vm
 
        // quotations
        void primitive_jit_compile();
-       code_block *lazy_jit_compile_block();
+       void *lazy_jit_compile_entry_point();
        void primitive_array_to_quotation();
        void primitive_quotation_code();
-       void set_quot_entry_point(quotation *quot, code_block *code);
        code_block *jit_compile_quot(cell owner_, cell quot_, bool relocating);
        void jit_compile_quot(cell quot_, bool relocating);
        fixnum quot_code_offset_to_scan(cell quot_, cell offset);
@@ -735,6 +727,9 @@ struct factor_vm
        void init_signals();
        void start_sampling_profiler_timer();
        void end_sampling_profiler_timer();
+       void open_console();
+       void lock_console();
+       void unlock_console();
 
        // os-windows
   #if defined(WINDOWS)
@@ -746,12 +741,10 @@ struct factor_vm
        void windows_image_path(vm_char *full_path, vm_char *temp_path, unsigned int length);
        BOOL windows_stat(vm_char *path);
 
-       void open_console();
        LONG exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, void *dispatch);
 
   #else  // UNIX
        void dispatch_signal(void *uap, void (handler)());
-       void enqueue_safepoint_signal(cell signal);
        void unix_init_signals();
   #endif