void showRelocatability() { int i; #ifdef RUNTIME_RELOC_CHECKS goto_len = calculateRelocatability(handler_sizes); #endif if(goto_len >= 0) printf("Dispatch sequence is relocatable\n"); else printf("Dispatch sequence is not relocatable (%s)\n", reason(goto_len)); for(i = 0; i < HANDLERS; i++) { int j; printf("Opcodes at depth %d: \n", i); for(j = 0; j < LABELS_SIZE; j++) { int size = handler_sizes[i][j]; if(size >= 0) printf("%d : is relocatable\n", j); else printf("%d : is not relocatable (%s)\n", j, reason(size)); } } }
int checkRelocatability() { char ***handlers = (char ***)executeJava(); int i; #ifdef RUNTIME_RELOC_CHECKS goto_len = calculateRelocatability(handler_sizes); #endif /* Check relocatability of the indirect goto. This is copied onto the end of each super-instruction. If this is un-relocatable, inlining is disabled. */ if(goto_len < 0) return FALSE; goto_start = handlers[ENTRY_LABELS][GOTO_START]; /* Calculate handler code range within the program text. This is used to tell which handlers in a method have been rewritten when freeing the method data on class unloading */ for(i = 0; i < HANDLERS; i++) { int j; for(j = 0; j < LABELS_SIZE; j++) { char *entry = handlers[ENTRY_LABELS+i][j]; if(entry < min_entry_point) min_entry_point = entry; if(entry > max_entry_point) max_entry_point = entry; } handler_entry_points[i] = handlers[ENTRY_LABELS+i]; } return TRUE; }
int main() { goto_len = calculateRelocatability(handler_sizes); return writeIncludeFile(); }