Skip to content
Success

Changes

Summary

  1. Merge pull request #9635 from xavierleroy/skiplists (commit: fb79bd8) (details)
  2. Refactor skiplist to avoid UB casts (#9660) (commit: 286e21c) (details)
  3. More efficient management of code fragments (#9654) (commit: 751f965) (details)
Commit fb79bd82499f8a90efb2e2bdb1bb57b62f4f5262 by gabriel.scherer
Merge pull request #9635 from xavierleroy/skiplists

Introduce a library of skip lists and use them to fix a performance issue in the debugger (issue #9606)

(cherry picked from commit c61fc39caac51e8414df5b53c9d0a7104011f4f2)
(commit: fb79bd8)
The file was modifiedruntime/Makefile (diff)
The file was addedruntime/caml/skiplist.h
The file was modifiedChanges (diff)
The file was modifiedruntime/debugger.c (diff)
The file was modifiedruntime/globroots.c (diff)
The file was addedruntime/skiplist.c
Commit 286e21cf4ac536857b43a580d79a36d18f2241a6 by gabriel.scherer
Refactor skiplist to avoid UB casts (#9660)

This patch removes casts between struct skiplist * and struct skipcell *, and removes the "layout compatibility" fields in skiplist that were there to enable these casts.

The only algorithmic difference is that caml_skiplist_find is now "stop-at" (see discussion here), as this was slightly easier to write in the no-cast style.

(cherry picked from commit 5946b93a855eb2549260b36274e2ae43d14efa15)
(commit: 286e21c)
The file was modifiedruntime/caml/skiplist.h (diff)
The file was modifiedruntime/skiplist.c (diff)
Commit 751f965f801cfc9ba0c3be12d0fa9edd200d8073 by gabriel.scherer
More efficient management of code fragments (#9654)

* Introducing codefrag: a new runtime module to work with code fragments

This module collects all the operations on code fragments performed in
various places of the runtime systems.  Applies both to bytecode and
to native code.

The implementation is based on skiplists, so that "lookup fragment by
PC" and "lookup fragment by number" are efficient (logarithmic in the
number of code fragments).  "Lookup fragment by digest" remains
linear-time.

The new module also improves the handling of digests: now it is
possible to mark a code fragment as "no digest" i.e. not marshal-able.

* Use the new "codefrag" runtime module for marshaling and for the
  debugger interface

Replace the previous handling of code fragments with calls to the
functions provided by the "codefrag" runtime module.

(cherry picked from commit 08e58c836e5b2e8e1015e06ad0ab3df444d6197a)
(commit: 751f965)
The file was addedruntime/caml/codefrag.h
The file was modifiedruntime/fix_code.c (diff)
The file was modifiedruntime/misc.c (diff)
The file was modifiedruntime/intern.c (diff)
The file was modifiedruntime/caml/misc.h (diff)
The file was modifiedChanges (diff)
The file was modifiedruntime/startup_nat.c (diff)
The file was addedruntime/codefrag.c
The file was modifiedruntime/Makefile (diff)
The file was modifiedruntime/debugger.c (diff)
The file was modifiedruntime/meta.c (diff)
The file was modifiedruntime/dynlink_nat.c (diff)
The file was modifiedruntime/extern.c (diff)