Patent ID: 9672152
Date: 2017-06-06
CPC Classifications: G06F

Claim:
1. A machine-readable non-transitory storage medium having instructions therein, which when executed by a machine, cause the machine to perform a method, the method comprising: allocating an object cell in a memory during runtime to represent a dynamically typed object according to an object model for a dynamically typed programming language, the object specified with one or more properties in a source code of the dynamically typed programming language, each property having a property name associated with a property value, the properties of the object having an array relationship, the object cell pointed to by a pointer during the runtime, the object cell having an index type, a value pointer and an inline storage, the index type indicating which of a number of object types the object belongs to, the value pointer for a reference to property values stored in value storages allocated outside of the object cell in the memory, the inline storage determined based on a status of memory allocation of the memory during the runtime; determining if the inline storage is sized with sufficient space for the value storages to store the property values; allocating the value storages within the inline storage in the object cell if the inline storage is sized with sufficient space for the value storages, wherein the value storages are allocated outside of the object cell if the inline storage is sized with insufficient space for the value storages; and generating instructions for an access to the property values of the object via the pointer to the object cell, wherein the instructions include a guard code, a fast code path and a slow code path, the slow code path to perform memory loading via the value pointer to retrieve the property values in the value storages outside of the object cell, the instructions to access the value pointer via the pointer to the object cell, the fast code path to retrieve the property values within the object cell directly via the pointer to the object cell without the memory loading via the value pointer, and the guard code to determine whether to invoke the slow code path or the fast code path for the access to the property values based on the index type of the object, wherein the fast code path is invoked if the property values have the array relationship and the inline storage of the object cell is sized with sufficient space for the value storages to store the property values, and wherein the instructions include profiling code to dynamically record types of the property values accessed for the object in a runtime profile allocated in the memory and associated with each access to the property values.