martinmcclure / mist

Filetree code for the Mist project (mist-project.org)
32 stars 5 forks source link

Implement complete but skeletal compile process #18

Open martinmcclure opened 10 years ago

martinmcclure commented 10 years ago

In order to have multiple routines, and to link them together, we need the process of compiling and installing a module to be roughed in.

Steps in installing a module, as currently envisioned: 1) Install all prerequisite modules. Detect any erroneously circular requisites. 2) Process all definitions for classes or module variables, creating empty classes for each class definition. 3) Compose the classes recursively to know what instvars and methods each class has. This process also detects erroneously circular class composition. Empty methods are created, and deltas are recorded for each affected selector's method dictionary. 4) Compile each method, leaving inline caches empty (0). 5) Fill in the guess for each send site's inline cache.' 6) Make the methods live by applying the deltas recorded earlier to the method dictionaries of the affected selectors.

martinmcclure commented 10 years ago

See also issue 16 regarding return values, which are not yet done.

martinmcclure commented 10 years ago

Step 7, previously omitted: Examine each previously-existing send site for any selector that has been added or removed (only added right now -- there won't be a way to remove methods until a Mist system can modify itself at runtime). For each send site, update the send site cache if it's now inaccurate.