added vm-ptr primitive
parent
0470b7d2c5
commit
2e50da6beb
|
@ -103,6 +103,7 @@ bootstrapping? on
|
|||
"words"
|
||||
"vectors"
|
||||
"vectors.private"
|
||||
"vm"
|
||||
} [ create-vocab drop ] each
|
||||
|
||||
! Builtin classes
|
||||
|
@ -518,6 +519,7 @@ tuple
|
|||
{ "inline-cache-stats" "generic.single" (( -- stats )) }
|
||||
{ "optimized?" "words" (( word -- ? )) }
|
||||
{ "quot-compiled?" "quotations" (( quot -- ? )) }
|
||||
{ "vm-ptr" "vm" (( -- ptr )) }
|
||||
} [ [ first3 ] dip swap make-primitive ] each-index
|
||||
|
||||
! Bump build number
|
||||
|
|
10
vm/alien.cpp
10
vm/alien.cpp
|
@ -303,4 +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()
|
||||
{
|
||||
box_alien(this);
|
||||
}
|
||||
|
||||
PRIMITIVE(vm_ptr)
|
||||
{
|
||||
PRIMITIVE_GETVM()->vmprim_vm_ptr();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,6 +36,8 @@ PRIMITIVE(dlsym);
|
|||
PRIMITIVE(dlclose);
|
||||
PRIMITIVE(dll_validp);
|
||||
|
||||
PRIMITIVE(vm_ptr);
|
||||
|
||||
VM_C_API char *alien_offset(cell object, factorvm *vm);
|
||||
VM_C_API char *unbox_alien(factorvm *vm);
|
||||
VM_C_API void box_alien(void *ptr, factorvm *vm);
|
||||
|
|
|
@ -162,6 +162,7 @@ const primitive_type primitives[] = {
|
|||
primitive_inline_cache_stats,
|
||||
primitive_optimized_p,
|
||||
primitive_quot_compiled_p,
|
||||
primitive_vm_ptr,
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue