Technique to actualize a high-speed access to a property when executing a compiled object code in a static compiler
A data processing apparatus that generates an object code from a source code, includes a unit that sets, for an access to a property of an object included in the source code, an offset of a one-dimensional array that stores a value in correspondence with a property in an offset table of hidden type data provided to correspond to the object, and accesses the property via the offset table.
1. A data processing apparatus that generates an object code from a source code, comprising:
a computer processor programmed to execute a process including:
setting, for an access to a property of an object included in the source code, an offset of a one-dimensional array that stores a value in correspondence with the property in an offset table of hidden type data provided to correspond to the object,
accessing the property via the offset table of hidden type data, and
generating a code to access the property via a hash table for a case when the access to the property via the offset table of hidden type data cannot be performed.
2. A non-transitory computer-readable recording medium having recorded thereon a program that causes a computer to function as:
a unit that sets, for an access to a property of an object included in the source code, an offset of a one-dimensional array that stores a value in correspondence with a property in an offset table of hidden type data provided to correspond to the object, accesses the property via the offset table of hidden type data, and generates a code to access the property via a hash table for a case when the access to the property via the offset table of hidden type data cannot be performed.