1. A computer-implemented method of dynamically optimizing runtime execution of computer code object on a computer by applying stack manipulation techniques, comprising: performing a stack walk for evaluating whether a requested permission is allowed for the plurality of sequential stack frames of a call stack; if the requested permission is not allowed for at least one of the sequential stack frames in the call stack, then creating a security exception; if the requested permission is allowed for the plurality of sequential stack frames in the call stack, then evaluating security elements associated with the requested permission and each stack frame of the call stack for determining whether the permission can be optimized; if yes, then automatically promoting a future request for the same permission into a permission assertion; if not, then continuing with the execution.