From 7ee4e5dea5c9734b3e24a70681ed919d941be823 Mon Sep 17 00:00:00 2001 From: Alexander Iljin Date: Sat, 30 Jul 2016 05:23:10 +0300 Subject: [PATCH] vm: replace line comments // with block comments /**/ for consintency Fix #1651. --- vm/bignum.cpp | 12 +++--- vm/bitwise_hacks.hpp | 10 ++--- vm/code_blocks.hpp | 16 ++++---- vm/contexts.cpp | 6 +-- vm/cpu-x86.hpp | 2 +- vm/data_heap.cpp | 2 +- vm/debug.cpp | 6 +-- vm/errors.hpp | 6 +-- vm/factor.cpp | 4 +- vm/factor.hpp | 6 +-- vm/gc_info.hpp | 6 +-- vm/io.cpp | 2 +- vm/layouts.hpp | 16 ++++---- vm/mach_signal.cpp | 2 +- vm/mvm.cpp | 2 +- vm/objects.hpp | 6 +-- vm/os-linux-x86.32.hpp | 5 +-- vm/os-windows.cpp | 16 ++++---- vm/os-windows.hpp | 9 ++--- vm/sampling_profiler.cpp | 2 +- vm/sampling_profiler.hpp | 14 +++---- vm/utilities.hpp | 2 +- vm/vm.hpp | 84 ++++++++++++++++++++-------------------- 23 files changed, 117 insertions(+), 119 deletions(-) diff --git a/vm/bignum.cpp b/vm/bignum.cpp index 5b78e19d98..e4fc0fb326 100644 --- a/vm/bignum.cpp +++ b/vm/bignum.cpp @@ -1737,7 +1737,7 @@ bignum* factor_vm::bignum_gcd(bignum* a_, bignum* b_) { /* clone the bignums so we can modify them in-place */ size_a = BIGNUM_LENGTH(a); data_root c(allot_bignum(size_a, 0), this); - // c = allot_bignum(size_a, 0); + /* c = allot_bignum(size_a, 0); */ scan_a = BIGNUM_START_PTR(a); a_end = scan_a + size_a; scan_c = BIGNUM_START_PTR(c); @@ -1808,7 +1808,7 @@ bignum* factor_vm::bignum_gcd(bignum* a_, bignum* b_) { return c.untagged(); } - // copy 'b' to 'a' + /* copy 'b' to 'a' */ scan_a = BIGNUM_START_PTR(a); scan_b = BIGNUM_START_PTR(b); a_end = scan_a + size_a; @@ -1819,7 +1819,7 @@ bignum* factor_vm::bignum_gcd(bignum* a_, bignum* b_) { *(scan_a++) = 0; size_a = size_b; - // copy 'c' to 'b' + /* copy 'c' to 'b' */ scan_b = BIGNUM_START_PTR(b); scan_c = BIGNUM_START_PTR(c); size_c = BIGNUM_LENGTH(c); @@ -1858,7 +1858,7 @@ bignum* factor_vm::bignum_gcd(bignum* a_, bignum* b_) { s -= (B * *scan_a); t += (D * *scan_a++); *scan_c++ = (bignum_digit_type)(s & BIGNUM_DIGIT_MASK); - //*scan_d++ = (bignum_digit_type) (t & BIGNUM_DIGIT_MASK); + /* *scan_d++ = (bignum_digit_type) (t & BIGNUM_DIGIT_MASK); */ s >>= BIGNUM_DIGIT_LENGTH; t >>= BIGNUM_DIGIT_LENGTH; } @@ -1875,7 +1875,7 @@ bignum* factor_vm::bignum_gcd(bignum* a_, bignum* b_) { s += (A * *scan_a); t -= (C * *scan_a++); *scan_c++ = (bignum_digit_type)(s & BIGNUM_DIGIT_MASK); - //*scan_d++ = (bignum_digit_type) (t & BIGNUM_DIGIT_MASK); + /* *scan_d++ = (bignum_digit_type) (t & BIGNUM_DIGIT_MASK); */ s >>= BIGNUM_DIGIT_LENGTH; t >>= BIGNUM_DIGIT_LENGTH; } @@ -1883,7 +1883,7 @@ bignum* factor_vm::bignum_gcd(bignum* a_, bignum* b_) { BIGNUM_ASSERT(s == 0); BIGNUM_ASSERT(t == 0); - // update size_a and size_b to remove any zeros at end + /* update size_a and size_b to remove any zeroes at end */ while (size_a > 0 && *(--scan_a) == 0) size_a--; while (size_b > 0 && *(--scan_b) == 0) diff --git a/vm/bitwise_hacks.hpp b/vm/bitwise_hacks.hpp index 8a7078b3dd..2b5686023a 100644 --- a/vm/bitwise_hacks.hpp +++ b/vm/bitwise_hacks.hpp @@ -59,11 +59,11 @@ inline cell popcount(cell x) { cell ks = 24; #endif - x = x - ((x >> 1) & k1); // put count of each 2 bits into those 2 bits - x = (x & k2) + ((x >> 2) & k2); // put count of each 4 bits into those 4 bits - x = (x + (x >> 4)) & k4; // put count of each 8 bits into those 8 bits - x = (x * kf) >> ks; // returns 8 most significant bits of x + (x<<8) + - // (x<<16) + (x<<24) + ... + x = x - ((x >> 1) & k1); /* put count of each 2 bits into those 2 bits */ + x = (x & k2) + ((x >> 2) & k2); /* put count of each 4 bits into those 4 bits */ + x = (x + (x >> 4)) & k4; /* put count of each 8 bits into those 8 bits */ + x = (x * kf) >> ks; /* returns 8 most significant bits of x + (x<<8) + */ + (x<<16) + (x<<24) + ... */ return x; #endif diff --git a/vm/code_blocks.hpp b/vm/code_blocks.hpp index 522ea27e67..af787de6b5 100644 --- a/vm/code_blocks.hpp +++ b/vm/code_blocks.hpp @@ -2,14 +2,14 @@ namespace factor { /* The compiled code heap is structured into blocks. */ struct code_block { - // header format (bits indexed with least significant as zero): - // bit 0 : free? - // bits 1-2: type (as a code_block_type) - // if not free: - // bits 3-23: code size / 8 - // bits 24-31: stack frame size / 16 - // if free: - // bits 3-end: code size / 8 + /* header format (bits indexed with least significant as zero): + bit 0 : free? + bits 1-2: type (as a code_block_type) + if not free: + bits 3-23: code size / 8 + bits 24-31: stack frame size / 16 + if free: + bits 3-end: code size / 8 */ cell header; cell owner; /* tagged pointer to word, quotation or f */ cell parameters; /* tagged pointer to array or f */ diff --git a/vm/contexts.cpp b/vm/contexts.cpp index 3df7227b4c..8419f96d67 100644 --- a/vm/contexts.cpp +++ b/vm/contexts.cpp @@ -140,9 +140,9 @@ VM_C_API void delete_context(factor_vm* parent) { /* Allocates memory (init_context()) */ VM_C_API void reset_context(factor_vm* parent) { - // The function is used by (start-context-and-delete) which expects - // the top two datastack items to be preserved after the context has - // been resetted. + /* The function is used by (start-context-and-delete) which expects + the top two datastack items to be preserved after the context has + been reset. */ context* ctx = parent->ctx; cell arg1 = ctx->pop(); diff --git a/vm/cpu-x86.hpp b/vm/cpu-x86.hpp index 2d1ae42e85..c906693e84 100644 --- a/vm/cpu-x86.hpp +++ b/vm/cpu-x86.hpp @@ -25,7 +25,7 @@ inline static unsigned char call_site_opcode(cell return_address) { inline static void check_call_site(cell return_address) { unsigned char opcode = call_site_opcode(return_address); FACTOR_ASSERT(opcode == call_opcode || opcode == jmp_opcode); - (void)opcode; // suppress warning when compiling without assertions + (void)opcode; /* suppress warning when compiling without assertions */ } inline static void* get_call_target(cell return_address) { diff --git a/vm/data_heap.cpp b/vm/data_heap.cpp index 4e2abbdcd4..a4b439c3fa 100644 --- a/vm/data_heap.cpp +++ b/vm/data_heap.cpp @@ -35,7 +35,7 @@ data_heap::data_heap(bump_allocator* vm_nursery, aging = new aging_space(aging_size, tenured->end); aging_semispace = new aging_space(aging_size, aging->end); - // Initialize vm nursery + /* Initialize vm nursery */ vm_nursery->here = aging_semispace->end; vm_nursery->start = aging_semispace->end; vm_nursery->end = vm_nursery->start + young_size; diff --git a/vm/debug.cpp b/vm/debug.cpp index 4249df3fe6..b2251a3923 100644 --- a/vm/debug.cpp +++ b/vm/debug.cpp @@ -440,9 +440,9 @@ void factor_vm::factorbug() { cout << "Starting low level debugger..." << endl; - // Even though we've stopped the VM, the stdin_loop thread (see os-*.cpp) - // that pumps the console is still running concurrently. We lock a mutex so - // the thread will take a break and give us exclusive access to stdin. + /* Even though we've stopped the VM, the stdin_loop thread (see os-*.cpp) + that pumps the console is still running concurrently. We lock a mutex so + the thread will take a break and give us exclusive access to stdin. */ lock_console(); ignore_ctrl_c(); diff --git a/vm/errors.hpp b/vm/errors.hpp index 068fa104f9..587678af14 100644 --- a/vm/errors.hpp +++ b/vm/errors.hpp @@ -1,8 +1,8 @@ namespace factor { -// Runtime errors must be kept in sync with: -// basis/debugger/debugger.factor -// core/kernel/kernel.factor +/* Runtime errors must be kept in sync with: + basis/debugger/debugger.factor + core/kernel/kernel.factor */ #define KERNEL_ERROR 0xfac7 enum vm_error_type { diff --git a/vm/factor.cpp b/vm/factor.cpp index 7a2200f6db..cfd646af93 100644 --- a/vm/factor.cpp +++ b/vm/factor.cpp @@ -9,7 +9,7 @@ void init_globals() { init_mvm(); } void factor_vm::prepare_boot_image() { std::cout << "*** Stage 2 early init... " << std::flush; - // Compile all words. + /* Compile all words. */ data_root words(instances(WORD_TYPE), this); cell n_words = array_capacity(words.untagged()); @@ -21,7 +21,7 @@ void factor_vm::prepare_boot_image() { } update_code_heap_words(true); - // Initialize all quotations + /* Initialize all quotations */ data_root quotations(instances(QUOTATION_TYPE), this); cell n_quots = array_capacity(quotations.untagged()); diff --git a/vm/factor.hpp b/vm/factor.hpp index d042d3a165..56f3c18def 100644 --- a/vm/factor.hpp +++ b/vm/factor.hpp @@ -4,13 +4,13 @@ VM_C_API void init_globals(); factor_vm* new_factor_vm(); VM_C_API void start_standalone_factor(int argc, vm_char** argv); -// image +/* image */ bool factor_arg(const vm_char* str, const vm_char* arg, cell* value); -// objects +/* objects */ cell object_size(cell tagged); -// os-* +/* os-* */ void open_console(); void close_console(); void lock_console(); diff --git a/vm/gc_info.hpp b/vm/gc_info.hpp index f5a25d2e3d..a23a6df8b9 100644 --- a/vm/gc_info.hpp +++ b/vm/gc_info.hpp @@ -1,8 +1,8 @@ namespace factor { -// gc_info should be kept in sync with: -// basis/compiler/codegen/gc-maps/gc-maps.factor -// basis/vm/vm.factor +/* gc_info should be kept in sync with: + basis/compiler/codegen/gc-maps/gc-maps.factor + basis/vm/vm.factor */ struct gc_info { uint32_t scrub_d_count; uint32_t scrub_r_count; diff --git a/vm/io.cpp b/vm/io.cpp index 6710a82de9..2a858fd873 100644 --- a/vm/io.cpp +++ b/vm/io.cpp @@ -34,7 +34,7 @@ size_t raw_fread(void* ptr, size_t size, size_t nitems, FILE* stream) { return items_read; } -// Call fclose() once only. Issues #1335, #908. +/* Call fclose() once only. Issues #1335, #908. */ int raw_fclose(FILE* stream) { if (fclose(stream) == EOF && errno != EINTR) return -1; diff --git a/vm/layouts.hpp b/vm/layouts.hpp index e295e2a000..e6345ffa1b 100644 --- a/vm/layouts.hpp +++ b/vm/layouts.hpp @@ -110,14 +110,14 @@ inline static cell tag_fixnum(fixnum untagged) { struct object { NO_TYPE_CHECK; - // header format (bits indexed with least significant as zero): - // bit 0 : free? - // if not forwarding: - // bit 1 : forwarding pointer? - // bit 2-5 : tag - // bit 7-end : hashcode - // if forwarding: - // bit 2-end : forwarding pointer + /* header format (bits indexed with least significant as zero): + bit 0 : free? + if not forwarding: + bit 1 : forwarding pointer? + bit 2-5 : tag + bit 7-end : hashcode + if forwarding: + bit 2-end : forwarding pointer */ cell header; template cell base_size(Fixup fixup) const; diff --git a/vm/mach_signal.cpp b/vm/mach_signal.cpp index 0795da2165..76a1211d10 100644 --- a/vm/mach_signal.cpp +++ b/vm/mach_signal.cpp @@ -187,7 +187,7 @@ static void* mach_exception_thread(void* arg) { abort(); } } - return NULL; // quiet warning + return NULL; /* quiet warning */ } /* Initialize the Mach exception handler thread. */ diff --git a/vm/mvm.cpp b/vm/mvm.cpp index e2a85454f0..e6a466f384 100644 --- a/vm/mvm.cpp +++ b/vm/mvm.cpp @@ -9,7 +9,7 @@ struct startargs { vm_char** argv; }; -// arg must be new'ed because we're going to delete it! +/* arg must be new'ed because we're going to delete it! */ void* start_standalone_factor_thread(void* arg) { factor_vm* newvm = new_factor_vm(); startargs* args = (startargs*)arg; diff --git a/vm/objects.hpp b/vm/objects.hpp index 9a54279ffd..8a96239c5c 100644 --- a/vm/objects.hpp +++ b/vm/objects.hpp @@ -1,8 +1,8 @@ namespace factor { -// Special object count and identifiers must be kept in sync with: -// core/kernel/kernel.factor -// basis/bootstrap/image/image.factor +/* Special object count and identifiers must be kept in sync with: + core/kernel/kernel.factor + basis/bootstrap/image/image.factor */ static const cell special_object_count = 85; diff --git a/vm/os-linux-x86.32.hpp b/vm/os-linux-x86.32.hpp index 9e08914c32..bf77a41946 100644 --- a/vm/os-linux-x86.32.hpp +++ b/vm/os-linux-x86.32.hpp @@ -2,9 +2,8 @@ namespace factor { -// glibc lies about the contents of the fpstate the kernel provides, hiding the -// FXSR -// environment +/* glibc lies about the contents of the fpstate the kernel provides, hiding the + FXSR environment */ struct _fpstate { /* Regular FPU environment */ unsigned long cw; diff --git a/vm/os-windows.cpp b/vm/os-windows.cpp index 94e43b521b..1ba44c66a2 100644 --- a/vm/os-windows.cpp +++ b/vm/os-windows.cpp @@ -41,7 +41,7 @@ BOOL factor_vm::windows_stat(vm_char* path) { OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); if (h == INVALID_HANDLE_VALUE) { - // FindFirstFile is the only call that can stat c:\pagefile.sys + /* FindFirstFile is the only call that can stat c:\pagefile.sys */ WIN32_FIND_DATA st; HANDLE h; @@ -151,12 +151,12 @@ uint64_t nano_count() { static uint32_t hi = 0; static uint32_t lo = 0; - // Note: on older systems QueryPerformanceCounter may be unreliable - // until you add /usepmtimer to Boot.ini. I had an issue where two - // nano_count calls would show a difference of about 1 second, - // while actually about 80 seconds have passed. The /usepmtimer - // switch cured the issue on that PC (WinXP Pro SP3 32-bit). - // See also http://www.virtualdub.org/blog/pivot/entry.php?id=106 + /* Note: on older systems QueryPerformanceCounter may be unreliable + until you add /usepmtimer to Boot.ini. I had an issue where two + nano_count calls would show a difference of about 1 second, + while actually about 80 seconds have passed. The /usepmtimer + switch cured the issue on that PC (WinXP Pro SP3 32-bit). + See also http://www.virtualdub.org/blog/pivot/entry.php?id=106 */ LARGE_INTEGER count; BOOL ret = QueryPerformanceCounter(&count); if (ret == 0) @@ -246,7 +246,7 @@ VM_C_API LONG exception_handler(PEXCEPTION_RECORD e, void* frame, PCONTEXT c, cancellation requests to unblock the thread. */ VOID CALLBACK dummy_cb (ULONG_PTR dwParam) { } -// CancelSynchronousIo is not in Windows XP +/* CancelSynchronousIo is not in Windows XP */ #if _WIN32_WINNT >= 0x0600 static void wake_up_thread(HANDLE thread) { if (!CancelSynchronousIo(thread)) { diff --git a/vm/os-windows.hpp b/vm/os-windows.hpp index b6218f59fa..a347608bb7 100644 --- a/vm/os-windows.hpp +++ b/vm/os-windows.hpp @@ -7,8 +7,8 @@ #if _WIN32_WINNT != 0x0600 #undef _WIN32_WINNT -#define _WIN32_WINNT 0x0501 // For AddVectoredExceptionHandler, WinXP support -//#define _WIN32_WINNT 0x0600 // For CancelSynchronousIo +#define _WIN32_WINNT 0x0501 /* For AddVectoredExceptionHandler, WinXP support */ +/*#define _WIN32_WINNT 0x0600 /* For CancelSynchronousIo */ #endif #ifndef UNICODE @@ -51,9 +51,8 @@ typedef HANDLE THREADHANDLE; #define FACTOR_OS_STRING "windows" -// SSE traps raise these exception codes, which are defined in internal NT -// headers -// but not winbase.h +/* SSE traps raise these exception codes, which are defined in internal NT +headers, but not winbase.h */ #ifndef STATUS_FLOAT_MULTIPLE_FAULTS #define STATUS_FLOAT_MULTIPLE_FAULTS 0xC00002B4 #endif diff --git a/vm/sampling_profiler.cpp b/vm/sampling_profiler.cpp index c6b530cc79..5815394059 100644 --- a/vm/sampling_profiler.cpp +++ b/vm/sampling_profiler.cpp @@ -67,7 +67,7 @@ void factor_vm::set_sampling_profiler(fixnum rate) { void factor_vm::start_sampling_profiler(fixnum rate) { samples_per_second = rate; safepoint.sample_counts.clear(); - // Release the memory consumed by collecting samples. + /* Release the memory consumed by collecting samples. */ samples.clear(); samples.shrink_to_fit(); sample_callstacks.clear(); diff --git a/vm/sampling_profiler.hpp b/vm/sampling_profiler.hpp index 8711f28d63..6def041b1c 100644 --- a/vm/sampling_profiler.hpp +++ b/vm/sampling_profiler.hpp @@ -1,15 +1,15 @@ namespace factor { struct profiling_sample_count { - // Number of samples taken before the safepoint that recorded the sample + /* Number of samples taken before the safepoint that recorded the sample */ fixnum sample_count; - // Number of samples taken during GC + /* Number of samples taken during GC */ fixnum gc_sample_count; - // Number of samples taken during unoptimized compiler + /* Number of samples taken during unoptimized compiler */ fixnum jit_sample_count; - // Number of samples taken during foreign code execution + /* Number of samples taken during foreign code execution */ fixnum foreign_sample_count; - // Number of samples taken during code execution in non-Factor threads + /* Number of samples taken during code execution in non-Factor threads */ fixnum foreign_thread_sample_count; profiling_sample_count() @@ -39,9 +39,9 @@ struct profiling_sample_count { }; struct profiling_sample { - // Sample counts + /* Sample counts */ profiling_sample_count counts; - // Active thread during sample + /* Active thread during sample */ cell thread; /* The callstack at safepoint time. Indexes to the beginning and ending code_block entries in the vm sample_callstacks array. */ diff --git a/vm/utilities.hpp b/vm/utilities.hpp index 9e7de0b3b5..960c93fc3b 100644 --- a/vm/utilities.hpp +++ b/vm/utilities.hpp @@ -1,6 +1,6 @@ namespace factor { -// Poor mans range-based for loops. +/* Poor man's range-based for-loops. */ #define FACTOR_FOR_EACH(iterable) \ for (auto iter = (iterable).begin(), \ _end = (iterable).end(); \ diff --git a/vm/vm.hpp b/vm/vm.hpp index 3069e5c8dc..50757252b8 100644 --- a/vm/vm.hpp +++ b/vm/vm.hpp @@ -11,11 +11,11 @@ struct growable_array; struct code_root; struct factor_vm { - // - // vvvvvv - // THESE FIELDS ARE ACCESSED DIRECTLY FROM FACTOR. See: - // basis/vm/vm.factor - // basis/compiler/constants/constants.factor + /* + vvvvvv + THESE FIELDS ARE ACCESSED DIRECTLY FROM FACTOR. See: + basis/vm/vm.factor + basis/compiler/constants/constants.factor */ /* Current context */ context* ctx; @@ -41,9 +41,9 @@ struct factor_vm { set-special-object primitives */ cell special_objects[special_object_count]; - // THESE FIELDS ARE ACCESSED DIRECTLY FROM FACTOR. - // ^^^^^^ - // + /* THESE FIELDS ARE ACCESSED DIRECTLY FROM FACTOR. + ^^^^^^ + */ /* Handle to the main thread we run in */ THREADHANDLE thread; @@ -148,7 +148,7 @@ struct factor_vm { /* Safepoint state */ volatile safepoint_state safepoint; - // contexts + /* contexts */ context* new_context(); void init_context(context* ctx); void delete_context(); @@ -171,13 +171,13 @@ struct factor_vm { void primitive_check_datastack(); void primitive_load_locals(); - // run + /* run */ void primitive_exit(); void primitive_nano_count(); void primitive_sleep(); void primitive_set_slot(); - // objects + /* objects */ void primitive_special_object(); void primitive_set_special_object(); void primitive_identity_hashcode(); @@ -186,7 +186,7 @@ struct factor_vm { void primitive_clone(); void primitive_become(); - // sampling_profiler + /* sampling_profiler */ void record_sample(bool prolog_p); void record_callstack_sample(cell* begin, cell* end, bool prolog_p); void start_sampling_profiler(fixnum rate); @@ -195,7 +195,7 @@ struct factor_vm { void primitive_sampling_profiler(); void primitive_get_samples(); - // errors + /* errors */ void general_error(vm_error_type error, cell arg1, cell arg2); void type_error(cell type, cell tagged); void not_implemented_error(); @@ -203,7 +203,7 @@ struct factor_vm { void divide_by_zero_error(); void primitive_unimplemented(); - // bignum + /* bignum */ int bignum_equal_p(bignum* x, bignum* y); enum bignum_comparison bignum_compare(bignum* x, bignum* y); bignum* bignum_add(bignum* x, bignum* y); @@ -277,7 +277,7 @@ struct factor_vm { int bignum_unsigned_logbitp(int shift, bignum* bn); bignum* bignum_gcd(bignum* a_, bignum* b_); - //data heap + /* data heap */ void set_data_heap(data_heap* data_); void init_data_heap(cell young_size, cell aging_size, cell tenured_size); void primitive_size(); @@ -334,10 +334,10 @@ struct factor_vm { write_barrier((cell*)offset); } - // data heap checker + /* data heap checker */ void check_data_heap(); - // gc + /* gc */ void end_gc(); void set_current_gc_op(gc_op op); void start_gc_again(); @@ -366,13 +366,13 @@ struct factor_vm { return (Type*)allot_object(Type::type_number, size); } - // generic arrays + /* generic arrays */ template Array* allot_uninitialized_array(cell capacity); template bool reallot_array_in_place_p(Array* array, cell capacity); template Array* reallot_array(Array* array_, cell capacity); - // debug + /* debug */ void print_chars(ostream& out, string* str); void print_word(ostream& out, word* word, cell nesting); void print_factor_string(ostream& out, string* str); @@ -398,7 +398,7 @@ struct factor_vm { void factorbug(); void primitive_die(); - // arrays + /* arrays */ inline void set_array_nth(array* array, cell slot, cell value); array* allot_array(cell capacity, cell fill_); void primitive_array(); @@ -406,7 +406,7 @@ struct factor_vm { void primitive_resize_array(); cell std_vector_to_array(std::vector& elements); - // strings + /* strings */ string* allot_string_internal(cell capacity); void fill_string(string* str_, cell start, cell capacity, cell fill); string* allot_string(cell capacity, cell fill); @@ -416,12 +416,12 @@ struct factor_vm { void primitive_resize_string(); void primitive_set_string_nth_fast(); - // booleans + /* booleans */ cell tag_boolean(cell untagged) { return untagged ? special_objects[OBJ_CANONICAL_TRUE] : false_object; } - // byte arrays + /* byte arrays */ byte_array* allot_byte_array(cell size); void primitive_byte_array(); void primitive_uninitialized_byte_array(); @@ -429,11 +429,11 @@ struct factor_vm { template byte_array* byte_array_from_value(Type* value); - // tuples + /* tuples */ void primitive_tuple(); void primitive_tuple_boa(); - // words + /* words */ word* allot_word(cell name_, cell vocab_, cell hashcode_); void primitive_word(); void primitive_word_code(); @@ -441,7 +441,7 @@ struct factor_vm { void primitive_wrapper(); void jit_compile_word(cell word_, cell def_, bool relocating); - // math + /* math */ void primitive_bignum_to_fixnum(); void primitive_bignum_to_fixnum_strict(); void primitive_float_to_fixnum(); @@ -513,7 +513,7 @@ struct factor_vm { inline fixnum float_to_fixnum(cell tagged); inline double fixnum_to_float(cell tagged); - // tagged + /* tagged */ template void check_tagged(tagged t) { if (!t.type_p()) type_error(Type::type_number, t.value_); @@ -525,7 +525,7 @@ struct factor_vm { return t.untagged(); } - // io + /* io */ void init_c_io(); void io_error_if_not_EINTR(); FILE* safe_fopen(char* filename, const char* mode); @@ -548,7 +548,7 @@ struct factor_vm { void primitive_fflush(); void primitive_fclose(); - // code_block + /* code_block */ cell compute_entry_point_pic_address(word* w, cell tagged_quot); cell compute_entry_point_pic_address(cell w_); cell compute_entry_point_pic_tail_address(cell w_); @@ -569,7 +569,7 @@ struct factor_vm { cell owner_, cell relocation_, cell parameters_, cell literals_, cell frame_size_untagged); - //code heap + /* code heap */ template void each_code_block(Iterator& iter) { code->allocator->iterate(iter); } @@ -581,12 +581,12 @@ struct factor_vm { void primitive_strip_stack_traces(); void primitive_code_blocks(); - // callbacks + /* callbacks */ void primitive_free_callback(); void primitive_callback(); void primitive_callback_room(); - // image + /* image */ void load_data_heap(FILE* file, image_header* h, vm_parameters* p); void load_code_heap(FILE* file, image_header* h, vm_parameters* p); bool save_image(const vm_char* saving_filename, const vm_char* filename); @@ -618,7 +618,7 @@ struct factor_vm { template void iterate_callstack(context* ctx, Iterator& iterator); - // cpu-* + /* cpu-* */ void dispatch_signal_handler(cell* sp, cell* pc, cell newpc); #if defined(FACTOR_X86) || defined(FACTOR_64) void dispatch_non_resumable_signal(cell* sp, cell* pc, @@ -627,7 +627,7 @@ struct factor_vm { void dispatch_resumable_signal(cell* sp, cell* pc, cell handler); #endif - // alien + /* alien */ char* pinned_alien_offset(cell obj); cell allot_alien(cell delegate_, cell displacement); cell allot_alien(cell address); @@ -641,7 +641,7 @@ struct factor_vm { void primitive_dll_validp(); char* alien_offset(cell obj); - // quotations + /* quotations */ void primitive_jit_compile(); cell lazy_jit_compile_entry_point(); void primitive_array_to_quotation(); @@ -653,7 +653,7 @@ struct factor_vm { bool quotation_compiled_p(quotation* quot); void primitive_quotation_compiled_p(); - // dispatch + /* dispatch */ cell lookup_tuple_method(cell obj, cell methods); cell lookup_method(cell obj, cell methods); void primitive_lookup_method(); @@ -663,7 +663,7 @@ struct factor_vm { void primitive_reset_dispatch_stats(); void primitive_dispatch_stats(); - // inline cache + /* inline cache */ void init_inline_caching(int max_size); void deallocate_inline_cache(cell return_address); void update_pic_count(cell type); @@ -674,13 +674,13 @@ struct factor_vm { void update_pic_transitions(cell pic_size); cell inline_cache_miss(cell return_address); - // entry points + /* entry points */ void c_to_factor(cell quot); void unwind_native_frames(cell quot, cell to); cell get_fpu_state(); void set_fpu_state(cell state); - // factor + /* factor */ void prepare_boot_image(); void init_factor(vm_parameters* p); void pass_args_to_factor(int argc, vm_char** argv); @@ -692,7 +692,7 @@ struct factor_vm { void factor_yield(); void factor_sleep(long us); - // os-* + /* os-* */ void primitive_existsp(); void init_ffi(); void ffi_dlopen(dll* dll); @@ -704,7 +704,7 @@ struct factor_vm { void start_sampling_profiler_timer(); void end_sampling_profiler_timer(); -// os-windows +/* os-windows */ #if defined(WINDOWS) HANDLE sampler_thread; void sampler_thread_loop(); @@ -716,7 +716,7 @@ struct factor_vm { LONG exception_handler(PEXCEPTION_RECORD e, void* frame, PCONTEXT c, void* dispatch); -#else // UNIX +#else /* UNIX */ void dispatch_signal(void* uap, void(handler)()); void unix_init_signals(); #endif