- Timestamp:
- 05/15/08 22:50:42 (6 months ago)
- Files:
-
- 1 modified
-
lang/c/misc/mlisp/core/v_vm.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/c/misc/mlisp/core/v_vm.cpp
r11617 r11643 177 177 178 178 //============================================================================= 179 // �{�b�N�X 180 181 static SExp box(SExp v) { 182 return cons(BOX, v); 183 } 184 185 static void set_box(SExp b, SExp v) { 186 rplacd(b, v); 187 } 188 189 static SExp unbox(SExp b) { 190 return cdr(b); 191 } 192 193 194 //============================================================================= 179 195 180 196 static int vm_return(SExp* px, sint* pf, SExp* pc, int s) { … … 230 246 SExp xx = cadddr(x); 231 247 a = closure(body, n, s); x = xx; s -= n; 248 } else if (op == BOX) { 249 sint n = s2int(cadr(x)); 250 SExp xx = caddr(x); 251 index_set(s, n + 1, box(index(s, n + 1))); 252 x = xx; 253 } else if (op == ASSIGN_LOCAL) { 254 sint n = s2int(cadr(x)); 255 SExp xx = caddr(x); 256 set_box(index(f, n + 1), a); 257 x = xx; 258 } else if (op == ASSIGN_FREE) { 259 sint n = s2int(cadr(x)); 260 SExp xx = caddr(x); 261 set_box(index_closure(c, n), a); 262 x = xx; 232 263 } else if (op == APPLY) { 233 264 SExp argnum = cadr(x); … … 277 308 SExp xx = caddr(x); 278 309 a = refer_global(var); x = xx; 310 } else if (op == ASSIGN_GLOBAL) { 311 SExp var = cadr(x); 312 SExp xx = caddr(x); 313 define_global(var, a); 314 a = var; x = xx; 279 315 } else { 280 316 runtime_error("illegal opecode");
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)