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

src: fix pointer compression build #50680

Closed
wants to merge 2 commits into from
Closed

Commits on Nov 16, 2023

  1. deps: V8: cherry-pick 475c8cdf9a95

    Original commit message:
    
        [ptr-compr] Fix multi-cage mode
    
        This CL introduces PtrComprCageAccessScope which sets/restores current
        thread's pointer compression cage base values. It's supposed to be used
        by V8 jobs accessing V8 heap outside of v8::Isolate::Scope or
        i::LocalHeap or i::LocalIsolate scopes (they already ensure that the
        cage base values are properly initialized).
        For all other build modes PtrComprCageAccessScope is a no-op.
    
        For simplicity reasons the multi-cage mode is made incompatible with
        external code space.
    
        Bug: v8:13788, v8:14292
        Change-Id: I06c2d19a1eb7254fa7af07a17617e22d98abea9f
        Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4846592
        Reviewed-by: Jakob Linke <[email protected]>
        Reviewed-by: Jakob Kummerow <[email protected]>
        Commit-Queue: Igor Sheludko <[email protected]>
        Reviewed-by: Dominik Inführ <[email protected]>
        Cr-Commit-Position: refs/heads/main@{#90075}
    
    Refs: v8/v8@475c8cd
    kvakil committed Nov 16, 2023
    Configuration menu
    Copy the full SHA
    7923103 View commit details
    Browse the repository at this point in the history
  2. src: add IsolateScopes before using isolates

    The V8 API requires entering an isolate before using it. We were often
    not doing this, which worked fine in practice. However when (multi-cage)
    pointer compression is enabled, the correct isolate needs to be active
    in order to decompress pointers correctly, otherwise it causes crashes.
    
    Fix this by sprinkling in some calls to v8::Isolate::Scope::Scope where
    they were missing.
    
    This also introduces RAIIIsolateWithoutEntering which is used in
    JSONParser to avoid otherwise exposing the Isolate::Scope outside of the
    class.
    
    Tested by compiling with `--experimental-enable-pointer-compression`
    locally and running all tests.
    
    Refs: nodejs/build#3204 (comment)
    Refs: https://bugs.chromium.org/p/v8/issues/detail?id=14292
    kvakil committed Nov 16, 2023
    Configuration menu
    Copy the full SHA
    b2b9acb View commit details
    Browse the repository at this point in the history