| return((int)(Cell)engine(ip0,sp0,rp0,fp0,lp0)); |
return((int)(Cell)engine(ip0,sp0,rp0,fp0,lp0)); |
| } |
} |
| |
|
| |
|
| #ifndef INCLUDE_IMAGE |
#ifndef INCLUDE_IMAGE |
| void print_sizes(Cell sizebyte) |
void print_sizes(Cell sizebyte) |
| /* print size information */ |
/* print size information */ |
| |
|
| int compare_priminfo_length(PrimInfo **a, PrimInfo **b) |
int compare_priminfo_length(PrimInfo **a, PrimInfo **b) |
| { |
{ |
| return (*a)->length - (*b)->length; |
Cell diff = (*a)->length - (*b)->length; |
| |
if (diff) |
| |
return diff; |
| |
else /* break ties by start address; thus the decompiler produces |
| |
the earliest primitive with the same code (e.g. noop instead |
| |
of (char) and @ instead of >code-address */ |
| |
return (*b)->start - (*a)->start; |
| } |
} |
| |
|
| #endif /* defined(NO_DYNAMIC) */ |
#endif /* defined(NO_DYNAMIC) */ |
| return code; |
return code; |
| #else /* !defined(NO_DYNAMIC) */ |
#else /* !defined(NO_DYNAMIC) */ |
| Cell i; |
Cell i; |
| |
struct code_block_list *p; |
| |
|
| |
/* first, check if we are in code at all */ |
| |
for (p = code_block_list;; p = p->next) { |
| |
if (p == NULL) |
| |
return code; |
| |
if (code >= p->block && code < p->block+p->size) |
| |
break; |
| |
} |
| /* reverse order because NOOP might match other prims */ |
/* reverse order because NOOP might match other prims */ |
| for (i=npriminfos-1; i>DOESJUMP; i--) { |
for (i=npriminfos-1; i>DOESJUMP; i--) { |
| PrimInfo *pi=decomp_prims[i]; |
PrimInfo *pi=decomp_prims[i]; |