mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-18 18:40:22 +02:00
Improved the VM's efficiency. The VM is as fast as the interpreter. :-(
* benchmark/lib.scm: New file. * benchmark/measure.scm: New file. * README: Added useful pointers to various threads. * doc/guile-vm.texi: Fixed the description of `load-program' (it now expects _immediate_ integers). * src/*.[ch]: Use immediate integers whereever possible, as in the original code. For `CONS', use `scm_cell' rather than `scm_cons'. git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-6
This commit is contained in:
parent
238e7a11a8
commit
2d80426a3e
16 changed files with 275 additions and 51 deletions
8
src/vm.c
8
src/vm.c
|
@ -476,10 +476,10 @@ SCM_DEFINE (scm_vm_stats, "vm-stats", 1, 0, 0,
|
|||
|
||||
SCM_VALIDATE_VM (1, vm);
|
||||
|
||||
stats = scm_make_vector (scm_from_int (2), SCM_UNSPECIFIED);
|
||||
scm_vector_set_x (stats, scm_from_int (0),
|
||||
stats = scm_make_vector (SCM_I_MAKINUM (2), SCM_UNSPECIFIED);
|
||||
scm_vector_set_x (stats, SCM_I_MAKINUM (0),
|
||||
scm_from_ulong (SCM_VM_DATA (vm)->time));
|
||||
scm_vector_set_x (stats, scm_from_int (1),
|
||||
scm_vector_set_x (stats, SCM_I_MAKINUM (1),
|
||||
scm_from_ulong (SCM_VM_DATA (vm)->clock));
|
||||
|
||||
return stats;
|
||||
|
@ -528,7 +528,7 @@ SCM_DEFINE (scm_vm_fetch_code, "vm-fetch-code", 1, 0, 0,
|
|||
|
||||
list = SCM_LIST1 (scm_str2symbol (p->name));
|
||||
for (i = 1; i <= p->len; i++)
|
||||
list = scm_cons (scm_from_uint8 (ip[i]), list);
|
||||
list = scm_cons (SCM_I_MAKINUM (ip[i]), list);
|
||||
return scm_reverse_x (list, SCM_EOL);
|
||||
}
|
||||
#undef FUNC_NAME
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue