1. A method of compiling source code, the method comprising the computer-implemented steps of: converting pointer-based access in the source code to array-based access in a first pass compilation of the source code; collecting information for objects in the source code during the first pass compilation to form collected information; selecting candidate objects in the source code based on the collected information to form selected candidate objects; creating global stride variables for the selected candidate objects, wherein global stride variables comprise global variables that contain information of each dimension of an array, wherein the global stride variables are used to record stride information of the array, and wherein the stride information specifies a reference pattern along each dimension of the array; updating memory allocation operations for the selected candidate objects in a second pass compilation of the source code; and replacing multiple-level pointer indirect references in the source code with multi-dimensional array indexed references for the selected candidate objects in the second pass compilation of the source code.