Revert "vm: replace line comments // with block comments /**/ for consintency"
This reverts commit 7ee4e5dea5
.
char-rename
parent
897d0d6eeb
commit
e0acf4f328
|
@ -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<bignum> 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 zeroes at end */
|
||||
// update size_a and size_b to remove any zeros at end
|
||||
while (size_a > 0 && *(--scan_a) == 0)
|
||||
size_a--;
|
||||
while (size_b > 0 && *(--scan_b) == 0)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 reset. */
|
||||
// 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.
|
||||
|
||||
context* ctx = parent->ctx;
|
||||
cell arg1 = ctx->pop();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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<array> 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<array> quotations(instances(QUOTATION_TYPE), this);
|
||||
|
||||
cell n_quots = array_capacity(quotations.untagged());
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 <typename Fixup> cell base_size(Fixup fixup) const;
|
||||
|
|
|
@ -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. */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
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;
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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,8 +51,9 @@ 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
|
||||
|
|
|
@ -67,7 +67,7 @@ void factor_vm::set_sampling_profiler(fixnum rate) {
|
|||
void factor_vm::start_sampling_profiler(fixnum rate) {
|
||||
samples_per_second = rate;
|
||||
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();
|
||||
|
|
|
@ -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(fixnum sample_count, fixnum gc_sample_count,
|
||||
|
@ -32,9 +32,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. */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
namespace factor {
|
||||
|
||||
/* Poor man's range-based for-loops. */
|
||||
// Poor mans range-based for loops.
|
||||
#define FACTOR_FOR_EACH(iterable) \
|
||||
for (auto iter = (iterable).begin(), \
|
||||
_end = (iterable).end(); \
|
||||
|
|
86
vm/vm.hpp
86
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;
|
||||
|
@ -149,7 +149,7 @@ struct factor_vm {
|
|||
/* Two fep_p variants, one might be redundant. */
|
||||
volatile cell safepoint_fep_p;
|
||||
|
||||
/* contexts */
|
||||
// contexts
|
||||
context* new_context();
|
||||
void init_context(context* ctx);
|
||||
void delete_context();
|
||||
|
@ -172,13 +172,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();
|
||||
|
@ -187,7 +187,7 @@ struct factor_vm {
|
|||
void primitive_clone();
|
||||
void primitive_become();
|
||||
|
||||
/* sampling_profiler */
|
||||
// sampling_profiler
|
||||
void record_sample(bool prolog_p);
|
||||
void start_sampling_profiler(fixnum rate);
|
||||
void end_sampling_profiler();
|
||||
|
@ -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 <typename Array> Array* allot_uninitialized_array(cell capacity);
|
||||
template <typename Array>
|
||||
bool reallot_array_in_place_p(Array* array, cell capacity);
|
||||
template <typename Array> 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<cell>& 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 <typename Type> 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 <typename Type> void check_tagged(tagged<Type> 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 <typename Iterator> 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 <typename Iterator>
|
||||
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 deallocate_inline_cache(cell return_address);
|
||||
void update_pic_count(cell type);
|
||||
code_block* compile_inline_cache(fixnum index, cell generic_word_,
|
||||
|
@ -673,18 +673,18 @@ 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);
|
||||
|
||||
/* safepoints */
|
||||
// safepoints
|
||||
void handle_safepoint(cell pc);
|
||||
void enqueue_samples(cell samples, cell pc, bool foreign_thread_p);
|
||||
void enqueue_fep();
|
||||
|
||||
/* factor */
|
||||
// factor
|
||||
void prepare_boot_image();
|
||||
void init_factor(vm_parameters* p);
|
||||
void pass_args_to_factor(int argc, vm_char** argv);
|
||||
|
@ -696,7 +696,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);
|
||||
|
@ -708,7 +708,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();
|
||||
|
@ -720,7 +720,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
|
||||
|
|
Loading…
Reference in New Issue