Remove some `#ifndef NO_NAKED_POINTERS` that are now redundant
Having Is_in_value_area always true in no-naked-pointers mode achieves the same result as the `#ifndef NO_NAKED_POINTERS` removed here. (commit: 247c1da)
weak.[ch]: use Is_in_value_area instead of Is_in_heap_or_young.
In weak.c there are two tests determining whether a value is a custom block or not. The original code, using Is_in_heap_or_young, would conclude "not a custom block" for statically-allocated custom blocks like int64 literals.
In weak.h there is one test Is_in_heap_or_young (child) that guards 1- a test for forward blocks 2- a test for white blocks.
Both guarded tests are false for a statically-allocated block: - test 1 because lazy values are not statically allocated normally - test 2 because statically-allocated blocks must have black headers.
Hence it makes no difference to test Is_in_value_area (child). (commit: 55fcf9f)
Is_in_heap_or_young is always true in no-naked-pointers mode
This is in preparation for the complete removal of the page table.
Without the page table, there is no way to distinguish pointers into the heaps (minor or major) from pointers outside the heaps, e.g. structured constants statically allocated by ocamlopt.
Hence, the difference between Is_in_heap_or_young and Is_in_value_area (behavior on static data) disappears, and both should always return true.
All uses of Is_in_heap_or_young but one are in assertions, which therefore become useless, but not wrong.
The one use inside the code is when registering a finalisation with `Gc.finalise`. Today, `Invalid_argument` is raised if the value to be finalised is statically allocated. With this commit and in no-naked-pointers mode, `GC.finalise` succeeds, but the finalisation function will never be called. (commit: 8c06218)
This is in preparation for the complete removal of the page table.
Without the page table, there is no way to distinguish pointers into the major heap from pointers to structured constants statically allocated by ocamlopt. The only distinction we can make between pointers is whether they point to the minor heap (Is_young) or not.
However, we cannot (yet) define Is_in_heap(v) as !Is_young(v), because Is_in_heap with its current meaning is used - in the compactor - in many assertions.
Yet, there are a few places, mostly in the handling of ephemerons, where Is_in_heap(v) can safely be replaced with !Is_young(v). This is done in this commit. (commit: 2aa502e)
Is_in_static_data is not available in no-naked-pointers mode
This is another classification macro that requires the page table. Its only uses in the whole OPAM universe is two of our own tests (tests/asmcomp/is_static.ml and tests/lib-obj/reachable_words_np.ml) which are now run only in naked-pointers mode. (commit: 40a55c7)