Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use STk_instr instead of uint16_t in vm.c #557

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,9 +1130,9 @@ static void run_vm(vm_thread_t *vm)
{
jbuf jb;
int16_t tailp;
int nargs=0;
volatile int offset,
have_code_lock = 0; /* if true, we're patching the code */
STk_instr nargs=0;
volatile STk_instr offset; /* Anything returned by fetch_next() should be STk_instr */
volatile int have_code_lock = 0; /* if true, we're patching the code */
#ifndef __clang__
// With clang, we are faster without the "volatile" (which seems quite normal).
// But, on gcc, omitting the "volatile" (weirdly) produces less efficient code.
Expand Down Expand Up @@ -1388,7 +1388,8 @@ CASE(LOCAL_REF3) { vm->val = FRAME_LOCAL(vm->env, 3); NEXT1;}
CASE(LOCAL_REF4) { vm->val = FRAME_LOCAL(vm->env, 4); NEXT1;}
CASE(LOCAL_REF) { vm->val = FRAME_LOCAL(vm->env, fetch_next()); NEXT1;}
CASE(DEEP_LOCAL_REF) {
int level, info = fetch_next();
int level;
STk_instr info = fetch_next();
SCM e = vm->env;

/* STklos organizes local environments as this: each level has a
Expand Down Expand Up @@ -1425,7 +1426,8 @@ CASE(DEEP_LOC_REF_FAR) {


CASE(DEEP_LOC_REF_PUSH) {
int level, info = fetch_next();
int level;
STk_instr info = fetch_next();
SCM e = vm->env;

/* Go down in the dynamic environment */
Expand Down Expand Up @@ -1493,7 +1495,8 @@ CASE(LOCAL_SET) { FRAME_LOCAL(vm->env,fetch_next()) = vm->val; NEXT0;}


CASE(DEEP_LOCAL_SET) {
int level, info = fetch_next();
int level;
STk_instr info = fetch_next();
SCM e = vm->env;

/* Go down in the dynamic environment */
Expand Down