renamed vmprim_ to primitive_
parent
dee151432c
commit
e3ac531fdb
28
vm/alien.cpp
28
vm/alien.cpp
|
@ -46,7 +46,7 @@ cell factorvm::allot_alien(cell delegate_, cell displacement)
|
|||
}
|
||||
|
||||
/* make an alien pointing at an offset of another alien */
|
||||
inline void factorvm::vmprim_displaced_alien()
|
||||
inline void factorvm::primitive_displaced_alien()
|
||||
{
|
||||
cell alien = dpop();
|
||||
cell displacement = to_cell(dpop());
|
||||
|
@ -71,19 +71,19 @@ inline void factorvm::vmprim_displaced_alien()
|
|||
|
||||
PRIMITIVE(displaced_alien)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_displaced_alien();
|
||||
PRIMITIVE_GETVM()->primitive_displaced_alien();
|
||||
}
|
||||
|
||||
/* address of an object representing a C pointer. Explicitly throw an error
|
||||
if the object is a byte array, as a sanity check. */
|
||||
inline void factorvm::vmprim_alien_address()
|
||||
inline void factorvm::primitive_alien_address()
|
||||
{
|
||||
box_unsigned_cell((cell)pinned_alien_offset(dpop()));
|
||||
}
|
||||
|
||||
PRIMITIVE(alien_address)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_alien_address();
|
||||
PRIMITIVE_GETVM()->primitive_alien_address();
|
||||
}
|
||||
|
||||
/* pop ( alien n ) from datastack, return alien's address plus n */
|
||||
|
@ -121,7 +121,7 @@ DEFINE_ALIEN_ACCESSOR(double,double,box_double,to_double)
|
|||
DEFINE_ALIEN_ACCESSOR(cell,void *,box_alien,pinned_alien_offset)
|
||||
|
||||
/* open a native library and push a handle */
|
||||
inline void factorvm::vmprim_dlopen()
|
||||
inline void factorvm::primitive_dlopen()
|
||||
{
|
||||
gc_root<byte_array> path(dpop(),this);
|
||||
path.untag_check(this);
|
||||
|
@ -133,11 +133,11 @@ inline void factorvm::vmprim_dlopen()
|
|||
|
||||
PRIMITIVE(dlopen)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_dlopen();
|
||||
PRIMITIVE_GETVM()->primitive_dlopen();
|
||||
}
|
||||
|
||||
/* look up a symbol in a native library */
|
||||
inline void factorvm::vmprim_dlsym()
|
||||
inline void factorvm::primitive_dlsym()
|
||||
{
|
||||
gc_root<object> library(dpop(),this);
|
||||
gc_root<byte_array> name(dpop(),this);
|
||||
|
@ -160,11 +160,11 @@ inline void factorvm::vmprim_dlsym()
|
|||
|
||||
PRIMITIVE(dlsym)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_dlsym();
|
||||
PRIMITIVE_GETVM()->primitive_dlsym();
|
||||
}
|
||||
|
||||
/* close a native library handle */
|
||||
inline void factorvm::vmprim_dlclose()
|
||||
inline void factorvm::primitive_dlclose()
|
||||
{
|
||||
dll *d = untag_check<dll>(dpop());
|
||||
if(d->dll != NULL)
|
||||
|
@ -173,10 +173,10 @@ inline void factorvm::vmprim_dlclose()
|
|||
|
||||
PRIMITIVE(dlclose)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_dlclose();
|
||||
PRIMITIVE_GETVM()->primitive_dlclose();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_dll_validp()
|
||||
inline void factorvm::primitive_dll_validp()
|
||||
{
|
||||
cell library = dpop();
|
||||
if(library == F)
|
||||
|
@ -187,7 +187,7 @@ inline void factorvm::vmprim_dll_validp()
|
|||
|
||||
PRIMITIVE(dll_validp)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_dll_validp();
|
||||
PRIMITIVE_GETVM()->primitive_dll_validp();
|
||||
}
|
||||
|
||||
/* gets the address of an object representing a C pointer */
|
||||
|
@ -303,14 +303,14 @@ VM_C_API void box_medium_struct(cell x1, cell x2, cell x3, cell x4, cell size, f
|
|||
return VM_PTR->box_medium_struct(x1, x2, x3, x4, size);
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_vm_ptr()
|
||||
inline void factorvm::primitive_vm_ptr()
|
||||
{
|
||||
box_alien(this);
|
||||
}
|
||||
|
||||
PRIMITIVE(vm_ptr)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_vm_ptr();
|
||||
PRIMITIVE_GETVM()->primitive_vm_ptr();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ array *factorvm::allot_array(cell capacity, cell fill_)
|
|||
|
||||
|
||||
/* push a new array on the stack */
|
||||
inline void factorvm::vmprim_array()
|
||||
inline void factorvm::primitive_array()
|
||||
{
|
||||
cell initial = dpop();
|
||||
cell size = unbox_array_size();
|
||||
|
@ -34,7 +34,7 @@ inline void factorvm::vmprim_array()
|
|||
|
||||
PRIMITIVE(array)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_array();
|
||||
PRIMITIVE_GETVM()->primitive_array();
|
||||
}
|
||||
|
||||
cell factorvm::allot_array_1(cell obj_)
|
||||
|
@ -72,7 +72,7 @@ cell factorvm::allot_array_4(cell v1_, cell v2_, cell v3_, cell v4_)
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_resize_array()
|
||||
inline void factorvm::primitive_resize_array()
|
||||
{
|
||||
array* a = untag_check<array>(dpop());
|
||||
cell capacity = unbox_array_size();
|
||||
|
@ -81,7 +81,7 @@ inline void factorvm::vmprim_resize_array()
|
|||
|
||||
PRIMITIVE(resize_array)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_resize_array();
|
||||
PRIMITIVE_GETVM()->primitive_resize_array();
|
||||
}
|
||||
|
||||
void growable_array::add(cell elt_)
|
||||
|
|
|
@ -11,7 +11,7 @@ byte_array *factorvm::allot_byte_array(cell size)
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_byte_array()
|
||||
inline void factorvm::primitive_byte_array()
|
||||
{
|
||||
cell size = unbox_array_size();
|
||||
dpush(tag<byte_array>(allot_byte_array(size)));
|
||||
|
@ -19,10 +19,10 @@ inline void factorvm::vmprim_byte_array()
|
|||
|
||||
PRIMITIVE(byte_array)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_byte_array();
|
||||
PRIMITIVE_GETVM()->primitive_byte_array();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_uninitialized_byte_array()
|
||||
inline void factorvm::primitive_uninitialized_byte_array()
|
||||
{
|
||||
cell size = unbox_array_size();
|
||||
dpush(tag<byte_array>(allot_array_internal<byte_array>(size)));
|
||||
|
@ -30,10 +30,10 @@ inline void factorvm::vmprim_uninitialized_byte_array()
|
|||
|
||||
PRIMITIVE(uninitialized_byte_array)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_uninitialized_byte_array();
|
||||
PRIMITIVE_GETVM()->primitive_uninitialized_byte_array();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_resize_byte_array()
|
||||
inline void factorvm::primitive_resize_byte_array()
|
||||
{
|
||||
byte_array *array = untag_check<byte_array>(dpop());
|
||||
cell capacity = unbox_array_size();
|
||||
|
@ -42,7 +42,7 @@ inline void factorvm::vmprim_resize_byte_array()
|
|||
|
||||
PRIMITIVE(resize_byte_array)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_resize_byte_array();
|
||||
PRIMITIVE_GETVM()->primitive_resize_byte_array();
|
||||
}
|
||||
|
||||
void growable_byte_array::append_bytes(void *elts, cell len)
|
||||
|
|
|
@ -46,7 +46,7 @@ stack_frame *factorvm::capture_start()
|
|||
return frame + 1;
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_callstack()
|
||||
inline void factorvm::primitive_callstack()
|
||||
{
|
||||
stack_frame *top = capture_start();
|
||||
stack_frame *bottom = stack_chain->callstack_bottom;
|
||||
|
@ -62,10 +62,10 @@ inline void factorvm::vmprim_callstack()
|
|||
|
||||
PRIMITIVE(callstack)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_callstack();
|
||||
PRIMITIVE_GETVM()->primitive_callstack();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_set_callstack()
|
||||
inline void factorvm::primitive_set_callstack()
|
||||
{
|
||||
callstack *stack = untag_check<callstack>(dpop());
|
||||
|
||||
|
@ -80,7 +80,7 @@ inline void factorvm::vmprim_set_callstack()
|
|||
|
||||
PRIMITIVE(set_callstack)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_set_callstack();
|
||||
PRIMITIVE_GETVM()->primitive_set_callstack();
|
||||
}
|
||||
|
||||
code_block *factorvm::frame_code(stack_frame *frame)
|
||||
|
@ -162,7 +162,7 @@ struct stack_frame_accumulator {
|
|||
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_callstack_to_array()
|
||||
inline void factorvm::primitive_callstack_to_array()
|
||||
{
|
||||
gc_root<callstack> callstack(dpop(),this);
|
||||
|
||||
|
@ -175,7 +175,7 @@ inline void factorvm::vmprim_callstack_to_array()
|
|||
|
||||
PRIMITIVE(callstack_to_array)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_callstack_to_array();
|
||||
PRIMITIVE_GETVM()->primitive_callstack_to_array();
|
||||
}
|
||||
|
||||
stack_frame *factorvm::innermost_stack_frame(callstack *stack)
|
||||
|
@ -199,27 +199,27 @@ stack_frame *factorvm::innermost_stack_frame_quot(callstack *callstack)
|
|||
|
||||
/* Some primitives implementing a limited form of callstack mutation.
|
||||
Used by the single stepper. */
|
||||
inline void factorvm::vmprim_innermost_stack_frame_executing()
|
||||
inline void factorvm::primitive_innermost_stack_frame_executing()
|
||||
{
|
||||
dpush(frame_executing(innermost_stack_frame(untag_check<callstack>(dpop()))));
|
||||
}
|
||||
|
||||
PRIMITIVE(innermost_stack_frame_executing)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_innermost_stack_frame_executing();
|
||||
PRIMITIVE_GETVM()->primitive_innermost_stack_frame_executing();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_innermost_stack_frame_scan()
|
||||
inline void factorvm::primitive_innermost_stack_frame_scan()
|
||||
{
|
||||
dpush(frame_scan(innermost_stack_frame_quot(untag_check<callstack>(dpop()))));
|
||||
}
|
||||
|
||||
PRIMITIVE(innermost_stack_frame_scan)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_innermost_stack_frame_scan();
|
||||
PRIMITIVE_GETVM()->primitive_innermost_stack_frame_scan();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_set_innermost_stack_frame_quot()
|
||||
inline void factorvm::primitive_set_innermost_stack_frame_quot()
|
||||
{
|
||||
gc_root<callstack> callstack(dpop(),this);
|
||||
gc_root<quotation> quot(dpop(),this);
|
||||
|
@ -237,7 +237,7 @@ inline void factorvm::vmprim_set_innermost_stack_frame_quot()
|
|||
|
||||
PRIMITIVE(set_innermost_stack_frame_quot)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_set_innermost_stack_frame_quot();
|
||||
PRIMITIVE_GETVM()->primitive_set_innermost_stack_frame_quot();
|
||||
}
|
||||
|
||||
/* called before entry into Factor code. */
|
||||
|
|
|
@ -59,7 +59,7 @@ void factorvm::update_code_heap_words()
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_modify_code_heap()
|
||||
inline void factorvm::primitive_modify_code_heap()
|
||||
{
|
||||
gc_root<array> alist(dpop(),this);
|
||||
|
||||
|
@ -112,11 +112,11 @@ inline void factorvm::vmprim_modify_code_heap()
|
|||
|
||||
PRIMITIVE(modify_code_heap)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_modify_code_heap();
|
||||
PRIMITIVE_GETVM()->primitive_modify_code_heap();
|
||||
}
|
||||
|
||||
/* Push the free space and total size of the code heap */
|
||||
inline void factorvm::vmprim_code_room()
|
||||
inline void factorvm::primitive_code_room()
|
||||
{
|
||||
cell used, total_free, max_free;
|
||||
heap_usage(&code,&used,&total_free,&max_free);
|
||||
|
@ -128,7 +128,7 @@ inline void factorvm::vmprim_code_room()
|
|||
|
||||
PRIMITIVE(code_room)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_code_room();
|
||||
PRIMITIVE_GETVM()->primitive_code_room();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ bool factorvm::stack_to_array(cell bottom, cell top)
|
|||
}
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_datastack()
|
||||
inline void factorvm::primitive_datastack()
|
||||
{
|
||||
if(!stack_to_array(ds_bot,ds))
|
||||
general_error(ERROR_DS_UNDERFLOW,F,F,NULL);
|
||||
|
@ -149,10 +149,10 @@ inline void factorvm::vmprim_datastack()
|
|||
|
||||
PRIMITIVE(datastack)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_datastack();
|
||||
PRIMITIVE_GETVM()->primitive_datastack();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_retainstack()
|
||||
inline void factorvm::primitive_retainstack()
|
||||
{
|
||||
if(!stack_to_array(rs_bot,rs))
|
||||
general_error(ERROR_RS_UNDERFLOW,F,F,NULL);
|
||||
|
@ -160,7 +160,7 @@ inline void factorvm::vmprim_retainstack()
|
|||
|
||||
PRIMITIVE(retainstack)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_retainstack();
|
||||
PRIMITIVE_GETVM()->primitive_retainstack();
|
||||
}
|
||||
|
||||
/* returns pointer to top of stack */
|
||||
|
@ -171,28 +171,28 @@ cell factorvm::array_to_stack(array *array, cell bottom)
|
|||
return bottom + depth - sizeof(cell);
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_set_datastack()
|
||||
inline void factorvm::primitive_set_datastack()
|
||||
{
|
||||
ds = array_to_stack(untag_check<array>(dpop()),ds_bot);
|
||||
}
|
||||
|
||||
PRIMITIVE(set_datastack)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_set_datastack();
|
||||
PRIMITIVE_GETVM()->primitive_set_datastack();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_set_retainstack()
|
||||
inline void factorvm::primitive_set_retainstack()
|
||||
{
|
||||
rs = array_to_stack(untag_check<array>(dpop()),rs_bot);
|
||||
}
|
||||
|
||||
PRIMITIVE(set_retainstack)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_set_retainstack();
|
||||
PRIMITIVE_GETVM()->primitive_set_retainstack();
|
||||
}
|
||||
|
||||
/* Used to implement call( */
|
||||
inline void factorvm::vmprim_check_datastack()
|
||||
inline void factorvm::primitive_check_datastack()
|
||||
{
|
||||
fixnum out = to_fixnum(dpop());
|
||||
fixnum in = to_fixnum(dpop());
|
||||
|
@ -219,7 +219,7 @@ inline void factorvm::vmprim_check_datastack()
|
|||
|
||||
PRIMITIVE(check_datastack)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_check_datastack();
|
||||
PRIMITIVE_GETVM()->primitive_check_datastack();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -592,17 +592,17 @@ void factorvm::gc()
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_gc()
|
||||
inline void factorvm::primitive_gc()
|
||||
{
|
||||
gc();
|
||||
}
|
||||
|
||||
PRIMITIVE(gc)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_gc();
|
||||
PRIMITIVE_GETVM()->primitive_gc();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_gc_stats()
|
||||
inline void factorvm::primitive_gc_stats()
|
||||
{
|
||||
growable_array result(this);
|
||||
|
||||
|
@ -634,7 +634,7 @@ inline void factorvm::vmprim_gc_stats()
|
|||
|
||||
PRIMITIVE(gc_stats)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_gc_stats();
|
||||
PRIMITIVE_GETVM()->primitive_gc_stats();
|
||||
}
|
||||
|
||||
void factorvm::clear_gc_stats()
|
||||
|
@ -648,19 +648,19 @@ void factorvm::clear_gc_stats()
|
|||
code_heap_scans = 0;
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_clear_gc_stats()
|
||||
inline void factorvm::primitive_clear_gc_stats()
|
||||
{
|
||||
clear_gc_stats();
|
||||
}
|
||||
|
||||
PRIMITIVE(clear_gc_stats)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_clear_gc_stats();
|
||||
PRIMITIVE_GETVM()->primitive_clear_gc_stats();
|
||||
}
|
||||
|
||||
/* classes.tuple uses this to reshape tuples; tools.deploy.shaker uses this
|
||||
to coalesce equal but distinct quotations and wrappers. */
|
||||
inline void factorvm::vmprim_become()
|
||||
inline void factorvm::primitive_become()
|
||||
{
|
||||
array *new_objects = untag_check<array>(dpop());
|
||||
array *old_objects = untag_check<array>(dpop());
|
||||
|
@ -691,7 +691,7 @@ inline void factorvm::vmprim_become()
|
|||
|
||||
PRIMITIVE(become)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_become();
|
||||
PRIMITIVE_GETVM()->primitive_become();
|
||||
}
|
||||
|
||||
void factorvm::inline_gc(cell *gc_roots_base, cell gc_roots_size)
|
||||
|
|
|
@ -231,14 +231,14 @@ cell factorvm::unaligned_object_size(object *pointer)
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_size()
|
||||
inline void factorvm::primitive_size()
|
||||
{
|
||||
box_unsigned_cell(object_size(dpop()));
|
||||
}
|
||||
|
||||
PRIMITIVE(size)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_size();
|
||||
PRIMITIVE_GETVM()->primitive_size();
|
||||
}
|
||||
|
||||
/* The number of cells from the start of the object which should be scanned by
|
||||
|
@ -280,7 +280,7 @@ cell factorvm::binary_payload_start(object *pointer)
|
|||
|
||||
|
||||
/* Push memory usage statistics in data heap */
|
||||
inline void factorvm::vmprim_data_room()
|
||||
inline void factorvm::primitive_data_room()
|
||||
{
|
||||
dpush(tag_fixnum((data->cards_end - data->cards) >> 10));
|
||||
dpush(tag_fixnum((data->decks_end - data->decks) >> 10));
|
||||
|
@ -301,7 +301,7 @@ inline void factorvm::vmprim_data_room()
|
|||
|
||||
PRIMITIVE(data_room)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_data_room();
|
||||
PRIMITIVE_GETVM()->primitive_data_room();
|
||||
}
|
||||
|
||||
/* Disables GC and activates next-object ( -- obj ) primitive */
|
||||
|
@ -318,14 +318,14 @@ void factorvm::end_scan()
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_begin_scan()
|
||||
inline void factorvm::primitive_begin_scan()
|
||||
{
|
||||
begin_scan();
|
||||
}
|
||||
|
||||
PRIMITIVE(begin_scan)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_begin_scan();
|
||||
PRIMITIVE_GETVM()->primitive_begin_scan();
|
||||
}
|
||||
|
||||
cell factorvm::next_object()
|
||||
|
@ -343,25 +343,25 @@ cell factorvm::next_object()
|
|||
|
||||
|
||||
/* Push object at heap scan cursor and advance; pushes f when done */
|
||||
inline void factorvm::vmprim_next_object()
|
||||
inline void factorvm::primitive_next_object()
|
||||
{
|
||||
dpush(next_object());
|
||||
}
|
||||
|
||||
PRIMITIVE(next_object)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_next_object();
|
||||
PRIMITIVE_GETVM()->primitive_next_object();
|
||||
}
|
||||
|
||||
/* Re-enables GC */
|
||||
inline void factorvm::vmprim_end_scan()
|
||||
inline void factorvm::primitive_end_scan()
|
||||
{
|
||||
gc_off = false;
|
||||
}
|
||||
|
||||
PRIMITIVE(end_scan)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_end_scan();
|
||||
PRIMITIVE_GETVM()->primitive_end_scan();
|
||||
}
|
||||
|
||||
template<typename TYPE> void factorvm::each_object(TYPE &functor)
|
||||
|
|
|
@ -497,7 +497,7 @@ void factorvm::factorbug()
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_die()
|
||||
inline void factorvm::primitive_die()
|
||||
{
|
||||
print_string("The die word was called by the library. Unless you called it yourself,\n");
|
||||
print_string("you have triggered a bug in Factor. Please report.\n");
|
||||
|
@ -506,7 +506,7 @@ inline void factorvm::vmprim_die()
|
|||
|
||||
PRIMITIVE(die)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_die();
|
||||
PRIMITIVE_GETVM()->primitive_die();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ cell factorvm::lookup_method(cell obj, cell methods)
|
|||
return array_nth(untag<array>(methods),TAG(obj));
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_lookup_method()
|
||||
inline void factorvm::primitive_lookup_method()
|
||||
{
|
||||
cell methods = dpop();
|
||||
cell obj = dpop();
|
||||
|
@ -122,7 +122,7 @@ inline void factorvm::vmprim_lookup_method()
|
|||
|
||||
PRIMITIVE(lookup_method)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_lookup_method();
|
||||
PRIMITIVE_GETVM()->primitive_lookup_method();
|
||||
}
|
||||
|
||||
cell factorvm::object_class(cell obj)
|
||||
|
@ -152,7 +152,7 @@ void factorvm::update_method_cache(cell cache, cell klass, cell method)
|
|||
set_array_nth(cache_elements,hashcode + 1,method);
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_mega_cache_miss()
|
||||
inline void factorvm::primitive_mega_cache_miss()
|
||||
{
|
||||
megamorphic_cache_misses++;
|
||||
|
||||
|
@ -171,20 +171,20 @@ inline void factorvm::vmprim_mega_cache_miss()
|
|||
|
||||
PRIMITIVE(mega_cache_miss)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_mega_cache_miss();
|
||||
PRIMITIVE_GETVM()->primitive_mega_cache_miss();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_reset_dispatch_stats()
|
||||
inline void factorvm::primitive_reset_dispatch_stats()
|
||||
{
|
||||
megamorphic_cache_hits = megamorphic_cache_misses = 0;
|
||||
}
|
||||
|
||||
PRIMITIVE(reset_dispatch_stats)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_reset_dispatch_stats();
|
||||
PRIMITIVE_GETVM()->primitive_reset_dispatch_stats();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_dispatch_stats()
|
||||
inline void factorvm::primitive_dispatch_stats()
|
||||
{
|
||||
growable_array stats(this);
|
||||
stats.add(allot_cell(megamorphic_cache_hits));
|
||||
|
@ -195,7 +195,7 @@ inline void factorvm::vmprim_dispatch_stats()
|
|||
|
||||
PRIMITIVE(dispatch_stats)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_dispatch_stats();
|
||||
PRIMITIVE_GETVM()->primitive_dispatch_stats();
|
||||
}
|
||||
|
||||
void quotation_jit::emit_mega_cache_lookup(cell methods_, fixnum index, cell cache_)
|
||||
|
|
|
@ -130,25 +130,25 @@ void factorvm::fp_trap_error(unsigned int fpu_status, stack_frame *signal_callst
|
|||
general_error(ERROR_FP_TRAP,tag_fixnum(fpu_status),F,signal_callstack_top);
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_call_clear()
|
||||
inline void factorvm::primitive_call_clear()
|
||||
{
|
||||
throw_impl(dpop(),stack_chain->callstack_bottom,this);
|
||||
}
|
||||
|
||||
PRIMITIVE(call_clear)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_call_clear();
|
||||
PRIMITIVE_GETVM()->primitive_call_clear();
|
||||
}
|
||||
|
||||
/* For testing purposes */
|
||||
inline void factorvm::vmprim_unimplemented()
|
||||
inline void factorvm::primitive_unimplemented()
|
||||
{
|
||||
not_implemented_error();
|
||||
}
|
||||
|
||||
PRIMITIVE(unimplemented)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_unimplemented();
|
||||
PRIMITIVE_GETVM()->primitive_unimplemented();
|
||||
}
|
||||
|
||||
void factorvm::memory_signal_handler_impl()
|
||||
|
|
|
@ -124,7 +124,7 @@ bool factorvm::save_image(const vm_char *filename)
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_save_image()
|
||||
inline void factorvm::primitive_save_image()
|
||||
{
|
||||
/* do a full GC to push everything into tenured space */
|
||||
gc();
|
||||
|
@ -136,10 +136,10 @@ inline void factorvm::vmprim_save_image()
|
|||
|
||||
PRIMITIVE(save_image)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_save_image();
|
||||
PRIMITIVE_GETVM()->primitive_save_image();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_save_image_and_exit()
|
||||
inline void factorvm::primitive_save_image_and_exit()
|
||||
{
|
||||
/* We unbox this before doing anything else. This is the only point
|
||||
where we might throw an error, so we have to throw an error here since
|
||||
|
@ -167,7 +167,7 @@ inline void factorvm::vmprim_save_image_and_exit()
|
|||
|
||||
PRIMITIVE(save_image_and_exit)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_save_image_and_exit();
|
||||
PRIMITIVE_GETVM()->primitive_save_image_and_exit();
|
||||
}
|
||||
|
||||
void factorvm::data_fixup(cell *cell)
|
||||
|
|
|
@ -252,7 +252,7 @@ VM_C_API void *inline_cache_miss(cell return_address, factorvm *myvm)
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_reset_inline_cache_stats()
|
||||
inline void factorvm::primitive_reset_inline_cache_stats()
|
||||
{
|
||||
cold_call_to_ic_transitions = ic_to_pic_transitions = pic_to_mega_transitions = 0;
|
||||
cell i;
|
||||
|
@ -261,10 +261,10 @@ inline void factorvm::vmprim_reset_inline_cache_stats()
|
|||
|
||||
PRIMITIVE(reset_inline_cache_stats)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_reset_inline_cache_stats();
|
||||
PRIMITIVE_GETVM()->primitive_reset_inline_cache_stats();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_inline_cache_stats()
|
||||
inline void factorvm::primitive_inline_cache_stats()
|
||||
{
|
||||
growable_array stats(this);
|
||||
stats.add(allot_cell(cold_call_to_ic_transitions));
|
||||
|
@ -279,7 +279,7 @@ inline void factorvm::vmprim_inline_cache_stats()
|
|||
|
||||
PRIMITIVE(inline_cache_stats)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_inline_cache_stats();
|
||||
PRIMITIVE_GETVM()->primitive_inline_cache_stats();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
32
vm/io.cpp
32
vm/io.cpp
|
@ -33,7 +33,7 @@ void factorvm::io_error()
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_fopen()
|
||||
inline void factorvm::primitive_fopen()
|
||||
{
|
||||
gc_root<byte_array> mode(dpop(),this);
|
||||
gc_root<byte_array> path(dpop(),this);
|
||||
|
@ -56,10 +56,10 @@ inline void factorvm::vmprim_fopen()
|
|||
|
||||
PRIMITIVE(fopen)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_fopen();
|
||||
PRIMITIVE_GETVM()->primitive_fopen();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_fgetc()
|
||||
inline void factorvm::primitive_fgetc()
|
||||
{
|
||||
FILE *file = (FILE *)unbox_alien();
|
||||
|
||||
|
@ -86,10 +86,10 @@ inline void factorvm::vmprim_fgetc()
|
|||
|
||||
PRIMITIVE(fgetc)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_fgetc();
|
||||
PRIMITIVE_GETVM()->primitive_fgetc();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_fread()
|
||||
inline void factorvm::primitive_fread()
|
||||
{
|
||||
FILE *file = (FILE *)unbox_alien();
|
||||
fixnum size = unbox_array_size();
|
||||
|
@ -131,10 +131,10 @@ inline void factorvm::vmprim_fread()
|
|||
|
||||
PRIMITIVE(fread)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_fread();
|
||||
PRIMITIVE_GETVM()->primitive_fread();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_fputc()
|
||||
inline void factorvm::primitive_fputc()
|
||||
{
|
||||
FILE *file = (FILE *)unbox_alien();
|
||||
fixnum ch = to_fixnum(dpop());
|
||||
|
@ -154,10 +154,10 @@ inline void factorvm::vmprim_fputc()
|
|||
|
||||
PRIMITIVE(fputc)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_fputc();
|
||||
PRIMITIVE_GETVM()->primitive_fputc();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_fwrite()
|
||||
inline void factorvm::primitive_fwrite()
|
||||
{
|
||||
FILE *file = (FILE *)unbox_alien();
|
||||
byte_array *text = untag_check<byte_array>(dpop());
|
||||
|
@ -188,10 +188,10 @@ inline void factorvm::vmprim_fwrite()
|
|||
|
||||
PRIMITIVE(fwrite)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_fwrite();
|
||||
PRIMITIVE_GETVM()->primitive_fwrite();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_fseek()
|
||||
inline void factorvm::primitive_fseek()
|
||||
{
|
||||
int whence = to_fixnum(dpop());
|
||||
FILE *file = (FILE *)unbox_alien();
|
||||
|
@ -218,10 +218,10 @@ inline void factorvm::vmprim_fseek()
|
|||
|
||||
PRIMITIVE(fseek)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_fseek();
|
||||
PRIMITIVE_GETVM()->primitive_fseek();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_fflush()
|
||||
inline void factorvm::primitive_fflush()
|
||||
{
|
||||
FILE *file = (FILE *)unbox_alien();
|
||||
for(;;)
|
||||
|
@ -235,10 +235,10 @@ inline void factorvm::vmprim_fflush()
|
|||
|
||||
PRIMITIVE(fflush)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_fflush();
|
||||
PRIMITIVE_GETVM()->primitive_fflush();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_fclose()
|
||||
inline void factorvm::primitive_fclose()
|
||||
{
|
||||
FILE *file = (FILE *)unbox_alien();
|
||||
for(;;)
|
||||
|
@ -252,7 +252,7 @@ inline void factorvm::vmprim_fclose()
|
|||
|
||||
PRIMITIVE(fclose)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_fclose();
|
||||
PRIMITIVE_GETVM()->primitive_fclose();
|
||||
}
|
||||
|
||||
/* This function is used by FFI I/O. Accessing the errno global directly is
|
||||
|
|
176
vm/math.cpp
176
vm/math.cpp
|
@ -3,29 +3,29 @@
|
|||
namespace factor
|
||||
{
|
||||
|
||||
inline void factorvm::vmprim_bignum_to_fixnum()
|
||||
inline void factorvm::primitive_bignum_to_fixnum()
|
||||
{
|
||||
drepl(tag_fixnum(bignum_to_fixnum(untag<bignum>(dpeek()))));
|
||||
}
|
||||
|
||||
PRIMITIVE(bignum_to_fixnum)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_to_fixnum();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_to_fixnum();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_float_to_fixnum()
|
||||
inline void factorvm::primitive_float_to_fixnum()
|
||||
{
|
||||
drepl(tag_fixnum(float_to_fixnum(dpeek())));
|
||||
}
|
||||
|
||||
PRIMITIVE(float_to_fixnum)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_float_to_fixnum();
|
||||
PRIMITIVE_GETVM()->primitive_float_to_fixnum();
|
||||
}
|
||||
|
||||
/* Division can only overflow when we are dividing the most negative fixnum
|
||||
by -1. */
|
||||
inline void factorvm::vmprim_fixnum_divint()
|
||||
inline void factorvm::primitive_fixnum_divint()
|
||||
{
|
||||
fixnum y = untag_fixnum(dpop()); \
|
||||
fixnum x = untag_fixnum(dpeek());
|
||||
|
@ -38,10 +38,10 @@ inline void factorvm::vmprim_fixnum_divint()
|
|||
|
||||
PRIMITIVE(fixnum_divint)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_fixnum_divint();
|
||||
PRIMITIVE_GETVM()->primitive_fixnum_divint();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_fixnum_divmod()
|
||||
inline void factorvm::primitive_fixnum_divmod()
|
||||
{
|
||||
cell y = ((cell *)ds)[0];
|
||||
cell x = ((cell *)ds)[-1];
|
||||
|
@ -59,7 +59,7 @@ inline void factorvm::vmprim_fixnum_divmod()
|
|||
|
||||
PRIMITIVE(fixnum_divmod)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_fixnum_divmod();
|
||||
PRIMITIVE_GETVM()->primitive_fixnum_divmod();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -84,7 +84,7 @@ inline fixnum factorvm::branchless_abs(fixnum x)
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_fixnum_shift()
|
||||
inline void factorvm::primitive_fixnum_shift()
|
||||
{
|
||||
fixnum y = untag_fixnum(dpop());
|
||||
fixnum x = untag_fixnum(dpeek());
|
||||
|
@ -113,34 +113,34 @@ inline void factorvm::vmprim_fixnum_shift()
|
|||
|
||||
PRIMITIVE(fixnum_shift)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_fixnum_shift();
|
||||
PRIMITIVE_GETVM()->primitive_fixnum_shift();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_fixnum_to_bignum()
|
||||
inline void factorvm::primitive_fixnum_to_bignum()
|
||||
{
|
||||
drepl(tag<bignum>(fixnum_to_bignum(untag_fixnum(dpeek()))));
|
||||
}
|
||||
|
||||
PRIMITIVE(fixnum_to_bignum)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_fixnum_to_bignum();
|
||||
PRIMITIVE_GETVM()->primitive_fixnum_to_bignum();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_float_to_bignum()
|
||||
inline void factorvm::primitive_float_to_bignum()
|
||||
{
|
||||
drepl(tag<bignum>(float_to_bignum(dpeek())));
|
||||
}
|
||||
|
||||
PRIMITIVE(float_to_bignum)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_float_to_bignum();
|
||||
PRIMITIVE_GETVM()->primitive_float_to_bignum();
|
||||
}
|
||||
|
||||
#define POP_BIGNUMS(x,y) \
|
||||
bignum * y = untag<bignum>(dpop()); \
|
||||
bignum * x = untag<bignum>(dpop());
|
||||
|
||||
inline void factorvm::vmprim_bignum_eq()
|
||||
inline void factorvm::primitive_bignum_eq()
|
||||
{
|
||||
POP_BIGNUMS(x,y);
|
||||
box_boolean(bignum_equal_p(x,y));
|
||||
|
@ -148,10 +148,10 @@ inline void factorvm::vmprim_bignum_eq()
|
|||
|
||||
PRIMITIVE(bignum_eq)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_eq();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_eq();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_add()
|
||||
inline void factorvm::primitive_bignum_add()
|
||||
{
|
||||
POP_BIGNUMS(x,y);
|
||||
dpush(tag<bignum>(bignum_add(x,y)));
|
||||
|
@ -159,10 +159,10 @@ inline void factorvm::vmprim_bignum_add()
|
|||
|
||||
PRIMITIVE(bignum_add)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_add();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_add();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_subtract()
|
||||
inline void factorvm::primitive_bignum_subtract()
|
||||
{
|
||||
POP_BIGNUMS(x,y);
|
||||
dpush(tag<bignum>(bignum_subtract(x,y)));
|
||||
|
@ -170,10 +170,10 @@ inline void factorvm::vmprim_bignum_subtract()
|
|||
|
||||
PRIMITIVE(bignum_subtract)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_subtract();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_subtract();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_multiply()
|
||||
inline void factorvm::primitive_bignum_multiply()
|
||||
{
|
||||
POP_BIGNUMS(x,y);
|
||||
dpush(tag<bignum>(bignum_multiply(x,y)));
|
||||
|
@ -181,10 +181,10 @@ inline void factorvm::vmprim_bignum_multiply()
|
|||
|
||||
PRIMITIVE(bignum_multiply)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_multiply();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_multiply();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_divint()
|
||||
inline void factorvm::primitive_bignum_divint()
|
||||
{
|
||||
POP_BIGNUMS(x,y);
|
||||
dpush(tag<bignum>(bignum_quotient(x,y)));
|
||||
|
@ -192,10 +192,10 @@ inline void factorvm::vmprim_bignum_divint()
|
|||
|
||||
PRIMITIVE(bignum_divint)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_divint();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_divint();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_divmod()
|
||||
inline void factorvm::primitive_bignum_divmod()
|
||||
{
|
||||
bignum *q, *r;
|
||||
POP_BIGNUMS(x,y);
|
||||
|
@ -206,10 +206,10 @@ inline void factorvm::vmprim_bignum_divmod()
|
|||
|
||||
PRIMITIVE(bignum_divmod)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_divmod();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_divmod();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_mod()
|
||||
inline void factorvm::primitive_bignum_mod()
|
||||
{
|
||||
POP_BIGNUMS(x,y);
|
||||
dpush(tag<bignum>(bignum_remainder(x,y)));
|
||||
|
@ -217,10 +217,10 @@ inline void factorvm::vmprim_bignum_mod()
|
|||
|
||||
PRIMITIVE(bignum_mod)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_mod();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_mod();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_and()
|
||||
inline void factorvm::primitive_bignum_and()
|
||||
{
|
||||
POP_BIGNUMS(x,y);
|
||||
dpush(tag<bignum>(bignum_bitwise_and(x,y)));
|
||||
|
@ -228,10 +228,10 @@ inline void factorvm::vmprim_bignum_and()
|
|||
|
||||
PRIMITIVE(bignum_and)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_and();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_and();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_or()
|
||||
inline void factorvm::primitive_bignum_or()
|
||||
{
|
||||
POP_BIGNUMS(x,y);
|
||||
dpush(tag<bignum>(bignum_bitwise_ior(x,y)));
|
||||
|
@ -239,10 +239,10 @@ inline void factorvm::vmprim_bignum_or()
|
|||
|
||||
PRIMITIVE(bignum_or)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_or();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_or();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_xor()
|
||||
inline void factorvm::primitive_bignum_xor()
|
||||
{
|
||||
POP_BIGNUMS(x,y);
|
||||
dpush(tag<bignum>(bignum_bitwise_xor(x,y)));
|
||||
|
@ -250,10 +250,10 @@ inline void factorvm::vmprim_bignum_xor()
|
|||
|
||||
PRIMITIVE(bignum_xor)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_xor();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_xor();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_shift()
|
||||
inline void factorvm::primitive_bignum_shift()
|
||||
{
|
||||
fixnum y = untag_fixnum(dpop());
|
||||
bignum* x = untag<bignum>(dpop());
|
||||
|
@ -262,10 +262,10 @@ inline void factorvm::vmprim_bignum_shift()
|
|||
|
||||
PRIMITIVE(bignum_shift)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_shift();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_shift();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_less()
|
||||
inline void factorvm::primitive_bignum_less()
|
||||
{
|
||||
POP_BIGNUMS(x,y);
|
||||
box_boolean(bignum_compare(x,y) == bignum_comparison_less);
|
||||
|
@ -273,10 +273,10 @@ inline void factorvm::vmprim_bignum_less()
|
|||
|
||||
PRIMITIVE(bignum_less)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_less();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_less();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_lesseq()
|
||||
inline void factorvm::primitive_bignum_lesseq()
|
||||
{
|
||||
POP_BIGNUMS(x,y);
|
||||
box_boolean(bignum_compare(x,y) != bignum_comparison_greater);
|
||||
|
@ -284,10 +284,10 @@ inline void factorvm::vmprim_bignum_lesseq()
|
|||
|
||||
PRIMITIVE(bignum_lesseq)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_lesseq();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_lesseq();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_greater()
|
||||
inline void factorvm::primitive_bignum_greater()
|
||||
{
|
||||
POP_BIGNUMS(x,y);
|
||||
box_boolean(bignum_compare(x,y) == bignum_comparison_greater);
|
||||
|
@ -295,10 +295,10 @@ inline void factorvm::vmprim_bignum_greater()
|
|||
|
||||
PRIMITIVE(bignum_greater)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_greater();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_greater();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_greatereq()
|
||||
inline void factorvm::primitive_bignum_greatereq()
|
||||
{
|
||||
POP_BIGNUMS(x,y);
|
||||
box_boolean(bignum_compare(x,y) != bignum_comparison_less);
|
||||
|
@ -306,20 +306,20 @@ inline void factorvm::vmprim_bignum_greatereq()
|
|||
|
||||
PRIMITIVE(bignum_greatereq)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_greatereq();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_greatereq();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_not()
|
||||
inline void factorvm::primitive_bignum_not()
|
||||
{
|
||||
drepl(tag<bignum>(bignum_bitwise_not(untag<bignum>(dpeek()))));
|
||||
}
|
||||
|
||||
PRIMITIVE(bignum_not)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_not();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_not();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_bitp()
|
||||
inline void factorvm::primitive_bignum_bitp()
|
||||
{
|
||||
fixnum bit = to_fixnum(dpop());
|
||||
bignum *x = untag<bignum>(dpop());
|
||||
|
@ -328,17 +328,17 @@ inline void factorvm::vmprim_bignum_bitp()
|
|||
|
||||
PRIMITIVE(bignum_bitp)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_bitp();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_bitp();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_log2()
|
||||
inline void factorvm::primitive_bignum_log2()
|
||||
{
|
||||
drepl(tag<bignum>(bignum_integer_length(untag<bignum>(dpeek()))));
|
||||
}
|
||||
|
||||
PRIMITIVE(bignum_log2)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_log2();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_log2();
|
||||
}
|
||||
|
||||
unsigned int factorvm::bignum_producer(unsigned int digit)
|
||||
|
@ -352,7 +352,7 @@ unsigned int bignum_producer(unsigned int digit, factorvm *myvm)
|
|||
return myvm->bignum_producer(digit);
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_byte_array_to_bignum()
|
||||
inline void factorvm::primitive_byte_array_to_bignum()
|
||||
{
|
||||
cell n_digits = array_capacity(untag_check<byte_array>(dpeek()));
|
||||
// bignum * result = factor::digit_stream_to_bignum(n_digits,factor::bignum_producer,0x100,0);
|
||||
|
@ -362,7 +362,7 @@ inline void factorvm::vmprim_byte_array_to_bignum()
|
|||
|
||||
PRIMITIVE(byte_array_to_bignum)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_byte_array_to_bignum();
|
||||
PRIMITIVE_GETVM()->primitive_byte_array_to_bignum();
|
||||
}
|
||||
|
||||
cell factorvm::unbox_array_size()
|
||||
|
@ -399,27 +399,27 @@ cell factorvm::unbox_array_size()
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_fixnum_to_float()
|
||||
inline void factorvm::primitive_fixnum_to_float()
|
||||
{
|
||||
drepl(allot_float(fixnum_to_float(dpeek())));
|
||||
}
|
||||
|
||||
PRIMITIVE(fixnum_to_float)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_fixnum_to_float();
|
||||
PRIMITIVE_GETVM()->primitive_fixnum_to_float();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bignum_to_float()
|
||||
inline void factorvm::primitive_bignum_to_float()
|
||||
{
|
||||
drepl(allot_float(bignum_to_float(dpeek())));
|
||||
}
|
||||
|
||||
PRIMITIVE(bignum_to_float)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bignum_to_float();
|
||||
PRIMITIVE_GETVM()->primitive_bignum_to_float();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_str_to_float()
|
||||
inline void factorvm::primitive_str_to_float()
|
||||
{
|
||||
byte_array *bytes = untag_check<byte_array>(dpeek());
|
||||
cell capacity = array_capacity(bytes);
|
||||
|
@ -435,10 +435,10 @@ inline void factorvm::vmprim_str_to_float()
|
|||
|
||||
PRIMITIVE(str_to_float)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_str_to_float();
|
||||
PRIMITIVE_GETVM()->primitive_str_to_float();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_float_to_str()
|
||||
inline void factorvm::primitive_float_to_str()
|
||||
{
|
||||
byte_array *array = allot_byte_array(33);
|
||||
snprintf((char *)(array + 1),32,"%.16g",untag_float_check(dpop()));
|
||||
|
@ -447,14 +447,14 @@ inline void factorvm::vmprim_float_to_str()
|
|||
|
||||
PRIMITIVE(float_to_str)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_float_to_str();
|
||||
PRIMITIVE_GETVM()->primitive_float_to_str();
|
||||
}
|
||||
|
||||
#define POP_FLOATS(x,y) \
|
||||
double y = untag_float(dpop()); \
|
||||
double x = untag_float(dpop());
|
||||
|
||||
inline void factorvm::vmprim_float_eq()
|
||||
inline void factorvm::primitive_float_eq()
|
||||
{
|
||||
POP_FLOATS(x,y);
|
||||
box_boolean(x == y);
|
||||
|
@ -462,10 +462,10 @@ inline void factorvm::vmprim_float_eq()
|
|||
|
||||
PRIMITIVE(float_eq)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_float_eq();
|
||||
PRIMITIVE_GETVM()->primitive_float_eq();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_float_add()
|
||||
inline void factorvm::primitive_float_add()
|
||||
{
|
||||
POP_FLOATS(x,y);
|
||||
box_double(x + y);
|
||||
|
@ -473,10 +473,10 @@ inline void factorvm::vmprim_float_add()
|
|||
|
||||
PRIMITIVE(float_add)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_float_add();
|
||||
PRIMITIVE_GETVM()->primitive_float_add();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_float_subtract()
|
||||
inline void factorvm::primitive_float_subtract()
|
||||
{
|
||||
POP_FLOATS(x,y);
|
||||
box_double(x - y);
|
||||
|
@ -484,10 +484,10 @@ inline void factorvm::vmprim_float_subtract()
|
|||
|
||||
PRIMITIVE(float_subtract)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_float_subtract();
|
||||
PRIMITIVE_GETVM()->primitive_float_subtract();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_float_multiply()
|
||||
inline void factorvm::primitive_float_multiply()
|
||||
{
|
||||
POP_FLOATS(x,y);
|
||||
box_double(x * y);
|
||||
|
@ -495,10 +495,10 @@ inline void factorvm::vmprim_float_multiply()
|
|||
|
||||
PRIMITIVE(float_multiply)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_float_multiply();
|
||||
PRIMITIVE_GETVM()->primitive_float_multiply();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_float_divfloat()
|
||||
inline void factorvm::primitive_float_divfloat()
|
||||
{
|
||||
POP_FLOATS(x,y);
|
||||
box_double(x / y);
|
||||
|
@ -506,10 +506,10 @@ inline void factorvm::vmprim_float_divfloat()
|
|||
|
||||
PRIMITIVE(float_divfloat)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_float_divfloat();
|
||||
PRIMITIVE_GETVM()->primitive_float_divfloat();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_float_mod()
|
||||
inline void factorvm::primitive_float_mod()
|
||||
{
|
||||
POP_FLOATS(x,y);
|
||||
box_double(fmod(x,y));
|
||||
|
@ -517,10 +517,10 @@ inline void factorvm::vmprim_float_mod()
|
|||
|
||||
PRIMITIVE(float_mod)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_float_mod();
|
||||
PRIMITIVE_GETVM()->primitive_float_mod();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_float_less()
|
||||
inline void factorvm::primitive_float_less()
|
||||
{
|
||||
POP_FLOATS(x,y);
|
||||
box_boolean(x < y);
|
||||
|
@ -528,10 +528,10 @@ inline void factorvm::vmprim_float_less()
|
|||
|
||||
PRIMITIVE(float_less)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_float_less();
|
||||
PRIMITIVE_GETVM()->primitive_float_less();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_float_lesseq()
|
||||
inline void factorvm::primitive_float_lesseq()
|
||||
{
|
||||
POP_FLOATS(x,y);
|
||||
box_boolean(x <= y);
|
||||
|
@ -539,10 +539,10 @@ inline void factorvm::vmprim_float_lesseq()
|
|||
|
||||
PRIMITIVE(float_lesseq)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_float_lesseq();
|
||||
PRIMITIVE_GETVM()->primitive_float_lesseq();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_float_greater()
|
||||
inline void factorvm::primitive_float_greater()
|
||||
{
|
||||
POP_FLOATS(x,y);
|
||||
box_boolean(x > y);
|
||||
|
@ -550,10 +550,10 @@ inline void factorvm::vmprim_float_greater()
|
|||
|
||||
PRIMITIVE(float_greater)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_float_greater();
|
||||
PRIMITIVE_GETVM()->primitive_float_greater();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_float_greatereq()
|
||||
inline void factorvm::primitive_float_greatereq()
|
||||
{
|
||||
POP_FLOATS(x,y);
|
||||
box_boolean(x >= y);
|
||||
|
@ -561,47 +561,47 @@ inline void factorvm::vmprim_float_greatereq()
|
|||
|
||||
PRIMITIVE(float_greatereq)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_float_greatereq();
|
||||
PRIMITIVE_GETVM()->primitive_float_greatereq();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_float_bits()
|
||||
inline void factorvm::primitive_float_bits()
|
||||
{
|
||||
box_unsigned_4(float_bits(untag_float_check(dpop())));
|
||||
}
|
||||
|
||||
PRIMITIVE(float_bits)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_float_bits();
|
||||
PRIMITIVE_GETVM()->primitive_float_bits();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bits_float()
|
||||
inline void factorvm::primitive_bits_float()
|
||||
{
|
||||
box_float(bits_float(to_cell(dpop())));
|
||||
}
|
||||
|
||||
PRIMITIVE(bits_float)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bits_float();
|
||||
PRIMITIVE_GETVM()->primitive_bits_float();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_double_bits()
|
||||
inline void factorvm::primitive_double_bits()
|
||||
{
|
||||
box_unsigned_8(double_bits(untag_float_check(dpop())));
|
||||
}
|
||||
|
||||
PRIMITIVE(double_bits)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_double_bits();
|
||||
PRIMITIVE_GETVM()->primitive_double_bits();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_bits_double()
|
||||
inline void factorvm::primitive_bits_double()
|
||||
{
|
||||
box_double(bits_double(to_unsigned_8(dpop())));
|
||||
}
|
||||
|
||||
PRIMITIVE(bits_double)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_bits_double();
|
||||
PRIMITIVE_GETVM()->primitive_bits_double();
|
||||
}
|
||||
|
||||
fixnum factorvm::to_fixnum(cell tagged)
|
||||
|
|
|
@ -79,7 +79,7 @@ void factorvm::ffi_dlclose(dll *dll)
|
|||
|
||||
|
||||
|
||||
inline void factorvm::vmprim_existsp()
|
||||
inline void factorvm::primitive_existsp()
|
||||
{
|
||||
struct stat sb;
|
||||
char *path = (char *)(untag_check<byte_array>(dpop()) + 1);
|
||||
|
@ -88,7 +88,7 @@ inline void factorvm::vmprim_existsp()
|
|||
|
||||
PRIMITIVE(existsp)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_existsp();
|
||||
PRIMITIVE_GETVM()->primitive_existsp();
|
||||
}
|
||||
|
||||
segment *factorvm::alloc_segment(cell size)
|
||||
|
|
|
@ -92,7 +92,7 @@ const vm_char *factorvm::vm_executable_path()
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_existsp()
|
||||
inline void factorvm::primitive_existsp()
|
||||
{
|
||||
vm_char *path = untag_check<byte_array>(dpop())->data<vm_char>();
|
||||
box_boolean(windows_stat(path));
|
||||
|
@ -100,7 +100,7 @@ inline void factorvm::vmprim_existsp()
|
|||
|
||||
PRIMITIVE(existsp)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_existsp();
|
||||
PRIMITIVE_GETVM()->primitive_existsp();
|
||||
}
|
||||
|
||||
segment *factorvm::alloc_segment(cell size)
|
||||
|
|
|
@ -51,14 +51,14 @@ void factorvm::set_profiling(bool profiling)
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_profiling()
|
||||
inline void factorvm::primitive_profiling()
|
||||
{
|
||||
set_profiling(to_boolean(dpop()));
|
||||
}
|
||||
|
||||
PRIMITIVE(profiling)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_profiling();
|
||||
PRIMITIVE_GETVM()->primitive_profiling();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -289,18 +289,18 @@ void factorvm::jit_compile(cell quot_, bool relocating)
|
|||
if(relocating) relocate_code_block(compiled);
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_jit_compile()
|
||||
inline void factorvm::primitive_jit_compile()
|
||||
{
|
||||
jit_compile(dpop(),true);
|
||||
}
|
||||
|
||||
PRIMITIVE(jit_compile)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_jit_compile();
|
||||
PRIMITIVE_GETVM()->primitive_jit_compile();
|
||||
}
|
||||
|
||||
/* push a new quotation on the stack */
|
||||
inline void factorvm::vmprim_array_to_quotation()
|
||||
inline void factorvm::primitive_array_to_quotation()
|
||||
{
|
||||
quotation *quot = allot<quotation>(sizeof(quotation));
|
||||
quot->array = dpeek();
|
||||
|
@ -313,10 +313,10 @@ inline void factorvm::vmprim_array_to_quotation()
|
|||
|
||||
PRIMITIVE(array_to_quotation)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_array_to_quotation();
|
||||
PRIMITIVE_GETVM()->primitive_array_to_quotation();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_quotation_xt()
|
||||
inline void factorvm::primitive_quotation_xt()
|
||||
{
|
||||
quotation *quot = untag_check<quotation>(dpeek());
|
||||
drepl(allot_cell((cell)quot->xt));
|
||||
|
@ -324,7 +324,7 @@ inline void factorvm::vmprim_quotation_xt()
|
|||
|
||||
PRIMITIVE(quotation_xt)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_quotation_xt();
|
||||
PRIMITIVE_GETVM()->primitive_quotation_xt();
|
||||
}
|
||||
|
||||
void factorvm::compile_all_words()
|
||||
|
@ -374,7 +374,7 @@ VM_ASM_API cell lazy_jit_compile_impl(cell quot_, stack_frame *stack, factorvm *
|
|||
return VM_PTR->lazy_jit_compile_impl(quot_,stack);
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_quot_compiled_p()
|
||||
inline void factorvm::primitive_quot_compiled_p()
|
||||
{
|
||||
tagged<quotation> quot(dpop());
|
||||
quot.untag_check(this);
|
||||
|
@ -383,7 +383,7 @@ inline void factorvm::vmprim_quot_compiled_p()
|
|||
|
||||
PRIMITIVE(quot_compiled_p)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_quot_compiled_p();
|
||||
PRIMITIVE_GETVM()->primitive_quot_compiled_p();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
32
vm/run.cpp
32
vm/run.cpp
|
@ -4,7 +4,7 @@ namespace factor
|
|||
{
|
||||
|
||||
|
||||
inline void factorvm::vmprim_getenv()
|
||||
inline void factorvm::primitive_getenv()
|
||||
{
|
||||
fixnum e = untag_fixnum(dpeek());
|
||||
drepl(userenv[e]);
|
||||
|
@ -12,10 +12,10 @@ inline void factorvm::vmprim_getenv()
|
|||
|
||||
PRIMITIVE(getenv)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_getenv();
|
||||
PRIMITIVE_GETVM()->primitive_getenv();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_setenv()
|
||||
inline void factorvm::primitive_setenv()
|
||||
{
|
||||
fixnum e = untag_fixnum(dpop());
|
||||
cell value = dpop();
|
||||
|
@ -24,40 +24,40 @@ inline void factorvm::vmprim_setenv()
|
|||
|
||||
PRIMITIVE(setenv)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_setenv();
|
||||
PRIMITIVE_GETVM()->primitive_setenv();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_exit()
|
||||
inline void factorvm::primitive_exit()
|
||||
{
|
||||
exit(to_fixnum(dpop()));
|
||||
}
|
||||
|
||||
PRIMITIVE(exit)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_exit();
|
||||
PRIMITIVE_GETVM()->primitive_exit();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_micros()
|
||||
inline void factorvm::primitive_micros()
|
||||
{
|
||||
box_unsigned_8(current_micros());
|
||||
}
|
||||
|
||||
PRIMITIVE(micros)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_micros();
|
||||
PRIMITIVE_GETVM()->primitive_micros();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_sleep()
|
||||
inline void factorvm::primitive_sleep()
|
||||
{
|
||||
sleep_micros(to_cell(dpop()));
|
||||
}
|
||||
|
||||
PRIMITIVE(sleep)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_sleep();
|
||||
PRIMITIVE_GETVM()->primitive_sleep();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_set_slot()
|
||||
inline void factorvm::primitive_set_slot()
|
||||
{
|
||||
fixnum slot = untag_fixnum(dpop());
|
||||
object *obj = untag<object>(dpop());
|
||||
|
@ -69,10 +69,10 @@ inline void factorvm::vmprim_set_slot()
|
|||
|
||||
PRIMITIVE(set_slot)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_set_slot();
|
||||
PRIMITIVE_GETVM()->primitive_set_slot();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_load_locals()
|
||||
inline void factorvm::primitive_load_locals()
|
||||
{
|
||||
fixnum count = untag_fixnum(dpop());
|
||||
memcpy((cell *)(rs + sizeof(cell)),(cell *)(ds - sizeof(cell) * (count - 1)),sizeof(cell) * count);
|
||||
|
@ -82,7 +82,7 @@ inline void factorvm::vmprim_load_locals()
|
|||
|
||||
PRIMITIVE(load_locals)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_load_locals();
|
||||
PRIMITIVE_GETVM()->primitive_load_locals();
|
||||
}
|
||||
|
||||
cell factorvm::clone_object(cell obj_)
|
||||
|
@ -100,14 +100,14 @@ cell factorvm::clone_object(cell obj_)
|
|||
}
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_clone()
|
||||
inline void factorvm::primitive_clone()
|
||||
{
|
||||
drepl(clone_object(dpeek()));
|
||||
}
|
||||
|
||||
PRIMITIVE(clone)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_clone();
|
||||
PRIMITIVE_GETVM()->primitive_clone();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ string *factorvm::allot_string(cell capacity, cell fill)
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_string()
|
||||
inline void factorvm::primitive_string()
|
||||
{
|
||||
cell initial = to_cell(dpop());
|
||||
cell length = unbox_array_size();
|
||||
|
@ -115,7 +115,7 @@ inline void factorvm::vmprim_string()
|
|||
|
||||
PRIMITIVE(string)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_string();
|
||||
PRIMITIVE_GETVM()->primitive_string();
|
||||
}
|
||||
|
||||
bool factorvm::reallot_string_in_place_p(string *str, cell capacity)
|
||||
|
@ -169,7 +169,7 @@ string* factorvm::reallot_string(string *str_, cell capacity)
|
|||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_resize_string()
|
||||
inline void factorvm::primitive_resize_string()
|
||||
{
|
||||
string* str = untag_check<string>(dpop());
|
||||
cell capacity = unbox_array_size();
|
||||
|
@ -178,10 +178,10 @@ inline void factorvm::vmprim_resize_string()
|
|||
|
||||
PRIMITIVE(resize_string)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_resize_string();
|
||||
PRIMITIVE_GETVM()->primitive_resize_string();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_string_nth()
|
||||
inline void factorvm::primitive_string_nth()
|
||||
{
|
||||
string *str = untag<string>(dpop());
|
||||
cell index = untag_fixnum(dpop());
|
||||
|
@ -190,10 +190,10 @@ inline void factorvm::vmprim_string_nth()
|
|||
|
||||
PRIMITIVE(string_nth)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_string_nth();
|
||||
PRIMITIVE_GETVM()->primitive_string_nth();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_set_string_nth_fast()
|
||||
inline void factorvm::primitive_set_string_nth_fast()
|
||||
{
|
||||
string *str = untag<string>(dpop());
|
||||
cell index = untag_fixnum(dpop());
|
||||
|
@ -203,10 +203,10 @@ inline void factorvm::vmprim_set_string_nth_fast()
|
|||
|
||||
PRIMITIVE(set_string_nth_fast)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_set_string_nth_fast();
|
||||
PRIMITIVE_GETVM()->primitive_set_string_nth_fast();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_set_string_nth_slow()
|
||||
inline void factorvm::primitive_set_string_nth_slow()
|
||||
{
|
||||
string *str = untag<string>(dpop());
|
||||
cell index = untag_fixnum(dpop());
|
||||
|
@ -216,7 +216,7 @@ inline void factorvm::vmprim_set_string_nth_slow()
|
|||
|
||||
PRIMITIVE(set_string_nth_slow)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_set_string_nth_slow();
|
||||
PRIMITIVE_GETVM()->primitive_set_string_nth_slow();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ tuple *factorvm::allot_tuple(cell layout_)
|
|||
return t.untagged();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_tuple()
|
||||
inline void factorvm::primitive_tuple()
|
||||
{
|
||||
gc_root<tuple_layout> layout(dpop(),this);
|
||||
tuple *t = allot_tuple(layout.value());
|
||||
|
@ -25,11 +25,11 @@ inline void factorvm::vmprim_tuple()
|
|||
|
||||
PRIMITIVE(tuple)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_tuple();
|
||||
PRIMITIVE_GETVM()->primitive_tuple();
|
||||
}
|
||||
|
||||
/* push a new tuple on the stack, filling its slots from the stack */
|
||||
inline void factorvm::vmprim_tuple_boa()
|
||||
inline void factorvm::primitive_tuple_boa()
|
||||
{
|
||||
gc_root<tuple_layout> layout(dpop(),this);
|
||||
gc_root<tuple> t(allot_tuple(layout.value()),this);
|
||||
|
@ -41,7 +41,7 @@ inline void factorvm::vmprim_tuple_boa()
|
|||
|
||||
PRIMITIVE(tuple_boa)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_tuple_boa();
|
||||
PRIMITIVE_GETVM()->primitive_tuple_boa();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
244
vm/vm.hpp
244
vm/vm.hpp
|
@ -20,28 +20,28 @@ struct factorvm : factorvmdata {
|
|||
void init_stacks(cell ds_size_, cell rs_size_);
|
||||
bool stack_to_array(cell bottom, cell top);
|
||||
cell array_to_stack(array *array, cell bottom);
|
||||
inline void vmprim_datastack();
|
||||
inline void vmprim_retainstack();
|
||||
inline void vmprim_set_datastack();
|
||||
inline void vmprim_set_retainstack();
|
||||
inline void vmprim_check_datastack();
|
||||
inline void primitive_datastack();
|
||||
inline void primitive_retainstack();
|
||||
inline void primitive_set_datastack();
|
||||
inline void primitive_set_retainstack();
|
||||
inline void primitive_check_datastack();
|
||||
|
||||
// run
|
||||
inline void vmprim_getenv();
|
||||
inline void vmprim_setenv();
|
||||
inline void vmprim_exit();
|
||||
inline void vmprim_micros();
|
||||
inline void vmprim_sleep();
|
||||
inline void vmprim_set_slot();
|
||||
inline void vmprim_load_locals();
|
||||
inline void primitive_getenv();
|
||||
inline void primitive_setenv();
|
||||
inline void primitive_exit();
|
||||
inline void primitive_micros();
|
||||
inline void primitive_sleep();
|
||||
inline void primitive_set_slot();
|
||||
inline void primitive_load_locals();
|
||||
cell clone_object(cell obj_);
|
||||
inline void vmprim_clone();
|
||||
inline void primitive_clone();
|
||||
|
||||
// profiler
|
||||
void init_profiler();
|
||||
code_block *compile_profiling_stub(cell word_);
|
||||
void set_profiling(bool profiling);
|
||||
inline void vmprim_profiling();
|
||||
inline void primitive_profiling();
|
||||
|
||||
// errors
|
||||
void out_of_memory();
|
||||
|
@ -53,8 +53,8 @@ struct factorvm : factorvmdata {
|
|||
void signal_error(int signal, stack_frame *native_stack);
|
||||
void divide_by_zero_error();
|
||||
void fp_trap_error(unsigned int fpu_status, stack_frame *signal_callstack_top);
|
||||
inline void vmprim_call_clear();
|
||||
inline void vmprim_unimplemented();
|
||||
inline void primitive_call_clear();
|
||||
inline void primitive_unimplemented();
|
||||
void memory_signal_handler_impl();
|
||||
void misc_signal_handler_impl();
|
||||
void fp_signal_handler_impl();
|
||||
|
@ -141,15 +141,15 @@ struct factorvm : factorvmdata {
|
|||
void init_data_heap(cell gens,cell young_size,cell aging_size,cell tenured_size,bool secure_gc_);
|
||||
cell untagged_object_size(object *pointer);
|
||||
cell unaligned_object_size(object *pointer);
|
||||
inline void vmprim_size();
|
||||
inline void primitive_size();
|
||||
cell binary_payload_start(object *pointer);
|
||||
inline void vmprim_data_room();
|
||||
inline void primitive_data_room();
|
||||
void begin_scan();
|
||||
void end_scan();
|
||||
inline void vmprim_begin_scan();
|
||||
inline void primitive_begin_scan();
|
||||
cell next_object();
|
||||
inline void vmprim_next_object();
|
||||
inline void vmprim_end_scan();
|
||||
inline void primitive_next_object();
|
||||
inline void primitive_end_scan();
|
||||
template<typename T> void each_object(T &functor);
|
||||
cell find_all_words();
|
||||
cell object_size(cell tagged);
|
||||
|
@ -192,10 +192,10 @@ struct factorvm : factorvmdata {
|
|||
void end_gc(cell gc_elapsed);
|
||||
void garbage_collection(cell gen,bool growing_data_heap_,cell requested_bytes);
|
||||
void gc();
|
||||
inline void vmprim_gc();
|
||||
inline void vmprim_gc_stats();
|
||||
inline void primitive_gc();
|
||||
inline void primitive_gc_stats();
|
||||
void clear_gc_stats();
|
||||
inline void vmprim_become();
|
||||
inline void primitive_become();
|
||||
void inline_gc(cell *gc_roots_base, cell gc_roots_size);
|
||||
inline bool collecting_accumulation_gen_p();
|
||||
inline object *allot_zone(zone *z, cell a);
|
||||
|
@ -203,7 +203,7 @@ struct factorvm : factorvmdata {
|
|||
template <typename TYPE> TYPE *allot(cell size);
|
||||
inline void check_data_pointer(object *pointer);
|
||||
inline void check_tagged_pointer(cell tagged);
|
||||
inline void vmprim_clear_gc_stats();
|
||||
inline void primitive_clear_gc_stats();
|
||||
|
||||
// generic arrays
|
||||
template <typename T> T *allot_array_internal(cell capacity);
|
||||
|
@ -232,15 +232,15 @@ struct factorvm : factorvmdata {
|
|||
void find_data_references(cell look_for_);
|
||||
void dump_code_heap();
|
||||
void factorbug();
|
||||
inline void vmprim_die();
|
||||
inline void primitive_die();
|
||||
|
||||
//arrays
|
||||
array *allot_array(cell capacity, cell fill_);
|
||||
inline void vmprim_array();
|
||||
inline void primitive_array();
|
||||
cell allot_array_1(cell obj_);
|
||||
cell allot_array_2(cell v1_, cell v2_);
|
||||
cell allot_array_4(cell v1_, cell v2_, cell v3_, cell v4_);
|
||||
inline void vmprim_resize_array();
|
||||
inline void primitive_resize_array();
|
||||
inline void set_array_nth(array *array, cell slot, cell value);
|
||||
|
||||
//strings
|
||||
|
@ -251,13 +251,13 @@ struct factorvm : factorvmdata {
|
|||
string *allot_string_internal(cell capacity);
|
||||
void fill_string(string *str_, cell start, cell capacity, cell fill);
|
||||
string *allot_string(cell capacity, cell fill);
|
||||
inline void vmprim_string();
|
||||
inline void primitive_string();
|
||||
bool reallot_string_in_place_p(string *str, cell capacity);
|
||||
string* reallot_string(string *str_, cell capacity);
|
||||
inline void vmprim_resize_string();
|
||||
inline void vmprim_string_nth();
|
||||
inline void vmprim_set_string_nth_fast();
|
||||
inline void vmprim_set_string_nth_slow();
|
||||
inline void primitive_resize_string();
|
||||
inline void primitive_string_nth();
|
||||
inline void primitive_set_string_nth_fast();
|
||||
inline void primitive_set_string_nth_slow();
|
||||
|
||||
//booleans
|
||||
void box_boolean(bool value);
|
||||
|
@ -266,28 +266,28 @@ struct factorvm : factorvmdata {
|
|||
|
||||
//byte arrays
|
||||
byte_array *allot_byte_array(cell size);
|
||||
inline void vmprim_byte_array();
|
||||
inline void vmprim_uninitialized_byte_array();
|
||||
inline void vmprim_resize_byte_array();
|
||||
inline void primitive_byte_array();
|
||||
inline void primitive_uninitialized_byte_array();
|
||||
inline void primitive_resize_byte_array();
|
||||
|
||||
//tuples
|
||||
tuple *allot_tuple(cell layout_);
|
||||
inline void vmprim_tuple();
|
||||
inline void vmprim_tuple_boa();
|
||||
inline void primitive_tuple();
|
||||
inline void primitive_tuple_boa();
|
||||
|
||||
//words
|
||||
word *allot_word(cell vocab_, cell name_);
|
||||
inline void vmprim_word();
|
||||
inline void vmprim_word_xt();
|
||||
inline void primitive_word();
|
||||
inline void primitive_word_xt();
|
||||
void update_word_xt(cell w_);
|
||||
inline void vmprim_optimized_p();
|
||||
inline void vmprim_wrapper();
|
||||
inline void primitive_optimized_p();
|
||||
inline void primitive_wrapper();
|
||||
|
||||
//math
|
||||
inline void vmprim_bignum_to_fixnum();
|
||||
inline void vmprim_float_to_fixnum();
|
||||
inline void vmprim_fixnum_divint();
|
||||
inline void vmprim_fixnum_divmod();
|
||||
inline void primitive_bignum_to_fixnum();
|
||||
inline void primitive_float_to_fixnum();
|
||||
inline void primitive_fixnum_divint();
|
||||
inline void primitive_fixnum_divmod();
|
||||
bignum *fixnum_to_bignum(fixnum);
|
||||
bignum *cell_to_bignum(cell);
|
||||
bignum *long_long_to_bignum(s64 n);
|
||||
|
@ -295,48 +295,48 @@ struct factorvm : factorvmdata {
|
|||
inline fixnum sign_mask(fixnum x);
|
||||
inline fixnum branchless_max(fixnum x, fixnum y);
|
||||
inline fixnum branchless_abs(fixnum x);
|
||||
inline void vmprim_fixnum_shift();
|
||||
inline void vmprim_fixnum_to_bignum();
|
||||
inline void vmprim_float_to_bignum();
|
||||
inline void vmprim_bignum_eq();
|
||||
inline void vmprim_bignum_add();
|
||||
inline void vmprim_bignum_subtract();
|
||||
inline void vmprim_bignum_multiply();
|
||||
inline void vmprim_bignum_divint();
|
||||
inline void vmprim_bignum_divmod();
|
||||
inline void vmprim_bignum_mod();
|
||||
inline void vmprim_bignum_and();
|
||||
inline void vmprim_bignum_or();
|
||||
inline void vmprim_bignum_xor();
|
||||
inline void vmprim_bignum_shift();
|
||||
inline void vmprim_bignum_less();
|
||||
inline void vmprim_bignum_lesseq();
|
||||
inline void vmprim_bignum_greater();
|
||||
inline void vmprim_bignum_greatereq();
|
||||
inline void vmprim_bignum_not();
|
||||
inline void vmprim_bignum_bitp();
|
||||
inline void vmprim_bignum_log2();
|
||||
inline void primitive_fixnum_shift();
|
||||
inline void primitive_fixnum_to_bignum();
|
||||
inline void primitive_float_to_bignum();
|
||||
inline void primitive_bignum_eq();
|
||||
inline void primitive_bignum_add();
|
||||
inline void primitive_bignum_subtract();
|
||||
inline void primitive_bignum_multiply();
|
||||
inline void primitive_bignum_divint();
|
||||
inline void primitive_bignum_divmod();
|
||||
inline void primitive_bignum_mod();
|
||||
inline void primitive_bignum_and();
|
||||
inline void primitive_bignum_or();
|
||||
inline void primitive_bignum_xor();
|
||||
inline void primitive_bignum_shift();
|
||||
inline void primitive_bignum_less();
|
||||
inline void primitive_bignum_lesseq();
|
||||
inline void primitive_bignum_greater();
|
||||
inline void primitive_bignum_greatereq();
|
||||
inline void primitive_bignum_not();
|
||||
inline void primitive_bignum_bitp();
|
||||
inline void primitive_bignum_log2();
|
||||
unsigned int bignum_producer(unsigned int digit);
|
||||
inline void vmprim_byte_array_to_bignum();
|
||||
inline void primitive_byte_array_to_bignum();
|
||||
cell unbox_array_size();
|
||||
inline void vmprim_fixnum_to_float();
|
||||
inline void vmprim_bignum_to_float();
|
||||
inline void vmprim_str_to_float();
|
||||
inline void vmprim_float_to_str();
|
||||
inline void vmprim_float_eq();
|
||||
inline void vmprim_float_add();
|
||||
inline void vmprim_float_subtract();
|
||||
inline void vmprim_float_multiply();
|
||||
inline void vmprim_float_divfloat();
|
||||
inline void vmprim_float_mod();
|
||||
inline void vmprim_float_less();
|
||||
inline void vmprim_float_lesseq();
|
||||
inline void vmprim_float_greater();
|
||||
inline void vmprim_float_greatereq();
|
||||
inline void vmprim_float_bits();
|
||||
inline void vmprim_bits_float();
|
||||
inline void vmprim_double_bits();
|
||||
inline void vmprim_bits_double();
|
||||
inline void primitive_fixnum_to_float();
|
||||
inline void primitive_bignum_to_float();
|
||||
inline void primitive_str_to_float();
|
||||
inline void primitive_float_to_str();
|
||||
inline void primitive_float_eq();
|
||||
inline void primitive_float_add();
|
||||
inline void primitive_float_subtract();
|
||||
inline void primitive_float_multiply();
|
||||
inline void primitive_float_divfloat();
|
||||
inline void primitive_float_mod();
|
||||
inline void primitive_float_less();
|
||||
inline void primitive_float_lesseq();
|
||||
inline void primitive_float_greater();
|
||||
inline void primitive_float_greatereq();
|
||||
inline void primitive_float_bits();
|
||||
inline void primitive_bits_float();
|
||||
inline void primitive_double_bits();
|
||||
inline void primitive_bits_double();
|
||||
fixnum to_fixnum(cell tagged);
|
||||
cell to_cell(cell tagged);
|
||||
void box_signed_1(s8 n);
|
||||
|
@ -373,14 +373,14 @@ struct factorvm : factorvmdata {
|
|||
//io
|
||||
void init_c_io();
|
||||
void io_error();
|
||||
inline void vmprim_fopen();
|
||||
inline void vmprim_fgetc();
|
||||
inline void vmprim_fread();
|
||||
inline void vmprim_fputc();
|
||||
inline void vmprim_fwrite();
|
||||
inline void vmprim_fseek();
|
||||
inline void vmprim_fflush();
|
||||
inline void vmprim_fclose();
|
||||
inline void primitive_fopen();
|
||||
inline void primitive_fgetc();
|
||||
inline void primitive_fread();
|
||||
inline void primitive_fputc();
|
||||
inline void primitive_fwrite();
|
||||
inline void primitive_fseek();
|
||||
inline void primitive_fflush();
|
||||
inline void primitive_fclose();
|
||||
|
||||
//code_gc
|
||||
void clear_free_list(heap *heap);
|
||||
|
@ -445,8 +445,8 @@ struct factorvm : factorvmdata {
|
|||
void iterate_code_heap(code_heap_iterator iter);
|
||||
void copy_code_heap_roots();
|
||||
void update_code_heap_words();
|
||||
inline void vmprim_modify_code_heap();
|
||||
inline void vmprim_code_room();
|
||||
inline void primitive_modify_code_heap();
|
||||
inline void primitive_code_room();
|
||||
code_block *forward_xt(code_block *compiled);
|
||||
void forward_frame_xt(stack_frame *frame);
|
||||
void forward_object_xts();
|
||||
|
@ -460,8 +460,8 @@ struct factorvm : factorvmdata {
|
|||
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 *filename);
|
||||
inline void vmprim_save_image();
|
||||
inline void vmprim_save_image_and_exit();
|
||||
inline void primitive_save_image();
|
||||
inline void primitive_save_image_and_exit();
|
||||
void data_fixup(cell *cell);
|
||||
template <typename T> void code_fixup(T **handle);
|
||||
void fixup_word(word *word);
|
||||
|
@ -481,19 +481,19 @@ struct factorvm : factorvmdata {
|
|||
callstack *allot_callstack(cell size);
|
||||
stack_frame *fix_callstack_top(stack_frame *top, stack_frame *bottom);
|
||||
stack_frame *capture_start();
|
||||
inline void vmprim_callstack();
|
||||
inline void vmprim_set_callstack();
|
||||
inline void primitive_callstack();
|
||||
inline void primitive_set_callstack();
|
||||
code_block *frame_code(stack_frame *frame);
|
||||
cell frame_type(stack_frame *frame);
|
||||
cell frame_executing(stack_frame *frame);
|
||||
stack_frame *frame_successor(stack_frame *frame);
|
||||
cell frame_scan(stack_frame *frame);
|
||||
inline void vmprim_callstack_to_array();
|
||||
inline void primitive_callstack_to_array();
|
||||
stack_frame *innermost_stack_frame(callstack *stack);
|
||||
stack_frame *innermost_stack_frame_quot(callstack *callstack);
|
||||
inline void vmprim_innermost_stack_frame_executing();
|
||||
inline void vmprim_innermost_stack_frame_scan();
|
||||
inline void vmprim_set_innermost_stack_frame_quot();
|
||||
inline void primitive_innermost_stack_frame_executing();
|
||||
inline void primitive_innermost_stack_frame_scan();
|
||||
inline void primitive_set_innermost_stack_frame_quot();
|
||||
void save_callstack_bottom(stack_frame *callstack_bottom);
|
||||
template<typename T> void iterate_callstack(cell top, cell bottom, T &iterator);
|
||||
inline void do_slots(cell obj, void (* iter)(cell *,factorvm*));
|
||||
|
@ -502,14 +502,14 @@ struct factorvm : factorvmdata {
|
|||
//alien
|
||||
char *pinned_alien_offset(cell obj);
|
||||
cell allot_alien(cell delegate_, cell displacement);
|
||||
inline void vmprim_displaced_alien();
|
||||
inline void vmprim_alien_address();
|
||||
inline void primitive_displaced_alien();
|
||||
inline void primitive_alien_address();
|
||||
void *alien_pointer();
|
||||
inline void vmprim_dlopen();
|
||||
inline void vmprim_dlsym();
|
||||
inline void vmprim_dlclose();
|
||||
inline void vmprim_dll_validp();
|
||||
inline void vmprim_vm_ptr();
|
||||
inline void primitive_dlopen();
|
||||
inline void primitive_dlsym();
|
||||
inline void primitive_dlclose();
|
||||
inline void primitive_dll_validp();
|
||||
inline void primitive_vm_ptr();
|
||||
char *alien_offset(cell obj);
|
||||
char *unbox_alien();
|
||||
void box_alien(void *ptr);
|
||||
|
@ -519,15 +519,15 @@ struct factorvm : factorvmdata {
|
|||
void box_medium_struct(cell x1, cell x2, cell x3, cell x4, cell size);
|
||||
|
||||
//quotations
|
||||
inline void vmprim_jit_compile();
|
||||
inline void vmprim_array_to_quotation();
|
||||
inline void vmprim_quotation_xt();
|
||||
inline void primitive_jit_compile();
|
||||
inline void primitive_array_to_quotation();
|
||||
inline void primitive_quotation_xt();
|
||||
void set_quot_xt(quotation *quot, code_block *code);
|
||||
void jit_compile(cell quot_, bool relocating);
|
||||
void compile_all_words();
|
||||
fixnum quot_code_offset_to_scan(cell quot_, cell offset);
|
||||
cell lazy_jit_compile_impl(cell quot_, stack_frame *stack);
|
||||
inline void vmprim_quot_compiled_p();
|
||||
inline void primitive_quot_compiled_p();
|
||||
|
||||
//dispatch
|
||||
cell search_lookup_alist(cell table, cell klass);
|
||||
|
@ -538,13 +538,13 @@ struct factorvm : factorvmdata {
|
|||
cell lookup_hi_tag_method(cell obj, cell methods);
|
||||
cell lookup_hairy_method(cell obj, cell methods);
|
||||
cell lookup_method(cell obj, cell methods);
|
||||
inline void vmprim_lookup_method();
|
||||
inline void primitive_lookup_method();
|
||||
cell object_class(cell obj);
|
||||
cell method_cache_hashcode(cell klass, array *array);
|
||||
void update_method_cache(cell cache, cell klass, cell method);
|
||||
inline void vmprim_mega_cache_miss();
|
||||
inline void vmprim_reset_dispatch_stats();
|
||||
inline void vmprim_dispatch_stats();
|
||||
inline void primitive_mega_cache_miss();
|
||||
inline void primitive_reset_dispatch_stats();
|
||||
inline void primitive_dispatch_stats();
|
||||
|
||||
//inline cache
|
||||
void init_inline_caching(int max_size);
|
||||
|
@ -557,8 +557,8 @@ struct factorvm : factorvmdata {
|
|||
cell add_inline_cache_entry(cell cache_entries_, cell klass_, cell method_);
|
||||
void update_pic_transitions(cell pic_size);
|
||||
void *inline_cache_miss(cell return_address);
|
||||
inline void vmprim_reset_inline_cache_stats();
|
||||
inline void vmprim_inline_cache_stats();
|
||||
inline void primitive_reset_inline_cache_stats();
|
||||
inline void primitive_inline_cache_stats();
|
||||
|
||||
//factor
|
||||
void default_parameters(vm_parameters *p);
|
||||
|
@ -576,7 +576,7 @@ struct factorvm : factorvmdata {
|
|||
void factor_sleep(long us);
|
||||
|
||||
// os-*
|
||||
inline void vmprim_existsp();
|
||||
inline void primitive_existsp();
|
||||
void init_ffi();
|
||||
void ffi_dlopen(dll *dll);
|
||||
void *ffi_dlsym(dll *dll, symbol_char *symbol);
|
||||
|
|
16
vm/words.cpp
16
vm/words.cpp
|
@ -32,7 +32,7 @@ word *factorvm::allot_word(cell vocab_, cell name_)
|
|||
}
|
||||
|
||||
/* <word> ( name vocabulary -- word ) */
|
||||
inline void factorvm::vmprim_word()
|
||||
inline void factorvm::primitive_word()
|
||||
{
|
||||
cell vocab = dpop();
|
||||
cell name = dpop();
|
||||
|
@ -41,11 +41,11 @@ inline void factorvm::vmprim_word()
|
|||
|
||||
PRIMITIVE(word)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_word();
|
||||
PRIMITIVE_GETVM()->primitive_word();
|
||||
}
|
||||
|
||||
/* word-xt ( word -- start end ) */
|
||||
inline void factorvm::vmprim_word_xt()
|
||||
inline void factorvm::primitive_word_xt()
|
||||
{
|
||||
word *w = untag_check<word>(dpop());
|
||||
code_block *code = (profiling_p ? w->profiling : w->code);
|
||||
|
@ -55,7 +55,7 @@ inline void factorvm::vmprim_word_xt()
|
|||
|
||||
PRIMITIVE(word_xt)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_word_xt();
|
||||
PRIMITIVE_GETVM()->primitive_word_xt();
|
||||
}
|
||||
|
||||
/* Allocates memory */
|
||||
|
@ -74,17 +74,17 @@ void factorvm::update_word_xt(cell w_)
|
|||
w->xt = w->code->xt();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_optimized_p()
|
||||
inline void factorvm::primitive_optimized_p()
|
||||
{
|
||||
drepl(tag_boolean(word_optimized_p(untag_check<word>(dpeek()))));
|
||||
}
|
||||
|
||||
PRIMITIVE(optimized_p)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_optimized_p();
|
||||
PRIMITIVE_GETVM()->primitive_optimized_p();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_wrapper()
|
||||
inline void factorvm::primitive_wrapper()
|
||||
{
|
||||
wrapper *new_wrapper = allot<wrapper>(sizeof(wrapper));
|
||||
new_wrapper->object = dpeek();
|
||||
|
@ -93,7 +93,7 @@ inline void factorvm::vmprim_wrapper()
|
|||
|
||||
PRIMITIVE(wrapper)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_wrapper();
|
||||
PRIMITIVE_GETVM()->primitive_wrapper();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue