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

Naked pointers and the bytecode interpreter #9680

Merged
merged 5 commits into from Jun 21, 2020

Commits on Jun 18, 2020

  1. callback.c: register the bytecode fragment used for callbacks

    So that the return address pushed on the bytecode interpreter stack
    is correctly recognized as a code pointer.
    xavierleroy committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    f8970c4 View commit details
    Browse the repository at this point in the history
  2. Revised linking of trap frames in bytecode interpreter stack

    Rather than storing a pointer to the previous frame in the Trap_link
    field of the current frame, store the distance (pointer difference)
    between the current frame and the previous frame, tagged as an OCaml
    integer.
    
    Using a tagged integer instead of a raw pointer means fever problems
    later with strict no-naked-pointer support.
    
    Using a distance rather than an absolute address simplifies
    the code that resizes the stack.
    xavierleroy committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    53d55f2 View commit details
    Browse the repository at this point in the history
  3. Revised scanning of bytecode interpreter stack

    In no-naked-pointers mode, recognize and skip code pointers present in
    the stack of the bytecode interpreter.  This is needed only for
    the scan at beginning of a major GC cycle, not for the scan done
    at every minor GC.
    xavierleroy committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    9476d5d View commit details
    Browse the repository at this point in the history
  4. major_gc.c: use no-naked-pointers mode even in bytecode

    Earlier, no-naked-pointers mode was effective only in native code.
    xavierleroy committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    4a953a2 View commit details
    Browse the repository at this point in the history
  5. interp.c: remove two assertions that cannot be checked without the pa…

    …ge table
    
    `!Is_in_value_area(pc)` is always false if we turn the page table off.
    A better check would be `caml_find_code_fragment_by_pc(pc) != NULL`,
    but I feel this is too costly even for the debug mode of the interpreter.
    xavierleroy committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    552bc3e View commit details
    Browse the repository at this point in the history