version 1.75, 2002/12/13 15:49:53
|
version 1.76, 2002/12/13 21:20:40
|
Line 463 typedef struct {
|
Line 463 typedef struct {
|
} PrimInfo; |
} PrimInfo; |
|
|
PrimInfo *priminfos; |
PrimInfo *priminfos; |
|
PrimInfo **decomp_prims; |
|
|
|
int compare_priminfo_length(PrimInfo **a, PrimInfo **b) |
|
{ |
|
return (*a)->length - (*b)->length; |
|
} |
|
|
#endif /* defined(NO_DYNAMIC) */ |
#endif /* defined(NO_DYNAMIC) */ |
Cell npriminfos=0; |
Cell npriminfos=0; |
|
|
|
|
void check_prims(Label symbols1[]) |
void check_prims(Label symbols1[]) |
{ |
{ |
int i; |
int i; |
Line 554 void check_prims(Label symbols1[])
|
Line 562 void check_prims(Label symbols1[])
|
if (debug) |
if (debug) |
fprintf(stderr,"\n"); |
fprintf(stderr,"\n"); |
} |
} |
|
decomp_prims = calloc(i,sizeof(PrimInfo *)); |
|
for (i=DOESJUMP+1; i<npriminfos; i++) |
|
decomp_prims[i] = &(priminfos[i]); |
|
qsort(decomp_prims+DOESJUMP+1, npriminfos-DOESJUMP-1, sizeof(PrimInfo *), |
|
compare_priminfo_length); |
#endif |
#endif |
} |
} |
|
|
Line 639 int forget_dyncode(Address code)
|
Line 652 int forget_dyncode(Address code)
|
#endif /* !defined(NO_DYNAMIC) */ |
#endif /* !defined(NO_DYNAMIC) */ |
} |
} |
|
|
Label decompile_code(Label prim) |
Label decompile_code(Label code) |
{ |
{ |
return prim; |
#ifdef NO_DYNAMIC |
|
return code; |
|
#else /* !defined(NO_DYNAMIC) */ |
|
Cell i; |
|
|
|
/* reverse order because NOOP might match other prims */ |
|
for (i=npriminfos-1; i>DOESJUMP; i--) { |
|
PrimInfo *pi=decomp_prims[i]; |
|
if (pi->start==code || (pi->start && memcmp(code,pi->start,pi->length)==0)) |
|
return pi->start; |
|
} |
|
return code; |
|
#endif /* !defined(NO_DYNAMIC) */ |
} |
} |
|
|
#ifdef NO_IP |
#ifdef NO_IP |