1. 28 Oct, 2020 2 commits
    • Jakob Gruber's avatar
      [embedded] Split blob hash into data/code hashes · 06b59094
      Jakob Gruber authored
      .. and add a --text-is-readable flag to support non-readable .text
      sections.
      
      This splits the embedded blob hash into two dedicated hashes for data
      and code sections. The main benefit is that we can now keep at least a
      partial hash even with non-readable .text sections.
      
      The second part of this CL adds a --text-is-readable runtime flag to
      support such platforms (with non-readable .text).
      
      It currently doesn't do much; setting it enables a few additional
      DCHECKs, disables the constant pool on x64, and and disables
      verification of the embedded blob's *code* hash.
      
      Bug: v8:10707
      Change-Id: Ib91ed8b50b50f2cd81677f62920bea6fb92af453
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2504251Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70827}
      06b59094
    • Jakob Gruber's avatar
      [code] Move embedded metadata to the .rodata section · 779b0edd
      Jakob Gruber authored
      The embedded metadata section is the off-heap equivalent to an on-heap
      Code object's metadata section. It contains no executable data, thus
      .rodata is the natural home for it. Another motivation is that some
      platforms do not grant read permissions on the .text section.
      
      Embedded blob stats before:
      
        EmbeddedData:
          Total size: 1322944
          Data size:  25952
          Code size:  1296992
      
      And after:
      
        EmbeddedData:
          Total size: 1323372
          Data size:  121452
          Code size:  1201920
      
      (Slight size increase due to additional padding.)
      
      Bug: v8:11036,v8:10707
      Change-Id: Ib6b54a7e947966c7bd2fcc1e7e44c85e352f0063
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2502334Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Auto-Submit: Jakob Gruber <jgruber@chromium.org>
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70822}
      779b0edd
  2. 27 Oct, 2020 1 commit
    • Jakob Gruber's avatar
      [code] Extend comments, use better terms to describe metadata · 23ba0667
      Jakob Gruber authored
      This addresses comments from [0] by extending comments to also
      describe embedded builtins in code.h, and by improving language
      around various meaning of 'metadata':
      
      - The Code object's metadata section is still called 'metadata'.
      - The embedded blob's table of layout descriptions for builtins is
        now called 'layout descriptions'.
      - The embedded blob's data section (containing hashes and layout
        descriptions) is now called 'data' section.
      
      [0] chromium-review.googlesource.com/c/v8/v8/+/2491025
      
      Bug: v8:11036
      Change-Id: Ibe84fddb9784cc5d3b66482612dcdb7a2e8d14ae
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2501284
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70793}
      23ba0667
  3. 26 Oct, 2020 1 commit
    • Jakob Gruber's avatar
      Reland "[code] Separate instruction and metadata areas" · a4449f26
      Jakob Gruber authored
      This is a reland of b66993bc
      
      Nothing changed in the reland, the original CL was not the
      culprit for win32 failures. They started earlier, at
      https://ci.chromium.org/p/v8/builders/ci/V8%20Win32/29444
      
      Original change's description:
      > [code] Separate instruction and metadata areas
      >
      > In this CL, Code object layout changes s.t. the instruction
      > area is distinct / non-overlapping from the metadata area.
      >
      > On-heap Code objects now have a variable-size `body` area,
      > containing distinct-but-adjacent `instruction` and `metadata`
      > areas.
      >
      > Off-heap code (= embedded builtins) currently have the same,
      > but in the future the metadata area will move elsewhere and
      > no longer be adjacent to instructions.
      >
      > To implement this, the main changes are:
      >
      >  - The Code object header now contains instruction and metadata
      >    sizes, and no longer contains the safepoint table offset
      >    (it's implicitly the first table of the metadata section).
      >  - The embedded metadata table contains information about both
      >    instruction and metadata areas.
      >
      > I've also added assertions in spots that currently rely on a
      > contiguous body area.
      >
      > Bug: v8:11036
      > Change-Id: I940f0c70c07ad511dafd2d2c3e337de8c92cd4b9
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2491025
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Reviewed-by: Clemens Backes <clemensb@chromium.org>
      > Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#70743}
      
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Tbr: leszeks@chromium.org, clemensb@chromium.org, dinfuehr@chromium.org
      Bug: v8:11036
      Change-Id: I238562d7e25cf28cc689856ee8b17f25627aaee7
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2497162
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Auto-Submit: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70747}
      a4449f26
  4. 25 Oct, 2020 2 commits
    • Zhi An Ng's avatar
      Revert "[code] Separate instruction and metadata areas" · 9a02964a
      Zhi An Ng authored
      This reverts commit b66993bc.
      
      Reason for revert: Broke v8 win32 https://ci.chromium.org/p/v8/builders/ci/V8%20Win32/29454?
      
      Original change's description:
      > [code] Separate instruction and metadata areas
      >
      > In this CL, Code object layout changes s.t. the instruction
      > area is distinct / non-overlapping from the metadata area.
      >
      > On-heap Code objects now have a variable-size `body` area,
      > containing distinct-but-adjacent `instruction` and `metadata`
      > areas.
      >
      > Off-heap code (= embedded builtins) currently have the same,
      > but in the future the metadata area will move elsewhere and
      > no longer be adjacent to instructions.
      >
      > To implement this, the main changes are:
      >
      >  - The Code object header now contains instruction and metadata
      >    sizes, and no longer contains the safepoint table offset
      >    (it's implicitly the first table of the metadata section).
      >  - The embedded metadata table contains information about both
      >    instruction and metadata areas.
      >
      > I've also added assertions in spots that currently rely on a
      > contiguous body area.
      >
      > Bug: v8:11036
      > Change-Id: I940f0c70c07ad511dafd2d2c3e337de8c92cd4b9
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2491025
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Reviewed-by: Clemens Backes <clemensb@chromium.org>
      > Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#70743}
      
      TBR=jgruber@chromium.org,leszeks@chromium.org,clemensb@chromium.org,dinfuehr@chromium.org
      
      Change-Id: Ia52ac609a47b8a2038a2511f0af8526ebdfe4719
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:11036
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2497381Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
      Commit-Queue: Zhi An Ng <zhin@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70744}
      9a02964a
    • Jakob Gruber's avatar
      [code] Separate instruction and metadata areas · b66993bc
      Jakob Gruber authored
      In this CL, Code object layout changes s.t. the instruction
      area is distinct / non-overlapping from the metadata area.
      
      On-heap Code objects now have a variable-size `body` area,
      containing distinct-but-adjacent `instruction` and `metadata`
      areas.
      
      Off-heap code (= embedded builtins) currently have the same,
      but in the future the metadata area will move elsewhere and
      no longer be adjacent to instructions.
      
      To implement this, the main changes are:
      
       - The Code object header now contains instruction and metadata
         sizes, and no longer contains the safepoint table offset
         (it's implicitly the first table of the metadata section).
       - The embedded metadata table contains information about both
         instruction and metadata areas.
      
      I've also added assertions in spots that currently rely on a
      contiguous body area.
      
      Bug: v8:11036
      Change-Id: I940f0c70c07ad511dafd2d2c3e337de8c92cd4b9
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2491025Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70743}
      b66993bc
  5. 22 Jul, 2020 1 commit
  6. 15 Nov, 2019 1 commit
  7. 27 May, 2019 1 commit
  8. 24 May, 2019 1 commit
  9. 22 May, 2019 1 commit
  10. 24 Apr, 2019 1 commit
  11. 31 Jan, 2019 3 commits
    • Jakob Gruber's avatar
      Reland "Reland "[builtins] Verify Isolate compatibility with the embedded blob"" · 354e34ac
      Jakob Gruber authored
      This is a reland of 1e3582b5
      
      Original change's description:
      > Reland "[builtins] Verify Isolate compatibility with the embedded blob"
      >
      > This is a reland of b022e825
      >
      > Original change's description:
      > > [builtins] Verify Isolate compatibility with the embedded blob
      > >
      > > Embedded builtins (= the embedded blob) have a few dependencies on the
      > > snapshot state. For instance, they require that metadata stored on
      > > builtin Code objects as well as the builtins constant table remain
      > > unchanged from mksnapshot-time. Embedders may violate these
      > > assumptions by accident, e.g. by loading a snapshot generated with
      > > different build flags, leading to seemingly unrelated failures later
      > > on.
      > >
      > > This CL introduces an Isolate hash stored in the embedded blob which
      > > hashes relevant parts of builtin Code objects and the builtins
      > > constant table. It's verified in Isolate::Init in debug builds.
      > >
      > > Bug: v8:8723
      > > Change-Id: Ifc9bdbe6f56ea67d8984f162afa73a3572cfbba8
      > > Reviewed-on: https://chromium-review.googlesource.com/c/1442641
      > > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > > Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
      > > Cr-Commit-Position: refs/heads/master@{#59177}
      >
      > Tbr: yangguo@chromium.org,sigurds@chromium.org
      > Bug: v8:8723
      > Change-Id: I1dd001783f0f1fae21a9809c8639e40f55b8f663
      > Reviewed-on: https://chromium-review.googlesource.com/c/1445985
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#59236}
      
      Tbr: yangguo@chromium.org,sigurds@chromium.org
      Bug: v8:8723
      Change-Id: I8e4ae2f09d16b693c1fb814477d8487385046ee4
      Reviewed-on: https://chromium-review.googlesource.com/c/1448312Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59250}
      354e34ac
    • Clemens Hammacher's avatar
      Revert "Reland "[builtins] Verify Isolate compatibility with the embedded blob"" · 2c6e96a6
      Clemens Hammacher authored
      This reverts commit 1e3582b5.
      
      Reason for revert: Still fails nosnap: https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20nosnap%20-%20debug/22789
      
      Original change's description:
      > Reland "[builtins] Verify Isolate compatibility with the embedded blob"
      > 
      > This is a reland of b022e825
      > 
      > Original change's description:
      > > [builtins] Verify Isolate compatibility with the embedded blob
      > >
      > > Embedded builtins (= the embedded blob) have a few dependencies on the
      > > snapshot state. For instance, they require that metadata stored on
      > > builtin Code objects as well as the builtins constant table remain
      > > unchanged from mksnapshot-time. Embedders may violate these
      > > assumptions by accident, e.g. by loading a snapshot generated with
      > > different build flags, leading to seemingly unrelated failures later
      > > on.
      > >
      > > This CL introduces an Isolate hash stored in the embedded blob which
      > > hashes relevant parts of builtin Code objects and the builtins
      > > constant table. It's verified in Isolate::Init in debug builds.
      > >
      > > Bug: v8:8723
      > > Change-Id: Ifc9bdbe6f56ea67d8984f162afa73a3572cfbba8
      > > Reviewed-on: https://chromium-review.googlesource.com/c/1442641
      > > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > > Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
      > > Cr-Commit-Position: refs/heads/master@{#59177}
      > 
      > Tbr: yangguo@chromium.org,sigurds@chromium.org
      > Bug: v8:8723
      > Change-Id: I1dd001783f0f1fae21a9809c8639e40f55b8f663
      > Reviewed-on: https://chromium-review.googlesource.com/c/1445985
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#59236}
      
      TBR=yangguo@chromium.org,sigurds@chromium.org,jgruber@chromium.org
      
      Change-Id: If6082452c739d4de44ed70d3c6355f5282684ac1
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:8723
      Reviewed-on: https://chromium-review.googlesource.com/c/1448311Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59241}
      2c6e96a6
    • Jakob Gruber's avatar
      Reland "[builtins] Verify Isolate compatibility with the embedded blob" · 1e3582b5
      Jakob Gruber authored
      This is a reland of b022e825
      
      Original change's description:
      > [builtins] Verify Isolate compatibility with the embedded blob
      >
      > Embedded builtins (= the embedded blob) have a few dependencies on the
      > snapshot state. For instance, they require that metadata stored on
      > builtin Code objects as well as the builtins constant table remain
      > unchanged from mksnapshot-time. Embedders may violate these
      > assumptions by accident, e.g. by loading a snapshot generated with
      > different build flags, leading to seemingly unrelated failures later
      > on.
      >
      > This CL introduces an Isolate hash stored in the embedded blob which
      > hashes relevant parts of builtin Code objects and the builtins
      > constant table. It's verified in Isolate::Init in debug builds.
      >
      > Bug: v8:8723
      > Change-Id: Ifc9bdbe6f56ea67d8984f162afa73a3572cfbba8
      > Reviewed-on: https://chromium-review.googlesource.com/c/1442641
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#59177}
      
      Tbr: yangguo@chromium.org,sigurds@chromium.org
      Bug: v8:8723
      Change-Id: I1dd001783f0f1fae21a9809c8639e40f55b8f663
      Reviewed-on: https://chromium-review.googlesource.com/c/1445985
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59236}
      1e3582b5
  12. 29 Jan, 2019 2 commits
    • Clemens Hammacher's avatar
      Revert "[builtins] Verify Isolate compatibility with the embedded blob" · 026ce2c1
      Clemens Hammacher authored
      This reverts commit b022e825.
      
      Reason for revert: Fails nosnap: https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20nosnap%20-%20debug/22761
      
      Original change's description:
      > [builtins] Verify Isolate compatibility with the embedded blob
      > 
      > Embedded builtins (= the embedded blob) have a few dependencies on the
      > snapshot state. For instance, they require that metadata stored on
      > builtin Code objects as well as the builtins constant table remain
      > unchanged from mksnapshot-time. Embedders may violate these
      > assumptions by accident, e.g. by loading a snapshot generated with
      > different build flags, leading to seemingly unrelated failures later
      > on.
      > 
      > This CL introduces an Isolate hash stored in the embedded blob which
      > hashes relevant parts of builtin Code objects and the builtins
      > constant table. It's verified in Isolate::Init in debug builds.
      > 
      > Bug: v8:8723
      > Change-Id: Ifc9bdbe6f56ea67d8984f162afa73a3572cfbba8
      > Reviewed-on: https://chromium-review.googlesource.com/c/1442641
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#59177}
      
      TBR=sigurds@chromium.org,jgruber@chromium.org
      
      Change-Id: I027ae2585bd06290ea3245b1fc23efba544eb470
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:8723
      Reviewed-on: https://chromium-review.googlesource.com/c/1443059Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59179}
      026ce2c1
    • Jakob Gruber's avatar
      [builtins] Verify Isolate compatibility with the embedded blob · b022e825
      Jakob Gruber authored
      Embedded builtins (= the embedded blob) have a few dependencies on the
      snapshot state. For instance, they require that metadata stored on
      builtin Code objects as well as the builtins constant table remain
      unchanged from mksnapshot-time. Embedders may violate these
      assumptions by accident, e.g. by loading a snapshot generated with
      different build flags, leading to seemingly unrelated failures later
      on.
      
      This CL introduces an Isolate hash stored in the embedded blob which
      hashes relevant parts of builtin Code objects and the builtins
      constant table. It's verified in Isolate::Init in debug builds.
      
      Bug: v8:8723
      Change-Id: Ifc9bdbe6f56ea67d8984f162afa73a3572cfbba8
      Reviewed-on: https://chromium-review.googlesource.com/c/1442641
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59177}
      b022e825
  13. 16 Nov, 2018 1 commit