Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Inline cache #3676

Merged
merged 2 commits into from
Jul 1, 2016
Merged

WIP Inline cache #3676

merged 2 commits into from
Jul 1, 2016

Conversation

brixen
Copy link
Member

@brixen brixen commented Jul 1, 2016

No description provided.

Under concurrent update, we need to preserve the coherence of the multiple
values is the InlineCache object. In other words, no thread should be able to
see values in a single InlineCache object that represent a partial update of
the inline cache.

To meet this constraint, we pre-allocate the number of InlineCache slots
specified at process invocation for every CallSite object. Those slots point
to individual InlineCache objects as the call site is executed and the type
profile changes. The pointers are swapped atomically, and if the atomic swap
succeeds, the previous cache is retained in a 'dead list' until the next
garbage collection cycle. If the update fails, the updated cache is discarded
and the update is attempted again.

Nothing should retain the InlineCache pointers outside the CallSite object.
During execution of the CallSite, the InlineCache pointer should be on the
execution stack, so swapping the pointers should not impact code that is
already-in-progress. At a garbage collection checkpoint, no interpreter will
be in-progress, so deleting the replaced InlineCache objects should be safe.
@brixen brixen merged commit 5c6a613 into master Jul 1, 2016
@brixen brixen deleted the inline_cache branch July 1, 2016 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant