A smart card which includes a non-volatile read/write memory, a processor
connected to the memory, and an installer module configured to cause the
processor to receive computer code having method bodies into the memory,
and further configured to cause the processor to perform a method for
determining the instruction boundaries of the method bodies and resolving
unresolved references within the method bodies. The method includes steps
for examining each instruction for a forward jump instruction and a valid
ending instruction, maintaining a farthest logical return pointer
corresponding to the instruction for which the farthest forward jump
instruction or the farthest valid ending instruction is detected,
resolving unresolved references within a method body starting with the
first instruction and ending with the instruction corresponding to the
farthest logical return pointer, and terminating the examination of each
instruction within a method body when the instruction under examination
is beyond the instruction corresponding to the farthest logical return
pointer.