diff --git a/.eslintrc.js b/.eslintrc.js index 8464945125b678..8542d2e77e0ea6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -43,9 +43,7 @@ module.exports = { { files: [ 'doc/api/esm.md', - 'doc/api/module.md', 'doc/api/modules.md', - 'doc/api/packages.md', 'test/es-module/test-esm-type-flag.js', 'test/es-module/test-esm-type-flag-alias.js', '*.mjs', diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c41a2c35c1d86f..f347898aeb3252 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,80 +5,57 @@ # 3. PRs touching any code with a codeowner must be signed off by at least one # person on the code owner team. -# tsc & commcomm - -/.github/CODEOWNERS @nodejs/tsc -/GOVERNANCE.md @nodejs/tsc -/onboarding.md @nodejs/tsc -/CODE_OF_CONDUCT.md @nodejs/tsc @nodejs/community-committee -/CONTRIBUTING.md @nodejs/tsc @nodejs/community-committee -/LICENSE @nodejs/tsc @nodejs/community-committee -/doc/guides/contributing/code-of-conduct.md @nodejs/tsc @nodejs/community-committee -# TODO(mmarchini): the bot doens't have a notion of precedence, that might -# change when move the codeowners code to an Action, at which point we can -# uncomment the line below -# /doc/guides/contributing/*.md @nodejs/tsc -/doc/guides/contributing/issues.md @nodejs/tsc -/doc/guides/contributing/pull-requests.md @nodejs/tsc -/doc/guides/collaborator-guide.md @nodejs/tsc -/doc/guides/offboarding.md @nodejs/tsc -/doc/guides/onboarding-extras.md @nodejs/tsc - -# streams - -/lib/_stream* @nodejs/streams -/lib/stream.js @nodejs/streams -/lib/stream/* @nodejs/streams -/lib/internal/streams/* @nodejs/streams +./.github/CODEOWNERS @nodejs/tsc # net -/deps/cares @nodejs/net -/doc/api/dns.md @nodejs/net -/doc/api/dgram.md @nodejs/net -/doc/api/net.md @nodejs/net -/lib/dgram.js @nodejs/net -/lib/dns.js @nodejs/net -/lib/net.js @nodejs/net @nodejs/quic -/lib/internal/dgram.js @nodejs/net -/lib/internal/dns/* @nodejs/net -/lib/internal/net.js @nodejs/net -/lib/internal/socket_list.js @nodejs/net -/lib/internal/js_stream_socket.js @nodejs/net -/src/cares_wrap.cc @nodejs/net -/src/connect_wrap.* @nodejs/net -/src/connection_wrap.* @nodejs/net -/src/node_sockaddr* @nodejs/net -/src/tcp_wrap.* @nodejs/net -/src/udp_wrap.* @nodejs/net +# ./deps/cares @nodejs/net +# ./doc/api/dns.md @nodejs/net +# ./doc/api/dgram.md @nodejs/net +# ./doc/api/net.md @nodejs/net +# ./lib/dgram.js @nodejs/net +# ./lib/dns.js @nodejs/net +# ./lib/net.js @nodejs/net @nodejs/quic +# ./lib/internal/dgram.js @nodejs/net +# ./lib/internal/dns/* @nodejs/net +# ./lib/internal/net.js @nodejs/net +# ./lib/internal/socket_list.js @nodejs/net +# ./lib/internal/js_stream_socket.js @nodejs/net +# ./src/cares_wrap.h @nodejs/net +# ./src/connect_wrap.* @nodejs/net +# ./src/connection_wrap.* @nodejs/net +# ./src/node_sockaddr* @nodejs/net +# ./src/tcp_wrap.* @nodejs/net +# ./src/udp_wrap.* @nodejs/net # tls/crypto -/lib/internal/crypto/* @nodejs/crypto -/lib/internal/tls.js @nodejs/crypto @nodejs/net -/lib/crypto.js @nodejs/crypto -/lib/tls.js @nodejs/crypto @nodejs/net -/src/node_crypto* @nodejs/crypto -/src/node_crypto_common* @nodejs/crypto @nodejs/quic +# ./lib/internal/crypto/* @nodejs/crypto +# ./lib/internal/tls.js @nodejs/crypto @nodejs/net +# ./lib/crypto.js @nodejs/crypto +# ./lib/tls.js @nodejs/crypto @nodejs/net +# ./src/node_crypto* @nodejs/crypto +# ./src/node_crypto_common* @nodejs/crypto @nodejs/quic # http -/deps/llhttp/* @nodejs/http @nodejs/net -/doc/api/http.md @nodejs/http @nodejs/net -/lib/_http_* @nodejs/http @nodejs/net -/lib/http.js @nodejs/http @nodejs/net -/lib/https.js @nodejs/crypto @nodejs/net @nodejs/http -/src/node_http_common* @nodejs/http @nodejs/http2 @nodejs/quic @nodejs/net -/src/node_http_parser.cc @nodejs/http @nodejs/net +# ./deps/llhttp/* @nodejs/http @nodejs/net +# ./doc/api/http.md @nodejs/http @nodejs/net +# ./doc/api/http2.md @nodejs/http @nodejs/net +# ./lib/_http_* @nodejs/http @nodejs/net +# ./lib/http.js @nodejs/http @nodejs/net +# ./lib/https.js @nodejs/crypto @nodejs/net @nodejs/http +# ./src/node_http_common* @nodejs/http @nodejs/http2 @nodejs/quic @nodejs/net +# ./src/node_http_parser.cc @nodejs/http @nodejs/net # http2 -/deps/nghttp2/* @nodejs/http2 @nodejs/net -/doc/api/http2.md @nodejs/http2 @nodejs/http @nodejs/net -/lib/http2.js @nodejs/http2 @nodejs/net -/lib/internal/http2/* @nodejs/http2 @nodejs/net -/src/node_http2* @nodejs/http2 @nodejs/net -/src/node_mem* @nodejs/http2 +# ./deps/nghttp2/* @nodejs/http2 @nodejs/net +# ./doc/api/http2.md @nodejs/http2 @nodejs/net +# ./lib/http2.js @nodejs/http2 @nodejs/net +# ./lib/internal/http2/* @nodejs/http2 @nodejs/net +# ./src/node_http2* @nodejs/http2 @nodejs/net +# ./src/node_mem* @nodejs/http2 # quic @@ -91,36 +68,16 @@ # modules -/doc/api/modules.md @nodejs/modules -/doc/api/esm.md @nodejs/modules -/doc/api/module.md @nodejs/modules -/doc/api/packages.md @nodejs/modules -/lib/module.js @nodejs/modules -/lib/internal/modules/* @nodejs/modules -/lib/internal/bootstrap/loaders.js @nodejs/modules -/src/module_wrap* @nodejs/modules @nodejs/vm +# ./doc/api/modules.md @nodejs/modules +# ./doc/api/esm.md @nodejs/modules +# ./lib/module.js @nodejs/modules +# ./lib/internal/modules/* @nodejs/modules +# ./lib/internal/bootstrap/loaders.js @nodejs/modules +# ./src/module_wrap* @nodejs/modules @nodejs/vm # N-API -/src/node_api* @nodejs/n-api -/src/js_native_api* @nodejs/n-api -/doc/guides/adding-new-napi-api.md @nodejs/n-api -/doc/api/n-api.md @nodejs/n-api - -# WASI -/deps/uvwasi/ @nodejs/wasi -/doc/api/wasi.md @nodejs/wasi -/lib/wasi.js @nodejs/wasi -/src/node_wasi* @nodejs/wasi -/test/wasi/ @nodejs/wasi -/test/fixtures/wasi/ @nodejs/wasi - -# Startup - -/benchmark/misc/startup.js @nodejs/startup -/src/node.cc @nodejs/startup -/src/node_code_cache_stub.cc @nodejs/startup -/src/node_native_module* @nodejs/startup -/lib/internal/bootstrap/* @nodejs/startup -/tools/code_cache/* @nodejs/startup -/tools/snapshot/* @nodejs/startup +# /src/node_api* @nodejs/n-api +# /src/js_native_api* @nodejs/n-api +# /doc/guides/adding-new-napi-api.md @nodejs/n-api +# /doc/api/n-api.md @nodejs/n-api diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md index d3af8e681917a0..48ad8a90cb77c5 100644 --- a/.github/SUPPORT.md +++ b/.github/SUPPORT.md @@ -15,7 +15,6 @@ If you didn't find an answer in the resources above, try these unofficial resources: * [Questions tagged 'node.js' on Stack Overflow](https://stackoverflow.com/questions/tagged/node.js) -* [#nodejs](https://openjs-foundation.slack.com/archives/CK9Q4MB53) channel on the OpenJS Foundation Slack ([join here](https://slack-invite.openjsf.org/)) * [#node.js channel on chat.freenode.net](https://webchat.freenode.net?channels=node.js&uio=d4) * [Node.js Slack Community](https://node-js.slack.com/) * To register: [nodeslackers.com](https://www.nodeslackers.com/) diff --git a/.github/workflows/auto-start-ci.yml b/.github/workflows/auto-start-ci.yml index cb9318ab4ade9f..4d12894a5f3439 100644 --- a/.github/workflows/auto-start-ci.yml +++ b/.github/workflows/auto-start-ci.yml @@ -3,15 +3,16 @@ name: Auto Start CI on: schedule: - # Runs every five minutes (fastest the scheduler can run). Five minutes is - # optimistic, it can take longer to run. - # To understand why `schedule` is used instead of other events, refer to - # ./doc/guides/commit-queue.md + # `schedule` event is used instead of `pull_request` because when a + # `pull_requesst` event is triggered on a PR from a fork, GITHUB_TOKEN will + # be read-only, and the Action won't have access to any other repository + # secrets, which it needs to access Jenkins API. Runs every five minutes + # (fastest the scheduler can run). Five minutes is optimistic, it can take + # longer to run. - cron: "*/5 * * * *" jobs: startCI: - if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: - uses: actions/checkout@master diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index 0caf0bdf961914..699efb39d17e35 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -5,8 +5,6 @@ on: push: branches: - master - - v[0-9]+.x-staging - - v[0-9]+.x env: FLAKY_TESTS: dontcare diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index a68cc06faf221a..a818bb7d0dbafb 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -5,9 +5,6 @@ on: push: branches: - master - - canary - - v[0-9]+.x-staging - - v[0-9]+.x env: PYTHON_VERSION: 3.8 diff --git a/.github/workflows/close-stalled.yml b/.github/workflows/close-stalled.yml deleted file mode 100644 index 1834d3ac2e6815..00000000000000 --- a/.github/workflows/close-stalled.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Close stalled issues and PRs -on: - schedule: - - cron: "0 0 * * *" - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-close: 30 - stale-pr-label: stalled - stale-issue-label: stalled - close-issue-message: Closing this because it has stalled. Feel free to reopen if this issue is still relevant, or to ping the collaborator who labelled it stalled if you have any questions. - close-pr-message: Closing this because it has stalled. Feel free to reopen if this PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions. - # used to filter issues to check whether or not should be closed, avoids hitting maximum operations allowed if needing to paginate through all open issues - only-labels: stalled - # max requests it will send per run to the GitHub API before it deliberately exits to avoid hitting API rate limits - operations-per-run: 500 - # deactivates automatic removal of stalled label if issue gets any activity - remove-stale-when-updated: false - # deactivates automatic stale labelling as we prefer to do that manually - days-before-stale: -1 diff --git a/.github/workflows/comment-stalled.yml b/.github/workflows/comment-stalled.yml deleted file mode 100644 index 62bd26f39eb72d..00000000000000 --- a/.github/workflows/comment-stalled.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Comment on issues and PRs when labelled stalled -on: - issues: - types: [labeled] - pull_request_target: - types: [labeled] - -jobs: - staleComment: - runs-on: ubuntu-latest - steps: - - name: Post comment - if: github.event.label.name == 'stalled' - env: - COMMENTS_URL: ${{ github.event.issue.comments_url || github.event.pull_request.comments_url }} - run: | - curl -X POST $COMMENTS_URL \ - -H "Content-Type: application/json" \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - --data '{ "body": "This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open." }' diff --git a/.github/workflows/commit-queue.yml b/.github/workflows/commit-queue.yml deleted file mode 100644 index cca9564f6c873b..00000000000000 --- a/.github/workflows/commit-queue.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -# This action requires the following secrets to be set on the repository: -# GH_USER_NAME: GitHub user whose Jenkins and GitHub token are defined below -# GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes -# JENKINS_TOKEN: Jenkins token, to be used to check CI status - -name: Commit Queue - -on: - # `schedule` event is used instead of `pull_request` because when a - # `pull_request` event is triggered on a PR from a fork, GITHUB_TOKEN will - # be read-only, and the Action won't have access to any other repository - # secrets, which it needs to access Jenkins API. - schedule: - - cron: "*/5 * * * *" - -jobs: - commitQueue: - if: github.repository == 'nodejs/node' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - # Needs the whole git history for ncu to work - # See https://github.com/nodejs/node-core-utils/pull/486 - fetch-depth: 0 - # A personal token is required because pushing with GITHUB_TOKEN will - # prevent commits from running CI after they land on master. It needs - # to be set here because `checkout` configures GitHub authentication - # for push as well. - token: ${{ secrets.GH_USER_TOKEN }} - - # Install dependencies - - name: Install Node.js - uses: actions/setup-node@v2-beta - with: - node-version: '12' - - name: Install dependencies - run: | - sudo apt-get install jq -y - npm install -g node-core-utils@latest - - - name: Set variables - run: | - echo "::set-env name=REPOSITORY::$(echo ${{ github.repository }} | cut -d/ -f2)" - echo "::set-env name=OWNER::${{ github.repository_owner }}" - - - name: Get Pull Requests - uses: octokit/graphql-action@v2.x - id: get_mergable_pull_requests - with: - query: | - query release($owner:String!,$repo:String!, $base_ref:String!) { - repository(owner:$owner, name:$repo) { - pullRequests(baseRefName: $base_ref, labels: ["commit-queue"], states: OPEN, last: 100) { - nodes { - number - } - } - } - } - owner: ${{ env.OWNER }} - repo: ${{ env.REPOSITORY }} - # Commit queue is only enabled for the default branch on the repository - # TODO(mmarchini): get the default branch programmatically instead of - # assuming `master` - base_ref: "master" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Configure node-core-utils - run: | - ncu-config set branch master - ncu-config set upstream origin - ncu-config set username "${{ secrets.GH_USER_NAME }}" - ncu-config set token "${{ secrets.GH_USER_TOKEN }}" - ncu-config set jenkins_token "${{ secrets.JENKINS_TOKEN }}" - ncu-config set repo "${{ env.REPOSITORY }}" - ncu-config set owner "${{ env.OWNER }}" - - - name: Start the commit queue - run: ./tools/actions/commit-queue.sh ${{ env.OWNER }} ${{ env.REPOSITORY }} ${{ secrets.GITHUB_TOKEN }} $(echo '${{ steps.get_mergable_pull_requests.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]') diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 3cd4def9f986bc..afab3284879499 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -5,8 +5,6 @@ on: push: branches: - master - - v[0-9]+.x-staging - - v[0-9]+.x env: PYTHON_VERSION: 3.8 @@ -77,11 +75,3 @@ jobs: run: | make lint-py-build || true NODE=$(which node) make lint-py - - lint-codeowners: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: mszostok/codeowners-validator@v0.4.0 - with: - checks: "files,duppatterns" diff --git a/.github/workflows/misc.yml b/.github/workflows/misc.yml index df33822770523b..4b4b305e7b25c9 100644 --- a/.github/workflows/misc.yml +++ b/.github/workflows/misc.yml @@ -5,8 +5,6 @@ on: push: branches: - master - - v[0-9]+.x-staging - - v[0-9]+.x env: NODE_VERSION: 12.x @@ -28,5 +26,3 @@ jobs: with: name: docs path: out/doc - - name: Check links - run: node tools/doc/checkLinks.js . diff --git a/.github/workflows/test-asan.yml b/.github/workflows/test-asan.yml index 224d18463ac172..d2d619f786cb0e 100644 --- a/.github/workflows/test-asan.yml +++ b/.github/workflows/test-asan.yml @@ -3,15 +3,12 @@ name: test-asan on: push: branches: - - master - - canary - - v[0-9]+.x-staging - - v[0-9]+.x + - master paths-ignore: - - 'doc/**' + - 'doc/**' pull_request: paths-ignore: - - 'doc/**' + - 'doc/**' env: PYTHON_VERSION: 3.8 @@ -36,4 +33,4 @@ jobs: - name: Build run: make build-ci -j2 V=1 - name: Test - run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions" + run: make run-ci -j2 V=1 TEST_CI_ARGS="-p dots" diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index a5eb2351c3e5d2..262ac7e2248ab6 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -5,9 +5,6 @@ on: push: branches: - master - - canary - - v[0-9]+.x-staging - - v[0-9]+.x env: PYTHON_VERSION: 3.8 @@ -27,7 +24,7 @@ jobs: - name: Build run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn" - name: Test - run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions" + run: make run-ci -j2 V=1 TEST_CI_ARGS="-p dots" test-linux-with-quic: runs-on: ubuntu-latest @@ -42,4 +39,4 @@ jobs: - name: Build run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn --experimental-quic" - name: Test - run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions" + run: make run-ci -j2 V=1 TEST_CI_ARGS="-p dots" diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index ba3bb5426da929..40ffdfc7535a04 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -5,9 +5,6 @@ on: push: branches: - master - - canary - - v[0-9]+.x-staging - - v[0-9]+.x env: PYTHON_VERSION: 3.8 @@ -27,4 +24,4 @@ jobs: - name: Build run: make build-ci -j8 V=1 CONFIG_FLAGS="--error-on-warn --experimental-quic" - name: Test - run: make run-ci -j8 V=1 TEST_CI_ARGS="-p actions" + run: make run-ci -j8 V=1 TEST_CI_ARGS="-p dots" diff --git a/.gitignore b/.gitignore index 4592f603e060ac..55152e1317f0ad 100644 --- a/.gitignore +++ b/.gitignore @@ -39,8 +39,6 @@ /*.msi /*.wixpdb /*.qlog -# For GitHub Codespaces -/pythonenv* # === Rules for artifacts of `./configure` === /icu_config.gypi @@ -133,9 +131,6 @@ _UpgradeReport_Files/ # Ignore dependencies fetched by deps/v8/tools/node/fetch_deps.py /deps/.cipd -# === Rules for Windows vcbuild.bat === -/temp-vcbuild - # === Global Rules === # Keep last to avoid being excluded *.pyc diff --git a/.mailmap b/.mailmap index 4597ae9e47f61d..64f74f4b08a4b9 100644 --- a/.mailmap +++ b/.mailmap @@ -37,9 +37,6 @@ Artem Zaytsev Artur G Vieira Artur Vieira Arnout Kazemier <3rd-Eden@users.noreply.github.com> Asaf David asafdav2 -Ash Cripps -Ash Cripps -Ash Cripps Ashley Maceli ashleyraymaceli Ashok Suthar Ashutosh Kumar Singh @@ -53,15 +50,13 @@ Benjamin Coe Benjamin Fleischer Benjamin Fleischer Benjamin Gruenbaum Benjamin Gruenbaum -Benjamin Gruenbaum Benjamin Waters Bert Belder Bert Belder Bert Belder -Beth Griggs Beth Griggs -Beth Griggs Bethany Griggs -Beth Griggs Bethany N Griggs -Beth Griggs BethGriggs +Beth Griggs Bethany Griggs +Beth Griggs Bethany N Griggs +Beth Griggs BethGriggs Bidisha Pyne Brad Decker brad-decker Brad Larson BradLarson @@ -284,9 +279,8 @@ Minwoo Jung Minwoo Jung Miroslav Bajtoš Mitar Milutinovic -Myles Borins -Myles Borins -Myles Borins +Myles Borins +Myles Borins Nam Nguyen Nebu Pookins Netto Farah nettofarah @@ -317,7 +311,6 @@ Rebecca Turner Refael Ackermann Reza Akhavan jedireza Ricardo Sánchez Gregorio richnologies -Richard Lau Rick Olson Rob Adelmann Rob Adelmann adelmann @@ -328,7 +321,6 @@ Roman Reiss Ron Korving Ron Korving ronkorving Ruben Bridgewater -Ruben Bridgewater Russell Dempsey Ryan Dahl Ryan Emery @@ -374,9 +366,8 @@ Stefan Bühler Stephen Belanger Steve Mao Steven R. Loomis -Stewart X Addison Stewart Addison -Stewart X Addison sxa555 -Stewart X Addison Stewart X Addison +Stewart X Addison Stewart Addison +Stewart X Addison sxa555 Suraiya Hameed suraiyah Suramya shah ss22ever Surya Panikkal surya panikkal @@ -410,8 +401,6 @@ Tim Smart Tim Smart Timothy Leverett Timothy Tobias Nießen -Tom Atkinson -Tom Atkinson Tom Hughes Tom Hughes-Croucher Tom Purcell tpurcell diff --git a/AUTHORS b/AUTHORS index a61c4010be5d3c..839039c541e56d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -808,7 +808,7 @@ David Boivin Liang-Chi Hsieh Timothy Gu Fábio Santos -Myles Borins +Myles Borins Jonas Dohse Коренберг Марк Caleb Boyd @@ -888,9 +888,9 @@ Julien Waechter Vitor Cortez Michael Theriot Peter Geiss -Richard Lau +Richard Lau José Moreira -Tom Atkinson +Tom Atkinson Glen Arrowsmith Jeff Harris Alexander Makarenko @@ -1035,7 +1035,7 @@ Joran Siu Vitaly Tomilov Ratikesh Misra Alex Perkins -Beth Griggs +Beth Griggs Joe Esposito Erin Spiceland Ravindra Barthwal @@ -1429,6 +1429,7 @@ Rj Bernaldo John F. Mercer Dejon "DJ" Gill Ahmad Nassri +Tom Atkinson Tobias Nießen Joseph Gentle Arunesh Chandra @@ -2871,7 +2872,7 @@ Michael Perrotte Alexandre Ferrando Loris Zinsou Jizu Sun -Ash Cripps +AshCripps garygsc Patrick Housley Artem Maksimov @@ -3020,124 +3021,5 @@ David Gilbertson Sergey Zelenov Eric Bickle Joe Pea -ExE Boss <3889017+ExE-Boss@users.noreply.github.com> -Mateusz Krawczuk -Jonathan MERCIER -Ujjwal Sharma -Jichan -Hassaan Pasha -Eric Dobbertin -Victor -Ling Samuel -Syohei YOSHIDA -Nitin Kumar -Christian Niederer -Sk Sajidul Kadir -Bartlomiej Brzozowski -Saajan -Yash Ladha -Xu Meng -Alex R -Hachimi Aa (Sfeir) -Daniel Estiven Rico Posada -Andrés M. Gómez -Nick Kreeger -Moni <40552237+NotMoni@users.noreply.github.com> -Dave Vandyke -Agustin Daguerre -Jesus Hernandez -龙腾道 -John Kleinschmidt -Cecchi MacNaughton -Reşat SABIQ -daemon1024 -Qinhui Chen -William Bonawentura -Vadzim Zieńka -David Daza <03dazal@gmail.com> -雨夜带刀 -karan singh virdi -William Armiros <54150514+willarmiros@users.noreply.github.com> -Matt Kulukundis -Edward Elric -Prosper Opara -Eileen -Ishaan Jain <37652866+ishaanjain1898@users.noreply.github.com> -Christopher Beeson -thecodrr -Chris Holland -Ranjan Purbey -白一梓 -John Leidegren -Karol Walasek -osher -szTheory -Jonathan Buhacoff -Paolo Insogna -Richard Townsend -Dan Fabulich -Deep310 <55121371+Deep310@users.noreply.github.com> -Dominykas Blyžė -Wenning Zhang <1527841714@qq.com> -shisama -Kirill Shatskiy -Ben Bucksch -Eli Schwartz -Maciej Kacper Jagiełło -Tom Nagle -rickyes -sapics -Sagar Jadhav -Dennis Ameling -Todd Short -Lucas Pardue -Pragyan Das -Shakil-Shahadat -wenningplus -WilliamConnatser <43946230+WilliamConnatser@users.noreply.github.com> -Benjamin Kaduk -Tatsuhiro Tsujikawa -Nathan Blair -patr0nus -Alec Davidson -falguniraina <48027052+falguniraina@users.noreply.github.com> -Rodion Abdurakhimov -Anentropic -Saleem -Julien Poissonnier -zombieleet -Nikola Glavina -Johannes Schöpp -Francisco Ryan Tolmasky I -Ye-hyoung Kang -Jucke -Pekka Nikander -iandrc -Tim Perry -Corey Butler -aetheryx -Robey Pointer -Priyank Singh -Gabriele Greco -Renato Mariscal -Matthew McEachen -Voltra -davkor -Carlos Lopez -Hilla Shahrabani -Frank Lemanschik -Justice Almanzar -Maksim Sinik -João Lucas Lucchetta -Danny Guo -Turner Jabbour -Igor Mikhalev -DeeDeeG -KuthorX -Pooja D.P -Shigma <33423008+Shigma@users.noreply.github.com> -atian25@qq.com -Amila Welihinda -schamberg97 <50446906+schamberg97@users.noreply.github.com> # Generated by tools/update-authors.js diff --git a/BUILDING.md b/BUILDING.md index d25d92fbfaa3f6..43245f1bdd1925 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -110,8 +110,8 @@ platforms. This is true regardless of entries in the table below. | Windows | x64, x86 (WoW64) | >= Windows 8.1/2012 R2 | Tier 1 | [4](#fn4),[5](#fn5) | | Windows | x86 (native) | >= Windows 8.1/2012 R2 | Tier 1 (running) / Experimental (compiling) [6](#fn6) | | | Windows | x64, x86 | Windows Server 2012 (not R2) | Experimental | | -| Windows | arm64 | >= Windows 10 | Tier 2 (compiling) / Experimental (running) | | -| macOS | x64 | >= 10.13 | Tier 1 | | +| Windows | arm64 | >= Windows 10 | Experimental | | +| macOS | x64 | >= 10.11 | Tier 1 | | | SmartOS | x64 | >= 18 | Tier 2 | | | AIX | ppc64be >=power7 | >= 7.2 TL02 | Tier 2 | | | FreeBSD | x64 | >= 11 | Experimental | Downgraded as of Node.js 12 [7](#fn7) | @@ -237,7 +237,7 @@ test with Python 3. * GNU Make 3.81 or newer * Python (see note above) * Python 2.7 - * Python 3.5, 3.6, 3.7, and 3.8 + * Python 3.5, 3.6, 3.7, and 3.8. Installation via Linux package manager can be achieved with: @@ -256,7 +256,7 @@ Python 3 users may also need to install `python3-distutils`. * Xcode Command Line Tools >= 10 for macOS * Python (see note above) * Python 2.7 - * Python 3.5, 3.6, 3.7, and 3.8 + * Python 3.5, 3.6, 3.7, and 3.8. macOS users can install the `Xcode Command Line Tools` by running `xcode-select --install`. Alternatively, if you already have the full Xcode @@ -417,51 +417,41 @@ To build the documentation: This will build Node.js first (if necessary) and then use it to build the docs: -```bash -make doc +```console +$ make doc ``` If you have an existing Node.js build, you can build just the docs with: -```bash -NODE=/path/to/node make doc-only -``` - -To read the man page: - -```bash -man doc/node.1 +```console +$ NODE=/path/to/node make doc-only ``` -If you prefer to read the full documentation in a browser, run the following. +To read the documentation: -```bash -make docserve +```console +$ man doc/node.1 ``` -This will spin up a static file server and provide a URL to where you may browse -the documentation locally. - -If you're comfortable viewing the documentation using the program your operating -system has associated with the default web browser, run the following. +If you prefer to read the documentation in a browser, +run the following after `make doc` is finished: -```bash -make docopen +```console +$ make docopen ``` -This will open a file URL to a one-page version of all the browsable HTML -documents using the default browser. +This will open a browser with the documentation. To test if Node.js was built correctly: -```bash -./node -e "console.log('Hello from Node.js ' + process.version)" +```console +$ ./node -e "console.log('Hello from Node.js ' + process.version)" ``` To install this version of Node.js into a system directory: -```bash -[sudo] make install +```console +$ [sudo] make install ``` #### Building a debug build @@ -541,7 +531,7 @@ to run it again before invoking `make -j4`. [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/) or the "Visual C++ build tools" workload from the [Build Tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019), - with the default optional components + with the default optional components. * Basic Unix tools required for some tests, [Git for Windows](https://git-scm.com/download/win) includes Git Bash and tools which can be included in the global `PATH`. @@ -553,12 +543,13 @@ to run it again before invoking `make -j4`. Optional requirements to build the MSI installer package: * The [WiX Toolset v3.11](https://wixtoolset.org/releases/) and the - [Wix Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension) -* The [WiX Toolset v3.14](https://wixtoolset.org/releases/) if - building for Windows 10 on ARM (ARM64) + [Wix Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension). Optional requirements for compiling for Windows 10 on ARM (ARM64): +* ARM64 Windows build machine + * Due to a GYP limitation, this is required to run compiled code + generation tools (like V8's builtins and mksnapshot tools) * Visual Studio 15.9.0 or newer * Visual Studio optional components * Visual C++ compilers and libraries for ARM64 @@ -573,7 +564,7 @@ This script will install the following [Chocolatey](https://chocolatey.org/) packages: * [Git for Windows](https://chocolatey.org/packages/git) with the `git` and - Unix tools added to the `PATH` + Unix tools added to the `PATH`. * [Python 3.x](https://chocolatey.org/packages/python) and [legacy Python](https://chocolatey.org/packages/python2) * [Visual Studio 2019 Build Tools](https://chocolatey.org/packages/visualstudio2019buildtools) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8de178813d6ac6..23992b516a105b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,14 +30,7 @@ release. -14.13.0
-14.12.0
-14.11.0
-14.10.1
-14.10.0
-14.9.0
-14.8.0
-14.7.0
+14.7.0
14.6.0
14.5.0
14.4.0
@@ -47,8 +40,7 @@ release. 14.0.0
-12.18.4
-12.18.3
+12.18.3
12.18.2
12.18.1
12.18.0
@@ -81,8 +73,7 @@ release. 12.0.0
-10.22.1
-10.22.0
+10.22.0
10.21.0
10.20.1
10.20.0
@@ -328,7 +319,7 @@ release. ## 2015-09-08, Version 4.0.0 (Stable), @rvagg -Moved to doc/changelogs/CHANGELOG_V6.md#6.0.0. + /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0) - -ifeq ($(HAS_DOCKER), 1) -DOCKER_COMMAND ?= docker run -it -v $(PWD):/node -IS_IN_WORKTREE = $(shell grep '^gitdir: ' $(PWD)/.git 2>/dev/null) -GIT_WORKTREE_COMMON = $(shell git rev-parse --git-common-dir) -DOCKER_COMMAND += $(if $(IS_IN_WORKTREE), -v $(GIT_WORKTREE_COMMON):$(GIT_WORKTREE_COMMON)) -gen-openssl: ## Generate platform dependent openssl files (requires docker) - docker build -t node-openssl-builder deps/openssl/config/ - $(DOCKER_COMMAND) node-openssl-builder make -C deps/openssl/config -else -gen-openssl: - @echo "No docker command, cannot continue" - @exit 1 -endif diff --git a/README.md b/README.md index 5818362c6e431c..bf178b4d9103d6 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,6 @@ For information on reporting security vulnerabilities in Node.js, see * [Contributing to the project][] * [Working Groups][] * [Strategic Initiatives][] -* [Technical values and prioritization][] ## Current Project Team Members @@ -154,10 +153,12 @@ For information about the governance of the Node.js project, see ### TSC (Technical Steering Committee) +* [addaleax](https://github.com/addaleax) - +**Anna Henningsen** <anna@addaleax.net> (she/her) * [apapirovski](https://github.com/apapirovski) - **Anatoli Papirovski** <apapirovski@mac.com> (he/him) * [BethGriggs](https://github.com/BethGriggs) - -**Beth Griggs** <bgriggs@redhat.com> (she/her) +**Beth Griggs** <Bethany.Griggs@uk.ibm.com> (she/her) * [BridgeAR](https://github.com/BridgeAR) - **Ruben Bridgewater** <ruben@bridgewater.de> (he/him) * [ChALkeR](https://github.com/ChALkeR) - @@ -181,7 +182,7 @@ For information about the governance of the Node.js project, see * [mcollina](https://github.com/mcollina) - **Matteo Collina** <matteo.collina@gmail.com> (he/him) * [mhdawson](https://github.com/mhdawson) - -**Michael Dawson** <midawson@redhat.com> (he/him) +**Michael Dawson** <michael_dawson@ca.ibm.com> (he/him) * [mmarchini](https://github.com/mmarchini) - **Mary Marchini** <oss@mmarchini.me> (she/her) * [MylesBorins](https://github.com/MylesBorins) - @@ -195,8 +196,6 @@ For information about the governance of the Node.js project, see ### TSC Emeriti -* [addaleax](https://github.com/addaleax) - -**Anna Henningsen** <anna@addaleax.net> (she/her) * [bnoordhuis](https://github.com/bnoordhuis) - **Ben Noordhuis** <info@bnoordhuis.nl> * [chrisdickinson](https://github.com/chrisdickinson) - @@ -249,7 +248,7 @@ For information about the governance of the Node.js project, see * [apapirovski](https://github.com/apapirovski) - **Anatoli Papirovski** <apapirovski@mac.com> (he/him) * [AshCripps](https://github.com/AshCripps) - -**Ash Cripps** <acripps@redhat.com> +**Ash Cripps** <ashley.cripps@ibm.com> * [bcoe](https://github.com/bcoe) - **Ben Coe** <bencoe@gmail.com> (he/him) * [bengl](https://github.com/bengl) - @@ -257,7 +256,7 @@ For information about the governance of the Node.js project, see * [benjamingr](https://github.com/benjamingr) - **Benjamin Gruenbaum** <benjamingr@gmail.com> * [BethGriggs](https://github.com/BethGriggs) - -**Beth Griggs** <bgriggs@redhat.com> (she/her) +**Beth Griggs** <Bethany.Griggs@uk.ibm.com> (she/her) * [bmeck](https://github.com/bmeck) - **Bradley Farias** <bradley.meck@gmail.com> * [bmeurer](https://github.com/bmeurer) - @@ -289,7 +288,7 @@ For information about the governance of the Node.js project, see * [devnexen](https://github.com/devnexen) - **David Carlier** <devnexen@gmail.com> * [devsnek](https://github.com/devsnek) - -**Gus Caplan** <me@gus.host> (they/them) +**Gus Caplan** <me@gus.host> (he/him) * [edsadr](https://github.com/edsadr) - **Adrian Estrada** <edsadr@gmail.com> (he/him) * [eugeneo](https://github.com/eugeneo) - @@ -357,7 +356,7 @@ For information about the governance of the Node.js project, see * [mcollina](https://github.com/mcollina) - **Matteo Collina** <matteo.collina@gmail.com> (he/him) * [mhdawson](https://github.com/mhdawson) - -**Michael Dawson** <midawson@redhat.com> (he/him) +**Michael Dawson** <michael_dawson@ca.ibm.com> (he/him) * [mildsunrise](https://github.com/mildsunrise) - **Alba Mendez** <me@alba.sh> (she/her) * [misterdjules](https://github.com/misterdjules) - @@ -383,9 +382,7 @@ For information about the governance of the Node.js project, see * [rexagod](https://github.com/rexagod) - **Pranshu Srivastava** <rexagod@gmail.com> (he/him) * [richardlau](https://github.com/richardlau) - -**Richard Lau** <rlau@redhat.com> -* [rickyes](https://github.com/rickyes) - -**Ricky Zhou** <0x19951125@gmail.com> (he/him) +**Richard Lau** <riclau@uk.ibm.com> * [ronag](https://github.com/ronag) - **Robert Nagy** <ronagy@icloud.com> * [ronkorving](https://github.com/ronkorving) - @@ -415,7 +412,7 @@ For information about the governance of the Node.js project, see * [starkwang](https://github.com/starkwang) - **Weijia Wang** <starkwang@126.com> * [sxa](https://github.com/sxa) - -**Stewart X Addison** <sxa@redhat.com> (he/him) +**Stewart X Addison** <sxa@uk.ibm.com> * [targos](https://github.com/targos) - **Michaël Zasso** <targos@protonmail.com> (he/him) * [TimothyGu](https://github.com/TimothyGu) - @@ -572,7 +569,7 @@ maintaining the Node.js project. Primary GPG keys for Node.js Releasers (some Releasers sign with subkeys): -* **Beth Griggs** <bgriggs@redhat.com> +* **Beth Griggs** <bethany.griggs@uk.ibm.com> `4ED778F539E3634C779C87C6D7062848A1AB005C` * **Colin Ihrig** <cjihrig@gmail.com> `94AE36675C464D64BAFA68DD7434390BDBE9B9C5` @@ -582,7 +579,7 @@ Primary GPG keys for Node.js Releasers (some Releasers sign with subkeys): `8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600` * **Myles Borins** <myles.borins@gmail.com> `C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8` -* **Richard Lau** <rlau@redhat.com> +* **Richard Lau** <riclau@uk.ibm.com> `C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C` * **Rod Vagg** <rod@vagg.org> `DD8F2338BAE7501E3DD5AC78C273792F7D83545D` @@ -634,6 +631,5 @@ Other keys used to sign some previous releases: [Contributing to the project]: CONTRIBUTING.md [Node.js Website]: https://nodejs.org/ [OpenJS Foundation]: https://openjsf.org/ -[Strategic Initiatives]: https://github.com/nodejs/TSC/blob/master/Strategic-Initiatives.md -[Technical values and prioritization]: doc/guides/technical-values.md [Working Groups]: https://github.com/nodejs/TSC/blob/master/WORKING_GROUPS.md +[Strategic Initiatives]: https://github.com/nodejs/TSC/blob/master/Strategic-Initiatives.md diff --git a/benchmark/README.md b/benchmark/README.md index dc02db4abd8d24..6a40d7af3e1fcf 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -32,7 +32,6 @@ directory, see [the guide on benchmarks](../doc/guides/writing-and-running-bench | module | Benchmarks for the `module` subsystem. | | net | Benchmarks for the `net` subsystem. | | path | Benchmarks for the `path` subsystem. | -| perf_hooks | Benchmarks for the `perf_hooks` subsystem. | | process | Benchmarks for the `process` subsystem. | | querystring | Benchmarks for the `querystring` subsystem. | | streams | Benchmarks for the `streams` subsystem. | diff --git a/benchmark/napi/function_args/binding.cc b/benchmark/napi/function_args/binding.cc index 2c54dd424d405d..9f250aaa83db50 100644 --- a/benchmark/napi/function_args/binding.cc +++ b/benchmark/napi/function_args/binding.cc @@ -2,20 +2,18 @@ #include #include -using v8::Array; -using v8::ArrayBuffer; -using v8::ArrayBufferView; -using v8::BackingStore; -using v8::Context; -using v8::FunctionCallbackInfo; using v8::Isolate; +using v8::Context; using v8::Local; using v8::MaybeLocal; +using v8::Value; using v8::Number; -using v8::Object; using v8::String; -using v8::Uint32; -using v8::Value; +using v8::Object; +using v8::Array; +using v8::ArrayBufferView; +using v8::ArrayBuffer; +using v8::FunctionCallbackInfo; void CallWithString(const FunctionCallbackInfo& args) { assert(args.Length() == 1 && args[0]->IsString()); @@ -24,7 +22,7 @@ void CallWithString(const FunctionCallbackInfo& args) { const int32_t length = str->Utf8Length(args.GetIsolate()) + 1; char* buf = new char[length]; str->WriteUtf8(args.GetIsolate(), buf, length); - delete[] buf; + delete [] buf; } } @@ -33,7 +31,7 @@ void CallWithArray(const FunctionCallbackInfo& args) { if (args.Length() == 1 && args[0]->IsArray()) { const Local array = args[0].As(); uint32_t length = array->Length(); - for (uint32_t i = 0; i < length; i++) { + for (uint32_t i = 0; i < length; ++ i) { Local v; v = array->Get(args.GetIsolate()->GetCurrentContext(), i).ToLocalChecked(); @@ -103,10 +101,12 @@ void CallWithTypedarray(const FunctionCallbackInfo& args) { const size_t byte_length = view->ByteLength(); assert(byte_length > 0); assert(view->HasBuffer()); - Local buffer = view->Buffer(); - std::shared_ptr bs = buffer->GetBackingStore(); + Local buffer; + buffer = view->Buffer(); + ArrayBuffer::Contents contents; + contents = buffer->GetContents(); const uint32_t* data = reinterpret_cast( - static_cast(bs->Data()) + byte_offset); + static_cast(contents.Data()) + byte_offset); assert(data); } } @@ -114,11 +114,11 @@ void CallWithTypedarray(const FunctionCallbackInfo& args) { void CallWithArguments(const FunctionCallbackInfo& args) { assert(args.Length() > 1 && args[0]->IsNumber()); if (args.Length() > 1 && args[0]->IsNumber()) { - int32_t loop = args[0].As()->Value(); + int32_t loop = args[0].As()->Value(); for (int32_t i = 1; i < loop; ++i) { assert(i < args.Length()); assert(args[i]->IsUint32()); - args[i].As()->Value(); + args[i].As()->Value(); } } } diff --git a/benchmark/perf_hooks/bench-eventlooputil.js b/benchmark/perf_hooks/bench-eventlooputil.js deleted file mode 100644 index 984b2b66aecbcf..00000000000000 --- a/benchmark/perf_hooks/bench-eventlooputil.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -const common = require('../common.js'); -const assert = require('assert').ok; -const { performance } = require('perf_hooks'); -const { nodeTiming, eventLoopUtilization } = performance; - -const bench = common.createBenchmark(main, { - n: [1e6], - method: [ - 'idleTime', - 'ELU_simple', - 'ELU_passed', - ], -}); - -function main({ method, n }) { - switch (method) { - case 'idleTime': - benchIdleTime(n); - break; - case 'ELU_simple': - benchELUSimple(n); - break; - case 'ELU_passed': - benchELUPassed(n); - break; - default: - throw new Error(`Unsupported method ${method}`); - } -} - -function benchIdleTime(n) { - bench.start(); - for (let i = 0; i < n; i++) - nodeTiming.idleTime; - bench.end(n); -} - -function benchELUSimple(n) { - // Need to put this in setImmediate or will always return 0. - setImmediate(() => { - const elu = eventLoopUtilization(); - assert(elu.active + elu.idle > 0); - - bench.start(); - for (let i = 0; i < n; i++) - eventLoopUtilization(); - bench.end(n); - }); -} - -function benchELUPassed(n) { - // Need to put this in setImmediate or will always return 0. - setImmediate(() => { - let elu = eventLoopUtilization(); - assert(elu.active + elu.idle > 0); - - bench.start(); - for (let i = 0; i < n; i++) - elu = eventLoopUtilization(elu); - bench.end(n); - }); -} diff --git a/benchmark/process/resourceUsage.js b/benchmark/process/resourceUsage.js deleted file mode 100644 index 83871db680b3b7..00000000000000 --- a/benchmark/process/resourceUsage.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -const common = require('../common.js'); -const bench = common.createBenchmark(main, { - n: [1e5] -}); - -function main({ n }) { - bench.start(); - for (let i = 0; i < n; i++) { - process.resourceUsage(); - } - bench.end(n); -} diff --git a/common.gypi b/common.gypi index 33b1325eb513ea..882b3a694c5fc0 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.16', + 'v8_embedder_string': '-node.13', ##### V8 defaults for Node.js ##### @@ -54,9 +54,6 @@ # Enable disassembler for `--print-code` v8 options 'v8_enable_disassembler': 1, - # Sets -dOBJECT_PRINT. - 'v8_enable_object_print%': 1, - # https://github.com/nodejs/node/pull/22920/files#r222779926 'v8_enable_handle_zapping': 0, @@ -111,9 +108,6 @@ ['target_arch in "ppc64 s390x"', { 'v8_enable_backtrace': 1, }], - ['OS=="linux"', { - 'node_section_ordering_info%': '' - }] ], }, @@ -175,20 +169,6 @@ }, 'cflags': [ '-O3' ], 'conditions': [ - ['OS=="linux"', { - 'conditions': [ - ['node_section_ordering_info!=""', { - 'cflags': [ - '-fuse-ld=gold', - '-ffunction-sections', - ], - 'ldflags': [ - '-fuse-ld=gold', - '-Wl,--section-ordering-file=<(node_section_ordering_info)', - ], - }], - ], - }], ['OS=="solaris"', { # pull in V8's postmortem metadata 'ldflags': [ '-Wl,-z,allextract' ] @@ -508,14 +488,6 @@ ['target_arch=="x64"', { 'xcode_settings': {'ARCHS': ['x86_64']}, }], - ['target_arch=="arm64"', { - 'xcode_settings': { - 'ARCHS': ['arm64'], - 'OTHER_LDFLAGS!': [ - '-Wl,-no_pie', - ], - }, - }], ['clang==1', { 'xcode_settings': { 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', diff --git a/configure.py b/configure.py index d68d8fc96abeb7..1d3e2917081a55 100755 --- a/configure.py +++ b/configure.py @@ -40,6 +40,10 @@ import getnapibuildversion from gyp_node import run_gyp +# imports in deps/v8/tools/node +sys.path.insert(0, os.path.join('deps', 'v8', 'tools', 'node')) +from fetch_deps import FetchDeps + # parse our options parser = optparse.OptionParser() @@ -435,11 +439,6 @@ dest='v8_options', help='v8 options to pass, see `node --v8-options` for examples.') -parser.add_option('--with-ossfuzz', - action='store_true', - dest='ossfuzz', - help='Enables building of fuzzers. This command should be run in an OSS-Fuzz Docker image.') - parser.add_option('--with-arm-float-abi', action='store', dest='arm_float_abi', @@ -498,14 +497,6 @@ dest='node_use_large_pages_script_lld', help='This option has no effect. --use-largepages is now a runtime option.') -parser.add_option('--use-section-ordering-file', - action='store', - dest='node_section_ordering_info', - default='', - help='Pass a section ordering file to the linker. This requires that ' + - 'Node.js be linked using the gold linker. The gold linker must have ' + - 'version 1.2 or greater.') - intl_optgroup.add_option('--with-intl', action='store', dest='with_intl', @@ -683,6 +674,12 @@ help='do not use V8 includes from the bundled deps folder. ' + '(This mode is not officially supported for regular applications)') +parser.add_option('--build-v8-with-gn', + action='store_true', + dest='build_v8_with_gn', + default=False, + help='build V8 using GN instead of gyp') + parser.add_option('--verbose', action='store_true', dest='verbose', @@ -709,12 +706,6 @@ 'memory footprint, but also implies no just-in-time compilation ' + 'support, thus much slower execution)') -parser.add_option('--v8-enable-object-print', - action='store_true', - dest='v8_enable_object_print', - default=True, - help='compile V8 with auxiliar functions for native debuggers') - parser.add_option('--node-builtin-modules-path', action='store', dest='node_builtin_modules_path', @@ -1330,7 +1321,6 @@ def configure_v8(o): o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs. o['variables']['v8_optimized_debug'] = 0 if options.v8_non_optimized_debug else 1 o['variables']['dcheck_always_on'] = 1 if options.v8_with_dchecks else 0 - o['variables']['v8_enable_object_print'] = 1 if options.v8_enable_object_print else 0 o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables. o['variables']['v8_promise_internal_field_count'] = 1 # Add internal field to promises for async hooks. o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1 @@ -1345,6 +1335,14 @@ def configure_v8(o): o['variables']['test_isolation_mode'] = 'noop' # Needed by d8.gyp. if options.without_bundled_v8 and options.enable_d8: raise Exception('--enable-d8 is incompatible with --without-bundled-v8.') + if options.without_bundled_v8 and options.build_v8_with_gn: + raise Exception( + '--build-v8-with-gn is incompatible with --without-bundled-v8.') + if options.build_v8_with_gn: + v8_path = os.path.join('deps', 'v8') + print('Fetching dependencies to build V8 with GN') + options.build_v8_with_gn = FetchDeps(v8_path) + o['variables']['build_v8_with_gn'] = b(options.build_v8_with_gn) def configure_openssl(o): @@ -1756,29 +1754,6 @@ def configure_inspector(o): options.without_ssl) o['variables']['v8_enable_inspector'] = 0 if disable_inspector else 1 -def configure_section_file(o): - try: - proc = subprocess.Popen(['ld.gold'] + ['-v'], stdin = subprocess.PIPE, - stdout = subprocess.PIPE, stderr = subprocess.PIPE) - except OSError: - warn('''No acceptable ld.gold linker found!''') - return 0 - - match = re.match(r"^GNU gold.*([0-9]+)\.([0-9]+)$", - proc.communicate()[0].decode("utf-8")) - - if match: - gold_major_version = match.group(1) - gold_minor_version = match.group(2) - if int(gold_major_version) == 1 and int(gold_minor_version) <= 1: - error('''GNU gold version must be greater than 1.2 in order to use section - reordering''') - - if options.node_section_ordering_info != "": - o['variables']['node_section_ordering_info'] = os.path.realpath( - str(options.node_section_ordering_info)) - else: - o['variables']['node_section_ordering_info'] = "" def make_bin_override(): if sys.platform == 'win32': @@ -1844,10 +1819,6 @@ def make_bin_override(): configure_intl(output) configure_static(output) configure_inspector(output) -configure_section_file(output) - -# Forward OSS-Fuzz settings -output['variables']['ossfuzz'] = b(options.ossfuzz) # variables should be a root level element, # move everything else to target_defaults diff --git a/deps/brotli/brotli.gyp b/deps/brotli/brotli.gyp index 2e6ab9bde3d1b7..dba8321786f353 100644 --- a/deps/brotli/brotli.gyp +++ b/deps/brotli/brotli.gyp @@ -29,10 +29,7 @@ ], 'sources': [ # Common - 'c/common/constants.c', - 'c/common/context.c', 'c/common/dictionary.c', - 'c/common/platform.c', 'c/common/transform.c', # Decoder @@ -48,14 +45,12 @@ 'c/enc/block_splitter.c', 'c/enc/brotli_bit_stream.c', 'c/enc/cluster.c', - 'c/enc/command.c', 'c/enc/compress_fragment.c', 'c/enc/compress_fragment_two_pass.c', 'c/enc/dictionary_hash.c', 'c/enc/encode.c', 'c/enc/encoder_dict.c', 'c/enc/entropy_encode.c', - 'c/enc/fast_log.c', 'c/enc/histogram.c', 'c/enc/literal_cost.c', 'c/enc/memory.c', diff --git a/deps/brotli/c/common/constants.c b/deps/brotli/c/common/constants.c deleted file mode 100644 index 6bad9f613ca5d4..00000000000000 --- a/deps/brotli/c/common/constants.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright 2013 Google Inc. All Rights Reserved. - - Distributed under MIT license. - See file LICENSE for detail or copy at https://opensource.org/licenses/MIT -*/ - -#include "./constants.h" - -const BrotliPrefixCodeRange - _kBrotliPrefixCodeRanges[BROTLI_NUM_BLOCK_LEN_SYMBOLS] = { - {1, 2}, {5, 2}, {9, 2}, {13, 2}, {17, 3}, {25, 3}, - {33, 3}, {41, 3}, {49, 4}, {65, 4}, {81, 4}, {97, 4}, - {113, 5}, {145, 5}, {177, 5}, {209, 5}, {241, 6}, {305, 6}, - {369, 7}, {497, 8}, {753, 9}, {1265, 10}, {2289, 11}, {4337, 12}, - {8433, 13}, {16625, 24}}; diff --git a/deps/brotli/c/common/constants.h b/deps/brotli/c/common/constants.h index e848195a0dc20f..d1b88d12af3874 100644 --- a/deps/brotli/c/common/constants.h +++ b/deps/brotli/c/common/constants.h @@ -4,18 +4,9 @@ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ -/** - * @file - * Common constants used in decoder and encoder API. - */ - #ifndef BROTLI_COMMON_CONSTANTS_H_ #define BROTLI_COMMON_CONSTANTS_H_ -#include "./platform.h" -#include -#include - /* Specification: 7.3. Encoding of the context map */ #define BROTLI_CONTEXT_MAP_MAX_RLE 16 @@ -38,31 +29,12 @@ #define BROTLI_INITIAL_REPEATED_CODE_LENGTH 8 /* "Large Window Brotli" */ - -/** - * The theoretical maximum number of distance bits specified for large window - * brotli, for 64-bit encoders and decoders. Even when in practice 32-bit - * encoders and decoders only support up to 30 max distance bits, the value is - * set to 62 because it affects the large window brotli file format. - * Specifically, it affects the encoding of simple huffman tree for distances, - * see Specification RFC 7932 chapter 3.4. - */ #define BROTLI_LARGE_MAX_DISTANCE_BITS 62U #define BROTLI_LARGE_MIN_WBITS 10 -/** - * The maximum supported large brotli window bits by the encoder and decoder. - * Large window brotli allows up to 62 bits, however the current encoder and - * decoder, designed for 32-bit integers, only support up to 30 bits maximum. - */ #define BROTLI_LARGE_MAX_WBITS 30 /* Specification: 4. Encoding of distances */ #define BROTLI_NUM_DISTANCE_SHORT_CODES 16 -/** - * Maximal number of "postfix" bits. - * - * Number of "postfix" bits is stored as 2 bits in meta-block header. - */ #define BROTLI_MAX_NPOSTFIX 3 #define BROTLI_MAX_NDIRECT 120 #define BROTLI_MAX_DISTANCE_BITS 24U @@ -73,22 +45,9 @@ #define BROTLI_NUM_DISTANCE_SYMBOLS \ BROTLI_DISTANCE_ALPHABET_SIZE( \ BROTLI_MAX_NDIRECT, BROTLI_MAX_NPOSTFIX, BROTLI_LARGE_MAX_DISTANCE_BITS) - -/* ((1 << 26) - 4) is the maximal distance that can be expressed in RFC 7932 - brotli stream using NPOSTFIX = 0 and NDIRECT = 0. With other NPOSTFIX and - NDIRECT values distances up to ((1 << 29) + 88) could be expressed. */ #define BROTLI_MAX_DISTANCE 0x3FFFFFC - -/* ((1 << 31) - 4) is the safe distance limit. Using this number as a limit - allows safe distance calculation without overflows, given the distance - alphabet size is limited to corresponding size - (see kLargeWindowDistanceCodeLimits). */ #define BROTLI_MAX_ALLOWED_DISTANCE 0x7FFFFFFC - -/* Specification: 4. Encoding of Literal Insertion Lengths and Copy Lengths */ -#define BROTLI_NUM_INS_COPY_CODES 24 - /* 7.1. Context modes and context ID lookup for literals */ /* "context IDs for literals are in the range of 0..63" */ #define BROTLI_LITERAL_CONTEXT_BITS 6 @@ -102,99 +61,4 @@ #define BROTLI_WINDOW_GAP 16 #define BROTLI_MAX_BACKWARD_LIMIT(W) (((size_t)1 << (W)) - BROTLI_WINDOW_GAP) -typedef struct BrotliDistanceCodeLimit { - uint32_t max_alphabet_size; - uint32_t max_distance; -} BrotliDistanceCodeLimit; - -/* This function calculates maximal size of distance alphabet, such that the - distances greater than the given values can not be represented. - - This limits are designed to support fast and safe 32-bit decoders. - "32-bit" means that signed integer values up to ((1 << 31) - 1) could be - safely expressed. - - Brotli distance alphabet symbols do not represent consecutive distance - ranges. Each distance alphabet symbol (excluding direct distances and short - codes), represent interleaved (for NPOSTFIX > 0) range of distances. - A "group" of consecutive (1 << NPOSTFIX) symbols represent non-interleaved - range. Two consecutive groups require the same amount of "extra bits". - - It is important that distance alphabet represents complete "groups". - To avoid complex logic on encoder side about interleaved ranges - it was decided to restrict both sides to complete distance code "groups". - */ -BROTLI_UNUSED_FUNCTION BrotliDistanceCodeLimit BrotliCalculateDistanceCodeLimit( - uint32_t max_distance, uint32_t npostfix, uint32_t ndirect) { - BrotliDistanceCodeLimit result; - /* Marking this function as unused, because not all files - including "constants.h" use it -> compiler warns about that. */ - BROTLI_UNUSED(&BrotliCalculateDistanceCodeLimit); - if (max_distance <= ndirect) { - /* This case never happens / exists only for the sake of completeness. */ - result.max_alphabet_size = max_distance + BROTLI_NUM_DISTANCE_SHORT_CODES; - result.max_distance = max_distance; - return result; - } else { - /* The first prohibited value. */ - uint32_t forbidden_distance = max_distance + 1; - /* Subtract "directly" encoded region. */ - uint32_t offset = forbidden_distance - ndirect - 1; - uint32_t ndistbits = 0; - uint32_t tmp; - uint32_t half; - uint32_t group; - /* Postfix for the last dcode in the group. */ - uint32_t postfix = (1u << npostfix) - 1; - uint32_t extra; - uint32_t start; - /* Remove postfix and "head-start". */ - offset = (offset >> npostfix) + 4; - /* Calculate the number of distance bits. */ - tmp = offset / 2; - /* Poor-man's log2floor, to avoid extra dependencies. */ - while (tmp != 0) {ndistbits++; tmp = tmp >> 1;} - /* One bit is covered with subrange addressing ("half"). */ - ndistbits--; - /* Find subrange. */ - half = (offset >> ndistbits) & 1; - /* Calculate the "group" part of dcode. */ - group = ((ndistbits - 1) << 1) | half; - /* Calculated "group" covers the prohibited distance value. */ - if (group == 0) { - /* This case is added for correctness; does not occur for limit > 128. */ - result.max_alphabet_size = ndirect + BROTLI_NUM_DISTANCE_SHORT_CODES; - result.max_distance = ndirect; - return result; - } - /* Decrement "group", so it is the last permitted "group". */ - group--; - /* After group was decremented, ndistbits and half must be recalculated. */ - ndistbits = (group >> 1) + 1; - /* The last available distance in the subrange has all extra bits set. */ - extra = (1u << ndistbits) - 1; - /* Calculate region start. NB: ndistbits >= 1. */ - start = (1u << (ndistbits + 1)) - 4; - /* Move to subregion. */ - start += (group & 1) << ndistbits; - /* Calculate the alphabet size. */ - result.max_alphabet_size = ((group << npostfix) | postfix) + ndirect + - BROTLI_NUM_DISTANCE_SHORT_CODES + 1; - /* Calculate the maximal distance representable by alphabet. */ - result.max_distance = ((start + extra) << npostfix) + postfix + ndirect + 1; - return result; - } -} - -/* Represents the range of values belonging to a prefix code: - [offset, offset + 2^nbits) */ -typedef struct { - uint16_t offset; - uint8_t nbits; -} BrotliPrefixCodeRange; - -/* "Soft-private", it is exported, but not "advertised" as API. */ -BROTLI_COMMON_API extern const BrotliPrefixCodeRange - _kBrotliPrefixCodeRanges[BROTLI_NUM_BLOCK_LEN_SYMBOLS]; - #endif /* BROTLI_COMMON_CONSTANTS_H_ */ diff --git a/deps/brotli/c/common/context.c b/deps/brotli/c/common/context.c deleted file mode 100644 index 2c2dceba9b6229..00000000000000 --- a/deps/brotli/c/common/context.c +++ /dev/null @@ -1,156 +0,0 @@ -#include "./context.h" - -#include - -/* Common context lookup table for all context modes. */ -const uint8_t _kBrotliContextLookupTable[2048] = { - /* CONTEXT_LSB6, last byte. */ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - - /* CONTEXT_LSB6, second last byte, */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - /* CONTEXT_MSB6, last byte. */ - 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, - 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, - 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, - 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, - 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, - 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, - 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, - 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, - 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, - 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, - 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, - 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, - 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, - 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, - 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59, - 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63, - - /* CONTEXT_MSB6, second last byte, */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - /* CONTEXT_UTF8, last byte. */ - /* ASCII range. */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 12, 16, 12, 12, 20, 12, 16, 24, 28, 12, 12, 32, 12, 36, 12, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 32, 32, 24, 40, 28, 12, - 12, 48, 52, 52, 52, 48, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48, - 52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 24, 12, 28, 12, 12, - 12, 56, 60, 60, 60, 56, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56, - 60, 60, 60, 60, 60, 56, 60, 60, 60, 60, 60, 24, 12, 28, 12, 0, - /* UTF8 continuation byte range. */ - 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, - 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, - 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, - 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, - /* UTF8 lead byte range. */ - 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, - 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, - 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, - 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, - - /* CONTEXT_UTF8 second last byte. */ - /* ASCII range. */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, - 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 0, - /* UTF8 continuation byte range. */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /* UTF8 lead byte range. */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - - /* CONTEXT_SIGNED, last byte, same as the above values shifted by 3 bits. */ - 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, - - /* CONTEXT_SIGNED, second last byte. */ - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, -}; diff --git a/deps/brotli/c/common/context.h b/deps/brotli/c/common/context.h index 685a279dc06993..24b3eb48f53339 100644 --- a/deps/brotli/c/common/context.h +++ b/deps/brotli/c/common/context.h @@ -88,7 +88,6 @@ #ifndef BROTLI_COMMON_CONTEXT_H_ #define BROTLI_COMMON_CONTEXT_H_ -#include #include typedef enum ContextType { @@ -98,14 +97,163 @@ typedef enum ContextType { CONTEXT_SIGNED = 3 } ContextType; -/* "Soft-private", it is exported, but not "advertised" as API. */ /* Common context lookup table for all context modes. */ -BROTLI_COMMON_API extern const uint8_t _kBrotliContextLookupTable[2048]; +static const uint8_t kContextLookup[2048] = { + /* CONTEXT_LSB6, last byte. */ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + + /* CONTEXT_LSB6, second last byte, */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + /* CONTEXT_MSB6, last byte. */ + 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, + 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, + 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, + 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, + 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, + 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, + 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, + 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, + 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, + 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, + 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, + 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, + 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, + 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, + 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59, + 60, 60, 60, 60, 61, 61, 61, 61, 62, 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44, 44, 44, 44, 44, 32, 32, 24, 40, 28, 12, + 12, 48, 52, 52, 52, 48, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48, + 52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 24, 12, 28, 12, 12, + 12, 56, 60, 60, 60, 56, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56, + 60, 60, 60, 60, 60, 56, 60, 60, 60, 60, 60, 24, 12, 28, 12, 0, + /* UTF8 continuation byte range. */ + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + /* UTF8 lead byte range. */ + 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, + 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, + 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, + 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, + + /* CONTEXT_UTF8 second last byte. */ + /* ASCII range. */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, + 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 0, + /* UTF8 continuation byte range. */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /* UTF8 lead byte range. */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + + /* CONTEXT_SIGNED, last byte, same as the above values shifted by 3 bits. */ + 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, + + /* CONTEXT_SIGNED, second last byte. */ + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, +}; typedef const uint8_t* ContextLut; /* typeof(MODE) == ContextType; returns ContextLut */ -#define BROTLI_CONTEXT_LUT(MODE) (&_kBrotliContextLookupTable[(MODE) << 9]) +#define BROTLI_CONTEXT_LUT(MODE) (&kContextLookup[(MODE) << 9]) /* typeof(LUT) == ContextLut */ #define BROTLI_CONTEXT(P1, P2, LUT) ((LUT)[P1] | ((LUT) + 256)[P2]) diff --git a/deps/brotli/c/common/dictionary.c b/deps/brotli/c/common/dictionary.c index f9e30417c00b2f..64822a381bbfd7 100644 --- a/deps/brotli/c/common/dictionary.c +++ b/deps/brotli/c/common/dictionary.c @@ -5,13 +5,12 @@ */ #include "./dictionary.h" -#include "./platform.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif -#if !defined(BROTLI_EXTERNAL_DICTIONARY_DATA) +#ifndef BROTLI_EXTERNAL_DICTIONARY_DATA static const uint8_t kBrotliDictionaryData[] = { 116,105,109,101,100,111,119,110,108,105,102,101,108,101,102,116,98,97,99,107,99, @@ -5863,11 +5862,7 @@ static const uint8_t kBrotliDictionaryData[] = ; #endif /* !BROTLI_EXTERNAL_DICTIONARY_DATA */ -#if !defined(BROTLI_EXTERNAL_DICTIONARY_DATA) -static const BrotliDictionary kBrotliDictionary = { -#else static BrotliDictionary kBrotliDictionary = { -#endif /* size_bits_by_length */ { 0, 0, 0, 0, 10, 10, 11, 11, @@ -5900,13 +5895,9 @@ const BrotliDictionary* BrotliGetDictionary() { } void BrotliSetDictionaryData(const uint8_t* data) { -#if defined(BROTLI_EXTERNAL_DICTIONARY_DATA) if (!!data && !kBrotliDictionary.data) { kBrotliDictionary.data = data; } -#else - BROTLI_UNUSED(data); // Appease -Werror=unused-parameter -#endif } #if defined(__cplusplus) || defined(c_plusplus) diff --git a/deps/brotli/c/common/platform.c b/deps/brotli/c/common/platform.c deleted file mode 100644 index aef39e93c469d1..00000000000000 --- a/deps/brotli/c/common/platform.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright 2016 Google Inc. All Rights Reserved. - - Distributed under MIT license. - See file LICENSE for detail or copy at https://opensource.org/licenses/MIT -*/ - -#include - -#include "./platform.h" -#include - -/* Default brotli_alloc_func */ -void* BrotliDefaultAllocFunc(void* opaque, size_t size) { - BROTLI_UNUSED(opaque); - return malloc(size); -} - -/* Default brotli_free_func */ -void BrotliDefaultFreeFunc(void* opaque, void* address) { - BROTLI_UNUSED(opaque); - free(address); -} diff --git a/deps/brotli/c/common/platform.h b/deps/brotli/c/common/platform.h index f5ca4435bc003b..84c448c4cf8c44 100644 --- a/deps/brotli/c/common/platform.h +++ b/deps/brotli/c/common/platform.h @@ -24,11 +24,12 @@ #define BROTLI_COMMON_PLATFORM_H_ #include /* memcpy */ +#include /* malloc, free */ #include #include -#if defined(OS_LINUX) || defined(OS_CYGWIN) || defined(__EMSCRIPTEN__) +#if defined(OS_LINUX) || defined(OS_CYGWIN) #include #elif defined(OS_FREEBSD) #include @@ -40,10 +41,6 @@ #define BROTLI_X_BIG_ENDIAN BIG_ENDIAN #endif -#if BROTLI_MSVC_VERSION_CHECK(12, 0, 0) -#include -#endif - #if defined(BROTLI_ENABLE_LOG) || defined(BROTLI_DEBUG) #include #include @@ -311,7 +308,8 @@ static BROTLI_INLINE void BrotliUnalignedWrite64(void* p, uint64_t v) { } #else /* BROTLI_ALIGNED_READ */ /* Unaligned memory access is allowed: just cast pointer to requested type. */ -#if BROTLI_SANITIZED +#if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) || \ + defined(MEMORY_SANITIZER) /* Consider we have an unaligned load/store of 4 bytes from address 0x...05. AddressSanitizer will treat it as a 3-byte access to the range 05:07 and will miss a bug if 08 is the first unaddressable byte. @@ -336,7 +334,7 @@ extern "C" { #define BrotliUnalignedRead32 __sanitizer_unaligned_load32 #define BrotliUnalignedRead64 __sanitizer_unaligned_load64 #define BrotliUnalignedWrite64 __sanitizer_unaligned_store64 -#else /* BROTLI_SANITIZED */ +#else static BROTLI_INLINE uint16_t BrotliUnalignedRead16(const void* p) { return *(const uint16_t*)p; } @@ -358,7 +356,7 @@ static BROTLI_INLINE void BrotliUnalignedWrite64(void* p, uint64_t v) { typedef BROTLI_ALIGNED(1) uint64_t brotli_unaligned_uint64_t; static BROTLI_INLINE uint64_t BrotliUnalignedRead64(const void* p) { - return (uint64_t) ((const brotli_unaligned_uint64_t*) p)[0]; + return (uint64_t) ((brotli_unaligned_uint64_t*) p)[0]; } static BROTLI_INLINE void BrotliUnalignedWrite64(void* p, uint64_t v) { brotli_unaligned_uint64_t* dwords = (brotli_unaligned_uint64_t*) p; @@ -376,7 +374,7 @@ static BROTLI_INLINE void BrotliUnalignedWrite64(void* p, uint64_t v) { } #endif /* BROTLI_GNUC_HAS_ATTRIBUTE(aligned, 2, 7, 0) */ #endif /* BROTLI_64_BITS */ -#endif /* BROTLI_SANITIZED */ +#endif /* ASAN / TSAN / MSAN */ #endif /* BROTLI_ALIGNED_READ */ #if BROTLI_LITTLE_ENDIAN @@ -468,20 +466,20 @@ static BROTLI_INLINE void BROTLI_UNALIGNED_STORE64LE(void* p, uint64_t v) { #endif #if defined(BROTLI_ENABLE_LOG) +#define BROTLI_DCHECK(x) assert(x) #define BROTLI_LOG(x) printf x #else +#define BROTLI_DCHECK(x) #define BROTLI_LOG(x) #endif #if defined(BROTLI_DEBUG) || defined(BROTLI_ENABLE_LOG) -#define BROTLI_DCHECK(x) assert(x) static BROTLI_INLINE void BrotliDump(const char* f, int l, const char* fn) { fprintf(stderr, "%s:%d (%s)\n", f, l, fn); fflush(stderr); } #define BROTLI_DUMP() BrotliDump(__FILE__, __LINE__, __FUNCTION__) #else -#define BROTLI_DCHECK(x) #define BROTLI_DUMP() (void)(0) #endif @@ -525,41 +523,17 @@ BROTLI_MIN_MAX(size_t) BROTLI_MIN_MAX(uint32_t) BROTLI_MIN_MAX(uint8_t) (A)[(J)] = __brotli_swap_tmp; \ } -#if BROTLI_64_BITS -#if BROTLI_GNUC_HAS_BUILTIN(__builtin_ctzll, 3, 4, 0) || \ - BROTLI_INTEL_VERSION_CHECK(16, 0, 0) -#define BROTLI_TZCNT64 __builtin_ctzll -#elif BROTLI_MSVC_VERSION_CHECK(12, 0, 0) -#if defined(BROTLI_TARGET_X64) -#define BROTLI_TZCNT64 _tzcnt_u64 -#else /* BROTLI_TARGET_X64 */ -static BROTLI_INLINE uint32_t BrotliBsf64Msvc(uint64_t x) { - uint32_t lsb; - _BitScanForward64(&lsb, x); - return lsb; -} -#define BROTLI_TZCNT64 BrotliBsf64Msvc -#endif /* BROTLI_TARGET_X64 */ -#endif /* __builtin_ctzll */ -#endif /* BROTLI_64_BITS */ - -#if BROTLI_GNUC_HAS_BUILTIN(__builtin_clz, 3, 4, 0) || \ - BROTLI_INTEL_VERSION_CHECK(16, 0, 0) -#define BROTLI_BSR32(x) (31u ^ (uint32_t)__builtin_clz(x)) -#elif BROTLI_MSVC_VERSION_CHECK(12, 0, 0) -static BROTLI_INLINE uint32_t BrotliBsr32Msvc(uint32_t x) { - unsigned long msb; - _BitScanReverse(&msb, x); - return (uint32_t)msb; -} -#define BROTLI_BSR32 BrotliBsr32Msvc -#endif /* __builtin_clz */ - /* Default brotli_alloc_func */ -BROTLI_COMMON_API void* BrotliDefaultAllocFunc(void* opaque, size_t size); +static void* BrotliDefaultAllocFunc(void* opaque, size_t size) { + BROTLI_UNUSED(opaque); + return malloc(size); +} /* Default brotli_free_func */ -BROTLI_COMMON_API void BrotliDefaultFreeFunc(void* opaque, void* address); +static void BrotliDefaultFreeFunc(void* opaque, void* address) { + BROTLI_UNUSED(opaque); + free(address); +} BROTLI_UNUSED_FUNCTION void BrotliSuppressUnusedFunctions(void) { BROTLI_UNUSED(&BrotliSuppressUnusedFunctions); diff --git a/deps/brotli/c/common/transform.c b/deps/brotli/c/common/transform.c index f8fa4335e1c2f5..426e635fd3d033 100644 --- a/deps/brotli/c/common/transform.c +++ b/deps/brotli/c/common/transform.c @@ -24,8 +24,8 @@ static const char kPrefixSuffix[217] = /* 8x _0 _ _3 _8 _C _E _ _1 _7 _F */ " not \3er \3al \4ful \4ive \5less \4es" /* Ax _5 _9 _D _2 _7 _D */ - "t \4ize \2\xc2\xa0\4ous \5 the \2e "; /* \0 - implicit trailing zero. */ -/* Cx _2 _7___ ___ _A _F _5 _8 */ + "t \4ize \2\xc2\xa0\4ous \5 the \2e \0"; +/* Cx _2 _7___ ___ _A _F _5 _8 */ static const uint16_t kPrefixSuffixMap[50] = { 0x00, 0x02, 0x05, 0x0E, 0x13, 0x16, 0x18, 0x1E, 0x23, 0x25, @@ -160,13 +160,12 @@ static const uint8_t kTransformsData[] = { 0, BROTLI_TRANSFORM_UPPERCASE_FIRST, 34, }; -static const BrotliTransforms kBrotliTransforms = { +static BrotliTransforms kBrotliTransforms = { sizeof(kPrefixSuffix), (const uint8_t*)kPrefixSuffix, kPrefixSuffixMap, sizeof(kTransformsData) / (3 * sizeof(kTransformsData[0])), kTransformsData, - NULL, /* no extra parameters */ {0, 12, 27, 23, 42, 63, 56, 48, 59, 64} }; @@ -191,48 +190,6 @@ static int ToUpperCase(uint8_t* p) { return 3; } -static int Shift(uint8_t* word, int word_len, uint16_t parameter) { - /* Limited sign extension: scalar < (1 << 24). */ - uint32_t scalar = - (parameter & 0x7FFFu) + (0x1000000u - (parameter & 0x8000u)); - if (word[0] < 0x80) { - /* 1-byte rune / 0sssssss / 7 bit scalar (ASCII). */ - scalar += (uint32_t)word[0]; - word[0] = (uint8_t)(scalar & 0x7Fu); - return 1; - } else if (word[0] < 0xC0) { - /* Continuation / 10AAAAAA. */ - return 1; - } else if (word[0] < 0xE0) { - /* 2-byte rune / 110sssss AAssssss / 11 bit scalar. */ - if (word_len < 2) return 1; - scalar += (uint32_t)((word[1] & 0x3Fu) | ((word[0] & 0x1Fu) << 6u)); - word[0] = (uint8_t)(0xC0 | ((scalar >> 6u) & 0x1F)); - word[1] = (uint8_t)((word[1] & 0xC0) | (scalar & 0x3F)); - return 2; - } else if (word[0] < 0xF0) { - /* 3-byte rune / 1110ssss AAssssss BBssssss / 16 bit scalar. */ - if (word_len < 3) return word_len; - scalar += (uint32_t)((word[2] & 0x3Fu) | ((word[1] & 0x3Fu) << 6u) | - ((word[0] & 0x0Fu) << 12u)); - word[0] = (uint8_t)(0xE0 | ((scalar >> 12u) & 0x0F)); - word[1] = (uint8_t)((word[1] & 0xC0) | ((scalar >> 6u) & 0x3F)); - word[2] = (uint8_t)((word[2] & 0xC0) | (scalar & 0x3F)); - return 3; - } else if (word[0] < 0xF8) { - /* 4-byte rune / 11110sss AAssssss BBssssss CCssssss / 21 bit scalar. */ - if (word_len < 4) return word_len; - scalar += (uint32_t)((word[3] & 0x3Fu) | ((word[2] & 0x3Fu) << 6u) | - ((word[1] & 0x3Fu) << 12u) | ((word[0] & 0x07u) << 18u)); - word[0] = (uint8_t)(0xF0 | ((scalar >> 18u) & 0x07)); - word[1] = (uint8_t)((word[1] & 0xC0) | ((scalar >> 12u) & 0x3F)); - word[2] = (uint8_t)((word[2] & 0xC0) | ((scalar >> 6u) & 0x3F)); - word[3] = (uint8_t)((word[3] & 0xC0) | (scalar & 0x3F)); - return 4; - } - return 1; -} - int BrotliTransformDictionaryWord(uint8_t* dst, const uint8_t* word, int len, const BrotliTransforms* transforms, int transform_idx) { int idx = 0; @@ -264,19 +221,6 @@ int BrotliTransformDictionaryWord(uint8_t* dst, const uint8_t* word, int len, uppercase += step; len -= step; } - } else if (t == BROTLI_TRANSFORM_SHIFT_FIRST) { - uint16_t param = (uint16_t)(transforms->params[transform_idx * 2] - + (transforms->params[transform_idx * 2 + 1] << 8u)); - Shift(&dst[idx - len], len, param); - } else if (t == BROTLI_TRANSFORM_SHIFT_ALL) { - uint16_t param = (uint16_t)(transforms->params[transform_idx * 2] - + (transforms->params[transform_idx * 2 + 1] << 8u)); - uint8_t* shift = &dst[idx - len]; - while (len > 0) { - int step = Shift(shift, len, param); - shift += step; - len -= step; - } } } { diff --git a/deps/brotli/c/common/transform.h b/deps/brotli/c/common/transform.h index b6f86cc7d5ad24..456c12db9b2bcf 100644 --- a/deps/brotli/c/common/transform.h +++ b/deps/brotli/c/common/transform.h @@ -37,8 +37,6 @@ enum BrotliWordTransformType { BROTLI_TRANSFORM_OMIT_FIRST_7 = 18, BROTLI_TRANSFORM_OMIT_FIRST_8 = 19, BROTLI_TRANSFORM_OMIT_FIRST_9 = 20, - BROTLI_TRANSFORM_SHIFT_FIRST = 21, - BROTLI_TRANSFORM_SHIFT_ALL = 22, BROTLI_NUM_TRANSFORM_TYPES /* Counts transforms, not a transform itself. */ }; @@ -52,9 +50,6 @@ typedef struct BrotliTransforms { uint32_t num_transforms; /* Each entry is a [prefix_id, transform, suffix_id] triplet. */ const uint8_t* transforms; - /* Shift for BROTLI_TRANSFORM_SHIFT_FIRST and BROTLI_TRANSFORM_SHIFT_ALL, - must be NULL if and only if no such transforms are present. */ - const uint8_t* params; /* Indices of transforms like ["", BROTLI_TRANSFORM_OMIT_LAST_#, ""]. 0-th element corresponds to ["", BROTLI_TRANSFORM_IDENTITY, ""]. -1, if cut-off transform does not exist. */ diff --git a/deps/brotli/c/common/version.h b/deps/brotli/c/common/version.h index 01b2998e25d787..0d0d0c79676809 100644 --- a/deps/brotli/c/common/version.h +++ b/deps/brotli/c/common/version.h @@ -14,13 +14,13 @@ BrotliEncoderVersion methods. */ /* Semantic version, calculated as (MAJOR << 24) | (MINOR << 12) | PATCH */ -#define BROTLI_VERSION 0x1000009 +#define BROTLI_VERSION 0x1000007 /* This macro is used by build system to produce Libtool-friendly soname. See https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html */ /* ABI version, calculated as (CURRENT << 24) | (REVISION << 12) | AGE */ -#define BROTLI_ABI_VERSION 0x1009000 +#define BROTLI_ABI_VERSION 0x1007000 #endif /* BROTLI_COMMON_VERSION_H_ */ diff --git a/deps/brotli/c/dec/bit_reader.c b/deps/brotli/c/dec/bit_reader.c index 7f7b256a40cebc..722fd906dd4342 100644 --- a/deps/brotli/c/dec/bit_reader.c +++ b/deps/brotli/c/dec/bit_reader.c @@ -15,17 +15,6 @@ extern "C" { #endif -const uint32_t kBrotliBitMask[33] = { 0x00000000, - 0x00000001, 0x00000003, 0x00000007, 0x0000000F, - 0x0000001F, 0x0000003F, 0x0000007F, 0x000000FF, - 0x000001FF, 0x000003FF, 0x000007FF, 0x00000FFF, - 0x00001FFF, 0x00003FFF, 0x00007FFF, 0x0000FFFF, - 0x0001FFFF, 0x0003FFFF, 0x0007FFFF, 0x000FFFFF, - 0x001FFFFF, 0x003FFFFF, 0x007FFFFF, 0x00FFFFFF, - 0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF, 0x0FFFFFFF, - 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF, 0xFFFFFFFF -}; - void BrotliInitBitReader(BrotliBitReader* const br) { br->val_ = 0; br->bit_pos_ = sizeof(br->val_) << 3; @@ -54,23 +43,6 @@ BROTLI_BOOL BrotliWarmupBitReader(BrotliBitReader* const br) { return BROTLI_TRUE; } -BROTLI_BOOL BrotliSafeReadBits32Slow(BrotliBitReader* const br, - uint32_t n_bits, uint32_t* val) { - uint32_t low_val; - uint32_t high_val; - BrotliBitReaderState memento; - BROTLI_DCHECK(n_bits <= 32); - BROTLI_DCHECK(n_bits > 24); - BrotliBitReaderSaveState(br, &memento); - if (!BrotliSafeReadBits(br, 16, &low_val) || - !BrotliSafeReadBits(br, n_bits - 16, &high_val)) { - BrotliBitReaderRestoreState(br, &memento); - return BROTLI_FALSE; - } - *val = low_val | (high_val << 16); - return BROTLI_TRUE; -} - #if defined(__cplusplus) || defined(c_plusplus) } /* extern "C" */ #endif diff --git a/deps/brotli/c/dec/bit_reader.h b/deps/brotli/c/dec/bit_reader.h index 22bc060cad1ec0..c06e91419f28f0 100644 --- a/deps/brotli/c/dec/bit_reader.h +++ b/deps/brotli/c/dec/bit_reader.h @@ -11,7 +11,6 @@ #include /* memcpy */ -#include "../common/constants.h" #include "../common/platform.h" #include @@ -21,7 +20,16 @@ extern "C" { #define BROTLI_SHORT_FILL_BIT_WINDOW_READ (sizeof(brotli_reg_t) >> 1) -BROTLI_INTERNAL extern const uint32_t kBrotliBitMask[33]; +static const uint32_t kBitMask[33] = { 0x00000000, + 0x00000001, 0x00000003, 0x00000007, 0x0000000F, + 0x0000001F, 0x0000003F, 0x0000007F, 0x000000FF, + 0x000001FF, 0x000003FF, 0x000007FF, 0x00000FFF, + 0x00001FFF, 0x00003FFF, 0x00007FFF, 0x0000FFFF, + 0x0001FFFF, 0x0003FFFF, 0x0007FFFF, 0x000FFFFF, + 0x001FFFFF, 0x003FFFFF, 0x007FFFFF, 0x00FFFFFF, + 0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF, 0x0FFFFFFF, + 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF, 0xFFFFFFFF +}; static BROTLI_INLINE uint32_t BitMask(uint32_t n) { if (BROTLI_IS_CONSTANT(n) || BROTLI_HAS_UBFX) { @@ -29,7 +37,7 @@ static BROTLI_INLINE uint32_t BitMask(uint32_t n) { "Unsigned Bit Field Extract" UBFX instruction on ARM. */ return ~((0xFFFFFFFFu) << n); } else { - return kBrotliBitMask[n]; + return kBitMask[n]; } } @@ -57,12 +65,6 @@ BROTLI_INTERNAL void BrotliInitBitReader(BrotliBitReader* const br); reading. */ BROTLI_INTERNAL BROTLI_BOOL BrotliWarmupBitReader(BrotliBitReader* const br); -/* Fallback for BrotliSafeReadBits32. Extracted as noninlined method to unburden - the main code-path. Never called for RFC brotli streams, required only for - "large-window" mode and other extensions. */ -BROTLI_INTERNAL BROTLI_NOINLINE BROTLI_BOOL BrotliSafeReadBits32Slow( - BrotliBitReader* const br, uint32_t n_bits, uint32_t* val); - static BROTLI_INLINE void BrotliBitReaderSaveState( BrotliBitReader* const from, BrotliBitReaderState* to) { to->val_ = from->val_; @@ -85,11 +87,8 @@ static BROTLI_INLINE uint32_t BrotliGetAvailableBits( } /* Returns amount of unread bytes the bit reader still has buffered from the - BrotliInput, including whole bytes in br->val_. Result is capped with - maximal ring-buffer size (larger number won't be utilized anyway). */ + BrotliInput, including whole bytes in br->val_. */ static BROTLI_INLINE size_t BrotliGetRemainingBytes(BrotliBitReader* br) { - static const size_t kCap = (size_t)1 << BROTLI_LARGE_MAX_WBITS; - if (br->avail_in > kCap) return kCap; return br->avail_in + (BrotliGetAvailableBits(br) >> 3); } @@ -238,17 +237,15 @@ static BROTLI_INLINE void BrotliBitReaderUnload(BrotliBitReader* br) { static BROTLI_INLINE void BrotliTakeBits( BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) { *val = (uint32_t)BrotliGetBitsUnmasked(br) & BitMask(n_bits); - BROTLI_LOG(("[BrotliTakeBits] %d %d %d val: %6x\n", + BROTLI_LOG(("[BrotliReadBits] %d %d %d val: %6x\n", (int)br->avail_in, (int)br->bit_pos_, (int)n_bits, (int)*val)); BrotliDropBits(br, n_bits); } /* Reads the specified number of bits from |br| and advances the bit pos. - Assumes that there is enough input to perform BrotliFillBitWindow. - Up to 24 bits are allowed to be requested from this method. */ -static BROTLI_INLINE uint32_t BrotliReadBits24( + Assumes that there is enough input to perform BrotliFillBitWindow. */ +static BROTLI_INLINE uint32_t BrotliReadBits( BrotliBitReader* const br, uint32_t n_bits) { - BROTLI_DCHECK(n_bits <= 24); if (BROTLI_64_BITS || (n_bits <= 16)) { uint32_t val; BrotliFillBitWindow(br, n_bits); @@ -265,32 +262,10 @@ static BROTLI_INLINE uint32_t BrotliReadBits24( } } -/* Same as BrotliReadBits24, but allows reading up to 32 bits. */ -static BROTLI_INLINE uint32_t BrotliReadBits32( - BrotliBitReader* const br, uint32_t n_bits) { - BROTLI_DCHECK(n_bits <= 32); - if (BROTLI_64_BITS || (n_bits <= 16)) { - uint32_t val; - BrotliFillBitWindow(br, n_bits); - BrotliTakeBits(br, n_bits, &val); - return val; - } else { - uint32_t low_val; - uint32_t high_val; - BrotliFillBitWindow(br, 16); - BrotliTakeBits(br, 16, &low_val); - BrotliFillBitWindow(br, 16); - BrotliTakeBits(br, n_bits - 16, &high_val); - return low_val | (high_val << 16); - } -} - /* Tries to read the specified amount of bits. Returns BROTLI_FALSE, if there - is not enough input. |n_bits| MUST be positive. - Up to 24 bits are allowed to be requested from this method. */ + is not enough input. |n_bits| MUST be positive. */ static BROTLI_INLINE BROTLI_BOOL BrotliSafeReadBits( BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) { - BROTLI_DCHECK(n_bits <= 24); while (BrotliGetAvailableBits(br) < n_bits) { if (!BrotliPullByte(br)) { return BROTLI_FALSE; @@ -300,23 +275,6 @@ static BROTLI_INLINE BROTLI_BOOL BrotliSafeReadBits( return BROTLI_TRUE; } -/* Same as BrotliSafeReadBits, but allows reading up to 32 bits. */ -static BROTLI_INLINE BROTLI_BOOL BrotliSafeReadBits32( - BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) { - BROTLI_DCHECK(n_bits <= 32); - if (BROTLI_64_BITS || (n_bits <= 24)) { - while (BrotliGetAvailableBits(br) < n_bits) { - if (!BrotliPullByte(br)) { - return BROTLI_FALSE; - } - } - BrotliTakeBits(br, n_bits, val); - return BROTLI_TRUE; - } else { - return BrotliSafeReadBits32Slow(br, n_bits, val); - } -} - /* Advances the bit reader position to the next byte boundary and verifies that any skipped bits are set to zero. */ static BROTLI_INLINE BROTLI_BOOL BrotliJumpToByteBoundary(BrotliBitReader* br) { diff --git a/deps/brotli/c/dec/decode.c b/deps/brotli/c/dec/decode.c index ae5a3d3fa359e5..08bd76ca16e2a8 100644 --- a/deps/brotli/c/dec/decode.c +++ b/deps/brotli/c/dec/decode.c @@ -41,8 +41,7 @@ extern "C" { /* We need the slack region for the following reasons: - doing up to two 16-byte copies for fast backward copying - - inserting transformed dictionary word: - 5 prefix + 24 base + 8 suffix */ + - inserting transformed dictionary word (5 prefix + 24 base + 8 suffix) */ static const uint32_t kRingBufferWriteAheadSlack = 42; static const uint8_t kCodeLengthCodeOrder[BROTLI_CODE_LENGTH_CODES] = { @@ -275,8 +274,7 @@ static BrotliDecoderErrorCode BROTLI_NOINLINE DecodeMetaBlockLength( s->loop_counter = i; return BROTLI_DECODER_NEEDS_MORE_INPUT; } - if (i + 1 == (int)s->size_nibbles && s->size_nibbles > 4 && - bits == 0) { + if (i + 1 == s->size_nibbles && s->size_nibbles > 4 && bits == 0) { return BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE); } s->meta_block_remaining_len |= (int)(bits << (i * 4)); @@ -325,8 +323,7 @@ static BrotliDecoderErrorCode BROTLI_NOINLINE DecodeMetaBlockLength( s->loop_counter = i; return BROTLI_DECODER_NEEDS_MORE_INPUT; } - if (i + 1 == (int)s->size_nibbles && s->size_nibbles > 1 && - bits == 0) { + if (i + 1 == s->size_nibbles && s->size_nibbles > 1 && bits == 0) { return BROTLI_FAILURE( BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE); } @@ -473,34 +470,32 @@ static BROTLI_INLINE uint32_t Log2Floor(uint32_t x) { Totally 1..4 symbols are read, 1..11 bits each. The list of symbols MUST NOT contain duplicates. */ static BrotliDecoderErrorCode ReadSimpleHuffmanSymbols( - uint32_t alphabet_size_max, uint32_t alphabet_size_limit, - BrotliDecoderState* s) { + uint32_t alphabet_size, uint32_t max_symbol, BrotliDecoderState* s) { /* max_bits == 1..11; symbol == 0..3; 1..44 bits will be read. */ BrotliBitReader* br = &s->br; - BrotliMetablockHeaderArena* h = &s->arena.header; - uint32_t max_bits = Log2Floor(alphabet_size_max - 1); - uint32_t i = h->sub_loop_counter; - uint32_t num_symbols = h->symbol; + uint32_t max_bits = Log2Floor(alphabet_size - 1); + uint32_t i = s->sub_loop_counter; + uint32_t num_symbols = s->symbol; while (i <= num_symbols) { uint32_t v; if (BROTLI_PREDICT_FALSE(!BrotliSafeReadBits(br, max_bits, &v))) { - h->sub_loop_counter = i; - h->substate_huffman = BROTLI_STATE_HUFFMAN_SIMPLE_READ; + s->sub_loop_counter = i; + s->substate_huffman = BROTLI_STATE_HUFFMAN_SIMPLE_READ; return BROTLI_DECODER_NEEDS_MORE_INPUT; } - if (v >= alphabet_size_limit) { + if (v >= max_symbol) { return BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET); } - h->symbols_lists_array[i] = (uint16_t)v; - BROTLI_LOG_UINT(h->symbols_lists_array[i]); + s->symbols_lists_array[i] = (uint16_t)v; + BROTLI_LOG_UINT(s->symbols_lists_array[i]); ++i; } for (i = 0; i < num_symbols; ++i) { uint32_t k = i + 1; for (; k <= num_symbols; ++k) { - if (h->symbols_lists_array[i] == h->symbols_lists_array[k]) { + if (s->symbols_lists_array[i] == s->symbols_lists_array[k]) { return BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME); } } @@ -593,28 +588,27 @@ static BROTLI_INLINE void ProcessRepeatedCodeLength(uint32_t code_len, static BrotliDecoderErrorCode ReadSymbolCodeLengths( uint32_t alphabet_size, BrotliDecoderState* s) { BrotliBitReader* br = &s->br; - BrotliMetablockHeaderArena* h = &s->arena.header; - uint32_t symbol = h->symbol; - uint32_t repeat = h->repeat; - uint32_t space = h->space; - uint32_t prev_code_len = h->prev_code_len; - uint32_t repeat_code_len = h->repeat_code_len; - uint16_t* symbol_lists = h->symbol_lists; - uint16_t* code_length_histo = h->code_length_histo; - int* next_symbol = h->next_symbol; + uint32_t symbol = s->symbol; + uint32_t repeat = s->repeat; + uint32_t space = s->space; + uint32_t prev_code_len = s->prev_code_len; + uint32_t repeat_code_len = s->repeat_code_len; + uint16_t* symbol_lists = s->symbol_lists; + uint16_t* code_length_histo = s->code_length_histo; + int* next_symbol = s->next_symbol; if (!BrotliWarmupBitReader(br)) { return BROTLI_DECODER_NEEDS_MORE_INPUT; } while (symbol < alphabet_size && space > 0) { - const HuffmanCode* p = h->table; + const HuffmanCode* p = s->table; uint32_t code_len; BROTLI_HC_MARK_TABLE_FOR_FAST_LOAD(p); if (!BrotliCheckInputAmount(br, BROTLI_SHORT_FILL_BIT_WINDOW_READ)) { - h->symbol = symbol; - h->repeat = repeat; - h->prev_code_len = prev_code_len; - h->repeat_code_len = repeat_code_len; - h->space = space; + s->symbol = symbol; + s->repeat = repeat; + s->prev_code_len = prev_code_len; + s->repeat_code_len = repeat_code_len; + s->space = space; return BROTLI_DECODER_NEEDS_MORE_INPUT; } BrotliFillBitWindow16(br); @@ -636,17 +630,16 @@ static BrotliDecoderErrorCode ReadSymbolCodeLengths( symbol_lists, code_length_histo, next_symbol); } } - h->space = space; + s->space = space; return BROTLI_DECODER_SUCCESS; } static BrotliDecoderErrorCode SafeReadSymbolCodeLengths( uint32_t alphabet_size, BrotliDecoderState* s) { BrotliBitReader* br = &s->br; - BrotliMetablockHeaderArena* h = &s->arena.header; BROTLI_BOOL get_byte = BROTLI_FALSE; - while (h->symbol < alphabet_size && h->space > 0) { - const HuffmanCode* p = h->table; + while (s->symbol < alphabet_size && s->space > 0) { + const HuffmanCode* p = s->table; uint32_t code_len; uint32_t available_bits; uint32_t bits = 0; @@ -666,9 +659,9 @@ static BrotliDecoderErrorCode SafeReadSymbolCodeLengths( code_len = BROTLI_HC_FAST_LOAD_VALUE(p); /* code_len == 0..17 */ if (code_len < BROTLI_REPEAT_PREVIOUS_CODE_LENGTH) { BrotliDropBits(br, BROTLI_HC_FAST_LOAD_BITS(p)); - ProcessSingleCodeLength(code_len, &h->symbol, &h->repeat, &h->space, - &h->prev_code_len, h->symbol_lists, h->code_length_histo, - h->next_symbol); + ProcessSingleCodeLength(code_len, &s->symbol, &s->repeat, &s->space, + &s->prev_code_len, s->symbol_lists, s->code_length_histo, + s->next_symbol); } else { /* code_len == 16..17, extra_bits == 2..3 */ uint32_t extra_bits = code_len - 14U; uint32_t repeat_delta = (bits >> BROTLI_HC_FAST_LOAD_BITS(p)) & @@ -679,9 +672,9 @@ static BrotliDecoderErrorCode SafeReadSymbolCodeLengths( } BrotliDropBits(br, BROTLI_HC_FAST_LOAD_BITS(p) + extra_bits); ProcessRepeatedCodeLength(code_len, repeat_delta, alphabet_size, - &h->symbol, &h->repeat, &h->space, &h->prev_code_len, - &h->repeat_code_len, h->symbol_lists, h->code_length_histo, - h->next_symbol); + &s->symbol, &s->repeat, &s->space, &s->prev_code_len, + &s->repeat_code_len, s->symbol_lists, s->code_length_histo, + s->next_symbol); } } return BROTLI_DECODER_SUCCESS; @@ -691,10 +684,9 @@ static BrotliDecoderErrorCode SafeReadSymbolCodeLengths( Each code is 2..4 bits long. In total 30..72 bits are used. */ static BrotliDecoderErrorCode ReadCodeLengthCodeLengths(BrotliDecoderState* s) { BrotliBitReader* br = &s->br; - BrotliMetablockHeaderArena* h = &s->arena.header; - uint32_t num_codes = h->repeat; - unsigned space = h->space; - uint32_t i = h->sub_loop_counter; + uint32_t num_codes = s->repeat; + unsigned space = s->space; + uint32_t i = s->sub_loop_counter; for (; i < BROTLI_CODE_LENGTH_CODES; ++i) { const uint8_t code_len_idx = kCodeLengthCodeOrder[i]; uint32_t ix; @@ -707,21 +699,21 @@ static BrotliDecoderErrorCode ReadCodeLengthCodeLengths(BrotliDecoderState* s) { ix = 0; } if (kCodeLengthPrefixLength[ix] > available_bits) { - h->sub_loop_counter = i; - h->repeat = num_codes; - h->space = space; - h->substate_huffman = BROTLI_STATE_HUFFMAN_COMPLEX; + s->sub_loop_counter = i; + s->repeat = num_codes; + s->space = space; + s->substate_huffman = BROTLI_STATE_HUFFMAN_COMPLEX; return BROTLI_DECODER_NEEDS_MORE_INPUT; } } v = kCodeLengthPrefixValue[ix]; BrotliDropBits(br, kCodeLengthPrefixLength[ix]); - h->code_length_code_lengths[code_len_idx] = (uint8_t)v; - BROTLI_LOG_ARRAY_INDEX(h->code_length_code_lengths, code_len_idx); + s->code_length_code_lengths[code_len_idx] = (uint8_t)v; + BROTLI_LOG_ARRAY_INDEX(s->code_length_code_lengths, code_len_idx); if (v != 0) { space = space - (32U >> v); ++num_codes; - ++h->code_length_histo[v]; + ++s->code_length_histo[v]; if (space - 1U >= 32U) { /* space is 0 or wrapped around. */ break; @@ -745,48 +737,49 @@ static BrotliDecoderErrorCode ReadCodeLengthCodeLengths(BrotliDecoderState* s) { encoded with predefined entropy code. 32 - 74 bits are used. B.2) Decoded table is used to decode code lengths of symbols in resulting Huffman table. In worst case 3520 bits are read. */ -static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size_max, - uint32_t alphabet_size_limit, +static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size, + uint32_t max_symbol, HuffmanCode* table, uint32_t* opt_table_size, BrotliDecoderState* s) { BrotliBitReader* br = &s->br; - BrotliMetablockHeaderArena* h = &s->arena.header; + /* Unnecessary masking, but might be good for safety. */ + alphabet_size &= 0x7FF; /* State machine. */ for (;;) { - switch (h->substate_huffman) { + switch (s->substate_huffman) { case BROTLI_STATE_HUFFMAN_NONE: - if (!BrotliSafeReadBits(br, 2, &h->sub_loop_counter)) { + if (!BrotliSafeReadBits(br, 2, &s->sub_loop_counter)) { return BROTLI_DECODER_NEEDS_MORE_INPUT; } - BROTLI_LOG_UINT(h->sub_loop_counter); + BROTLI_LOG_UINT(s->sub_loop_counter); /* The value is used as follows: 1 for simple code; 0 for no skipping, 2 skips 2 code lengths, 3 skips 3 code lengths */ - if (h->sub_loop_counter != 1) { - h->space = 32; - h->repeat = 0; /* num_codes */ - memset(&h->code_length_histo[0], 0, sizeof(h->code_length_histo[0]) * + if (s->sub_loop_counter != 1) { + s->space = 32; + s->repeat = 0; /* num_codes */ + memset(&s->code_length_histo[0], 0, sizeof(s->code_length_histo[0]) * (BROTLI_HUFFMAN_MAX_CODE_LENGTH_CODE_LENGTH + 1)); - memset(&h->code_length_code_lengths[0], 0, - sizeof(h->code_length_code_lengths)); - h->substate_huffman = BROTLI_STATE_HUFFMAN_COMPLEX; + memset(&s->code_length_code_lengths[0], 0, + sizeof(s->code_length_code_lengths)); + s->substate_huffman = BROTLI_STATE_HUFFMAN_COMPLEX; continue; } /* Fall through. */ case BROTLI_STATE_HUFFMAN_SIMPLE_SIZE: /* Read symbols, codes & code lengths directly. */ - if (!BrotliSafeReadBits(br, 2, &h->symbol)) { /* num_symbols */ - h->substate_huffman = BROTLI_STATE_HUFFMAN_SIMPLE_SIZE; + if (!BrotliSafeReadBits(br, 2, &s->symbol)) { /* num_symbols */ + s->substate_huffman = BROTLI_STATE_HUFFMAN_SIMPLE_SIZE; return BROTLI_DECODER_NEEDS_MORE_INPUT; } - h->sub_loop_counter = 0; + s->sub_loop_counter = 0; /* Fall through. */ case BROTLI_STATE_HUFFMAN_SIMPLE_READ: { BrotliDecoderErrorCode result = - ReadSimpleHuffmanSymbols(alphabet_size_max, alphabet_size_limit, s); + ReadSimpleHuffmanSymbols(alphabet_size, max_symbol, s); if (result != BROTLI_DECODER_SUCCESS) { return result; } @@ -795,21 +788,21 @@ static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size_max, case BROTLI_STATE_HUFFMAN_SIMPLE_BUILD: { uint32_t table_size; - if (h->symbol == 3) { + if (s->symbol == 3) { uint32_t bits; if (!BrotliSafeReadBits(br, 1, &bits)) { - h->substate_huffman = BROTLI_STATE_HUFFMAN_SIMPLE_BUILD; + s->substate_huffman = BROTLI_STATE_HUFFMAN_SIMPLE_BUILD; return BROTLI_DECODER_NEEDS_MORE_INPUT; } - h->symbol += bits; + s->symbol += bits; } - BROTLI_LOG_UINT(h->symbol); + BROTLI_LOG_UINT(s->symbol); table_size = BrotliBuildSimpleHuffmanTable( - table, HUFFMAN_TABLE_BITS, h->symbols_lists_array, h->symbol); + table, HUFFMAN_TABLE_BITS, s->symbols_lists_array, s->symbol); if (opt_table_size) { *opt_table_size = table_size; } - h->substate_huffman = BROTLI_STATE_HUFFMAN_NONE; + s->substate_huffman = BROTLI_STATE_HUFFMAN_NONE; return BROTLI_DECODER_SUCCESS; } @@ -820,45 +813,44 @@ static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size_max, if (result != BROTLI_DECODER_SUCCESS) { return result; } - BrotliBuildCodeLengthsHuffmanTable(h->table, - h->code_length_code_lengths, - h->code_length_histo); - memset(&h->code_length_histo[0], 0, sizeof(h->code_length_histo)); + BrotliBuildCodeLengthsHuffmanTable(s->table, + s->code_length_code_lengths, + s->code_length_histo); + memset(&s->code_length_histo[0], 0, sizeof(s->code_length_histo)); for (i = 0; i <= BROTLI_HUFFMAN_MAX_CODE_LENGTH; ++i) { - h->next_symbol[i] = (int)i - (BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1); - h->symbol_lists[h->next_symbol[i]] = 0xFFFF; + s->next_symbol[i] = (int)i - (BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1); + s->symbol_lists[s->next_symbol[i]] = 0xFFFF; } - h->symbol = 0; - h->prev_code_len = BROTLI_INITIAL_REPEATED_CODE_LENGTH; - h->repeat = 0; - h->repeat_code_len = 0; - h->space = 32768; - h->substate_huffman = BROTLI_STATE_HUFFMAN_LENGTH_SYMBOLS; + s->symbol = 0; + s->prev_code_len = BROTLI_INITIAL_REPEATED_CODE_LENGTH; + s->repeat = 0; + s->repeat_code_len = 0; + s->space = 32768; + s->substate_huffman = BROTLI_STATE_HUFFMAN_LENGTH_SYMBOLS; } /* Fall through. */ case BROTLI_STATE_HUFFMAN_LENGTH_SYMBOLS: { uint32_t table_size; - BrotliDecoderErrorCode result = ReadSymbolCodeLengths( - alphabet_size_limit, s); + BrotliDecoderErrorCode result = ReadSymbolCodeLengths(max_symbol, s); if (result == BROTLI_DECODER_NEEDS_MORE_INPUT) { - result = SafeReadSymbolCodeLengths(alphabet_size_limit, s); + result = SafeReadSymbolCodeLengths(max_symbol, s); } if (result != BROTLI_DECODER_SUCCESS) { return result; } - if (h->space != 0) { - BROTLI_LOG(("[ReadHuffmanCode] space = %d\n", (int)h->space)); + if (s->space != 0) { + BROTLI_LOG(("[ReadHuffmanCode] space = %d\n", (int)s->space)); return BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE); } table_size = BrotliBuildHuffmanTable( - table, HUFFMAN_TABLE_BITS, h->symbol_lists, h->code_length_histo); + table, HUFFMAN_TABLE_BITS, s->symbol_lists, s->code_length_histo); if (opt_table_size) { *opt_table_size = table_size; } - h->substate_huffman = BROTLI_STATE_HUFFMAN_NONE; + s->substate_huffman = BROTLI_STATE_HUFFMAN_NONE; return BROTLI_DECODER_SUCCESS; } @@ -875,8 +867,8 @@ static BROTLI_INLINE uint32_t ReadBlockLength(const HuffmanCode* table, uint32_t code; uint32_t nbits; code = ReadSymbol(table, br); - nbits = _kBrotliPrefixCodeRanges[code].nbits; /* nbits == 2..24 */ - return _kBrotliPrefixCodeRanges[code].offset + BrotliReadBits24(br, nbits); + nbits = kBlockLengthPrefixCode[code].nbits; /* nbits == 2..24 */ + return kBlockLengthPrefixCode[code].offset + BrotliReadBits(br, nbits); } /* WARNING: if state is not BROTLI_STATE_READ_BLOCK_LENGTH_NONE, then @@ -894,14 +886,13 @@ static BROTLI_INLINE BROTLI_BOOL SafeReadBlockLength( } { uint32_t bits; - uint32_t nbits = _kBrotliPrefixCodeRanges[index].nbits; - uint32_t offset = _kBrotliPrefixCodeRanges[index].offset; + uint32_t nbits = kBlockLengthPrefixCode[index].nbits; /* nbits == 2..24 */ if (!BrotliSafeReadBits(br, nbits, &bits)) { s->block_length_index = index; s->substate_read_block_length = BROTLI_STATE_READ_BLOCK_LENGTH_SUFFIX; return BROTLI_FALSE; } - *result = offset + bits; + *result = kBlockLengthPrefixCode[index].offset + bits; s->substate_read_block_length = BROTLI_STATE_READ_BLOCK_LENGTH_NONE; return BROTLI_TRUE; } @@ -961,22 +952,22 @@ static BROTLI_NOINLINE void InverseMoveToFrontTransform( /* Decodes a series of Huffman table using ReadHuffmanCode function. */ static BrotliDecoderErrorCode HuffmanTreeGroupDecode( HuffmanTreeGroup* group, BrotliDecoderState* s) { - BrotliMetablockHeaderArena* h = &s->arena.header; - if (h->substate_tree_group != BROTLI_STATE_TREE_GROUP_LOOP) { - h->next = group->codes; - h->htree_index = 0; - h->substate_tree_group = BROTLI_STATE_TREE_GROUP_LOOP; + if (s->substate_tree_group != BROTLI_STATE_TREE_GROUP_LOOP) { + s->next = group->codes; + s->htree_index = 0; + s->substate_tree_group = BROTLI_STATE_TREE_GROUP_LOOP; } - while (h->htree_index < group->num_htrees) { + while (s->htree_index < group->num_htrees) { uint32_t table_size; - BrotliDecoderErrorCode result = ReadHuffmanCode(group->alphabet_size_max, - group->alphabet_size_limit, h->next, &table_size, s); + BrotliDecoderErrorCode result = + ReadHuffmanCode(group->alphabet_size, group->max_symbol, + s->next, &table_size, s); if (result != BROTLI_DECODER_SUCCESS) return result; - group->htrees[h->htree_index] = h->next; - h->next += table_size; - ++h->htree_index; + group->htrees[s->htree_index] = s->next; + s->next += table_size; + ++s->htree_index; } - h->substate_tree_group = BROTLI_STATE_TREE_GROUP_NONE; + s->substate_tree_group = BROTLI_STATE_TREE_GROUP_NONE; return BROTLI_DECODER_SUCCESS; } @@ -994,16 +985,15 @@ static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size, BrotliDecoderState* s) { BrotliBitReader* br = &s->br; BrotliDecoderErrorCode result = BROTLI_DECODER_SUCCESS; - BrotliMetablockHeaderArena* h = &s->arena.header; - switch ((int)h->substate_context_map) { + switch ((int)s->substate_context_map) { case BROTLI_STATE_CONTEXT_MAP_NONE: result = DecodeVarLenUint8(s, br, num_htrees); if (result != BROTLI_DECODER_SUCCESS) { return result; } (*num_htrees)++; - h->context_index = 0; + s->context_index = 0; BROTLI_LOG_UINT(context_map_size); BROTLI_LOG_UINT(*num_htrees); *context_map_arg = @@ -1015,7 +1005,7 @@ static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size, memset(*context_map_arg, 0, (size_t)context_map_size); return BROTLI_DECODER_SUCCESS; } - h->substate_context_map = BROTLI_STATE_CONTEXT_MAP_READ_PREFIX; + s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_READ_PREFIX; /* Fall through. */ case BROTLI_STATE_CONTEXT_MAP_READ_PREFIX: { @@ -1026,38 +1016,38 @@ static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size, return BROTLI_DECODER_NEEDS_MORE_INPUT; } if ((bits & 1) != 0) { /* Use RLE for zeros. */ - h->max_run_length_prefix = (bits >> 1) + 1; + s->max_run_length_prefix = (bits >> 1) + 1; BrotliDropBits(br, 5); } else { - h->max_run_length_prefix = 0; + s->max_run_length_prefix = 0; BrotliDropBits(br, 1); } - BROTLI_LOG_UINT(h->max_run_length_prefix); - h->substate_context_map = BROTLI_STATE_CONTEXT_MAP_HUFFMAN; + BROTLI_LOG_UINT(s->max_run_length_prefix); + s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_HUFFMAN; } /* Fall through. */ case BROTLI_STATE_CONTEXT_MAP_HUFFMAN: { - uint32_t alphabet_size = *num_htrees + h->max_run_length_prefix; + uint32_t alphabet_size = *num_htrees + s->max_run_length_prefix; result = ReadHuffmanCode(alphabet_size, alphabet_size, - h->context_map_table, NULL, s); + s->context_map_table, NULL, s); if (result != BROTLI_DECODER_SUCCESS) return result; - h->code = 0xFFFF; - h->substate_context_map = BROTLI_STATE_CONTEXT_MAP_DECODE; + s->code = 0xFFFF; + s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_DECODE; } /* Fall through. */ case BROTLI_STATE_CONTEXT_MAP_DECODE: { - uint32_t context_index = h->context_index; - uint32_t max_run_length_prefix = h->max_run_length_prefix; + uint32_t context_index = s->context_index; + uint32_t max_run_length_prefix = s->max_run_length_prefix; uint8_t* context_map = *context_map_arg; - uint32_t code = h->code; + uint32_t code = s->code; BROTLI_BOOL skip_preamble = (code != 0xFFFF); while (context_index < context_map_size || skip_preamble) { if (!skip_preamble) { - if (!SafeReadSymbol(h->context_map_table, br, &code)) { - h->code = 0xFFFF; - h->context_index = context_index; + if (!SafeReadSymbol(s->context_map_table, br, &code)) { + s->code = 0xFFFF; + s->context_index = context_index; return BROTLI_DECODER_NEEDS_MORE_INPUT; } BROTLI_LOG_UINT(code); @@ -1078,8 +1068,8 @@ static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size, { uint32_t reps; if (!BrotliSafeReadBits(br, code, &reps)) { - h->code = code; - h->context_index = context_index; + s->code = code; + s->context_index = context_index; return BROTLI_DECODER_NEEDS_MORE_INPUT; } reps += 1U << code; @@ -1099,13 +1089,13 @@ static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size, case BROTLI_STATE_CONTEXT_MAP_TRANSFORM: { uint32_t bits; if (!BrotliSafeReadBits(br, 1, &bits)) { - h->substate_context_map = BROTLI_STATE_CONTEXT_MAP_TRANSFORM; + s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_TRANSFORM; return BROTLI_DECODER_NEEDS_MORE_INPUT; } if (bits != 0) { InverseMoveToFrontTransform(*context_map_arg, context_map_size, s); } - h->substate_context_map = BROTLI_STATE_CONTEXT_MAP_NONE; + s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_NONE; return BROTLI_DECODER_SUCCESS; } @@ -1467,28 +1457,32 @@ static BrotliDecoderErrorCode ReadContextModes(BrotliDecoderState* s) { } static BROTLI_INLINE void TakeDistanceFromRingBuffer(BrotliDecoderState* s) { - int offset = s->distance_code - 3; - if (s->distance_code <= 3) { + if (s->distance_code == 0) { + --s->dist_rb_idx; + s->distance_code = s->dist_rb[s->dist_rb_idx & 3]; /* Compensate double distance-ring-buffer roll for dictionary items. */ - s->distance_context = 1 >> s->distance_code; - s->distance_code = s->dist_rb[(s->dist_rb_idx - offset) & 3]; - s->dist_rb_idx -= s->distance_context; + s->distance_context = 1; } else { - int index_delta = 3; - int delta; - int base = s->distance_code - 10; - if (s->distance_code < 10) { - base = s->distance_code - 4; + int distance_code = s->distance_code << 1; + /* kDistanceShortCodeIndexOffset has 2-bit values from LSB: + 3, 2, 1, 0, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2 */ + const uint32_t kDistanceShortCodeIndexOffset = 0xAAAFFF1B; + /* kDistanceShortCodeValueOffset has 2-bit values from LSB: + -0, 0,-0, 0,-1, 1,-2, 2,-3, 3,-1, 1,-2, 2,-3, 3 */ + const uint32_t kDistanceShortCodeValueOffset = 0xFA5FA500; + int v = (s->dist_rb_idx + + (int)(kDistanceShortCodeIndexOffset >> distance_code)) & 0x3; + s->distance_code = s->dist_rb[v]; + v = (int)(kDistanceShortCodeValueOffset >> distance_code) & 0x3; + if ((distance_code & 0x3) != 0) { + s->distance_code += v; } else { - index_delta = 2; - } - /* Unpack one of six 4-bit values. */ - delta = ((0x605142 >> (4 * base)) & 0xF) - 3; - s->distance_code = s->dist_rb[(s->dist_rb_idx + index_delta) & 0x3] + delta; - if (s->distance_code <= 0) { - /* A huge distance will cause a BROTLI_FAILURE() soon. - This is a little faster than failing here. */ - s->distance_code = 0x7FFFFFFF; + s->distance_code -= v; + if (s->distance_code <= 0) { + /* A huge distance will cause a BROTLI_FAILURE() soon. + This is a little faster than failing here. */ + s->distance_code = 0x7FFFFFFF; + } } } } @@ -1503,153 +1497,62 @@ static BROTLI_INLINE BROTLI_BOOL SafeReadBits( } } -static BROTLI_INLINE BROTLI_BOOL SafeReadBits32( - BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) { - if (n_bits != 0) { - return BrotliSafeReadBits32(br, n_bits, val); - } else { - *val = 0; - return BROTLI_TRUE; - } -} - -/* - RFC 7932 Section 4 with "..." shortenings and "[]" emendations. - - Each distance ... is represented with a pair ... - The distance code is encoded using a prefix code... The number of extra bits - can be 0..24... Two additional parameters: NPOSTFIX (0..3), and ... - NDIRECT (0..120) ... are encoded in the meta-block header... - - The first 16 distance symbols ... reference past distances... ring buffer ... - Next NDIRECT distance symbols ... represent distances from 1 to NDIRECT... - [For] distance symbols 16 + NDIRECT and greater ... the number of extra bits - ... is given by the following formula: - - [ xcode = dcode - NDIRECT - 16 ] - ndistbits = 1 + [ xcode ] >> (NPOSTFIX + 1) - - ... -*/ - -/* - RFC 7932 Section 9.2 with "..." shortenings and "[]" emendations. - - ... to get the actual value of the parameter NDIRECT, left-shift this - four-bit number by NPOSTFIX bits ... -*/ - -/* Remaining formulas from RFC 7932 Section 4 could be rewritten as following: - - alphabet_size = 16 + NDIRECT + (max_distbits << (NPOSTFIX + 1)) - - half = ((xcode >> NPOSTFIX) & 1) << ndistbits - postfix = xcode & ((1 << NPOSTFIX) - 1) - range_start = 2 * (1 << ndistbits - 1 - 1) - - distance = (range_start + half + extra) << NPOSTFIX + postfix + NDIRECT + 1 - - NB: ndistbits >= 1 -> range_start >= 0 - NB: range_start has factor 2, as the range is covered by 2 "halves" - NB: extra -1 offset in range_start formula covers the absence of - ndistbits = 0 case - NB: when NPOSTFIX = 0, NDIRECT is not greater than 15 - - In other words, xcode has the following binary structure - XXXHPPP: - - XXX represent the number of extra distance bits - - H selects upper / lower range of distances - - PPP represent "postfix" - - "Regular" distance encoding has NPOSTFIX = 0; omitting the postfix part - simplifies distance calculation. - - Using NPOSTFIX > 0 allows cheaper encoding of regular structures, e.g. where - most of distances have the same reminder of division by 2/4/8. For example, - the table of int32_t values that come from different sources; if it is likely - that 3 highest bytes of values from the same source are the same, then - copy distance often looks like 4x + y. - - Distance calculation could be rewritten to: - - ndistbits = NDISTBITS(NDIRECT, NPOSTFIX)[dcode] - distance = OFFSET(NDIRECT, NPOSTFIX)[dcode] + extra << NPOSTFIX - - NDISTBITS and OFFSET could be pre-calculated, as NDIRECT and NPOSTFIX could - change only once per meta-block. -*/ - -/* Calculates distance lookup table. - NB: it is possible to have all 64 tables precalculated. */ -static void CalculateDistanceLut(BrotliDecoderState* s) { - BrotliMetablockBodyArena* b = &s->arena.body; - uint32_t npostfix = s->distance_postfix_bits; - uint32_t ndirect = s->num_direct_distance_codes; - uint32_t alphabet_size_limit = s->distance_hgroup.alphabet_size_limit; - uint32_t postfix = 1u << npostfix; - uint32_t j; - uint32_t bits = 1; - uint32_t half = 0; - - /* Skip short codes. */ - uint32_t i = BROTLI_NUM_DISTANCE_SHORT_CODES; - - /* Fill direct codes. */ - for (j = 0; j < ndirect; ++j) { - b->dist_extra_bits[i] = 0; - b->dist_offset[i] = j + 1; - ++i; - } - - /* Fill regular distance codes. */ - while (i < alphabet_size_limit) { - uint32_t base = ndirect + ((((2 + half) << bits) - 4) << npostfix) + 1; - /* Always fill the complete group. */ - for (j = 0; j < postfix; ++j) { - b->dist_extra_bits[i] = (uint8_t)bits; - b->dist_offset[i] = base + j; - ++i; - } - bits = bits + half; - half = half ^ 1; - } -} - /* Precondition: s->distance_code < 0. */ static BROTLI_INLINE BROTLI_BOOL ReadDistanceInternal( int safe, BrotliDecoderState* s, BrotliBitReader* br) { - BrotliMetablockBodyArena* b = &s->arena.body; - uint32_t code; - uint32_t bits; + int distval; BrotliBitReaderState memento; HuffmanCode* distance_tree = s->distance_hgroup.htrees[s->dist_htree_index]; if (!safe) { - code = ReadSymbol(distance_tree, br); + s->distance_code = (int)ReadSymbol(distance_tree, br); } else { + uint32_t code; BrotliBitReaderSaveState(br, &memento); if (!SafeReadSymbol(distance_tree, br, &code)) { return BROTLI_FALSE; } + s->distance_code = (int)code; } - --s->block_length[2]; /* Convert the distance code to the actual distance by possibly - looking up past distances from the s->dist_rb. */ + looking up past distances from the s->ringbuffer. */ s->distance_context = 0; - if ((code & ~0xFu) == 0) { - s->distance_code = (int)code; + if ((s->distance_code & ~0xF) == 0) { TakeDistanceFromRingBuffer(s); + --s->block_length[2]; return BROTLI_TRUE; } - if (!safe) { - bits = BrotliReadBits32(br, b->dist_extra_bits[code]); - } else { - if (!SafeReadBits32(br, b->dist_extra_bits[code], &bits)) { - ++s->block_length[2]; - BrotliBitReaderRestoreState(br, &memento); - return BROTLI_FALSE; + distval = s->distance_code - (int)s->num_direct_distance_codes; + if (distval >= 0) { + uint32_t nbits; + int postfix; + int offset; + if (!safe && (s->distance_postfix_bits == 0)) { + nbits = ((uint32_t)distval >> 1) + 1; + offset = ((2 + (distval & 1)) << nbits) - 4; + s->distance_code = (int)s->num_direct_distance_codes + offset + + (int)BrotliReadBits(br, nbits); + } else { + /* This branch also works well when s->distance_postfix_bits == 0. */ + uint32_t bits; + postfix = distval & s->distance_postfix_mask; + distval >>= s->distance_postfix_bits; + nbits = ((uint32_t)distval >> 1) + 1; + if (safe) { + if (!SafeReadBits(br, nbits, &bits)) { + s->distance_code = -1; /* Restore precondition. */ + BrotliBitReaderRestoreState(br, &memento); + return BROTLI_FALSE; + } + } else { + bits = BrotliReadBits(br, nbits); + } + offset = ((2 + (distval & 1)) << nbits) - 4; + s->distance_code = (int)s->num_direct_distance_codes + + ((offset + (int)bits) << s->distance_postfix_bits) + postfix; } } - s->distance_code = - (int)(b->dist_offset[code] + (bits << s->distance_postfix_bits)); + s->distance_code = s->distance_code - BROTLI_NUM_DISTANCE_SHORT_CODES + 1; + --s->block_length[2]; return BROTLI_TRUE; } @@ -1685,9 +1588,9 @@ static BROTLI_INLINE BROTLI_BOOL ReadCommandInternal( *insert_length = v.insert_len_offset; if (!safe) { if (BROTLI_PREDICT_FALSE(v.insert_len_extra_bits != 0)) { - insert_len_extra = BrotliReadBits24(br, v.insert_len_extra_bits); + insert_len_extra = BrotliReadBits(br, v.insert_len_extra_bits); } - copy_length = BrotliReadBits24(br, v.copy_len_extra_bits); + copy_length = BrotliReadBits(br, v.copy_len_extra_bits); } else { if (!SafeReadBits(br, v.insert_len_extra_bits, &insert_len_extra) || !SafeReadBits(br, v.copy_len_extra_bits, ©_length)) { @@ -2032,6 +1935,21 @@ static BROTLI_NOINLINE BrotliDecoderErrorCode SafeProcessCommands( return ProcessCommandsInternal(1, s); } +/* Returns the maximum number of distance symbols which can only represent + distances not exceeding BROTLI_MAX_ALLOWED_DISTANCE. */ +static uint32_t BrotliMaxDistanceSymbol(uint32_t ndirect, uint32_t npostfix) { + static const uint32_t bound[BROTLI_MAX_NPOSTFIX + 1] = {0, 4, 12, 28}; + static const uint32_t diff[BROTLI_MAX_NPOSTFIX + 1] = {73, 126, 228, 424}; + uint32_t postfix = 1U << npostfix; + if (ndirect < bound[npostfix]) { + return ndirect + diff[npostfix] + postfix; + } else if (ndirect > bound[npostfix] + postfix) { + return ndirect + diff[npostfix]; + } else { + return bound[npostfix] + diff[npostfix] + postfix; + } +} + BrotliDecoderResult BrotliDecoderDecompress( size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size, uint8_t* decoded_buffer) { @@ -2249,23 +2167,33 @@ BrotliDecoderResult BrotliDecoderDecompressStream( s->state = BROTLI_STATE_UNCOMPRESSED; break; } - s->state = BROTLI_STATE_BEFORE_COMPRESSED_METABLOCK_HEADER; - /* Fall through. */ - - case BROTLI_STATE_BEFORE_COMPRESSED_METABLOCK_HEADER: { - BrotliMetablockHeaderArena* h = &s->arena.header; s->loop_counter = 0; - /* Initialize compressed metablock header arena. */ - h->sub_loop_counter = 0; - /* Make small negative indexes addressable. */ - h->symbol_lists = - &h->symbols_lists_array[BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1]; - h->substate_huffman = BROTLI_STATE_HUFFMAN_NONE; - h->substate_tree_group = BROTLI_STATE_TREE_GROUP_NONE; - h->substate_context_map = BROTLI_STATE_CONTEXT_MAP_NONE; s->state = BROTLI_STATE_HUFFMAN_CODE_0; + break; + + case BROTLI_STATE_UNCOMPRESSED: { + result = CopyUncompressedBlockToOutput( + available_out, next_out, total_out, s); + if (result != BROTLI_DECODER_SUCCESS) { + break; + } + s->state = BROTLI_STATE_METABLOCK_DONE; + break; } - /* Fall through. */ + + case BROTLI_STATE_METADATA: + for (; s->meta_block_remaining_len > 0; --s->meta_block_remaining_len) { + uint32_t bits; + /* Read one byte and ignore it. */ + if (!BrotliSafeReadBits(br, 8, &bits)) { + result = BROTLI_DECODER_NEEDS_MORE_INPUT; + break; + } + } + if (result == BROTLI_DECODER_SUCCESS) { + s->state = BROTLI_STATE_METABLOCK_DONE; + } + break; case BROTLI_STATE_HUFFMAN_CODE_0: if (s->loop_counter >= 3) { @@ -2319,30 +2247,6 @@ BrotliDecoderResult BrotliDecoderDecompressStream( break; } - case BROTLI_STATE_UNCOMPRESSED: { - result = CopyUncompressedBlockToOutput( - available_out, next_out, total_out, s); - if (result != BROTLI_DECODER_SUCCESS) { - break; - } - s->state = BROTLI_STATE_METABLOCK_DONE; - break; - } - - case BROTLI_STATE_METADATA: - for (; s->meta_block_remaining_len > 0; --s->meta_block_remaining_len) { - uint32_t bits; - /* Read one byte and ignore it. */ - if (!BrotliSafeReadBits(br, 8, &bits)) { - result = BROTLI_DECODER_NEEDS_MORE_INPUT; - break; - } - } - if (result == BROTLI_DECODER_SUCCESS) { - s->state = BROTLI_STATE_METABLOCK_DONE; - } - break; - case BROTLI_STATE_METABLOCK_HEADER_2: { uint32_t bits; if (!BrotliSafeReadBits(br, 6, &bits)) { @@ -2351,9 +2255,11 @@ BrotliDecoderResult BrotliDecoderDecompressStream( } s->distance_postfix_bits = bits & BitMask(2); bits >>= 2; - s->num_direct_distance_codes = bits << s->distance_postfix_bits; + s->num_direct_distance_codes = BROTLI_NUM_DISTANCE_SHORT_CODES + + (bits << s->distance_postfix_bits); BROTLI_LOG_UINT(s->num_direct_distance_codes); BROTLI_LOG_UINT(s->distance_postfix_bits); + s->distance_postfix_mask = (int)BitMask(s->distance_postfix_bits); s->context_modes = (uint8_t*)BROTLI_DECODER_ALLOC(s, (size_t)s->num_block_types[0]); if (s->context_modes == 0) { @@ -2385,19 +2291,17 @@ BrotliDecoderResult BrotliDecoderDecompressStream( /* Fall through. */ case BROTLI_STATE_CONTEXT_MAP_2: { - uint32_t npostfix = s->distance_postfix_bits; - uint32_t ndirect = s->num_direct_distance_codes; - uint32_t distance_alphabet_size_max = BROTLI_DISTANCE_ALPHABET_SIZE( - npostfix, ndirect, BROTLI_MAX_DISTANCE_BITS); - uint32_t distance_alphabet_size_limit = distance_alphabet_size_max; + uint32_t num_direct_codes = + s->num_direct_distance_codes - BROTLI_NUM_DISTANCE_SHORT_CODES; + uint32_t num_distance_codes = BROTLI_DISTANCE_ALPHABET_SIZE( + s->distance_postfix_bits, num_direct_codes, + (s->large_window ? BROTLI_LARGE_MAX_DISTANCE_BITS : + BROTLI_MAX_DISTANCE_BITS)); + uint32_t max_distance_symbol = (s->large_window ? + BrotliMaxDistanceSymbol( + num_direct_codes, s->distance_postfix_bits) : + num_distance_codes); BROTLI_BOOL allocation_success = BROTLI_TRUE; - if (s->large_window) { - BrotliDistanceCodeLimit limit = BrotliCalculateDistanceCodeLimit( - BROTLI_MAX_ALLOWED_DISTANCE, npostfix, ndirect); - distance_alphabet_size_max = BROTLI_DISTANCE_ALPHABET_SIZE( - npostfix, ndirect, BROTLI_LARGE_MAX_DISTANCE_BITS); - distance_alphabet_size_limit = limit.max_alphabet_size; - } result = DecodeContextMap( s->num_block_types[2] << BROTLI_DISTANCE_CONTEXT_BITS, &s->num_dist_htrees, &s->dist_context_map, s); @@ -2411,8 +2315,8 @@ BrotliDecoderResult BrotliDecoderDecompressStream( s, &s->insert_copy_hgroup, BROTLI_NUM_COMMAND_SYMBOLS, BROTLI_NUM_COMMAND_SYMBOLS, s->num_block_types[1]); allocation_success &= BrotliDecoderHuffmanTreeGroupInit( - s, &s->distance_hgroup, distance_alphabet_size_max, - distance_alphabet_size_limit, s->num_dist_htrees); + s, &s->distance_hgroup, num_distance_codes, + max_distance_symbol, s->num_dist_htrees); if (!allocation_success) { return SaveErrorCode(s, BROTLI_FAILURE(BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS)); @@ -2434,24 +2338,18 @@ BrotliDecoderResult BrotliDecoderDecompressStream( result = HuffmanTreeGroupDecode(hgroup, s); if (result != BROTLI_DECODER_SUCCESS) break; s->loop_counter++; - if (s->loop_counter < 3) { - break; + if (s->loop_counter >= 3) { + PrepareLiteralDecoding(s); + s->dist_context_map_slice = s->dist_context_map; + s->htree_command = s->insert_copy_hgroup.htrees[0]; + if (!BrotliEnsureRingBuffer(s)) { + result = BROTLI_FAILURE(BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2); + break; + } + s->state = BROTLI_STATE_COMMAND_BEGIN; } - s->state = BROTLI_STATE_BEFORE_COMPRESSED_METABLOCK_BODY; + break; } - /* Fall through. */ - - case BROTLI_STATE_BEFORE_COMPRESSED_METABLOCK_BODY: - PrepareLiteralDecoding(s); - s->dist_context_map_slice = s->dist_context_map; - s->htree_command = s->insert_copy_hgroup.htrees[0]; - if (!BrotliEnsureRingBuffer(s)) { - result = BROTLI_FAILURE(BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2); - break; - } - CalculateDistanceLut(s); - s->state = BROTLI_STATE_COMMAND_BEGIN; - /* Fall through. */ case BROTLI_STATE_COMMAND_BEGIN: /* Fall through. */ diff --git a/deps/brotli/c/dec/huffman.h b/deps/brotli/c/dec/huffman.h index a8fbc453479e5d..b9f0716c160498 100644 --- a/deps/brotli/c/dec/huffman.h +++ b/deps/brotli/c/dec/huffman.h @@ -18,6 +18,12 @@ extern "C" { #define BROTLI_HUFFMAN_MAX_CODE_LENGTH 15 +/* Maximum possible Huffman table size for an alphabet size of (index * 32), + max code length 15 and root table bits 8. */ +static const uint16_t kMaxHuffmanTableSize[] = { + 256, 402, 436, 468, 500, 534, 566, 598, 630, 662, 694, 726, 758, 790, 822, + 854, 886, 920, 952, 984, 1016, 1048, 1080, 1112, 1144, 1176, 1208, 1240, 1272, + 1304, 1336, 1368, 1400, 1432, 1464, 1496, 1528}; /* BROTLI_NUM_BLOCK_LEN_SYMBOLS == 26 */ #define BROTLI_HUFFMAN_MAX_SIZE_26 396 /* BROTLI_MAX_BLOCK_TYPE_SYMBOLS == 258 */ @@ -76,7 +82,7 @@ typedef BROTLI_ALIGNED(4) uint32_t HuffmanCode; static BROTLI_INLINE HuffmanCode ConstructHuffmanCode(const uint8_t bits, const uint16_t value) { - return (HuffmanCode) ((value & 0xFFFF) << 16) | (bits & 0xFF); + return ((value & 0xFFFF) << 16) | (bits & 0xFF); } #define BROTLI_HC_MARK_TABLE_FOR_FAST_LOAD(H) uint32_t __fastload_##H = (*H) @@ -94,7 +100,7 @@ BROTLI_INTERNAL void BrotliBuildCodeLengthsHuffmanTable(HuffmanCode* root_table, /* Builds Huffman lookup table assuming code lengths are in symbol order. Returns size of resulting table. */ BROTLI_INTERNAL uint32_t BrotliBuildHuffmanTable(HuffmanCode* root_table, - int root_bits, const uint16_t* const symbol_lists, uint16_t* count); + int root_bits, const uint16_t* const symbol_lists, uint16_t* count_arg); /* Builds a simple Huffman table. The |num_symbols| parameter is to be interpreted as follows: 0 means 1 symbol, 1 means 2 symbols, @@ -104,13 +110,13 @@ BROTLI_INTERNAL uint32_t BrotliBuildSimpleHuffmanTable(HuffmanCode* table, int root_bits, uint16_t* symbols, uint32_t num_symbols); /* Contains a collection of Huffman trees with the same alphabet size. */ -/* alphabet_size_limit is needed due to simple codes, since - log2(alphabet_size_max) could be greater than log2(alphabet_size_limit). */ +/* max_symbol is needed due to simple codes since log2(alphabet_size) could be + greater than log2(max_symbol). */ typedef struct { HuffmanCode** htrees; HuffmanCode* codes; - uint16_t alphabet_size_max; - uint16_t alphabet_size_limit; + uint16_t alphabet_size; + uint16_t max_symbol; uint16_t num_htrees; } HuffmanTreeGroup; diff --git a/deps/brotli/c/dec/prefix.h b/deps/brotli/c/dec/prefix.h index 481a2c791706b8..3ea062d84a2ed6 100644 --- a/deps/brotli/c/dec/prefix.h +++ b/deps/brotli/c/dec/prefix.h @@ -13,6 +13,24 @@ #include "../common/constants.h" #include +/* Represents the range of values belonging to a prefix code: + [offset, offset + 2^nbits) */ +struct PrefixCodeRange { + uint16_t offset; + uint8_t nbits; +}; + +static const struct PrefixCodeRange + kBlockLengthPrefixCode[BROTLI_NUM_BLOCK_LEN_SYMBOLS] = { + { 1, 2}, { 5, 2}, { 9, 2}, { 13, 2}, + { 17, 3}, { 25, 3}, { 33, 3}, { 41, 3}, + { 49, 4}, { 65, 4}, { 81, 4}, { 97, 4}, + { 113, 5}, { 145, 5}, { 177, 5}, { 209, 5}, + { 241, 6}, { 305, 6}, { 369, 7}, { 497, 8}, + { 753, 9}, { 1265, 10}, {2289, 11}, {4337, 12}, + {8433, 13}, {16625, 24} +}; + typedef struct CmdLutElement { uint8_t insert_len_extra_bits; uint8_t copy_len_extra_bits; diff --git a/deps/brotli/c/dec/state.c b/deps/brotli/c/dec/state.c index f847836dda4612..e0b37c2dcd0305 100644 --- a/deps/brotli/c/dec/state.c +++ b/deps/brotli/c/dec/state.c @@ -33,7 +33,10 @@ BROTLI_BOOL BrotliDecoderStateInit(BrotliDecoderState* s, s->state = BROTLI_STATE_UNINITED; s->large_window = 0; s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NONE; + s->substate_tree_group = BROTLI_STATE_TREE_GROUP_NONE; + s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_NONE; s->substate_uncompressed = BROTLI_STATE_UNCOMPRESSED_NONE; + s->substate_huffman = BROTLI_STATE_HUFFMAN_NONE; s->substate_decode_uint8 = BROTLI_STATE_DECODE_UINT8_NONE; s->substate_read_block_length = BROTLI_STATE_READ_BLOCK_LENGTH_NONE; @@ -56,6 +59,8 @@ BROTLI_BOOL BrotliDecoderStateInit(BrotliDecoderState* s, s->context_map_slice = NULL; s->dist_context_map_slice = NULL; + s->sub_loop_counter = 0; + s->literal_hgroup.codes = NULL; s->literal_hgroup.htrees = NULL; s->insert_copy_hgroup.codes = NULL; @@ -79,6 +84,9 @@ BROTLI_BOOL BrotliDecoderStateInit(BrotliDecoderState* s, s->block_type_trees = NULL; s->block_len_trees = NULL; + /* Make small negative indexes addressable. */ + s->symbol_lists = &s->symbols_lists_array[BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1]; + s->mtf_upper_bound = 63; s->dictionary = BrotliGetDictionary(); @@ -134,20 +142,17 @@ void BrotliDecoderStateCleanup(BrotliDecoderState* s) { } BROTLI_BOOL BrotliDecoderHuffmanTreeGroupInit(BrotliDecoderState* s, - HuffmanTreeGroup* group, uint32_t alphabet_size_max, - uint32_t alphabet_size_limit, uint32_t ntrees) { - /* 376 = 256 (1-st level table) + 4 + 7 + 15 + 31 + 63 (2-nd level mix-tables) - This number is discovered "unlimited" "enough" calculator; it is actually - a wee bigger than required in several cases (especially for alphabets with - less than 16 symbols). */ - const size_t max_table_size = alphabet_size_limit + 376; + HuffmanTreeGroup* group, uint32_t alphabet_size, uint32_t max_symbol, + uint32_t ntrees) { + /* Pack two allocations into one */ + const size_t max_table_size = kMaxHuffmanTableSize[(alphabet_size + 31) >> 5]; const size_t code_size = sizeof(HuffmanCode) * ntrees * max_table_size; const size_t htree_size = sizeof(HuffmanCode*) * ntrees; /* Pointer alignment is, hopefully, wider than sizeof(HuffmanCode). */ HuffmanCode** p = (HuffmanCode**)BROTLI_DECODER_ALLOC(s, code_size + htree_size); - group->alphabet_size_max = (uint16_t)alphabet_size_max; - group->alphabet_size_limit = (uint16_t)alphabet_size_limit; + group->alphabet_size = (uint16_t)alphabet_size; + group->max_symbol = (uint16_t)max_symbol; group->num_htrees = (uint16_t)ntrees; group->htrees = p; group->codes = (HuffmanCode*)(&p[ntrees]); diff --git a/deps/brotli/c/dec/state.h b/deps/brotli/c/dec/state.h index 54dab698ba4454..d28b63920ef453 100644 --- a/deps/brotli/c/dec/state.h +++ b/deps/brotli/c/dec/state.h @@ -21,95 +21,6 @@ extern "C" { #endif -/* Graphviz diagram that describes state transitions: - -digraph States { - graph [compound=true] - concentrate=true - node [shape="box"] - - UNINITED -> {LARGE_WINDOW_BITS -> INITIALIZE} - subgraph cluster_metablock_workflow { - style="rounded" - label=< METABLOCK CYCLE > - METABLOCK_BEGIN -> METABLOCK_HEADER - METABLOCK_HEADER:sw -> METADATA - METABLOCK_HEADER:s -> UNCOMPRESSED - METABLOCK_HEADER:se -> METABLOCK_DONE:ne - METADATA:s -> METABLOCK_DONE:w - UNCOMPRESSED:s -> METABLOCK_DONE:n - METABLOCK_DONE:e -> METABLOCK_BEGIN:e [constraint="false"] - } - INITIALIZE -> METABLOCK_BEGIN - METABLOCK_DONE -> DONE - - subgraph cluster_compressed_metablock { - style="rounded" - label=< COMPRESSED METABLOCK > - - subgraph cluster_command { - style="rounded" - label=< HOT LOOP > - - _METABLOCK_DONE_PORT_ [shape=point style=invis] - - { - // Set different shape for nodes returning from "compressed metablock". - node [shape=invhouse]; CMD_INNER CMD_POST_DECODE_LITERALS; - CMD_POST_WRAP_COPY; CMD_INNER_WRITE; CMD_POST_WRITE_1; - } - - CMD_BEGIN -> CMD_INNER -> CMD_POST_DECODE_LITERALS -> CMD_POST_WRAP_COPY - - // IO ("write") nodes are not in the hot loop! - CMD_INNER_WRITE [style=dashed] - CMD_INNER -> CMD_INNER_WRITE - CMD_POST_WRITE_1 [style=dashed] - CMD_POST_DECODE_LITERALS -> CMD_POST_WRITE_1 - CMD_POST_WRITE_2 [style=dashed] - CMD_POST_WRAP_COPY -> CMD_POST_WRITE_2 - - CMD_POST_WRITE_1 -> CMD_BEGIN:s [constraint="false"] - CMD_INNER_WRITE -> {CMD_INNER CMD_POST_DECODE_LITERALS} - [constraint="false"] - CMD_BEGIN:ne -> CMD_POST_DECODE_LITERALS [constraint="false"] - CMD_POST_WRAP_COPY -> CMD_BEGIN [constraint="false"] - CMD_POST_DECODE_LITERALS -> CMD_BEGIN:ne [constraint="false"] - CMD_POST_WRITE_2 -> CMD_POST_WRAP_COPY [constraint="false"] - {rank=same; CMD_BEGIN; CMD_INNER; CMD_POST_DECODE_LITERALS; - CMD_POST_WRAP_COPY} - {rank=same; CMD_INNER_WRITE; CMD_POST_WRITE_1; CMD_POST_WRITE_2} - - {CMD_INNER CMD_POST_DECODE_LITERALS CMD_POST_WRAP_COPY} -> - _METABLOCK_DONE_PORT_ [style=invis] - {CMD_INNER_WRITE CMD_POST_WRITE_1} -> _METABLOCK_DONE_PORT_ - [constraint="false" style=invis] - } - - BEFORE_COMPRESSED_METABLOCK_HEADER:s -> HUFFMAN_CODE_0:n - HUFFMAN_CODE_0 -> HUFFMAN_CODE_1 -> HUFFMAN_CODE_2 -> HUFFMAN_CODE_3 - HUFFMAN_CODE_0 -> METABLOCK_HEADER_2 -> CONTEXT_MODES -> CONTEXT_MAP_1 - CONTEXT_MAP_1 -> CONTEXT_MAP_2 -> TREE_GROUP - TREE_GROUP -> BEFORE_COMPRESSED_METABLOCK_BODY:e - BEFORE_COMPRESSED_METABLOCK_BODY:s -> CMD_BEGIN:n - - HUFFMAN_CODE_3:e -> HUFFMAN_CODE_0:ne [constraint="false"] - {rank=same; HUFFMAN_CODE_0; HUFFMAN_CODE_1; HUFFMAN_CODE_2; HUFFMAN_CODE_3} - {rank=same; METABLOCK_HEADER_2; CONTEXT_MODES; CONTEXT_MAP_1; CONTEXT_MAP_2; - TREE_GROUP} - } - METABLOCK_HEADER:e -> BEFORE_COMPRESSED_METABLOCK_HEADER:n - - _METABLOCK_DONE_PORT_ -> METABLOCK_DONE:se - [constraint="false" ltail=cluster_command] - - UNINITED [shape=Mdiamond]; - DONE [shape=Msquare]; -} - - - */ - typedef enum { BROTLI_STATE_UNINITED, BROTLI_STATE_LARGE_WINDOW_BITS, @@ -128,7 +39,6 @@ typedef enum { BROTLI_STATE_METABLOCK_DONE, BROTLI_STATE_COMMAND_POST_WRITE_1, BROTLI_STATE_COMMAND_POST_WRITE_2, - BROTLI_STATE_BEFORE_COMPRESSED_METABLOCK_HEADER, BROTLI_STATE_HUFFMAN_CODE_0, BROTLI_STATE_HUFFMAN_CODE_1, BROTLI_STATE_HUFFMAN_CODE_2, @@ -136,7 +46,6 @@ typedef enum { BROTLI_STATE_CONTEXT_MAP_1, BROTLI_STATE_CONTEXT_MAP_2, BROTLI_STATE_TREE_GROUP, - BROTLI_STATE_BEFORE_COMPRESSED_METABLOCK_BODY, BROTLI_STATE_DONE } BrotliRunningState; @@ -189,50 +98,6 @@ typedef enum { BROTLI_STATE_READ_BLOCK_LENGTH_SUFFIX } BrotliRunningReadBlockLengthState; -typedef struct BrotliMetablockHeaderArena { - BrotliRunningTreeGroupState substate_tree_group; - BrotliRunningContextMapState substate_context_map; - BrotliRunningHuffmanState substate_huffman; - - uint32_t sub_loop_counter; - - uint32_t repeat_code_len; - uint32_t prev_code_len; - - /* For ReadHuffmanCode. */ - uint32_t symbol; - uint32_t repeat; - uint32_t space; - - /* Huffman table for "histograms". */ - HuffmanCode table[32]; - /* List of heads of symbol chains. */ - uint16_t* symbol_lists; - /* Storage from symbol_lists. */ - uint16_t symbols_lists_array[BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1 + - BROTLI_NUM_COMMAND_SYMBOLS]; - /* Tails of symbol chains. */ - int next_symbol[32]; - uint8_t code_length_code_lengths[BROTLI_CODE_LENGTH_CODES]; - /* Population counts for the code lengths. */ - uint16_t code_length_histo[16]; - - /* For HuffmanTreeGroupDecode. */ - int htree_index; - HuffmanCode* next; - - /* For DecodeContextMap. */ - uint32_t context_index; - uint32_t max_run_length_prefix; - uint32_t code; - HuffmanCode context_map_table[BROTLI_HUFFMAN_MAX_SIZE_272]; -} BrotliMetablockHeaderArena; - -typedef struct BrotliMetablockBodyArena { - uint8_t dist_extra_bits[544]; - uint32_t dist_offset[544]; -} BrotliMetablockBodyArena; - struct BrotliDecoderStateStruct { BrotliRunningState state; @@ -245,8 +110,7 @@ struct BrotliDecoderStateStruct { brotli_free_func free_func; void* memory_manager_opaque; - /* Temporary storage for remaining input. Brotli stream format is designed in - a way, that 64 bits are enough to make progress in decoding. */ + /* Temporary storage for remaining input. */ union { uint64_t u64; uint8_t u8[8]; @@ -261,6 +125,7 @@ struct BrotliDecoderStateStruct { int dist_rb_idx; int dist_rb[4]; int error_code; + uint32_t sub_loop_counter; uint8_t* ringbuffer; uint8_t* ringbuffer_end; HuffmanCode* htree_command; @@ -288,10 +153,13 @@ struct BrotliDecoderStateStruct { uint32_t block_type_rb[6]; uint32_t distance_postfix_bits; uint32_t num_direct_distance_codes; + int distance_postfix_mask; uint32_t num_dist_htrees; uint8_t* dist_context_map; HuffmanCode* literal_htree; uint8_t dist_htree_index; + uint32_t repeat_code_len; + uint32_t prev_code_len; int copy_length; int distance_code; @@ -300,6 +168,33 @@ struct BrotliDecoderStateStruct { size_t rb_roundtrips; /* how many times we went around the ring-buffer */ size_t partial_pos_out; /* how much output to the user in total */ + /* For ReadHuffmanCode. */ + uint32_t symbol; + uint32_t repeat; + uint32_t space; + + HuffmanCode table[32]; + /* List of heads of symbol chains. */ + uint16_t* symbol_lists; + /* Storage from symbol_lists. */ + uint16_t symbols_lists_array[BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1 + + BROTLI_NUM_COMMAND_SYMBOLS]; + /* Tails of symbol chains. */ + int next_symbol[32]; + uint8_t code_length_code_lengths[BROTLI_CODE_LENGTH_CODES]; + /* Population counts for the code lengths. */ + uint16_t code_length_histo[16]; + + /* For HuffmanTreeGroupDecode. */ + int htree_index; + HuffmanCode* next; + + /* For DecodeContextMap. */ + uint32_t context_index; + uint32_t max_run_length_prefix; + uint32_t code; + HuffmanCode context_map_table[BROTLI_HUFFMAN_MAX_SIZE_272]; + /* For InverseMoveToFrontTransform. */ uint32_t mtf_upper_bound; uint32_t mtf[64 + 1]; @@ -308,7 +203,10 @@ struct BrotliDecoderStateStruct { /* States inside function calls. */ BrotliRunningMetablockHeaderState substate_metablock_header; + BrotliRunningTreeGroupState substate_tree_group; + BrotliRunningContextMapState substate_context_map; BrotliRunningUncompressedState substate_uncompressed; + BrotliRunningHuffmanState substate_huffman; BrotliRunningDecodeUint8State substate_decode_uint8; BrotliRunningReadBlockLengthState substate_read_block_length; @@ -331,11 +229,6 @@ struct BrotliDecoderStateStruct { const BrotliTransforms* transforms; uint32_t trivial_literal_contexts[8]; /* 256 bits */ - - union { - BrotliMetablockHeaderArena header; - BrotliMetablockBodyArena body; - } arena; }; typedef struct BrotliDecoderStateStruct BrotliDecoderStateInternal; @@ -348,8 +241,8 @@ BROTLI_INTERNAL void BrotliDecoderStateMetablockBegin(BrotliDecoderState* s); BROTLI_INTERNAL void BrotliDecoderStateCleanupAfterMetablock( BrotliDecoderState* s); BROTLI_INTERNAL BROTLI_BOOL BrotliDecoderHuffmanTreeGroupInit( - BrotliDecoderState* s, HuffmanTreeGroup* group, uint32_t alphabet_size_max, - uint32_t alphabet_size_limit, uint32_t ntrees); + BrotliDecoderState* s, HuffmanTreeGroup* group, uint32_t alphabet_size, + uint32_t max_symbol, uint32_t ntrees); #define BROTLI_DECODER_ALLOC(S, L) S->alloc_func(S->memory_manager_opaque, L) diff --git a/deps/brotli/c/enc/backward_references.c b/deps/brotli/c/enc/backward_references.c index a07a617a097c04..cd023d9b41ce24 100644 --- a/deps/brotli/c/enc/backward_references.c +++ b/deps/brotli/c/enc/backward_references.c @@ -9,7 +9,6 @@ #include "./backward_references.h" #include "../common/constants.h" -#include "../common/context.h" #include "../common/dictionary.h" #include "../common/platform.h" #include @@ -120,17 +119,17 @@ static BROTLI_INLINE size_t ComputeDistanceCode(size_t distance, #undef CAT #undef EXPAND_CAT -void BrotliCreateBackwardReferences(size_t num_bytes, - size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask, - ContextLut literal_context_lut, const BrotliEncoderParams* params, - Hasher* hasher, int* dist_cache, size_t* last_insert_len, +void BrotliCreateBackwardReferences( + size_t num_bytes, size_t position, const uint8_t* ringbuffer, + size_t ringbuffer_mask, const BrotliEncoderParams* params, + HasherHandle hasher, int* dist_cache, size_t* last_insert_len, Command* commands, size_t* num_commands, size_t* num_literals) { switch (params->hasher.type) { #define CASE_(N) \ case N: \ - CreateBackwardReferencesNH ## N(num_bytes, \ - position, ringbuffer, ringbuffer_mask, \ - literal_context_lut, params, hasher, dist_cache, \ + CreateBackwardReferencesNH ## N( \ + num_bytes, position, ringbuffer, \ + ringbuffer_mask, params, hasher, dist_cache, \ last_insert_len, commands, num_commands, num_literals); \ return; FOR_GENERIC_HASHERS(CASE_) diff --git a/deps/brotli/c/enc/backward_references.h b/deps/brotli/c/enc/backward_references.h index 9589cc15419bda..3a4146647c4748 100644 --- a/deps/brotli/c/enc/backward_references.h +++ b/deps/brotli/c/enc/backward_references.h @@ -10,7 +10,6 @@ #define BROTLI_ENC_BACKWARD_REFERENCES_H_ #include "../common/constants.h" -#include "../common/context.h" #include "../common/dictionary.h" #include "../common/platform.h" #include @@ -26,10 +25,10 @@ extern "C" { initially the total amount of commands output by previous CreateBackwardReferences calls, and must be incremented by the amount written by this call. */ -BROTLI_INTERNAL void BrotliCreateBackwardReferences(size_t num_bytes, - size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask, - ContextLut literal_context_lut, const BrotliEncoderParams* params, - Hasher* hasher, int* dist_cache, size_t* last_insert_len, +BROTLI_INTERNAL void BrotliCreateBackwardReferences( + size_t num_bytes, size_t position, const uint8_t* ringbuffer, + size_t ringbuffer_mask, const BrotliEncoderParams* params, + HasherHandle hasher, int* dist_cache, size_t* last_insert_len, Command* commands, size_t* num_commands, size_t* num_literals); #if defined(__cplusplus) || defined(c_plusplus) diff --git a/deps/brotli/c/enc/backward_references_hq.c b/deps/brotli/c/enc/backward_references_hq.c index 5651caeb7aca8a..96b0e708de4bcd 100644 --- a/deps/brotli/c/enc/backward_references_hq.c +++ b/deps/brotli/c/enc/backward_references_hq.c @@ -11,7 +11,6 @@ #include /* memcpy, memset */ #include "../common/constants.h" -#include "../common/context.h" #include "../common/platform.h" #include #include "./command.h" @@ -27,7 +26,6 @@ extern "C" { #endif -/* BrotliCalculateDistanceCodeLimit(BROTLI_MAX_ALLOWED_DISTANCE, 3, 120). */ #define BROTLI_MAX_EFFECTIVE_DISTANCE_ALPHABET_SIZE 544 static const float kInfinity = 1.7e38f; /* ~= 2 ^ 127 */ @@ -88,10 +86,14 @@ typedef struct ZopfliCostModel { static void InitZopfliCostModel( MemoryManager* m, ZopfliCostModel* self, const BrotliDistanceParams* dist, size_t num_bytes) { + uint32_t distance_histogram_size = dist->alphabet_size; + if (distance_histogram_size > BROTLI_MAX_EFFECTIVE_DISTANCE_ALPHABET_SIZE) { + distance_histogram_size = BROTLI_MAX_EFFECTIVE_DISTANCE_ALPHABET_SIZE; + } self->num_bytes_ = num_bytes; self->literal_costs_ = BROTLI_ALLOC(m, float, num_bytes + 2); - self->cost_dist_ = BROTLI_ALLOC(m, float, dist->alphabet_size_limit); - self->distance_histogram_size = dist->alphabet_size_limit; + self->cost_dist_ = BROTLI_ALLOC(m, float, dist->alphabet_size); + self->distance_histogram_size = distance_histogram_size; if (BROTLI_IS_OOM(m)) return; } @@ -406,12 +408,9 @@ static size_t UpdateNodes( const int* starting_dist_cache, const size_t num_matches, const BackwardMatch* matches, const ZopfliCostModel* model, StartPosQueue* queue, ZopfliNode* nodes) { - const size_t stream_offset = params->stream_offset; const size_t cur_ix = block_start + pos; const size_t cur_ix_masked = cur_ix & ringbuffer_mask; const size_t max_distance = BROTLI_MIN(size_t, cur_ix, max_backward_limit); - const size_t dictionary_start = BROTLI_MIN(size_t, - cur_ix + stream_offset, max_backward_limit); const size_t max_len = num_bytes - pos; const size_t max_zopfli_len = MaxZopfliLen(params); const size_t max_iters = MaxZopfliCandidates(params); @@ -420,8 +419,8 @@ static size_t UpdateNodes( size_t k; size_t gap = 0; - EvaluateNode(block_start + stream_offset, pos, max_backward_limit, gap, - starting_dist_cache, model, queue, nodes); + EvaluateNode(block_start, pos, max_backward_limit, gap, starting_dist_cache, + model, queue, nodes); { const PosData* posdata = StartPosQueueAt(queue, 0); @@ -454,7 +453,7 @@ static size_t UpdateNodes( if (cur_ix_masked + best_len > ringbuffer_mask) { break; } - if (BROTLI_PREDICT_FALSE(backward > dictionary_start + gap)) { + if (BROTLI_PREDICT_FALSE(backward > max_distance + gap)) { /* Word dictionary -> ignore. */ continue; } @@ -473,8 +472,6 @@ static size_t UpdateNodes( &ringbuffer[cur_ix_masked], max_len); } else { - /* "Gray" area. It is addressable by decoder, but this encoder - instance does not have that data -> should not touch it. */ continue; } { @@ -509,7 +506,7 @@ static size_t UpdateNodes( BackwardMatch match = matches[j]; size_t dist = match.distance; BROTLI_BOOL is_dictionary_match = - TO_BROTLI_BOOL(dist > dictionary_start + gap); + TO_BROTLI_BOOL(dist > max_distance + gap); /* We already tried all possible last distance matches, so we can use normal distance code here. */ size_t dist_code = dist + BROTLI_NUM_DISTANCE_SHORT_CODES - 1; @@ -572,7 +569,6 @@ void BrotliZopfliCreateCommands(const size_t num_bytes, const size_t block_start, const ZopfliNode* nodes, int* dist_cache, size_t* last_insert_len, const BrotliEncoderParams* params, Command* commands, size_t* num_literals) { - const size_t stream_offset = params->stream_offset; const size_t max_backward_limit = BROTLI_MAX_BACKWARD_LIMIT(params->lgwin); size_t pos = 0; uint32_t offset = nodes[0].u.next; @@ -591,10 +587,9 @@ void BrotliZopfliCreateCommands(const size_t num_bytes, { size_t distance = ZopfliNodeCopyDistance(next); size_t len_code = ZopfliNodeLengthCode(next); - size_t dictionary_start = BROTLI_MIN(size_t, - block_start + pos + stream_offset, max_backward_limit); - BROTLI_BOOL is_dictionary = - TO_BROTLI_BOOL(distance > dictionary_start + gap); + size_t max_distance = + BROTLI_MIN(size_t, block_start + pos, max_backward_limit); + BROTLI_BOOL is_dictionary = TO_BROTLI_BOOL(distance > max_distance + gap); size_t dist_code = ZopfliNodeDistanceCode(next); InitCommand(&commands[i], ¶ms->dist, insert_length, copy_length, (int)len_code - (int)copy_length, dist_code); @@ -618,7 +613,6 @@ static size_t ZopfliIterate(size_t num_bytes, size_t position, const BrotliEncoderParams* params, const size_t gap, const int* dist_cache, const ZopfliCostModel* model, const uint32_t* num_matches, const BackwardMatch* matches, ZopfliNode* nodes) { - const size_t stream_offset = params->stream_offset; const size_t max_backward_limit = BROTLI_MAX_BACKWARD_LIMIT(params->lgwin); const size_t max_zopfli_len = MaxZopfliLen(params); StartPosQueue queue; @@ -643,7 +637,7 @@ static size_t ZopfliIterate(size_t num_bytes, size_t position, while (skip) { i++; if (i + 3 >= num_bytes) break; - EvaluateNode(position + stream_offset, i, max_backward_limit, gap, + EvaluateNode(position, i, max_backward_limit, gap, dist_cache, model, &queue, nodes); cur_match_pos += num_matches[i]; skip--; @@ -656,9 +650,8 @@ static size_t ZopfliIterate(size_t num_bytes, size_t position, /* REQUIRES: nodes != NULL and len(nodes) >= num_bytes + 1 */ size_t BrotliZopfliComputeShortestPath(MemoryManager* m, size_t num_bytes, size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask, - ContextLut literal_context_lut, const BrotliEncoderParams* params, - const int* dist_cache, Hasher* hasher, ZopfliNode* nodes) { - const size_t stream_offset = params->stream_offset; + const BrotliEncoderParams* params, + const int* dist_cache, HasherHandle hasher, ZopfliNode* nodes) { const size_t max_backward_limit = BROTLI_MAX_BACKWARD_LIMIT(params->lgwin); const size_t max_zopfli_len = MaxZopfliLen(params); ZopfliCostModel model; @@ -669,7 +662,6 @@ size_t BrotliZopfliComputeShortestPath(MemoryManager* m, size_t num_bytes, size_t i; size_t gap = 0; size_t lz_matches_offset = 0; - BROTLI_UNUSED(literal_context_lut); nodes[0].length = 0; nodes[0].u.cost = 0; InitZopfliCostModel(m, &model, ¶ms->dist, num_bytes); @@ -680,14 +672,12 @@ size_t BrotliZopfliComputeShortestPath(MemoryManager* m, size_t num_bytes, for (i = 0; i + HashTypeLengthH10() - 1 < num_bytes; i++) { const size_t pos = position + i; const size_t max_distance = BROTLI_MIN(size_t, pos, max_backward_limit); - const size_t dictionary_start = BROTLI_MIN(size_t, - pos + stream_offset, max_backward_limit); size_t skip; size_t num_matches; - num_matches = FindAllMatchesH10(&hasher->privat._H10, + num_matches = FindAllMatchesH10(hasher, ¶ms->dictionary, ringbuffer, ringbuffer_mask, pos, num_bytes - i, max_distance, - dictionary_start + gap, params, &matches[lz_matches_offset]); + gap, params, &matches[lz_matches_offset]); if (num_matches > 0 && BackwardMatchLength(&matches[num_matches - 1]) > max_zopfli_len) { matches[0] = matches[num_matches - 1]; @@ -702,14 +692,13 @@ size_t BrotliZopfliComputeShortestPath(MemoryManager* m, size_t num_bytes, } if (skip > 1) { /* Add the tail of the copy to the hasher. */ - StoreRangeH10(&hasher->privat._H10, - ringbuffer, ringbuffer_mask, pos + 1, BROTLI_MIN( + StoreRangeH10(hasher, ringbuffer, ringbuffer_mask, pos + 1, BROTLI_MIN( size_t, pos + skip, store_end)); skip--; while (skip) { i++; if (i + HashTypeLengthH10() - 1 >= num_bytes) break; - EvaluateNode(position + stream_offset, i, max_backward_limit, gap, + EvaluateNode(position, i, max_backward_limit, gap, dist_cache, &model, &queue, nodes); skip--; } @@ -721,14 +710,15 @@ size_t BrotliZopfliComputeShortestPath(MemoryManager* m, size_t num_bytes, void BrotliCreateZopfliBackwardReferences(MemoryManager* m, size_t num_bytes, size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask, - ContextLut literal_context_lut, const BrotliEncoderParams* params, - Hasher* hasher, int* dist_cache, size_t* last_insert_len, + const BrotliEncoderParams* params, + HasherHandle hasher, int* dist_cache, size_t* last_insert_len, Command* commands, size_t* num_commands, size_t* num_literals) { - ZopfliNode* nodes = BROTLI_ALLOC(m, ZopfliNode, num_bytes + 1); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(nodes)) return; + ZopfliNode* nodes; + nodes = BROTLI_ALLOC(m, ZopfliNode, num_bytes + 1); + if (BROTLI_IS_OOM(m)) return; BrotliInitZopfliNodes(nodes, num_bytes + 1); *num_commands += BrotliZopfliComputeShortestPath(m, num_bytes, - position, ringbuffer, ringbuffer_mask, literal_context_lut, params, + position, ringbuffer, ringbuffer_mask, params, dist_cache, hasher, nodes); if (BROTLI_IS_OOM(m)) return; BrotliZopfliCreateCommands(num_bytes, position, nodes, dist_cache, @@ -738,10 +728,9 @@ void BrotliCreateZopfliBackwardReferences(MemoryManager* m, size_t num_bytes, void BrotliCreateHqZopfliBackwardReferences(MemoryManager* m, size_t num_bytes, size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask, - ContextLut literal_context_lut, const BrotliEncoderParams* params, - Hasher* hasher, int* dist_cache, size_t* last_insert_len, + const BrotliEncoderParams* params, + HasherHandle hasher, int* dist_cache, size_t* last_insert_len, Command* commands, size_t* num_commands, size_t* num_literals) { - const size_t stream_offset = params->stream_offset; const size_t max_backward_limit = BROTLI_MAX_BACKWARD_LIMIT(params->lgwin); uint32_t* num_matches = BROTLI_ALLOC(m, uint32_t, num_bytes); size_t matches_size = 4 * num_bytes; @@ -758,16 +747,10 @@ void BrotliCreateHqZopfliBackwardReferences(MemoryManager* m, size_t num_bytes, BackwardMatch* matches = BROTLI_ALLOC(m, BackwardMatch, matches_size); size_t gap = 0; size_t shadow_matches = 0; - BROTLI_UNUSED(literal_context_lut); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(num_matches) || - BROTLI_IS_NULL(matches)) { - return; - } + if (BROTLI_IS_OOM(m)) return; for (i = 0; i + HashTypeLengthH10() - 1 < num_bytes; ++i) { const size_t pos = position + i; size_t max_distance = BROTLI_MIN(size_t, pos, max_backward_limit); - size_t dictionary_start = BROTLI_MIN(size_t, - pos + stream_offset, max_backward_limit); size_t max_length = num_bytes - i; size_t num_found_matches; size_t cur_match_end; @@ -776,10 +759,10 @@ void BrotliCreateHqZopfliBackwardReferences(MemoryManager* m, size_t num_bytes, BROTLI_ENSURE_CAPACITY(m, BackwardMatch, matches, matches_size, cur_match_pos + MAX_NUM_MATCHES_H10 + shadow_matches); if (BROTLI_IS_OOM(m)) return; - num_found_matches = FindAllMatchesH10(&hasher->privat._H10, + num_found_matches = FindAllMatchesH10(hasher, ¶ms->dictionary, ringbuffer, ringbuffer_mask, pos, max_length, - max_distance, dictionary_start + gap, params, + max_distance, gap, params, &matches[cur_match_pos + shadow_matches]); cur_match_end = cur_match_pos + num_found_matches; for (j = cur_match_pos; j + 1 < cur_match_end; ++j) { @@ -794,8 +777,7 @@ void BrotliCreateHqZopfliBackwardReferences(MemoryManager* m, size_t num_bytes, matches[cur_match_pos++] = matches[cur_match_end - 1]; num_matches[i] = 1; /* Add the tail of the copy to the hasher. */ - StoreRangeH10(&hasher->privat._H10, - ringbuffer, ringbuffer_mask, pos + 1, + StoreRangeH10(hasher, ringbuffer, ringbuffer_mask, pos + 1, BROTLI_MIN(size_t, pos + match_len, store_end)); memset(&num_matches[i + 1], 0, skip * sizeof(num_matches[0])); i += skip; @@ -809,7 +791,7 @@ void BrotliCreateHqZopfliBackwardReferences(MemoryManager* m, size_t num_bytes, memcpy(orig_dist_cache, dist_cache, 4 * sizeof(dist_cache[0])); orig_num_commands = *num_commands; nodes = BROTLI_ALLOC(m, ZopfliNode, num_bytes + 1); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(nodes)) return; + if (BROTLI_IS_OOM(m)) return; InitZopfliCostModel(m, &model, ¶ms->dist, num_bytes); if (BROTLI_IS_OOM(m)) return; for (i = 0; i < 2; i++) { diff --git a/deps/brotli/c/enc/backward_references_hq.h b/deps/brotli/c/enc/backward_references_hq.h index 36b75f250d7989..1e4275d403f96f 100644 --- a/deps/brotli/c/enc/backward_references_hq.h +++ b/deps/brotli/c/enc/backward_references_hq.h @@ -10,7 +10,6 @@ #define BROTLI_ENC_BACKWARD_REFERENCES_HQ_H_ #include "../common/constants.h" -#include "../common/context.h" #include "../common/dictionary.h" #include "../common/platform.h" #include @@ -24,17 +23,15 @@ extern "C" { #endif BROTLI_INTERNAL void BrotliCreateZopfliBackwardReferences(MemoryManager* m, - size_t num_bytes, - size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask, - ContextLut literal_context_lut, const BrotliEncoderParams* params, - Hasher* hasher, int* dist_cache, size_t* last_insert_len, + size_t num_bytes, size_t position, const uint8_t* ringbuffer, + size_t ringbuffer_mask, const BrotliEncoderParams* params, + HasherHandle hasher, int* dist_cache, size_t* last_insert_len, Command* commands, size_t* num_commands, size_t* num_literals); BROTLI_INTERNAL void BrotliCreateHqZopfliBackwardReferences(MemoryManager* m, - size_t num_bytes, - size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask, - ContextLut literal_context_lut, const BrotliEncoderParams* params, - Hasher* hasher, int* dist_cache, size_t* last_insert_len, + size_t num_bytes, size_t position, const uint8_t* ringbuffer, + size_t ringbuffer_mask, const BrotliEncoderParams* params, + HasherHandle hasher, int* dist_cache, size_t* last_insert_len, Command* commands, size_t* num_commands, size_t* num_literals); typedef struct ZopfliNode { @@ -80,8 +77,8 @@ BROTLI_INTERNAL void BrotliInitZopfliNodes(ZopfliNode* array, size_t length); BROTLI_INTERNAL size_t BrotliZopfliComputeShortestPath( MemoryManager* m, size_t num_bytes, size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask, - ContextLut literal_context_lut, const BrotliEncoderParams* params, - const int* dist_cache, Hasher* hasher, ZopfliNode* nodes); + const BrotliEncoderParams* params, + const int* dist_cache, HasherHandle hasher, ZopfliNode* nodes); BROTLI_INTERNAL void BrotliZopfliCreateCommands( const size_t num_bytes, const size_t block_start, const ZopfliNode* nodes, diff --git a/deps/brotli/c/enc/backward_references_inc.h b/deps/brotli/c/enc/backward_references_inc.h index 766bf91ffd2643..c18cdb00cb9b07 100644 --- a/deps/brotli/c/enc/backward_references_inc.h +++ b/deps/brotli/c/enc/backward_references_inc.h @@ -10,13 +10,11 @@ static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)( size_t num_bytes, size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask, - ContextLut literal_context_lut, const BrotliEncoderParams* params, - Hasher* hasher, int* dist_cache, size_t* last_insert_len, + const BrotliEncoderParams* params, + HasherHandle hasher, int* dist_cache, size_t* last_insert_len, Command* commands, size_t* num_commands, size_t* num_literals) { - HASHER()* privat = &hasher->privat.FN(_); /* Set maximum distance, see section 9.1. of the spec. */ const size_t max_backward_limit = BROTLI_MAX_BACKWARD_LIMIT(params->lgwin); - const size_t position_offset = params->stream_offset; const Command* const orig_commands = commands; size_t insert_length = *last_insert_len; @@ -33,23 +31,19 @@ static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)( /* Minimum score to accept a backward reference. */ const score_t kMinScore = BROTLI_SCORE_BASE + 100; - BROTLI_UNUSED(literal_context_lut); - - FN(PrepareDistanceCache)(privat, dist_cache); + FN(PrepareDistanceCache)(hasher, dist_cache); while (position + FN(HashTypeLength)() < pos_end) { size_t max_length = pos_end - position; size_t max_distance = BROTLI_MIN(size_t, position, max_backward_limit); - size_t dictionary_start = BROTLI_MIN(size_t, - position + position_offset, max_backward_limit); HasherSearchResult sr; sr.len = 0; sr.len_code_delta = 0; sr.distance = 0; sr.score = kMinScore; - FN(FindLongestMatch)(privat, ¶ms->dictionary, + FN(FindLongestMatch)(hasher, ¶ms->dictionary, ringbuffer, ringbuffer_mask, dist_cache, position, max_length, - max_distance, dictionary_start + gap, params->dist.max_distance, &sr); + max_distance, gap, params->dist.max_distance, &sr); if (sr.score > kMinScore) { /* Found a match. Let's look for something even better ahead. */ int delayed_backward_references_in_row = 0; @@ -63,13 +57,10 @@ static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)( sr2.distance = 0; sr2.score = kMinScore; max_distance = BROTLI_MIN(size_t, position + 1, max_backward_limit); - dictionary_start = BROTLI_MIN(size_t, - position + 1 + position_offset, max_backward_limit); - FN(FindLongestMatch)(privat, + FN(FindLongestMatch)(hasher, ¶ms->dictionary, ringbuffer, ringbuffer_mask, dist_cache, position + 1, max_length, - max_distance, dictionary_start + gap, params->dist.max_distance, - &sr2); + max_distance, gap, params->dist.max_distance, &sr2); if (sr2.score >= sr.score + cost_diff_lazy) { /* Ok, let's just write one byte for now and start a match from the next byte. */ @@ -85,19 +76,18 @@ static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)( } apply_random_heuristics = position + 2 * sr.len + random_heuristics_window_size; - dictionary_start = BROTLI_MIN(size_t, - position + position_offset, max_backward_limit); + max_distance = BROTLI_MIN(size_t, position, max_backward_limit); { /* The first 16 codes are special short-codes, and the minimum offset is 1. */ size_t distance_code = ComputeDistanceCode( - sr.distance, dictionary_start + gap, dist_cache); - if ((sr.distance <= (dictionary_start + gap)) && distance_code > 0) { + sr.distance, max_distance + gap, dist_cache); + if ((sr.distance <= (max_distance + gap)) && distance_code > 0) { dist_cache[3] = dist_cache[2]; dist_cache[2] = dist_cache[1]; dist_cache[1] = dist_cache[0]; dist_cache[0] = (int)sr.distance; - FN(PrepareDistanceCache)(privat, dist_cache); + FN(PrepareDistanceCache)(hasher, dist_cache); } InitCommand(commands++, ¶ms->dist, insert_length, sr.len, sr.len_code_delta, distance_code); @@ -115,7 +105,7 @@ static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)( range_start = BROTLI_MIN(size_t, range_end, BROTLI_MAX(size_t, range_start, position + sr.len - (sr.distance << 2))); } - FN(StoreRange)(privat, ringbuffer, ringbuffer_mask, range_start, + FN(StoreRange)(hasher, ringbuffer, ringbuffer_mask, range_start, range_end); } position += sr.len; @@ -141,7 +131,7 @@ static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)( size_t pos_jump = BROTLI_MIN(size_t, position + 16, pos_end - kMargin); for (; position < pos_jump; position += 4) { - FN(Store)(privat, ringbuffer, ringbuffer_mask, position); + FN(Store)(hasher, ringbuffer, ringbuffer_mask, position); insert_length += 4; } } else { @@ -150,7 +140,7 @@ static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)( size_t pos_jump = BROTLI_MIN(size_t, position + 8, pos_end - kMargin); for (; position < pos_jump; position += 2) { - FN(Store)(privat, ringbuffer, ringbuffer_mask, position); + FN(Store)(hasher, ringbuffer, ringbuffer_mask, position); insert_length += 2; } } diff --git a/deps/brotli/c/enc/block_splitter.c b/deps/brotli/c/enc/block_splitter.c index deb7c2e151ad94..d308eca59d300b 100644 --- a/deps/brotli/c/enc/block_splitter.c +++ b/deps/brotli/c/enc/block_splitter.c @@ -132,7 +132,7 @@ void BrotliSplitBlock(MemoryManager* m, { size_t literals_count = CountLiterals(cmds, num_commands); uint8_t* literals = BROTLI_ALLOC(m, uint8_t, literals_count); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(literals)) return; + if (BROTLI_IS_OOM(m)) return; /* Create a continuous array of literals. */ CopyLiteralsToByteArray(cmds, num_commands, data, pos, mask, literals); /* Create the block split on the array of literals. @@ -150,7 +150,7 @@ void BrotliSplitBlock(MemoryManager* m, /* Compute prefix codes for commands. */ uint16_t* insert_and_copy_codes = BROTLI_ALLOC(m, uint16_t, num_commands); size_t i; - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(insert_and_copy_codes)) return; + if (BROTLI_IS_OOM(m)) return; for (i = 0; i < num_commands; ++i) { insert_and_copy_codes[i] = cmds[i].cmd_prefix_; } @@ -170,7 +170,7 @@ void BrotliSplitBlock(MemoryManager* m, uint16_t* distance_prefixes = BROTLI_ALLOC(m, uint16_t, num_commands); size_t j = 0; size_t i; - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(distance_prefixes)) return; + if (BROTLI_IS_OOM(m)) return; for (i = 0; i < num_commands; ++i) { const Command* cmd = &cmds[i]; if (CommandCopyLen(cmd) && cmd->cmd_prefix_ >= 128) { diff --git a/deps/brotli/c/enc/block_splitter_inc.h b/deps/brotli/c/enc/block_splitter_inc.h index e612d6a370712b..023712b84d3e42 100644 --- a/deps/brotli/c/enc/block_splitter_inc.h +++ b/deps/brotli/c/enc/block_splitter_inc.h @@ -219,12 +219,7 @@ static void FN(ClusterBlocks)(MemoryManager* m, uint32_t symbols[HISTOGRAMS_PER_BATCH] = { 0 }; uint32_t remap[HISTOGRAMS_PER_BATCH] = { 0 }; - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(histogram_symbols) || - BROTLI_IS_NULL(block_lengths) || BROTLI_IS_NULL(all_histograms) || - BROTLI_IS_NULL(cluster_size) || BROTLI_IS_NULL(histograms) || - BROTLI_IS_NULL(pairs)) { - return; - } + if (BROTLI_IS_OOM(m)) return; memset(block_lengths, 0, num_blocks * sizeof(uint32_t)); @@ -283,11 +278,11 @@ static void FN(ClusterBlocks)(MemoryManager* m, if (pairs_capacity < max_num_pairs + 1) { BROTLI_FREE(m, pairs); pairs = BROTLI_ALLOC(m, HistogramPair, max_num_pairs + 1); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(pairs)) return; + if (BROTLI_IS_OOM(m)) return; } clusters = BROTLI_ALLOC(m, uint32_t, num_clusters); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(clusters)) return; + if (BROTLI_IS_OOM(m)) return; for (i = 0; i < num_clusters; ++i) { clusters[i] = (uint32_t)i; } @@ -299,7 +294,7 @@ static void FN(ClusterBlocks)(MemoryManager* m, BROTLI_FREE(m, cluster_size); new_index = BROTLI_ALLOC(m, uint32_t, num_clusters); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(new_index)) return; + if (BROTLI_IS_OOM(m)) return; for (i = 0; i < num_clusters; ++i) new_index[i] = kInvalidIndex; pos = 0; { @@ -391,7 +386,7 @@ static void FN(SplitByteVector)(MemoryManager* m, return; } histograms = BROTLI_ALLOC(m, HistogramType, num_histograms); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(histograms)) return; + if (BROTLI_IS_OOM(m)) return; /* Find good entropy codes. */ FN(InitialEntropyCodes)(data, length, sampling_stride_length, @@ -410,11 +405,7 @@ static void FN(SplitByteVector)(MemoryManager* m, uint16_t* new_id = BROTLI_ALLOC(m, uint16_t, num_histograms); const size_t iters = params->quality < HQ_ZOPFLIFICATION_QUALITY ? 3 : 10; size_t i; - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(block_ids) || - BROTLI_IS_NULL(insert_cost) || BROTLI_IS_NULL(cost) || - BROTLI_IS_NULL(switch_signal) || BROTLI_IS_NULL(new_id)) { - return; - } + if (BROTLI_IS_OOM(m)) return; for (i = 0; i < iters; ++i) { num_blocks = FN(FindBlocks)(data, length, block_switch_cost, diff --git a/deps/brotli/c/enc/brotli_bit_stream.c b/deps/brotli/c/enc/brotli_bit_stream.c index 9348a97e1b9b9b..aaf2dad7dbdcc5 100644 --- a/deps/brotli/c/enc/brotli_bit_stream.c +++ b/deps/brotli/c/enc/brotli_bit_stream.c @@ -34,18 +34,33 @@ extern "C" { BROTLI_DISTANCE_ALPHABET_SIZE(0, 0, BROTLI_LARGE_MAX_DISTANCE_BITS) /* MAX_SIMPLE_DISTANCE_ALPHABET_SIZE == 140 */ +/* Represents the range of values belonging to a prefix code: + [offset, offset + 2^nbits) */ +typedef struct PrefixCodeRange { + uint32_t offset; + uint32_t nbits; +} PrefixCodeRange; + +static const PrefixCodeRange + kBlockLengthPrefixCode[BROTLI_NUM_BLOCK_LEN_SYMBOLS] = { + { 1, 2}, { 5, 2}, { 9, 2}, {13, 2}, {17, 3}, { 25, 3}, { 33, 3}, + {41, 3}, {49, 4}, {65, 4}, {81, 4}, {97, 4}, {113, 5}, {145, 5}, + {177, 5}, { 209, 5}, { 241, 6}, { 305, 6}, { 369, 7}, { 497, 8}, + {753, 9}, {1265, 10}, {2289, 11}, {4337, 12}, {8433, 13}, {16625, 24} +}; + static BROTLI_INLINE uint32_t BlockLengthPrefixCode(uint32_t len) { uint32_t code = (len >= 177) ? (len >= 753 ? 20 : 14) : (len >= 41 ? 7 : 0); while (code < (BROTLI_NUM_BLOCK_LEN_SYMBOLS - 1) && - len >= _kBrotliPrefixCodeRanges[code + 1].offset) ++code; + len >= kBlockLengthPrefixCode[code + 1].offset) ++code; return code; } static BROTLI_INLINE void GetBlockLengthPrefixCode(uint32_t len, size_t* code, uint32_t* n_extra, uint32_t* extra) { *code = BlockLengthPrefixCode(len); - *n_extra = _kBrotliPrefixCodeRanges[*code].nbits; - *extra = len - _kBrotliPrefixCodeRanges[*code].offset; + *n_extra = kBlockLengthPrefixCode[*code].nbits; + *extra = len - kBlockLengthPrefixCode[*code].offset; } typedef struct BlockTypeCodeCalculator { @@ -435,7 +450,7 @@ void BrotliBuildAndStoreHuffmanTreeFast(MemoryManager* m, const size_t max_tree_size = 2 * length + 1; HuffmanTree* tree = BROTLI_ALLOC(m, HuffmanTree, max_tree_size); uint32_t count_limit; - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(tree)) return; + if (BROTLI_IS_OOM(m)) return; for (count_limit = 1; ; count_limit *= 2) { HuffmanTree* node = tree; size_t l; @@ -699,7 +714,7 @@ static void EncodeContextMap(MemoryManager* m, } rle_symbols = BROTLI_ALLOC(m, uint32_t, context_map_size); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(rle_symbols)) return; + if (BROTLI_IS_OOM(m)) return; MoveToFrontTransform(context_map, context_map_size, rle_symbols); RunLengthCodeZeros(context_map_size, rle_symbols, &num_rle_symbols, &max_run_length_prefix); @@ -941,21 +956,23 @@ void BrotliStoreMetaBlock(MemoryManager* m, size_t pos = start_pos; size_t i; - uint32_t num_distance_symbols = params->dist.alphabet_size_max; - uint32_t num_effective_distance_symbols = params->dist.alphabet_size_limit; + uint32_t num_distance_symbols = params->dist.alphabet_size; + uint32_t num_effective_distance_symbols = num_distance_symbols; HuffmanTree* tree; ContextLut literal_context_lut = BROTLI_CONTEXT_LUT(literal_context_mode); BlockEncoder literal_enc; BlockEncoder command_enc; BlockEncoder distance_enc; const BrotliDistanceParams* dist = ¶ms->dist; - BROTLI_DCHECK( - num_effective_distance_symbols <= BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS); + if (params->large_window && + num_effective_distance_symbols > BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS) { + num_effective_distance_symbols = BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS; + } StoreCompressedMetaBlockHeader(is_last, length, storage_ix, storage); tree = BROTLI_ALLOC(m, HuffmanTree, MAX_HUFFMAN_TREE_SIZE); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(tree)) return; + if (BROTLI_IS_OOM(m)) return; InitBlockEncoder(&literal_enc, BROTLI_NUM_LITERAL_SYMBOLS, mb->literal_split.num_types, mb->literal_split.types, mb->literal_split.lengths, mb->literal_split.num_blocks); @@ -1146,7 +1163,7 @@ void BrotliStoreMetaBlockTrivial(MemoryManager* m, uint8_t dist_depth[MAX_SIMPLE_DISTANCE_ALPHABET_SIZE]; uint16_t dist_bits[MAX_SIMPLE_DISTANCE_ALPHABET_SIZE]; HuffmanTree* tree; - uint32_t num_distance_symbols = params->dist.alphabet_size_max; + uint32_t num_distance_symbols = params->dist.alphabet_size; StoreCompressedMetaBlockHeader(is_last, length, storage_ix, storage); @@ -1160,7 +1177,7 @@ void BrotliStoreMetaBlockTrivial(MemoryManager* m, BrotliWriteBits(13, 0, storage_ix, storage); tree = BROTLI_ALLOC(m, HuffmanTree, MAX_HUFFMAN_TREE_SIZE); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(tree)) return; + if (BROTLI_IS_OOM(m)) return; BuildAndStoreHuffmanTree(lit_histo.data_, BROTLI_NUM_LITERAL_SYMBOLS, BROTLI_NUM_LITERAL_SYMBOLS, tree, lit_depth, lit_bits, @@ -1189,7 +1206,7 @@ void BrotliStoreMetaBlockFast(MemoryManager* m, BROTLI_BOOL is_last, const BrotliEncoderParams* params, const Command* commands, size_t n_commands, size_t* storage_ix, uint8_t* storage) { - uint32_t num_distance_symbols = params->dist.alphabet_size_max; + uint32_t num_distance_symbols = params->dist.alphabet_size; uint32_t distance_alphabet_bits = Log2FloorNonZero(num_distance_symbols - 1) + 1; diff --git a/deps/brotli/c/enc/cluster_inc.h b/deps/brotli/c/enc/cluster_inc.h index 3d4f40e601202f..22ecb3cca809df 100644 --- a/deps/brotli/c/enc/cluster_inc.h +++ b/deps/brotli/c/enc/cluster_inc.h @@ -215,7 +215,7 @@ BROTLI_INTERNAL size_t FN(BrotliHistogramReindex)(MemoryManager* m, uint32_t next_index; HistogramType* tmp; size_t i; - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(new_index)) return 0; + if (BROTLI_IS_OOM(m)) return 0; for (i = 0; i < length; ++i) { new_index[i] = kInvalidIndex; } @@ -229,7 +229,7 @@ BROTLI_INTERNAL size_t FN(BrotliHistogramReindex)(MemoryManager* m, /* TODO: by using idea of "cycle-sort" we can avoid allocation of tmp and reduce the number of copying by the factor of 2. */ tmp = BROTLI_ALLOC(m, HistogramType, next_index); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(tmp)) return 0; + if (BROTLI_IS_OOM(m)) return 0; next_index = 0; for (i = 0; i < length; ++i) { if (new_index[symbols[i]] == next_index) { @@ -259,10 +259,7 @@ BROTLI_INTERNAL void FN(BrotliClusterHistograms)( HistogramPair* pairs = BROTLI_ALLOC(m, HistogramPair, pairs_capacity + 1); size_t i; - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(cluster_size) || - BROTLI_IS_NULL(clusters) || BROTLI_IS_NULL(pairs)) { - return; - } + if (BROTLI_IS_OOM(m)) return; for (i = 0; i < in_size; ++i) { cluster_size[i] = 1; diff --git a/deps/brotli/c/enc/command.c b/deps/brotli/c/enc/command.c deleted file mode 100644 index 5e6c249196280c..00000000000000 --- a/deps/brotli/c/enc/command.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright 2013 Google Inc. All Rights Reserved. - - Distributed under MIT license. - See file LICENSE for detail or copy at https://opensource.org/licenses/MIT -*/ - -#include "./command.h" - -#include - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -const uint32_t kBrotliInsBase[BROTLI_NUM_INS_COPY_CODES] = { - 0, 1, 2, 3, 4, 5, 6, 8, 10, 14, 18, 26, - 34, 50, 66, 98, 130, 194, 322, 578, 1090, 2114, 6210, 22594}; -const uint32_t kBrotliInsExtra[BROTLI_NUM_INS_COPY_CODES] = { - 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 12, 14, 24}; -const uint32_t kBrotliCopyBase[BROTLI_NUM_INS_COPY_CODES] = { - 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 18, - 22, 30, 38, 54, 70, 102, 134, 198, 326, 582, 1094, 2118}; -const uint32_t kBrotliCopyExtra[BROTLI_NUM_INS_COPY_CODES] = { - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 24}; - -#if defined(__cplusplus) || defined(c_plusplus) -} /* extern "C" */ -#endif diff --git a/deps/brotli/c/enc/command.h b/deps/brotli/c/enc/command.h index d84e373d0031c9..1aac85689be6c7 100644 --- a/deps/brotli/c/enc/command.h +++ b/deps/brotli/c/enc/command.h @@ -20,14 +20,14 @@ extern "C" { #endif -BROTLI_INTERNAL extern const uint32_t - kBrotliInsBase[BROTLI_NUM_INS_COPY_CODES]; -BROTLI_INTERNAL extern const uint32_t - kBrotliInsExtra[BROTLI_NUM_INS_COPY_CODES]; -BROTLI_INTERNAL extern const uint32_t - kBrotliCopyBase[BROTLI_NUM_INS_COPY_CODES]; -BROTLI_INTERNAL extern const uint32_t - kBrotliCopyExtra[BROTLI_NUM_INS_COPY_CODES]; +static uint32_t kInsBase[] = { 0, 1, 2, 3, 4, 5, 6, 8, 10, 14, 18, 26, 34, 50, + 66, 98, 130, 194, 322, 578, 1090, 2114, 6210, 22594 }; +static uint32_t kInsExtra[] = { 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, + 5, 5, 6, 7, 8, 9, 10, 12, 14, 24 }; +static uint32_t kCopyBase[] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 18, 22, 30, + 38, 54, 70, 102, 134, 198, 326, 582, 1094, 2118 }; +static uint32_t kCopyExtra[] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, + 4, 4, 5, 5, 6, 7, 8, 9, 10, 24 }; static BROTLI_INLINE uint16_t GetInsertLengthCode(size_t insertlen) { if (insertlen < 6) { @@ -89,19 +89,19 @@ static BROTLI_INLINE void GetLengthCode(size_t insertlen, size_t copylen, } static BROTLI_INLINE uint32_t GetInsertBase(uint16_t inscode) { - return kBrotliInsBase[inscode]; + return kInsBase[inscode]; } static BROTLI_INLINE uint32_t GetInsertExtra(uint16_t inscode) { - return kBrotliInsExtra[inscode]; + return kInsExtra[inscode]; } static BROTLI_INLINE uint32_t GetCopyBase(uint16_t copycode) { - return kBrotliCopyBase[copycode]; + return kCopyBase[copycode]; } static BROTLI_INLINE uint32_t GetCopyExtra(uint16_t copycode) { - return kBrotliCopyExtra[copycode]; + return kCopyExtra[copycode]; } typedef struct Command { diff --git a/deps/brotli/c/enc/compress_fragment_two_pass.c b/deps/brotli/c/enc/compress_fragment_two_pass.c index ca68b38139ff51..f8a56063843957 100644 --- a/deps/brotli/c/enc/compress_fragment_two_pass.c +++ b/deps/brotli/c/enc/compress_fragment_two_pass.c @@ -524,7 +524,7 @@ static void StoreCommands(MemoryManager* m, static BROTLI_BOOL ShouldCompress( const uint8_t* input, size_t input_size, size_t num_literals) { double corpus_size = (double)input_size; - if ((double)num_literals < MIN_RATIO * corpus_size) { + if (num_literals < MIN_RATIO * corpus_size) { return BROTLI_TRUE; } else { uint32_t literal_histo[256] = { 0 }; diff --git a/deps/brotli/c/enc/dictionary_hash.c b/deps/brotli/c/enc/dictionary_hash.c index 16d853fe5aad11..3677d7ddb4ee4f 100644 --- a/deps/brotli/c/enc/dictionary_hash.c +++ b/deps/brotli/c/enc/dictionary_hash.c @@ -13,1833 +13,1107 @@ extern "C" { #endif -BROTLI_INTERNAL const uint16_t kStaticDictionaryHashWords[32768] = { -1002,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,1265,0,0,0,0,0,1431,0,0,0,0,0,0,40,0,0,0, -0,155,8,741,0,624,0,0,0,0,0,0,0,0,0,0,0,0,66,503,0,0,0,451,0,0,0,0,0,0,0,835,70, -0,0,539,0,0,0,0,0,0,0,0,0,113,0,0,0,0,718,0,0,0,0,0,0,520,0,1070,0,0,0,0,0,1515, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,610,0,0,750,0,0,0,307,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,964,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,999,0,0,0,0,0,0,0,0, -645,75,0,649,52,282,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1621,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,211,225,0,0,687,718,0,0,110,0,58,0,0,0,0,0,0,345,0,0,301,0,0, -0,203,0,0,1154,674,1949,0,0,0,0,0,0,0,0,0,259,0,0,0,0,0,0,0,1275,0,0,0,1231,254, -0,0,0,0,0,0,0,277,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,0,0,800,0,0,0,29, -116,100,490,0,0,0,0,0,1641,0,543,0,0,0,0,41,181,0,657,0,0,202,25,0,0,0,0,0,0,0, -0,0,0,423,0,0,0,113,0,0,0,927,963,0,976,0,206,0,0,0,0,0,0,0,0,0,2002,0,0,0,0,0, -0,0,0,0,0,0,696,0,1170,0,0,0,0,226,13,0,769,678,551,0,0,0,0,0,0,57,0,0,0,10,188, -0,0,0,624,0,0,0,0,0,0,0,0,0,1941,130,0,0,0,0,378,269,0,0,528,0,1146,0,0,0,1105, -0,1616,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,656,0,1940,0,0,0,0,0,173,0,0,0,0,0,0,0,0,0, -0,0,457,342,810,0,0,0,0,620,0,0,0,0,0,0,0,967,95,447,406,0,0,0,477,0,1268,944, -1941,0,0,0,629,0,0,0,0,0,375,0,0,0,1636,0,0,0,0,774,0,1,1034,0,0,0,0,0,824,0,0, -0,0,0,118,0,0,560,296,0,0,0,0,0,0,0,0,1009,894,0,0,0,0,0,0,0,0,0,0,0,0,0,1474, -366,0,0,0,0,0,0,0,0,0,79,1723,0,0,200,0,0,0,0,0,0,0,0,1759,372,0,16,0,943,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,0,0,900,1839,707,30,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,2004,0,0,10,115,0,50,0,0,0,0,0,0,0,0,0,0,520,1,0,738,98,482,0,0,0,0, -0,0,0,0,0,0,701,2,0,0,0,0,0,0,0,0,557,0,0,0,0,0,0,0,0,0,347,0,0,0,0,572,0,0,0,0, -0,0,0,0,0,832,0,0,797,809,0,0,0,0,0,0,0,0,0,0,0,528,0,0,0,861,0,0,294,0,0,0,109, -0,0,0,0,0,0,0,0,1187,290,266,0,0,0,0,49,50,748,0,0,466,399,0,0,0,0,0,0,0,378,0, -519,0,0,0,0,0,0,0,0,0,0,0,0,667,351,902,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,180, -0,0,869,0,0,0,0,0,0,0,260,0,0,0,0,0,0,0,0,0,0,523,36,0,0,587,510,809,29,260,0,0, -0,0,0,0,0,0,570,0,565,0,1464,0,0,0,0,0,0,10,0,0,787,399,380,200,0,0,0,0,516,0, -844,887,0,0,0,0,0,0,0,44,0,0,0,305,1655,0,0,0,0,0,0,0,0,0,0,0,0,0,0,786,10,0,0, -0,0,0,0,0,0,0,2031,0,0,0,0,0,684,0,0,0,0,0,1480,0,0,0,27,0,0,0,395,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,813,511,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,0,0,0,206, -496,0,0,0,0,0,909,0,891,0,0,0,0,0,0,0,0,0,687,0,0,0,1342,0,0,0,0,0,0,0,0,0,0, -160,41,0,0,0,0,0,0,0,0,0,0,0,1718,778,0,0,0,0,0,0,0,0,0,0,1610,0,0,0,0,0,115,0, -0,0,0,314,294,0,0,0,983,178,193,0,0,0,0,0,0,0,0,0,174,0,0,0,0,0,0,0,0,0,0,848, -1796,0,0,0,0,0,0,221,0,687,1660,0,0,0,0,262,0,0,179,0,0,0,0,0,66,0,773,0,352,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,0,152,0,0,1197,0,0,0,0,0,0,0,0,0,0,0,0,560,0,0, -564,0,0,0,797,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,556,0,819,0,0,0,0,0,0,0,0,719,544, -637,5,0,0,0,0,0,0,0,0,0,0,0,101,0,1441,0,0,0,893,0,0,0,0,0,0,0,0,0,238,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,1296,0,0,969,1729,314,60,0,0,0,0,0,1144,0,1147,0,0,0,0,0, -0,0,0,0,0,437,1853,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,828,0,176,0,0,0,0,0,0,434,39,0, -0,0,0,0,159,0,0,0,902,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,270,0,0,0,0,801,556,0,0, -0,0,0,0,0,416,19,197,369,0,0,0,0,0,0,0,0,0,28,34,0,757,0,0,898,1553,0,721,0,0,0, -0,1012,0,0,0,0,1102,0,898,183,0,0,0,0,0,0,0,136,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,277,0,0,0,435,0,0,0,0,0,1311,0,0,0,0, -0,0,211,437,0,0,0,28,0,0,750,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2012,0,702, -0,808,0,0,0,0,739,166,0,0,0,0,0,0,719,170,500,0,0,0,0,0,0,0,0,1500,327,0,0,450, -0,0,0,1318,0,0,0,1602,0,0,331,754,0,0,0,0,0,1368,0,0,557,0,0,0,799,850,0,0,0,0, -0,0,0,0,908,0,0,0,0,0,19,62,459,0,0,0,0,0,0,0,0,0,0,0,0,1802,0,0,0,0,0,0,0,0,0, -1397,0,0,0,0,120,238,0,0,0,0,0,0,0,0,0,0,0,1324,0,0,0,0,0,0,0,0,602,201,0,0,164, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,0,0,0,0,0,0,0,0,0,0,0,0,0,1243,0,0,0,0,968,0,0, -0,0,0,0,882,0,0,0,907,329,100,0,0,0,0,0,0,0,0,0,0,0,176,26,9,0,0,265,256,0,0,0, -0,0,0,0,0,0,643,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,610,0,0,0,0,973,2001,0, -0,0,0,0,0,522,0,0,0,0,0,0,0,0,0,0,0,553,0,0,0,0,0,0,1582,0,1578,0,0,0,0,0,0,0,0, -0,0,0,795,0,0,0,432,0,0,0,0,0,0,84,126,0,0,0,0,790,0,377,64,0,1529,0,0,0,0,530, -1857,539,1104,0,0,0,0,0,0,0,0,0,0,0,0,977,0,0,0,34,0,0,0,0,0,0,0,0,0,0,0,24,26, -0,0,918,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,183,379,0,0,0,0,0,0,0,792, -0,0,0,0,0,0,0,0,0,1920,0,0,0,0,0,0,0,0,0,771,0,0,0,1979,0,901,254,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,140,0,0,0,0,0,440,37,0, -508,0,0,0,513,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,533,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,752,920,0,1048,0,153,0, -0,391,0,0,1952,0,0,0,0,0,0,0,0,0,0,126,0,0,0,0,640,0,483,69,1616,0,0,0,0,0,734, -0,0,0,0,0,0,480,0,495,0,472,0,0,0,0,0,0,0,0,874,229,0,0,0,0,948,0,0,0,0,0,0,0,0, -1009,748,0,555,0,0,0,0,0,0,193,0,653,0,0,0,0,0,0,0,0,0,0,984,0,0,0,172,0,0,0,0, -0,0,0,0,83,1568,0,0,384,0,0,0,0,0,0,0,164,880,0,0,0,0,0,0,0,0,0,0,0,367,121,0,0, -828,0,0,0,0,0,0,0,1541,0,0,0,0,0,0,0,343,0,0,0,0,0,0,0,0,561,57,0,0,0,0,0,0,0, -926,0,0,0,0,827,0,194,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,0,0,0,0,0,0, -0,0,0,896,1249,0,0,0,0,0,1614,0,0,0,860,0,0,0,0,0,0,0,0,964,102,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,899,0,569,0,0,0,0,795,2045,0,0,0, -0,0,0,104,52,0,0,0,0,0,604,0,0,0,0,779,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0, -494,0,677,0,0,0,0,0,0,0,508,0,0,0,0,0,0,0,0,0,1014,0,957,0,0,630,310,0,0,0,570, -0,0,449,0,64,537,0,0,0,0,0,0,0,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,702,1650,49,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,338,0,0,0,0,1279,0,0,0,0,0,0,0,896,0,0, -178,0,0,0,0,0,0,0,0,0,0,0,0,0,808,695,0,0,0,0,539,1117,0,0,0,0,0,0,0,0,257,0, -1003,0,0,0,1,448,0,516,0,0,960,0,125,4,0,1268,30,748,0,0,852,0,0,0,6,0,0,848, -236,1385,862,1811,0,0,0,0,698,803,0,0,0,0,0,0,0,610,992,0,0,878,0,1847,0,0,0,0, -0,0,0,383,0,1404,0,0,0,0,986,0,347,0,0,0,0,0,0,0,0,0,0,0,592,572,0,1411,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,0,0,0,0,0,0, -0,0,0,0,0,0,0,1829,0,0,0,0,0,0,0,0,0,0,0,0,700,748,0,0,0,0,0,0,365,0,0,127,0,0, -83,198,0,0,0,0,0,0,864,55,0,0,0,0,726,1752,0,0,0,0,0,0,0,0,0,0,0,0,0,1066,0,764, -0,0,0,0,683,0,550,309,0,0,874,1212,0,0,0,1364,0,986,381,723,0,0,0,1573,0,0,0,0, -0,1025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1559,0,0,0,0,493,133,0,0,0,0,148, -119,0,0,0,0,0,0,537,14,541,0,635,126,0,0,0,495,0,0,0,0,861,998,1009,0,0,0,0,0,0, -0,359,368,0,0,0,0,304,1577,0,0,0,0,0,1107,0,0,0,0,0,929,0,0,0,1142,0,0,0,0,289, -175,0,432,0,219,0,0,0,0,0,785,0,0,595,0,0,0,0,0,0,0,0,0,0,0,0,0,80,0,0,0,0,0,0, -931,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1323,0,0,0,0,290,0,559,1751,127,0,0,0, -934,1167,0,963,0,260,0,0,0,573,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -580,1689,0,0,0,0,0,0,0,0,0,1164,0,0,982,1922,0,63,0,0,0,0,0,793,0,0,0,0,0,0,0,0, -0,0,0,0,0,67,790,0,0,0,0,0,0,0,0,0,0,391,443,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,271,0,0,0,0,0,0,0,0,0,0,0,1140,0,0,0,0,340,300,0,897,0,0,0,0,0,0, -0,0,0,0,890,0,0,0,0,818,321,53,0,0,0,0,0,0,0,0,0,468,0,243,0,870,0,0,0,1765,121, -0,0,0,180,518,0,822,419,634,0,0,0,0,0,0,0,0,0,898,0,0,0,0,454,36,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,806,0,0,0,0,0,0,0,0,0,0,0,0,1326,0,104,0,0,0,0,0,0,0, -0,0,260,0,0,0,0,0,0,0,0,0,0,0,0,542,45,0,0,263,1516,42,0,0,0,0,0,468,0,1005,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,288,87,0,0,0,0,0,0,0,0,502,988,133,0,0,0,0,0,0, -141,0,0,872,1842,0,0,0,0,0,0,0,0,261,619,0,0,0,0,189,246,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,678,0,0,0,0,0,0,0,0,0,0,0,0,285,35,0,517,0,0,0,0,0,0,0,0,0,0, -540,214,667,0,74,0,0,125,0,0,0,0,0,761,131,0,0,0,0,0,0,0,0,0,0,0,0,0,333,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1338,94,0,0,0,0,0,0,0,0,0,0,0,0,449,0,646,103, -86,641,2028,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,869,87,277,117,39,0,0,0,0,0,0,0,0,938, -297,0,0,0,0,558,464,0,0,0,0,0,0,0,0,0,0,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1608,0, -0,0,0,0,0,0,1429,0,0,733,1010,0,0,338,1656,0,0,0,1038,979,2010,0,0,0,0,0,0,0, -1005,0,0,121,0,0,0,219,20,0,0,0,0,0,0,872,1440,0,0,0,683,0,1070,0,0,522,0,0,0,0, -439,669,0,0,0,0,0,0,0,0,1245,0,0,0,0,0,1218,0,0,547,233,0,0,0,0,0,0,0,0,0,482,0, -0,0,0,0,0,0,886,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,795,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,371,0,0,0,0,0,0,0,0,0,0,0,0,0,622,0,625,0,0,0,339,29,0,0,338,0,0,0, -0,130,0,0,0,0,0,0,0,0,0,307,0,0,0,0,0,0,0,0,0,0,2044,0,0,0,0,0,0,0,0,308,770,0, -0,0,0,0,1266,0,0,0,0,0,0,0,0,0,400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,690,739,0,0, -0,0,0,0,0,990,0,0,0,1831,0,0,0,0,0,0,0,0,0,0,0,0,0,613,0,0,0,0,0,0,0,0,0,0,0,0, -0,763,0,878,0,0,0,977,0,100,0,0,0,0,0,0,0,0,0,463,0,0,0,0,623,318,0,0,296,463, -137,0,0,454,0,0,0,1527,58,0,0,0,0,0,0,0,18,48,0,0,0,0,0,729,0,0,0,442,0,0,0,0, -40,449,0,853,0,0,0,0,0,0,227,0,0,0,0,0,0,1491,0,0,0,0,0,0,0,0,0,0,161,55,0,450, -0,1174,62,0,207,0,0,0,0,0,0,0,0,869,0,0,0,0,80,213,0,0,0,0,0,0,0,0,0,0,354,820, -0,0,747,0,0,0,954,0,0,1073,0,556,0,0,0,692,0,191,0,804,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,831,162,0,0,35,0,0,0,0,0,0,0,0,1235,0,0,0,0,0,1234,0,0, -0,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,149,0,0,0,902,204,0,0,833,0,287,366,0,0,0,0,0, -0,992,2020,0,0,0,0,0,0,0,0,0,0,0,356,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,784,0,0,567, -630,0,0,0,539,0,0,27,0,0,0,0,0,0,0,0,0,0,755,0,0,0,0,0,0,0,0,0,0,0,0,814,0,0,0, -0,0,0,0,0,0,0,0,0,0,987,0,0,255,761,194,0,1086,0,0,0,0,0,0,1016,0,0,1396,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,562,271,913,0,0,0,0,0,0,0,0,320,153,45,475,0,0, -0,0,0,0,0,713,0,327,0,0,0,0,0,0,604,552,3,359,0,0,0,0,853,80,0,0,0,0,0,0,0,2016, -6,887,0,0,0,0,975,0,961,0,0,0,0,0,916,1891,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,100,101,390,708,0,0,0,587,983,512,0,0,0,0,0,0,0,0,0,0,0,645,0,0,0,851,0,0,0, -0,0,498,140,217,0,0,0,1448,0,0,0,0,0,0,0,0,0,905,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -643,105,0,792,0,0,0,0,0,0,0,0,0,0,0,0,56,0,0,0,0,0,0,0,0,0,0,535,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,1748,0,0,0,0,0,754,0,0,0,0,0,0,0,0,0,0,0,0,91,0,0,1565,0,91,792, -939,3,370,0,0,0,0,95,0,0,0,0,551,7,619,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1150,0, -0,0,0,0,0,0,0,0,0,0,0,0,671,0,0,0,0,0,888,368,149,0,0,105,1134,0,983,0,0,458,31, -0,643,0,0,0,312,0,740,0,0,0,1642,0,0,0,0,0,0,0,236,0,0,0,0,0,0,0,59,68,0,0,0,0, -0,867,795,0,0,0,0,970,1977,0,0,0,0,0,0,0,1148,0,775,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,970,0,0,0,0,0,0,0,0,0,665,71,0,0,0,0,827,0,0,0,0,0,0,0,0,0, -0,479,0,0,0,0,0,0,0,0,99,607,0,0,0,0,0,0,0,1960,0,0,0,793,0,0,871,41,0,0,241,94, -0,0,0,0,209,0,0,1497,0,0,0,0,0,0,0,0,0,98,0,0,0,463,0,0,0,0,291,0,0,0,0,0,0,0,0, -0,0,984,0,0,0,0,0,205,0,0,0,0,0,0,205,42,0,801,0,0,0,0,0,635,0,0,533,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,371,0,1282,0,0,0,825,0,0,0,0,0,0,0,0,0,357,879,467,0,317,0,0, -0,0,0,0,0,924,0,0,0,0,849,1795,0,0,0,0,895,1799,43,0,0,0,0,0,0,0,0,0,0,1820,0,0, -0,0,0,0,0,525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,110,0,493,0,174,417,0,0, -0,0,0,583,733,0,0,0,0,0,0,481,215,0,0,0,0,477,0,0,0,0,0,0,0,0,308,0,0,0,0,0,0,0, -0,297,126,0,0,361,1551,0,0,0,0,0,0,871,1807,0,0,0,0,0,1307,0,685,0,0,0,0,0,0,0, -797,0,858,0,565,0,0,0,0,0,0,0,0,0,0,0,0,434,252,826,0,0,0,0,0,0,791,0,0,0,0,509, -231,178,601,0,0,0,0,0,0,0,0,43,1591,0,0,0,0,0,1683,0,0,0,0,45,0,0,0,0,0,0,0,0,0, -0,1120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,556,494,0,398,0,0,0,1030,0,0,0,0,0,0, -168,0,0,0,0,0,0,0,0,0,0,973,0,642,0,0,0,0,0,0,0,0,0,1615,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,378,594,0,1093,0,679,112,0,0,0,0,1492,540,1374,714, -1486,0,0,0,0,825,1511,0,0,0,0,0,0,0,0,0,0,0,0,0,952,0,0,736,143,0,700,0,1540,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1557,0,0,0,860,990,0,0,0,807,0,0,0,0,0,131, -515,0,646,0,0,0,0,117,728,508,121,0,0,0,0,0,0,357,0,0,0,0,0,0,237,0,0,0,0,0,0,0, -0,0,1784,0,0,0,0,0,0,0,0,0,0,0,713,348,1536,0,738,0,0,0,0,0,0,0,434,0,0,0,0,0,0, -366,1877,39,0,0,0,0,0,0,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,0,0,0,0,171,0,625, -550,107,343,943,0,0,0,0,0,0,0,768,0,0,0,0,0,0,0,799,0,0,0,894,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,1673,0,0,0,0,0,0,0,0,0,0,0,1052,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -272,0,441,0,0,3,9,0,0,0,1182,0,1346,0,0,0,0,0,0,0,0,682,0,0,1004,24,0,0,968,0,0, -0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,185,0,0,0,578, -474,0,0,0,0,0,0,0,0,0,0,0,0,0,0,113,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,556,0,0,0,0,0,0,16,1317,0,0,97,0,0,0,703,0,0,0,0,0,0,0,0,892,0,0,0,1571,0,0, -426,186,0,1101,0,0,0,0,0,0,0,0,937,585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,644,291, -0,0,0,0,749,0,162,0,0,381,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,762,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,628,21,0,0,0,0,0,0,0,0,919,0,0,0,0,0,0,0,0,0, -633,0,0,0,0,332,0,0,0,0,0,0,0,0,0,1489,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,832,398,0,645,0,0,0,13,0,0,0,0,0,0,0,0,0,0,20,0,800,0,0,0,0,0,0,0,0,0, -0,0,0,0,1993,0,0,0,0,769,0,0,0,665,0,0,0,0,0,0,0,0,0,0,1426,0,0,0,0,60,0,0,0, -641,1874,0,644,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1757,0,0,0,0,0,937,0,1652,0,654,0, -0,0,0,0,0,0,527,0,0,0,0,0,0,0,0,0,0,0,0,0,226,0,0,0,0,0,1486,0,0,0,0,0,0,0,0,0, -0,0,325,0,0,0,0,0,0,0,1345,0,0,91,0,404,0,0,0,0,0,0,0,0,0,0,0,0,973,0,0,0,0,0,0, -0,1176,0,549,0,0,0,0,0,0,0,0,0,0,976,0,0,0,0,0,21,0,0,0,0,0,51,0,0,0,0,314,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,198,6,0,1093,0,0,0,0,0,0,0,0,0, -0,0,0,0,1776,0,0,0,0,0,1528,0,419,0,0,0,0,0,0,0,0,76,138,0,0,0,0,638,29,0,0,0,0, -0,0,0,1418,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1710,0,0,0,0,0, -0,0,0,0,0,0,0,532,23,0,0,0,0,0,0,0,862,0,0,946,592,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,70,0,0,0,0,0,0,0,0,0,812,0,0,0,76,0,0,988,0,442,0,0,0,896,0,0,0,0,0,0, -483,0,0,0,0,1709,0,0,0,0,0,0,119,0,0,0,117,0,309,0,0,0,0,0,596,976,0,0,0,0,0,0, -0,0,0,0,0,768,0,0,0,0,0,0,0,0,0,518,0,0,0,0,0,0,0,0,0,0,0,0,0,0,863,0,0,0,24, -145,1020,0,0,1984,0,0,0,0,0,0,0,658,0,0,0,0,0,0,0,0,0,0,106,1827,0,1010,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,582,87,0,0,0,0,0,0,0,267,0,0,0,703,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,496,0,0,0,0,1121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,561,0,0,0,0,0, -0,0,760,0,0,154,0,0,0,255,0,419,323,0,0,0,0,0,368,0,0,0,0,0,0,0,0,0,0,522,0,0,0, -0,0,0,0,551,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,92,0,0,0,0, -0,0,0,284,525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,958,0,0,594,0,0,0,0,0,0,6,479,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,61,0,0,0,0,0,0,0,820,1641,0,1556,0,0,0,0,0,0,0,302,0,0, -0,0,0,148,0,0,676,0,0,0,0,0,0,1674,0,0,0,0,0,0,178,0,0,0,0,0,0,0,94,389,0,0,0,0, -91,8,0,0,0,0,0,0,0,0,0,0,112,0,0,0,0,0,0,0,0,0,0,747,0,0,0,0,0,0,0,1746,0,0,0,0, -0,24,0,1352,158,1530,0,0,718,130,280,1401,0,0,0,0,0,1946,8,0,0,0,0,1607,0,0,0,0, -0,0,882,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,417,0,0,0,1597,633,433,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,234,0,0,0,0,0,0,0,0,680,1950,0,0,0,0,249,5,0,0,0, -0,0,0,0,0,0,1216,0,1773,0,0,0,0,0,0,0,0,0,0,0,0,0,0,509,180,0,0,0,0,0,0,0,1002, -0,0,0,0,0,0,0,0,0,0,0,0,0,931,0,0,0,0,0,0,0,0,747,943,0,1837,0,0,0,0,0,0,0,641, -0,0,0,0,280,0,0,0,5,0,0,0,0,0,72,545,0,0,0,0,0,0,0,0,0,742,0,0,254,151,872,0,0, -0,0,0,0,0,0,0,0,0,0,921,0,0,517,833,0,1680,0,0,436,251,584,0,0,0,0,0,0,0,0,0,0, -0,24,500,0,0,0,0,0,0,0,0,195,1775,514,389,0,0,0,0,0,0,0,743,0,0,0,0,0,0,292,0,0, -0,227,1283,774,1805,0,0,0,0,0,0,0,0,0,0,119,81,0,0,0,0,0,0,0,0,0,0,0,0,0,0,913, -1910,0,0,0,1826,490,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1162,700,30, -0,0,0,721,839,0,0,0,617,0,0,0,0,0,0,0,0,0,169,428,0,0,0,0,0,1648,637,1205,0,0,0, -1596,0,0,4,266,0,0,0,0,0,0,0,0,0,0,0,862,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0, -0,279,157,391,604,0,0,713,945,877,973,0,0,0,0,0,0,0,0,0,0,0,0,0,0,859,567,628, -1846,0,0,0,0,0,0,0,0,0,762,0,0,191,0,0,0,0,298,0,0,767,909,0,0,0,0,0,0,0,795,0, -0,301,0,0,1970,0,0,0,0,0,0,0,0,0,1236,0,0,0,0,0,0,644,369,15,0,160,71,0,0,0,0,0, -1447,0,0,0,0,0,0,0,0,735,1255,76,0,0,0,0,0,0,0,0,0,0,474,0,0,0,0,0,0,0,0,0,0, -841,0,0,0,0,0,0,0,0,0,0,836,0,0,0,0,0,1622,0,0,735,0,0,0,0,1601,804,1390,394,0, -0,0,0,0,0,96,0,289,0,0,35,688,0,0,0,667,0,513,0,0,0,0,0,0,0,2034,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,704,0,1524,0,1078,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,306, -0,0,0,0,0,0,0,431,0,1196,0,0,54,0,15,1448,0,1418,0,0,0,0,0,0,0,0,0,907,0,0,0,0, -0,0,194,1767,0,0,0,0,0,840,0,900,0,0,0,0,0,0,0,0,0,0,0,1436,0,0,0,0,642,1560,0, -0,0,0,0,0,94,386,0,0,0,0,0,0,0,0,0,0,830,416,0,0,20,731,0,0,0,0,0,0,0,0,697,0,0, -662,0,0,0,0,0,0,0,0,0,861,0,0,0,0,0,0,0,871,671,864,0,928,7,0,332,0,0,0,0,1055, -0,0,0,0,0,0,986,0,0,0,0,0,44,76,0,0,0,0,0,0,0,0,0,0,300,0,0,0,0,0,0,0,175,518, -831,1108,0,0,0,836,0,1852,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,843,1804,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,246,0,0,0,610,202,0,0,36,0,0,0,240,654,13,0,0,0,0,0,0,0, -0,391,0,403,0,0,0,0,0,0,0,0,0,0,75,0,366,815,0,0,631,0,0,0,0,0,0,0,0,345,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,952,0,0,0,0,0,0,0,0,0,0,0,673,35,662,0,287,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,5,34,0,0,0,0,0,0,0,0,151,0,427,0,0,382,0,0,0,329,0,0,279,0,0,0, -0,0,0,0,0,0,0,906,0,0,366,843,0,1443,0,1372,992,0,36,123,0,649,0,0,0,0,0,767,0, -1018,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,995,0,0,0,0,0,0,0,72,368,0,0,1345,0,0,0, -589,0,0,0,0,0,0,0,0,0,1988,0,0,220,541,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,32,196,0,0,0,0,0,0,0,0,0,0,0,0,0,381,0,0,0,0,0,0,0,0,0,1452,0, -0,0,616,0,0,0,0,0,0,0,0,0,1229,0,0,0,0,0,0,0,0,0,0,667,120,0,0,0,0,0,0,0,1146,0, -0,0,0,0,0,0,0,0,0,0,352,0,0,0,0,0,293,0,0,0,0,0,0,0,0,0,0,0,0,0,935,0,1050,0, -147,88,0,0,923,0,0,0,0,0,934,0,0,0,0,0,0,0,0,114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,341,222,0,0,0,0,0,0,0,0,0,0,293,0,0,0,0,0,0,0,0,0,0,0,0, -637,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1159,0,0,0,847,0,0,0,0,0,0,683,0,867,944,0,0, -0,0,0,1809,0,0,0,0,0,0,0,0,0,0,395,170,0,0,0,0,0,0,0,0,0,0,618,535,0,1625,0,0,0, -0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,778,0,0,0,0,0,46,0,2032,0,0,37, -1458,0,938,363,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,314,0,0,0,0,0,0,889,0,0,0,0,0,0,0, -0,0,0,0,462,0,0,0,0,525,0,0,23,0,0,0,0,0,0,0,0,0,0,0,676,0,0,0,0,0,0,0,0,0,0,0, -0,498,725,0,0,0,0,7,0,0,0,0,773,0,0,0,164,0,0,0,0,0,0,0,0,936,583,659,1462,0, -220,0,0,0,0,803,0,0,544,119,0,0,0,0,0,0,0,0,0,0,0,181,176,0,1192,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,1878,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,0,0,0,0,0, -944,0,0,0,0,0,0,0,273,0,0,0,0,0,855,0,0,0,0,5,127,0,0,0,0,0,0,0,0,752,230,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,162,0,654,48,156,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,197, -0,0,0,0,0,0,0,963,0,0,0,0,0,0,0,0,0,0,858,0,0,0,0,0,0,0,0,0,0,676,1978,0,0,102, -972,0,0,0,0,0,0,0,361,0,461,0,0,0,472,0,0,0,0,0,0,0,0,0,0,0,0,0,0,747,905,0,0,0, -155,0,0,0,0,0,0,0,0,0,0,319,163,0,0,0,0,0,0,0,0,0,848,0,0,36,631,0,0,0,0,0,1769, -0,0,0,0,0,144,0,0,0,0,0,0,0,0,0,0,369,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,555,247,0,0, -996,0,0,189,0,0,0,0,0,0,0,0,0,0,280,0,0,0,0,0,0,0,0,0,0,0,526,746,0,0,345,0,0,0, -1017,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,651,428,0,0,0,1162,230,327,546,792,0,0,0, -1203,0,0,0,0,0,0,0,0,0,672,189,0,0,0,0,0,0,99,0,0,0,298,0,0,0,0,0,0,555,397,0,0, -0,0,0,1157,0,0,0,0,0,0,0,0,0,0,398,1523,0,366,0,0,787,0,0,0,282,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,157,0,941,0,0,0,0,0,1336,0,0,116,0,0,0,0,0,0,787,0,0,0,0,0,0,0,0,0, -0,170,160,0,1815,0,0,0,0,0,866,0,0,0,0,0,0,0,0,0,689,0,0,0,0,820,0,498,108,0,0, -0,1119,0,0,0,244,609,1005,0,581,0,0,0,0,0,895,0,0,0,1898,0,0,0,0,0,926,0,0,0,0, -0,0,0,0,0,0,0,0,0,538,496,294,301,0,0,0,18,0,0,757,0,0,0,0,0,1263,0,820,0,722,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2028,0,0,0,0,124,1875,0,0,0,881,0,0,0,1348, -0,0,0,0,0,0,0,911,0,954,0,0,0,0,414,0,0,0,0,517,0,0,0,0,0,816,0,0,0,0,0,0,0,0, -713,0,0,0,0,0,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,593,150,0,0,0,0, -0,553,0,0,0,0,0,0,0,0,0,0,108,0,0,0,0,420,0,0,0,0,0,0,0,0,0,0,0,1777,0,0,55,493, -0,0,81,0,321,980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,362,112,0,74,0,0,0,0,0,0,0,625,0,0, -0,0,0,0,377,16,0,0,61,281,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,1031,0,0,0,0,0,0,51,0, -0,0,0,0,0,0,211,309,15,125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,789,173,0,439,9,648, -0,0,294,0,0,0,0,0,0,0,374,8,0,1099,0,0,0,0,0,0,0,575,0,0,0,518,0,0,0,702,0,0,0, -0,0,0,87,0,0,0,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,464,122,0,0,0,1802,0,0,0,0, -0,0,499,0,0,0,87,476,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,840,283,0,0,0,0,1620,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,609,1160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600, -323,372,0,0,0,0,471,722,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0, -477,1304,0,1774,0,0,88,0,438,12,0,0,0,0,0,0,0,0,671,997,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,639,22,0,0,782,681,0,0,0,0,0,0,0,0,0,0,1013,664,0,942,0,1349,0,0,0,0,0,0,0, -0,0,0,0,0,356,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,289,0,1975, -109,450,0,0,0,0,0,0,0,0,0,0,705,0,0,664,0,0,0,0,0,0,0,1238,0,0,318,0,0,0,0,0,0, -0,0,0,0,0,0,0,960,1872,0,0,0,0,0,0,0,0,0,0,0,0,0,0,103,0,0,0,0,0,0,0,0,0,239, -777,0,26,0,0,0,0,0,0,0,0,0,0,0,0,375,414,0,17,0,0,0,1350,0,955,0,0,0,0,0,0,0,0, -887,960,0,0,0,0,0,0,0,0,0,0,708,710,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,919,0,0,0, -0,502,280,7,45,0,0,0,0,777,0,0,0,0,410,0,1110,0,0,0,0,0,0,414,341,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,787,0,0,0,436,0,0,0,0,0,0,0,1707,613,377,96,0,0,0,0,451, -0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,483,916,0,0,0,0,0,0,937,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,739,0,0,0,0,0,0,0,0,82,0,0,663,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,128,0,0,0,0,0,0,0,0,1087,0,0,0,0,0,0,0,503,0,0,0,0,0,0,9,113,104,324,0,460,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,935,702,434,485,1014,949,423,0,900, -0,0,0,0,0,0,0,2018,574,0,0,0,0,0,0,0,0,0,0,0,0,1206,0,0,0,0,0,0,0,0,38,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,1022,0,0,0,0,143,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,2029,0,0,0,0,0,0,0,0,0,0,0,0,523,0,0,0,0,0,0,625,0,0,425,37,0,0,0,1943,0,0,0, -0,0,765,0,0,0,0,0,0,0,0,0,0,551,0,0,0,0,0,0,0,0,0,0,0,0,168,0,0,1010,0,0,1994,0, -0,0,91,0,0,0,0,532,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1884,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,240,15,0,0,0,1227,0,1534,0,0,0,0,0,0,0,0,0,0,0,0,0,0,392,0, -0,0,0,0,0,0,0,0,0,0,0,655,562,395,0,0,0,501,1019,0,0,0,0,509,267,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1099,0,0,0,0,0,0,948,0,0,0,0,0,0,0, -462,114,0,0,258,404,0,1717,0,0,0,0,82,1061,0,724,0,0,0,0,0,1133,0,0,0,0,0,0, -1021,841,0,1021,0,0,0,0,0,0,0,0,0,0,488,373,37,0,0,0,0,564,0,0,0,0,0,513,0,0,0, -825,0,0,899,0,0,778,0,0,12,1417,0,1116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114,545,0,5, -0,0,0,0,0,0,0,192,0,0,763,0,0,0,0,0,0,0,755,759,0,0,0,0,0,0,0,0,0,370,0,1237,0, -0,0,0,0,0,298,87,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0, -0,0,0,0,814,991,0,757,57,0,0,0,0,0,0,0,0,0,540,0,0,0,0,608,0,0,0,0,0,0,0,0,1014, -0,0,0,902,0,0,0,0,553,1668,0,0,0,0,0,0,0,0,0,559,60,0,0,0,0,0,511,0,0,675,0,0, -156,0,0,0,0,0,0,709,0,698,0,0,0,1745,0,0,0,0,0,0,0,0,0,714,0,0,0,0,0,0,0,0,206, -8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,776,0,0,0,0,0,0,0,0,0,1272,0,0, -0,0,0,1059,0,0,0,0,0,0,406,0,0,0,0,0,0,0,0,0,0,947,0,0,0,0,0,0,168,0,0,0,0,0,0, -870,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,554,0,0,0,0,784,908,0,0,0,0,0,0, -0,396,358,0,0,0,0,0,0,0,0,2,228,0,0,0,0,0,0,0,0,0,0,0,845,14,0,716,1820,594,0, -81,1428,0,161,0,782,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,998,0, -0,0,0,0,0,0,0,0,0,0,0,1043,0,1496,0,0,0,0,0,0,0,0,781,0,0,0,0,0,0,0,817,1114,0, -1814,958,0,0,0,0,812,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,139,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,236,643,0,0,0,0,0,0,0,0,0,1172,0,0,0,0,0,0,0,0,0,1338,0,0,0, -0,0,0,0,0,0,0,0,54,0,0,0,256,0,0,351,0,955,1885,0,469,0,0,0,1270,0,744,0,313,0, -0,0,0,0,0,0,0,402,969,0,0,0,0,0,0,50,0,0,0,0,572,0,0,0,0,847,0,0,0,0,0,0,0,248, -43,0,369,0,0,0,0,0,0,0,0,0,0,0,0,0,766,0,363,0,0,0,0,0,0,0,0,0,0,0,678,0,0,409, -258,82,249,0,0,0,0,0,0,0,0,0,0,0,0,32,393,0,788,0,0,0,1281,509,1968,0,0,0,0,39, -291,0,0,0,589,0,0,54,1059,0,0,0,0,0,0,824,0,0,0,0,0,0,0,0,0,0,1005,0,1598,0,0,0, -0,0,919,0,0,0,0,0,0,0,0,52,132,0,0,0,0,0,328,0,0,0,0,173,0,0,0,0,0,65,1411,0,0, -0,0,0,0,0,0,0,0,442,0,842,0,0,0,0,0,0,0,0,0,534,0,0,0,0,0,0,0,0,0,0,0,0,0,845, -210,0,0,0,0,0,0,0,0,892,0,0,223,0,0,0,0,529,0,0,0,807,0,137,218,0,1444,0,0,0,0, -0,332,661,0,0,0,0,0,0,0,76,1517,0,0,0,0,0,0,0,0,0,0,0,418,0,0,0,0,0,0,0,0,481, -379,0,0,0,0,0,149,18,0,0,0,0,0,0,0,0,742,304,142,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,799,925,195,51,0,0,0,0,688,0,0,0,0,697,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,1169,751,0,0,0,452,929,0,221,0,1437,0,0,0,0,955,1251,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,132,0,0,0,0,0,865,0,0,0,0,0,0,0,767, -672,42,0,0,0,1050,0,0,0,0,0,0,0,0,368,44,0,0,0,0,0,0,0,570,29,0,0,0,0,0,0,227,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,522,0,0,0,0,0,0,0,1529,0,0,0,0,0,0,739,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,1667,0,0,0,0,0,0,132,511,0,138,208,1020,0,0,23,565,0,344,0,0,0, -0,0,922,0,0,0,0,0,0,0,240,0,0,415,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,402,0,0,754,31,716,0,982,731,0,0,0,0,0,0,0,888,0,0,0,803,847,0,0,823, -0,0,0,0,0,0,785,0,0,2,0,0,0,0,0,0,0,532,0,0,681,0,0,314,0,384,684,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,649,447,0,1818,1007,0,321,0,66,360,0,0,0,385,0,0,0,0,0,0, -0,900,73,254,0,0,0,0,683,1959,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,86,0,0,725,0,0,0,0,0,196,0,0,0,0,0,831,0,0,0,0,723,0,0,0,0,0,994,627,0,0, -0,0,0,0,0,0,0,0,764,66,0,0,0,0,205,36,0,0,0,0,0,0,0,950,0,0,0,887,111,0,0,831, -388,165,0,0,0,0,0,155,0,0,0,0,0,0,0,0,0,0,0,0,0,0,780,755,0,0,0,0,898,146,0,0,0, -0,0,0,0,45,7,0,0,0,0,0,0,0,0,607,0,0,0,0,0,0,65,0,0,0,0,0,0,0,0,0,88,0,0,0,0,0, -621,600,0,367,0,0,0,0,0,0,0,561,0,559,0,585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,672,157,0,0,0,0,714,0,0,0, -0,0,456,0,925,0,0,0,0,0,0,0,0,19,0,0,0,0,1473,0,0,0,0,0,0,0,0,0,0,113,0,0,0,0,0, -0,0,0,0,0,0,0,0,69,463,0,0,82,193,2,471,0,0,0,0,633,0,0,0,0,0,0,1148,129,1392, -542,803,0,0,0,0,0,0,0,0,0,0,0,0,438,0,0,0,0,0,0,875,0,0,0,0,0,237,0,0,0,0,0,0,0, -65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,0,0,0,9,444,0,0,43,1260,0,0,0,0,0,0, -971,0,0,699,0,0,0,0,0,1116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,829,242,0, -0,593,0,0,0,0,0,0,0,0,201,36,224,0,0,0,0,0,0,1430,0,1806,0,523,0,0,212,1889,0,0, -0,827,0,0,0,0,0,2043,136,242,0,0,0,0,0,0,284,148,10,0,0,0,0,0,0,1249,0,0,0,807, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,0,0,0,494,0,0,0,0,0,0,0,0,1510,0,0,0,0,0, -0,0,0,0,0,505,1306,0,0,764,268,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1703,0,0,0,0,159,964,583,0,0,0, -0,0,0,515,0,0,854,0,0,0,0,0,0,0,0,0,0,0,0,1123,0,0,0,0,0,0,0,136,0,0,0,0,0,1782, -0,0,44,1287,0,0,0,0,0,732,0,0,0,0,313,679,0,0,316,0,0,0,0,595,0,0,0,0,0,0,753, -147,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,137,0,0,0,0,414,0,1762,0,0,0,0,0,0,0,0, -0,0,0,599,0,0,0,0,0,0,0,0,0,1749,0,0,0,1627,0,488,0,0,0,0,0,83,0,0,0,0,676,0,0, -1639,0,0,0,0,0,0,0,0,0,278,0,0,0,0,0,0,97,0,14,1085,0,0,0,0,0,0,781,388,0,849, -59,229,0,0,0,0,0,1115,0,0,0,0,108,0,0,0,0,700,0,0,0,0,0,0,0,0,0,1414,0,0,0,0,0, -0,0,0,0,0,0,0,0,660,737,1035,0,0,0,0,0,0,521,690,0,0,0,0,0,0,0,0,0,0,0,0,272,0, -0,0,0,0,0,0,0,0,0,1744,0,0,0,0,0,0,128,733,0,0,277,0,0,0,0,0,0,0,0,0,4,0,0,0,0, -0,0,0,0,0,0,0,0,0,936,1981,40,0,0,0,0,0,0,0,0,775,0,0,0,0,0,0,0,0,0,306,0,0,0,0, -0,0,0,979,0,0,0,0,0,611,0,0,0,0,0,178,0,0,0,1969,0,0,0,0,0,0,0,664,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,390,0,0,0,1510,0,0,0,0,0,0,0,0,0,0,0,493,0,0,37,0,0,0,0,724,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,1537,0,0,168,473,0,0,0,105,0,0,0,0, -627,438,0,0,0,0,0,0,0,0,0,0,11,1256,0,0,0,1626,0,779,0,0,0,0,25,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,308,0,0,0,0,0,741,0,671,0,0,0,0,649,150,0,0,99,521,0,0,3,339,0,0,0, -543,0,0,0,0,0,0,0,0,0,1358,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,234,155, -0,0,0,0,0,0,0,1628,0,766,0,0,0,0,0,0,0,0,0,0,0,0,0,829,0,0,0,1445,0,0,0,486,0,0, -0,0,2,1635,0,0,0,0,558,0,0,0,0,0,0,0,0,0,0,1461,0,0,0,0,0,599,0,0,0,0,0,0,0,0,0, -1376,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,0,0,0,0,0,0,447,0,0,66,1432,0,0,0,0, -0,0,307,0,413,609,0,0,0,930,0,0,0,0,21,939,0,0,0,0,0,962,4,651,0,0,0,0,15,579,0, -0,0,0,0,597,0,0,0,0,0,981,0,0,0,545,0,0,0,0,0,0,0,1558,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,800,17,0,0,17,0,907,0,0,0,110,0,0,0,53,458,0,1983,0,0,0,0,0,0,0,0,0,0,443,0, -0,0,0,0,0,0,0,0,0,0,924,1844,0,1232,0,0,0,0,70,519,0,993,0,0,0,0,0,0,14,530,0, -907,0,0,0,0,0,733,0,0,0,0,0,0,0,0,55,0,188,531,56,0,0,1693,0,0,0,0,0,0,0,0,441, -0,192,928,0,0,0,0,0,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1525,0,259,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,512,185,0,464,1603,0,0,0,0,0,0,0,0,0,0,0,1113, -284,720,0,0,722,0,0,0,0,0,13,0,0,0,0,0,0,0,4,289,43,0,0,0,0,0,0,1694,0,0,0,0, -193,0,0,0,0,409,0,0,0,0,0,0,0,0,0,0,0,0,308,0,0,1863,0,0,0,0,0,0,0,0,0,790,0,0, -745,1002,0,0,0,0,0,0,0,0,0,289,68,477,13,0,0,0,0,0,0,0,0,0,0,609,0,0,0,0,0,0,0, -0,0,0,0,367,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,528,0,0,0,0,0,0,0,0,0,694,58, -548,0,0,0,0,0,0,687,0,0,0,0,1749,0,0,0,0,0,0,0,0,1004,661,0,0,0,0,0,0,445,0,0,0, -74,0,0,0,0,213,0,0,0,0,0,0,0,0,0,0,0,0,0,834,0,0,189,1672,0,0,0,0,0,0,0,1548, -192,0,0,0,0,0,0,0,0,0,0,0,0,0,32,751,0,78,0,0,0,0,0,0,544,1602,105,473,0,0,0,0, -0,0,156,1949,0,1779,0,0,0,0,0,0,0,0,0,0,0,763,0,0,0,0,0,0,0,0,29,0,0,0,0,0,0,0, -0,0,0,883,0,0,0,0,0,0,0,488,0,617,0,0,50,0,694,1518,785,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,546,0,0,0,0,0,0,0,0,0,0,22,0,0,0,0,1016,0,0,0,577,0,0,0,0,0,0, -184,935,114,720,0,0,100,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,95,14,0,969,0,0,0,0,0,0,0, -727,0,1021,0,0,0,0,0,1190,0,0,0,0,0,0,0,0,0,0,0,0,0,153,0,0,0,0,0,0,0,0,0,798,0, -587,0,0,695,42,0,1929,141,957,0,465,7,908,0,0,450,148,0,0,0,1166,0,0,0,0,0,0,0, -0,0,0,0,0,253,0,1003,0,0,0,0,0,0,0,0,0,0,0,46,0,0,879,0,806,0,1868,0,0,0,0,0, -1846,0,0,0,730,0,0,0,0,0,0,0,965,0,0,0,0,506,0,0,0,10,0,0,0,22,0,0,0,0,0,0,0,0, -0,0,0,0,0,960,296,0,0,0,0,0,0,0,0,0,0,0,587,0,0,0,0,20,0,0,0,32,982,0,0,0,0,0,0, -0,0,0,0,941,0,0,0,0,435,0,0,0,0,0,0,71,419,0,0,0,0,0,0,688,740,94,345,0,0,679, -582,0,0,0,0,0,0,0,945,0,0,0,0,0,0,0,0,0,0,0,0,539,0,684,1993,0,0,0,659,0,583,0, -803,0,704,0,0,0,0,0,198,181,347,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,481,405,203,0,0,99,826,0,0,0,0,0,0,0,492,0,408,0,0,0,0,0,0,0,0,0,0,4,0,0, -0,0,665,349,137,0,0,0,0,612,1270,0,0,0,0,0,371,0,0,0,826,0,0,0,0,21,1535,858, -374,0,0,0,0,0,0,311,0,0,0,991,1968,0,0,0,0,494,1647,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,769,0,0,0,0,0,642,0,0,157,123,0,0,0,1435,0,0,0,0,0,0,0,0,0,0,79,0,0,0, -0,0,0,1425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,106,393,486,1690,0,0,0,0, -0,0,0,0,0,0,0,0,756,184,0,0,0,1382,0,0,0,175,0,1493,0,1007,0,0,0,0,0,0,0,0,0,0, -0,219,0,0,0,0,515,99,0,851,0,0,0,0,0,1278,0,0,0,0,0,0,0,1000,982,0,762,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,910,1819,0,0,0,0,0,0,906,0,0,0,0,0,0,0,0,0,0,1730,0,0, -0,0,0,0,0,0,0,0,0,1185,0,0,0,0,0,0,0,0,40,0,0,0,147,0,0,0,0,0,0,0,0,0,0,0,0,0, -650,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,30,0,553,0,0,20,597,0,1614,0,0,0,0,0,327, -49,0,0,0,0,0,0,0,78,0,0,786,134,0,0,0,12,496,0,0,0,0,0,0,0,0,0,0,42,204,0,614,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,147,247,0,0,0,0,942,0,0,2023,0,0,0,0, -0,0,67,285,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1309,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,532,0,0,0,0,0,0,0, -1692,0,0,0,0,55,1704,0,0,0,0,988,0,0,0,223,0,0,0,0,0,0,0,57,1123,0,0,0,0,0,1764, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2015,0,0,0,1599,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,129,0,0,0,0,0,0,0,0,0,0,0,534,0,0,0,0,0,0,0,0,0,0,0, -0,0,504,621,1248,321,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1397,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,441,75,0,0,0,0,0,0,0,0,0,0,841,0,0,0,0,0,693,0,650,314,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,913,0,0,0,0,0,0,0,0,0,0,0,0,0,0,880,0,475,0, -0,1016,179,602,111,329,0,0,0,1864,0,0,0,0,846,1888,0,0,780,0,0,0,82,0,0,0,0,821, -0,0,0,0,0,0,0,0,0,0,0,956,112,0,0,0,261,455,0,0,0,0,0,0,337,385,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,184,1865,0,0,721,16,0,486,0,0,0,265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,0,0,0,0,0,0,0,0,234,0,0,815,0,0,743, -1987,205,197,0,0,0,0,0,0,0,0,0,314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,452,589,0, -176,333,0,0,0,0,0,0,0,1110,47,0,0,0,0,0,0,0,0,0,0,0,864,0,0,300,0,1237,0,0,0,0, -0,0,0,0,0,0,0,1685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,135,395,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,631,0,0,0,0,0,0,835,0,0,0,606,459,0,979,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,0,0,0,0,0,0,0,0,158,372,0,854,0,0,0,0,0, -0,0,1492,0,0,0,833,0,0,0,0,0,0,0,1739,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -195,0,0,0,0,0,0,0,0,730,1997,0,0,0,0,0,0,0,0,61,0,0,0,0,0,0,0,266,751,0,0,0,0,0, -0,0,821,0,0,0,715,0,0,0,868,0,959,0,0,0,0,0,0,0,0,0,0,0,1053,0,0,0,950,0,1081,0, -1595,0,0,0,0,59,0,0,0,0,0,0,0,0,0,0,47,684,0,0,0,0,0,0,1606,0,777,0,1020,0,0,0, -1094,0,0,0,0,0,0,0,350,0,0,0,0,0,0,242,1812,0,0,0,967,0,0,0,473,286,0,0,0,0,0,0, -798,629,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,513,337,306,0,0,0,0,0,0,0,0,0, -146,0,0,1646,0,0,0,0,0,465,0,0,0,525,0,0,0,0,0,0,299,165,0,0,0,0,0,0,0,1064,0,0, -0,0,0,596,0,0,0,0,0,0,0,0,0,0,0,0,0,0,238,1741,0,1233,451,1824,0,0,0,0,733,495, -0,0,0,0,0,1204,0,0,0,559,341,0,224,21,0,0,0,0,0,0,0,0,97,1446,0,0,0,0,0,0,0,729, -0,0,565,727,0,1948,0,0,0,519,0,0,0,0,0,0,0,0,0,1193,0,0,0,0,0,0,790,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,323,2,201,0,0,59,0,0,34,0,896,961,0,1285,0,0,46,0,479,0,0, -0,0,549,0,663,0,0,0,0,0,783,65,682,0,0,0,0,0,11,0,0,0,0,0,522,0,0,0,52,0,0,0,0, -0,383,0,0,0,0,0,0,0,0,127,0,0,0,0,0,397,194,0,0,635,0,0,0,0,0,0,0,0,0,0,975,0,0, -0,0,0,0,0,0,0,0,116,0,51,0,0,858,0,1075,535,448,0,0,0,0,0,610,0,0,0,0,0,0,0,0,0, -0,191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,267,673,319,94,92,0,551,0,0,218, -1406,69,256,0,0,952,1980,0,833,0,0,0,0,0,0,0,0,0,0,0,0,39,0,0,0,0,0,0,0,81,0,0, -0,352,634,0,0,0,0,0,618,0,0,0,0,0,0,73,339,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,759, -0,0,0,0,0,0,0,0,0,0,0,0,0,1075,0,0,0,0,0,0,482,649,0,0,0,0,0,0,0,0,386,336,0,0, -0,1035,0,0,0,0,0,0,0,0,0,0,0,924,0,73,0,0,0,0,0,1971,0,0,0,0,0,0,0,0,0,1344,0, -501,0,0,0,0,0,0,0,0,46,799,0,0,0,0,0,0,0,276,0,0,0,0,0,0,0,770,0,0,0,0,0,0,0,0, -0,0,0,0,0,158,0,0,0,0,0,1432,0,0,0,0,0,0,0,0,0,0,25,0,0,2001,0,0,0,0,0,0,0,0,0, -0,0,0,0,478,0,0,0,0,0,0,91,1461,211,602,0,0,0,0,0,0,0,0,0,1068,0,0,124,567,0,0, -0,1006,0,0,0,0,0,0,0,0,0,735,812,0,0,323,0,0,0,304,0,0,0,0,0,0,0,0,0,148,0,0,0, -0,0,0,0,0,0,523,0,0,144,730,0,0,981,0,0,111,0,0,132,0,0,0,0,0,0,890,0,0,0,0,0, -444,0,1787,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,2041,932,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,937,0,995,0,0,255,0,0,138,863,965,0,0,631,0,0,0,0,1394,16,652,0,0,0,0,0,0, -0,0,0,0,0,0,0,897,0,321,0,0,0,0,0,922,0,619,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,844,0,0,0,0,0,0,1659,0,1100,0,0,0,1173,0,1930,268,251,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,390,711,0,0,0,0,0,0,0,0,0,0,0,0,0,744,0,0,0,0,0,0,0,0,0,624,0,0,0, -1998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1125,0,0,0,594,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,268,0,0,0,0,0,0,0,563,0,0,0,0,0,0,0,0,2,39,0,0,0,1332,0,0,0,0,0, -0,0,508,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,796,0,0,0,0,527,0,0,0,0,98,0,0,576,0, -0,0,0,0,122,0,276,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,645,0,0,0,0, -0,0,0,0,0,0,0,290,0,0,762,1292,0,0,0,1315,0,1955,0,0,0,0,0,0,0,0,0,0,210,131,0, -0,0,0,797,0,38,0,11,488,0,936,0,441,0,0,0,0,0,595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -991,0,0,0,0,0,0,0,0,0,0,0,653,0,523,0,0,0,903,0,0,0,0,0,0,0,0,0,0,0,0,80,0,0,0, -0,0,0,0,0,0,432,0,0,314,0,0,0,0,232,1368,534,0,0,0,0,0,27,0,0,0,12,0,0,0,0,0,0, -0,0,0,264,736,0,1657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1117,0,127,0,0,0,1208,0,1294, -0,0,0,0,364,0,0,0,0,0,125,1334,0,0,0,0,0,0,0,0,0,0,0,0,0,0,792,0,0,0,0,0,0,0, -849,699,0,0,0,0,0,968,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1446, -124,397,0,0,0,0,0,0,0,0,0,0,0,641,0,0,0,0,0,0,0,0,0,0,0,0,127,346,0,0,517,75,0, -0,0,0,0,0,0,0,83,0,0,0,0,0,0,1031,0,0,0,0,0,0,0,1470,0,954,0,0,345,304,410,0,0, -0,0,734,0,0,0,0,0,1822,0,0,0,1798,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,161, -1865,69,0,0,0,0,0,0,922,0,0,0,0,0,0,0,0,0,0,0,541,0,627,0,0,0,0,0,0,0,0,0,166,0, -0,0,0,0,0,0,0,0,849,0,0,0,0,0,0,0,717,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,0,0,0,0,0, -0,654,0,0,188,273,0,0,0,543,0,410,87,0,0,941,0,0,186,250,0,1785,0,0,0,0,0,1339, -462,961,0,780,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,529,0,0,0,0,0,0,474,1276,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,24,948,0,0,0,0,657,753,0,0,0,0,941,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,706,985,837,0,1861,0,0,0,0,0,0,0,0,0,0,0,0,0,0,292,933,0,0,0,0,0, -0,0,0,0,767,0,0,0,0,0,0,0,641,0,0,0,1233,114,0,883,0,274,2008,0,1794,285,0,0, -571,0,0,0,0,0,0,0,0,0,0,823,960,16,617,0,431,0,0,0,0,0,0,0,0,0,0,567,0,401,0,2, -781,424,33,0,2006,0,0,274,0,0,1882,0,794,0,0,0,1848,0,0,0,0,0,0,448,47,0,0,0, -1199,0,0,0,0,0,0,0,0,417,0,0,0,0,0,0,0,0,0,0,295,0,0,0,0,0,0,0,1019,0,0,0,0,0,0, -0,0,0,0,0,0,0,620,0,0,0,0,464,0,0,0,0,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,442,0,930,0,0,0,0,0,516,68,0,0,0,0,0,1128,104,0,0,0,0,0,0,0,0,787,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,491,0,0,0,0,0,0,711,0,0,9,0,101,441,0,0,0,0,0,0,0,0, -0,0,160,396,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,679,326,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,1128,0,0,0,0,0,737,0,1796,0,0,0,0,0,0,0,0,0,0,0,0,338,574,0,0, -0,0,0,1096,491,405,0,0,0,0,0,1081,0,0,0,0,0,0,0,0,0,0,0,0,0,1676,0,1207,0,0,0,0, -0,0,969,354,0,0,0,0,598,0,297,0,0,0,0,0,0,0,0,1772,751,0,37,0,0,1828,0,0,0,0,0, -0,0,0,0,257,191,582,0,0,0,0,0,0,790,0,0,0,0,0,47,0,0,0,0,0,0,0,449,306,1011,0,0, -0,0,0,299,0,0,0,0,0,0,837,0,0,0,0,0,0,10,329,0,0,0,0,0,1320,0,0,0,0,0,0,158,657, -0,1191,0,0,0,0,0,0,7,0,974,1939,0,1665,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,288, -66,0,0,0,0,494,175,0,1643,0,0,0,0,0,0,0,0,570,750,719,0,0,0,0,0,0,0,0,0,0,0,0,0, -13,0,0,1247,0,0,221,356,0,0,0,0,0,0,0,0,0,0,694,1809,0,0,0,0,0,0,0,411,0,44,31, -0,0,0,0,669,0,673,0,0,0,0,0,0,0,0,0,1303,704,299,0,0,0,275,0,0,216,1761,0,0,0,0, -0,0,0,0,0,0,0,1319,0,0,428,0,0,0,0,0,0,0,0,0,0,514,0,0,0,0,0,0,49,55,102,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,364,0,0,0,0,379,0,921,971,52,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,1258,0,0,0,1058,0,0,0,0,0,656,0,0,0,0,0,144,0,0,0,0,0,0,0,0,0,0, -0,1373,10,605,0,0,0,0,0,0,0,838,0,1012,0,0,0,0,0,0,0,0,0,0,0,0,0,0,154,365,0,0, -0,0,0,0,0,0,0,340,0,0,0,0,0,810,0,0,0,0,0,0,495,0,0,0,0,0,0,0,0,0,261,0,535,248, -0,358,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,567,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,697,0,0,0,1336,0,0,0,0,0,0,0,0,917,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,972,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,351,0,0,0,0,0,0,0,0,0,0, -0,0,0,286,0,0,56,438,0,0,0,0,0,1950,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,738,0,0,0,0,0, -0,0,0,0,0,969,2047,0,0,0,0,0,0,0,818,0,0,0,0,0,0,0,866,0,0,0,0,0,0,0,1467,0,0,0, -0,0,0,0,0,0,0,0,0,0,972,0,355,0,0,0,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,267,189,104,0,0,0,0,1613,0,0,0,0,0,0,0,116,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,886,0,86,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,0,0,863,0,0,0,0,0, -0,0,1953,450,1773,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,381,0,0,0,0,0,0,0, -0,0,0,0,0,1142,0,1189,0,0,0,663,0,0,0,0,0,0,0,846,0,0,528,0,393,378,0,0,0,0,0,0, -325,899,680,1880,0,1770,0,0,0,0,0,648,0,0,0,0,0,0,185,167,0,2046,0,0,0,0,0,0, -249,1645,0,152,0,0,0,1733,0,0,0,0,0,1006,0,0,0,0,0,420,0,0,0,832,0,0,0,0,0,351, -0,0,0,0,6,40,0,0,60,0,0,0,0,1354,745,724,0,0,0,0,0,0,0,0,772,1951,275,108,639,0, -0,0,0,0,0,0,0,0,500,1758,0,0,0,0,0,0,0,0,0,0,0,1886,711,205,0,0,965,865,0,0,0, -534,0,0,0,0,691,0,0,0,237,443,0,878,0,0,0,0,0,1410,0,0,0,0,0,0,0,0,0,0,0,0,0, -995,0,0,0,0,0,0,0,0,0,0,0,0,0,578,0,0,0,0,881,0,0,0,0,0,0,0,0,822,0,923,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,924,0,0,0,665,0,0,0,0,0,1901,0,0,0,0,0,950,498,93, -0,0,0,1451,0,0,0,0,0,747,828,788,400,184,0,198,0,0,0,0,0,0,0,0,0,0,0,994,0,0,0, -0,0,0,0,0,615,320,0,0,0,978,843,905,0,0,0,0,0,0,0,0,850,974,0,0,0,0,6,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,509,0,0,0,0,0,273,0,0,0,0,0,0,0,0,0,0,0,0,0, -201,0,0,0,1041,0,0,0,1040,0,0,0,0,0,0,0,0,0,693,234,774,0,336,0,1399,22,0,805, -802,777,167,789,0,0,1705,0,0,0,0,0,0,0,0,0,0,0,10,13,11,0,0,204,264,0,0,56,0,0, -1917,0,470,0,0,0,0,0,0,0,0,0,0,0,1198,0,0,0,0,0,0,0,0,0,0,1015,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,715,0,0,1002,0,0,0,298,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,867,0,0,724,0,0,0,0,0,0,0,0,0,0,0,0,768,0,0,0,0,0,1066,0,0,0,0,67,0,174,948, -0,0,0,0,0,0,0,0,0,0,0,0,0,764,0,0,0,0,75,137,0,756,0,0,0,0,0,0,1008,842,643,0,0, -0,67,0,0,0,0,0,0,0,0,0,0,0,135,821,0,0,0,0,0,0,0,0,736,0,389,355,0,0,786,0,0,0, -0,0,0,2044,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1030,0,0,0,1083,0,0,0,0,0, -1226,0,0,0,0,356,319,8,389,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,474,0,0,0,427, -0,413,0,730,0,0,0,0,0,373,0,0,0,0,0,0,0,0,0,799,0,0,0,1793,0,0,0,322,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,89,290,2,0,0,0,0,0,0,0,0,0,0,672, -699,1860,0,0,0,737,0,0,0,1612,0,0,0,0,0,0,0,0,0,0,0,145,124,884,0,0,0,0,0,387,0, -0,0,0,0,0,0,0,0,0,0,679,0,550,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1305,0,0,0,0,0,0,0, -576,0,0,0,0,0,0,0,686,0,607,0,0,37,0,0,0,0,0,0,0,0,0,101,1726,0,0,0,0,0,958,0,0, -0,903,0,0,0,0,147,0,0,0,0,0,0,0,0,0,0,0,367,0,0,0,0,690,0,705,273,0,0,887,0,0,0, -0,0,0,0,0,0,0,0,90,0,0,0,0,0,0,0,908,0,0,0,0,0,0,0,1261,0,0,497,1235,0,429,0,0, -0,0,904,0,12,125,0,0,0,841,0,0,0,0,0,860,946,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,768,0,770,160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,271,0,0,0,0,0,0,0,719,0,699,581,0,0,0,0,0,0,0,0,0,0,862,304,0,631,0,0,0,0,880, -1513,0,0,0,0,0,981,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,434,0,0,0,0,0,550,0,0,476,930, -824,553,0,0,452,0,151,0,0,0,0,0,0,772,0,292,135,0,0,0,0,0,0,0,504,0,0,1089,0,0, -0,0,0,0,0,0,0,0,0,783,0,0,0,0,0,0,206,393,0,0,0,0,0,0,0,0,232,912,0,0,0,0,0,977, -0,0,716,98,0,0,0,0,0,733,0,0,0,0,0,0,0,0,19,0,0,0,0,668,0,360,0,0,0,0,0,0,656,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,726,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,1269,0,0,463,0, -0,0,0,0,0,1454,0,1287,245,0,989,0,0,0,0,0,0,0,0,0,107,164,0,0,0,0,0,0,0,1061,0, -0,0,0,2,484,0,0,0,0,0,0,0,1127,0,0,0,0,0,0,0,460,0,0,0,0,0,932,0,0,0,0,0,0,0, -588,625,0,0,0,0,76,92,0,0,0,0,0,0,0,0,0,0,0,0,0,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -763,0,622,0,0,0,253,0,546,0,0,110,0,256,916,0,0,35,212,0,0,746,0,0,0,150,0,0, -1466,0,0,0,1299,0,0,0,0,0,0,0,0,0,1518,0,0,0,0,0,0,0,0,0,0,0,0,0,1229,0,0,0,816, -0,0,0,0,0,0,159,0,0,0,0,0,734,869,126,1716,0,0,0,0,0,0,202,232,0,0,0,0,212,0,0, -0,0,0,111,1003,0,0,0,0,0,0,0,0,0,0,0,1712,0,0,216,0,0,0,0,516,0,0,0,0,0,650,0,0, -0,0,57,99,0,0,0,0,300,574,0,0,0,0,1023,0,0,302,0,1871,0,728,252,0,0,461,0,0,0, -323,0,0,0,0,0,0,775,461,0,0,0,0,0,0,172,0,0,464,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,73,727,0,1023,0,0,0,0,0,0,0,0,0,0,577,0,0,0,0,0,0,0,0,1037,0,0,0,0,0,0, -0,0,280,677,0,0,0,0,0,0,0,0,0,0,0,799,0,0,0,0,159,0,446,1730,0,0,0,0,0,0,0,0,0, -395,0,0,0,0,145,0,0,0,0,0,0,0,20,0,0,426,608,0,0,0,0,0,977,0,250,0,0,0,0,0,100, -0,0,0,0,1982,0,0,0,0,0,476,0,0,0,0,0,0,594,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,447,0,0,0,0,526,0,0,14,1124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,188,0,0,0,0,0,0,0,0,362,301,0,0,0,1743,0,178,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,872,0,831,0,0,208,202,0,0,0,0,0,0,0,1954,0, -0,0,0,516,872,0,0,313,224,0,0,24,0,11,546,0,0,0,1937,242,241,46,0,0,0,830,1273, -0,0,0,0,0,0,0,825,327,1006,0,0,0,0,0,1580,516,366,0,0,0,0,0,1736,0,0,0,0,0,0,0, -0,0,0,0,1935,0,826,0,0,0,0,139,331,0,0,0,0,0,0,0,0,0,0,0,288,0,916,0,0,0,0,0, -1888,0,0,0,0,0,0,0,1471,0,1570,0,394,0,0,0,0,0,0,0,1931,0,1719,0,658,228,0,0,0, -0,0,374,0,0,0,0,735,0,0,0,0,0,0,323,498,0,1063,0,0,0,0,155,0,0,0,0,0,0,0,0,906, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1139,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,616, -902,0,0,0,0,0,692,0,0,0,0,0,0,823,0,0,0,305,0,0,0,0,0,0,0,681,0,0,0,0,0,214, -1004,0,0,0,0,0,0,0,23,0,0,1703,0,0,0,0,0,0,0,0,0,1443,0,0,19,714,0,0,0,0,64,737, -0,0,345,1758,0,0,579,47,0,0,539,139,0,0,0,0,388,0,0,0,0,253,0,0,0,0,0,0,252,0, -745,0,0,0,0,0,0,0,0,0,0,0,504,107,0,871,0,0,0,229,0,0,0,0,0,903,0,0,71,0,0,549, -6,47,0,0,0,0,0,0,0,0,0,980,865,705,0,0,0,161,0,0,0,0,143,1331,0,0,0,1388,33,724, -0,0,0,19,0,0,0,395,0,0,0,0,0,846,210,0,0,0,122,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,937,497,0,0,0,0,0,718,0,0,0,0,0,0,0,1581,0, -0,0,0,0,0,161,49,0,0,0,0,0,0,0,0,0,597,0,0,0,1094,0,0,0,811,908,0,0,0,0,0,0,0,0, -0,0,1471,0,0,0,0,0,0,0,0,0,0,42,1935,0,0,0,2014,66,2007,0,0,586,0,0,0,0,0,0,0,0, -0,28,1077,0,0,0,1221,0,0,62,0,0,0,0,0,0,0,0,0,0,1766,0,0,0,0,0,0,0,0,0,0,0,0,25, -0,499,1388,0,0,97,10,0,0,0,0,0,481,0,0,0,0,0,0,0,0,0,0,37,134,155,486,0,1442,0, -0,0,0,0,591,0,0,0,0,0,0,310,1173,0,0,0,0,409,1156,0,0,0,482,0,0,263,926,0,0,0,0, -0,0,0,0,0,0,0,0,0,804,0,0,0,0,0,0,0,0,0,0,0,0,0,1265,0,415,0,348,0,0,0,1012,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,165,1803,0,0,0,0,0,0,0,408, -0,0,0,0,0,0,257,1321,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1138,0,0,0,249,0, -0,0,576,0,0,0,0,231,0,0,0,288,0,0,0,0,0,0,0,0,0,433,1487,569,1678,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,0,0,0,0,0,779,538,0,0,0,413,0,0,0, -0,0,0,0,0,0,0,495,0,0,0,0,0,191,54,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,530,567, -0,0,0,0,0,1484,0,0,0,0,0,0,815,609,0,0,0,0,0,484,0,0,0,0,0,0,0,0,0,0,900,0,0,0, -0,1335,0,1724,0,0,0,0,0,0,0,0,0,0,0,640,0,0,0,0,0,0,0,0,0,0,0,1831,0,0,0,0,0,0, -0,0,0,0,0,0,0,474,0,0,0,0,0,0,0,0,0,1103,0,1504,655,1034,0,0,0,0,0,305,0,0,0,0, -0,0,0,0,0,1236,0,0,429,217,0,0,0,0,739,278,0,0,0,0,0,0,0,708,0,0,0,0,0,1840,233, -0,0,0,0,0,0,0,0,2017,0,0,0,0,0,1488,0,0,0,1590,0,0,0,0,0,1800,28,0,0,0,0,0,0,0, -0,0,45,0,36,0,22,1442,378,0,0,0,0,0,0,1507,0,0,0,0,0,0,0,0,0,0,39,0,0,1054,725, -1955,0,2036,0,0,0,0,0,0,0,0,0,0,896,1871,0,0,0,0,0,0,0,0,0,0,805,0,0,0,0,2046,0, -0,0,0,17,712,0,617,55,320,271,0,0,0,0,0,0,0,0,0,445,0,184,103,0,0,0,0,0,0,0,0, -659,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,676,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -337,0,0,0,506,0,0,0,0,0,843,77,0,458,0,0,0,0,0,1420,382,109,142,330,0,0,0,0,0,0, -0,0,0,0,0,0,87,0,0,0,492,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1239,0,0,0,0,0,0, -211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1049,0,321,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,1985,0,0,122,0,0,234,0,0,0,1098,0,0,0,0,0,0,549,253,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,522,131,0,0,149,0,0,0,0,0,0,0,0,0,0,0,0,0,0,507,0,0,0,0,811,630,0,0,0,343, -0,0,0,0,0,448,591,455,0,1381,0,0,0,0,0,0,0,575,0,0,0,0,0,1175,0,0,0,0,0,0,0,0,0, -653,0,0,0,1761,0,1198,0,0,0,0,297,1127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,678,0,0, -164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,0,45,0,0,0,0,0,121,0,0,0,0,0,0, -0,0,125,0,0,0,1622,0,0,0,0,0,721,145,0,0,0,970,792,0,0,0,715,0,0,0,0,0,1999,0,0, -74,531,0,0,65,0,0,0,105,220,0,0,0,0,0,0,0,960,0,0,0,0,0,0,428,19,0,0,401,96,0,0, -0,0,0,1595,116,0,1021,0,0,0,0,0,750,1961,0,0,148,0,0,0,0,0,0,0,0,0,0,0,0,0,75,0, -0,1383,0,0,0,0,0,0,0,0,0,0,0,0,0,0,779,0,0,0,0,0,0,0,0,598,0,424,0,0,0,0,0,0,0, -1222,0,0,0,876,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,0,0,0,0,187,0,8,0,0,0,0,0, -0,0,429,0,685,0,0,0,0,0,0,0,0,0,0,0,132,472,0,0,0,0,0,0,0,0,0,938,0,0,874,0,0,0, -0,0,774,0,0,0,0,0,92,0,0,0,0,0,0,830,701,0,0,0,0,0,426,350,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,603,59,0,0,0,0,0,0,0,0,0,0,293,0,0,0,0,0,0,0,0,0,0,0,0,0,0,441,163,4,0, -0,0,0,0,0,0,0,0,806,0,0,0,0,0,0,233,0,0,0,0,1994,0,1739,0,0,393,0,47,1038,0,0,0, -309,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,0,0,0,175,0,0,0,0,0,0,0,666, -0,0,1675,0,1600,0,0,0,808,0,0,0,0,0,0,0,0,0,0,0,280,54,0,0,0,0,0,0,0,0,421,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,0,0,103,254,0,262,1,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,805,0,0,0,0,0,0,0,0,0,1630,0,0,0,0,0,0,0,0,0,0,0,0,0,671,972,989,0,0, -0,0,0,0,0,889,0,0,0,1382,0,0,0,0,0,0,0,775,0,0,0,0,0,0,0,0,0,0,388,202,0,0,0,0, -16,560,0,0,0,841,0,0,566,0,0,0,938,0,0,0,0,0,0,0,0,0,0,912,0,0,0,1361,0,0,0,0,0, -0,618,236,0,1854,0,0,318,190,0,1376,0,0,0,0,0,0,0,349,0,0,0,0,951,1972,0,0,0,0, -0,0,344,0,0,0,0,0,0,0,0,850,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,910,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,163,85,0,487,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,145,0,83,0,0,1013,0,0,0,1922,0,0,169,557,66,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,1193,82,0,352,454,57,0,0,1333,396,107,0,370,0,0,0,0,0,0,0,0,0,204,0,0,0, -0,0,1706,0,0,0,0,0,0,0,0,0,0,0,0,394,1204,0,0,0,0,0,1007,0,0,0,1696,0,1519,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,981,0,0,0,0,1072,0,0,0,712,0,1629,0,0,0,0,0,0,0,728,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1271,0,0,0,1608,16,0,0,0,0,485,0,0,0,0,0,0, -153,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1991,0,0,0,0,0,0,0,0,52,0,21,0, -0,0,0,0,0,0,0,0,819,0,0,0,0,0,917,0,0,0,0,784,0,0,0,0,135,0,0,0,0,0,454,0,0,0,0, -0,0,0,0,0,852,1719,0,0,0,0,0,852,0,0,0,0,0,952,0,0,0,0,568,0,0,0,0,0,448,0,0,0, -67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1826,657,0,729,666,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -669,0,0,0,0,0,0,0,402,0,0,152,0,0,0,0,912,0,0,0,0,0,0,51,320,0,445,0,0,0,0,308, -0,0,0,0,0,386,0,0,239,0,0,130,83,0,143,0,348,0,0,0,0,0,0,0,958,0,0,0,0,0,210,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,0,0,0,0,0,0,0,0,0,0,0,0,7,213,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,801,0,0,0,0,0,0,0,0,0,936,0,108,0,0, -0,0,0,0,0,0,0,885,587,219,398,364,0,1165,0,0,342,241,303,0,0,0,0,0,0,0,0,0,0, -1454,0,0,0,0,0,0,0,0,0,0,254,562,0,786,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1294,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,493,216,0,0,0,0,219,341,0,0,0,0,0, -0,0,0,0,0,130,1734,154,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,604,0,0,879,0,195, -666,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1669,0,0,0,1791,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,1228,0,0,0,0,0,623,0,0,0,0,0,0,0,798,0,0,0,0,0,0,0,0,0,0,0,0,84, -122,0,0,0,837,0,0,0,0,0,0,1013,0,0,577,0,0,0,460,932,0,0,0,0,0,0,0,0,0,0,0,31, -131,0,0,0,605,0,0,0,1246,0,0,0,0,68,278,165,307,781,0,0,0,0,0,0,33,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,1113,0,0,720,1953,203,0,0,0,0,0,0,0,425,326,0,0,0,0,0, -0,0,0,0,0,241,1316,0,0,0,0,0,416,0,0,0,1300,0,847,0,0,662,358,0,0,0,0,839,1823, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,654,1522,0,0,0,0,0,0,163,0,0,0,0,0,314,978,0,0,0, -601,0,0,0,0,0,946,434,0,0,0,402,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,1467, -410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,483,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,677,0,0,0,0,0,0,0,0,0,0,0,0,70,0,0,0,0,1405,0,0,0,0,0,0,108,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,777,0,0,0,0,0,747,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,505,0,326,0,0,164,628,654,0,0,0, -37,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,668,152,0,0,0,0,0,0,0,0,0,0,0,581, -0,0,0,0,44,126,89,0,0,0,0,0,0,0,0,1531,0,0,0,0,0,0,0,0,203,1167,0,0,0,0,0,0,0,0, -531,1232,0,0,0,0,0,943,0,670,231,880,0,1617,0,0,0,1957,0,0,0,0,0,0,0,975,0,0,0, -0,0,0,0,0,0,0,0,242,0,0,0,0,0,0,0,0,0,421,0,0,14,834,0,0,0,0,0,0,0,0,0,0,0,0, -465,0,0,0,0,0,834,688,413,855,0,0,0,590,0,0,0,0,0,0,0,0,114,0,0,0,0,0,0,0,0,0,0, -0,45,169,0,0,0,0,0,0,0,0,0,0,0,198,0,0,565,585,0,0,0,0,0,0,0,0,0,0,0,0,0,691,0, -0,0,593,0,0,0,0,0,0,0,0,0,913,116,0,0,0,0,1360,0,0,0,802,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,673,308,0,709,1006,1895,0,228,0,0,0,1840,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,608,0,0,0,0,0,0,0,0,0,1573,0,2039,136,540,0,0,0,0,0,0,0, -897,0,0,938,1878,0,0,0,0,0,0,0,0,0,1469,0,999,0,299,0,0,0,0,0,0,0,578,0,0,0,0,0, -456,0,0,0,1679,163,693,0,0,0,0,0,0,48,755,0,0,0,0,0,0,0,0,0,0,0,0,338,0,0,0,0, -1091,0,0,0,0,695,0,0,1464,0,0,0,0,0,975,0,0,335,0,0,1979,0,0,0,0,269,1566,630, -396,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1815,634,0,0,0,966,0,0,0,0,0,0,0,9, -412,0,958,0,0,579,382,0,212,0,0,0,0,965,681,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,655, -0,0,0,0,67,0,0,0,0,0,0,751,0,0,0,0,423,231,0,0,1016,300,0,0,0,0,100,237,0,0,0, -1370,0,0,0,1208,0,0,0,0,0,1219,129,0,0,0,0,0,0,0,0,0,0,0,0,0,0,199,0,0,427,0,0, -0,0,949,665,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,712,0,0,0,0,0,1186,0,0,0,0,0,0,0,0,0,0,295,312,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -151,0,0,0,0,588,4,0,0,0,0,0,414,104,0,0,757,263,0,561,0,0,0,320,0,0,0,0,0,0,0,0, -0,0,0,225,0,0,0,0,37,817,0,974,0,0,0,0,0,0,0,0,0,0,0,0,0,2026,131,235,16,0,590, -1157,0,0,0,0,0,0,0,0,221,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,140,390,0,0,0,0, -0,0,0,1144,0,0,0,464,0,0,0,0,0,0,0,0,0,0,0,0,204,407,303,1218,0,0,0,0,5,325,0,0, -0,0,12,800,0,1783,0,0,0,0,0,0,0,0,0,0,504,621,0,0,0,0,0,0,0,0,0,920,0,376,0,0,0, -0,0,218,580,0,768,454,0,0,0,0,0,0,0,0,0,0,0,0,676,0,0,0,0,0,0,164,0,0,0,0,0,0,0, -0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,120,285,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,226,343, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,1812,0,0,8,0,0,0,21,1125,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,1327,0,0,0,0,575,1598,0,0,0,0,0,0,0,0,0,895,0,0,0,959,0,0, -0,0,0,1759,173,0,0,0,0,266,261,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,1427,0,0,300,1033,0,0,0,0,0,0,0,0,0,0,0,584,0,0,0,0,52,734, -0,0,217,239,0,1129,0,0,0,0,0,0,0,0,732,20,0,0,0,0,0,0,0,0,0,0,0,418,0,0,0,613,0, -0,0,0,0,0,0,0,0,632,0,0,85,984,0,0,0,0,909,694,7,1109,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,167,0,0,0,0,280,62,0,0,33,0,0,359,186,980,0,0,0,0,0,0,0,0,0,0,0,585,0,0,0, -211,0,0,336,145,0,1130,0,873,0,0,840,263,0,0,0,0,0,0,0,0,0,916,0,0,0,0,0,0,0,0, -0,0,155,0,0,0,461,97,0,0,0,0,0,1356,0,0,0,0,0,0,0,593,0,0,0,0,0,1392,0,0,0,0, -126,0,0,0,0,1179,0,0,0,0,0,162,0,0,0,0,0,765,0,187,0,1286,0,0,0,0,0,0,0,0,0,635, -0,0,23,215,0,0,0,1306,0,0,97,716,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,657,0, -0,0,0,0,0,0,0,299,0,0,0,0,0,0,134,0,0,0,0,0,0,0,0,0,0,0,658,1082,0,0,0,0,0,2002, -0,0,0,0,0,0,833,248,0,0,0,0,0,1654,0,0,531,0,0,0,0,0,0,634,0,0,0,0,0,0,0,0,0, -853,573,249,0,0,0,0,0,0,0,0,527,0,0,0,0,1419,0,0,0,0,0,0,20,49,0,0,0,992,0,0,0, -728,0,0,0,0,0,0,0,0,0,0,0,0,497,1579,0,0,0,0,62,268,0,0,0,0,0,0,0,1201,0,0,0,0, -0,0,0,0,0,0,0,0,495,193,0,0,0,0,106,0,0,859,0,0,23,0,0,0,0,0,0,0,813,925,0,0, -223,613,953,0,0,0,0,0,0,0,0,666,0,0,0,0,0,0,0,0,0,670,0,0,40,216,0,0,0,0,0,0, -259,0,0,0,440,1114,0,0,0,0,0,0,0,0,74,475,0,0,188,139,0,797,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,1572,0,0,0,0,39,0,0,0,0,0,0,0,0,0,0,0,0,1594,0,0,0,0,0,0,0,290,0,232, -0,0,887,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,521,14,0,0,0,0,0,741,0,0,0,992,0, -0,0,0,0,0,0,0,111,0,0,425,0,0,0,0,0,789,0,0,0,1593,0,1768,0,0,233,0,0,0,0,943,0, -0,0,0,0,0,0,955,225,245,0,0,0,0,0,0,241,0,0,0,0,1943,0,0,0,1284,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,709,0,0,0,0,0,0,554,0,0,0,0,0,0,0,0,1564,0,0,0, -443,0,0,0,0,0,0,280,0,0,0,0,0,0,0,0,729,0,0,0,348,0,0,0,0,0,0,0,758,848,298,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,829,1422,189,121,0,0,632,812,0,0,556,0,0,0,0,0,436,172, -530,844,232,984,0,0,0,0,0,0,0,0,0,0,147,0,0,0,0,0,0,0,0,537,0,0,0,0,0,859,0,0, -842,0,0,0,0,0,0,0,0,0,0,1291,0,0,0,0,0,0,0,0,0,0,0,1482,612,392,0,0,0,262,31,0, -0,0,0,0,0,0,0,0,0,753,549,0,0,0,0,0,0,696,0,0,0,0,0,0,0,834,0,0,0,0,0,771,0,0,0, -0,0,0,0,0,0,0,0,0,0,921,0,0,0,674,0,0,0,0,0,0,0,0,0,0,308,444,0,0,0,0,0,0,805, -180,0,0,278,271,0,0,214,505,0,1215,0,0,0,0,0,0,387,271,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,1645,42,92,0,459,0,0,330,1557,0,0,0,0,0,0,0,0,113,18,0,0,0, -1742,0,0,0,965,0,0,0,0,0,0,0,0,0,0,0,0,0,182,0,0,65,0,0,0,0,0,0,0,0,0,0,0,0,973, -0,0,0,0,0,328,0,0,588,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1786, -0,0,962,1985,0,0,0,308,508,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,588,0,0,0,0,0,0,614,793,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,290,0,0,0,0,0,0,0,0,0,0,1136,0,0,0,0,0,0,0,0,0,0,796,719,0,0, -326,210,0,0,0,701,758,472,0,0,0,1947,278,1079,0,0,0,0,0,0,497,41,0,0,634,46,961, -0,810,524,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,532,0,997,0,0,0,0,0,0,0,0,0,0,0,1301,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1298,0,671,0,0,0,306,0,0,0,0,0,0,0,0,0,0, -693,1823,0,0,0,759,0,0,0,0,0,1932,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,182,0,0,0,1964, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,521,0,0,0,0,0,0,424,857,0,0,0,0,671,328,0, -529,0,0,0,0,0,716,0,1509,80,67,0,0,0,0,59,141,0,0,0,0,0,0,783,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1498,0,0,0,0,343,430,803,1183,677, +BROTLI_INTERNAL const uint16_t kStaticDictionaryHash[32768] = { +32072,0,0,0,0,0,0,0,0,21860,0,0,0,0,0,0,0,40486,0,0,0,0,0,45798,0,0,0,0,0,0,1292 +,0,0,0,0,4964,278,23717,0,19972,0,0,0,0,0,0,0,0,0,0,0,0,2126,16102,0,0,0,14437,0 +,0,0,0,0,0,0,26727,2253,0,0,17252,0,0,0,0,0,0,0,0,0,3622,0,0,0,0,22984,0,0,0,0,0 +,0,16647,0,34247,0,0,0,0,0,48486,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2511,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19532,0,0,24004,0,0,0,9828,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30853,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,31974,0,0,0,0,0,0,0,0,20650,2404,0,20773,1677,9031,0,6404,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51879,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6761,7206 +,0,0,21992,22983,0,0,3529,0,1864,0,0,0,0,0,0,11046,0,0,9641,0,0,0,6507,0,0,36934 +,21576,62375,0,0,0,0,0,0,0,0,0,8294,0,0,0,0,0,0,0,40807,0,0,0,39398,8136,0,0,0,0 +,0,0,0,8875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7941,0,0,25609,0,0,0,936, +3716,3213,15687,0,0,0,0,0,52519,0,17381,0,0,0,0,1320,5797,0,21029,0,0,6472,807,0 +,0,0,0,0,0,0,0,0,0,13545,0,0,0,3624,0,0,0,29674,30820,0,31237,0,6596,0,0,0,0,0,0 +,0,0,0,64070,0,0,0,0,0,0,0,0,0,0,0,22278,0,37446,0,0,0,0,7240,423,0,24612,21705, +17636,0,0,0,0,0,0,1833,0,0,0,328,6021,0,0,0,19974,0,0,0,0,0,0,0,0,0,62119,4178,0 +,0,0,0,12100,8617,0,0,16900,0,36678,0,0,0,35366,0,51718,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,20998,0,62086,0,0,0,0,0,5542,0,0,0,0,0,0,0,0,0,0,0,14629,10952,25927,0,0,0 +,0,19849,0,0,0,0,0,0,0,30952,3046,14314,12998,0,0,0,15268,0,40582,30216,62118,0, +0,0,20132,0,0,0,0,0,12005,0,0,0,52358,0,0,0,0,24778,0,44,33095,0,0,0,0,0,26372,0 +,0,0,0,0,3781,0,0,17928,9479,0,0,0,0,0,0,0,0,32297,28613,0,0,0,0,0,0,0,0,0,0,0,0 +,0,47174,11723,0,0,0,0,0,0,0,0,0,2536,55143,0,0,6410,0,0,0,0,0,0,0,0,56294,11914 +,0,529,0,30184,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8261,0,0,28808,58854,22633, +965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64135,0,0,331,3684,0,1605,0,0,0,0,0,0, +0,0,0,0,16650,37,0,23622,3144,15429,0,0,0,0,0,0,0,0,0,0,22443,69,0,0,0,0,0,0,0,0 +,17832,0,0,0,0,0,0,0,0,0,11113,0,0,0,0,18309,0,0,0,0,0,0,0,0,0,26630,0,0,25512, +25895,0,0,0,0,0,0,0,0,0,0,0,16901,0,0,0,27558,0,0,9418,0,0,0,3508,0,0,0,0,0,0,0, +0,37990,9289,8517,0,0,0,0,1578,1604,23944,0,0,14916,12781,0,0,0,0,0,0,0,12105,0, +16617,0,0,0,0,0,0,0,0,0,0,0,0,21348,11240,28870,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,5772,0,0,27812,0,0,0,0,0,0,0,8324,0,0,0,0,0,0,0,0,0,0,16748,1157,0,0,18794, +16324,25898,935,8333,0,0,0,0,0,0,0,0,18246,0,18086,0,46854,0,0,0,0,0,0,339,0,0, +25188,12780,12166,6409,0,0,0,0,16516,0,27012,28395,0,0,0,0,0,0,0,1420,0,0,0,9768 +,52967,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25163,324,0,0,0,0,0,0,0,0,0,64998,0,0,0,0,0, +21893,0,0,0,0,0,47366,0,0,0,870,0,0,0,12646,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,26020,16360,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1809,0,0,0,6601,15878,0,0,0,0,0, +29092,0,28516,0,0,0,0,0,0,0,0,0,21988,0,0,0,42950,0,0,0,0,0,0,0,0,0,0,5133,1318, +0,0,0,0,0,0,0,0,0,0,0,54982,24904,0,0,0,0,0,0,0,0,0,0,51526,0,0,0,0,0,3685,0,0,0 +,0,10062,9412,0,0,0,31460,5708,6181,0,0,0,0,0,0,0,0,0,5575,0,0,0,0,0,0,0,0,0,0, +27144,57478,0,0,0,0,0,0,7084,0,21993,53126,0,0,0,0,8397,0,0,5733,0,0,0,0,0,2116, +0,24742,0,11271,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1133,0,4873,0,0,38310,0,0,0,0,0, +0,0,0,0,0,0,0,17932,0,0,18053,0,0,0,25510,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17798,0, +26214,0,0,0,0,0,0,0,0,23016,17415,20392,164,0,0,0,0,0,0,0,0,0,0,0,3239,0,46119,0 +,0,0,28580,0,0,0,0,0,0,0,0,0,7621,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41478,0,0,31016, +55334,10056,1924,0,0,0,0,0,36614,0,36711,0,0,0,0,0,0,0,0,0,0,13994,59303,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,26501,0,5639,0,0,0,0,0,0,13897,1253,0,0,0,0,0,5095,0,0,0, +28869,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8646,0,0,0,0,25641,17796,0,0,0,0,0,0,0, +13316,620,6309,11819,0,0,0,0,0,0,0,0,0,904,1095,0,24229,0,0,28744,49703,0,23077, +0,0,0,0,32392,0,0,0,0,35271,0,28740,5866,0,0,0,0,0,0,0,4361,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7917,8869,0,0,0,13924,0,0,0,0, +0,41958,0,0,0,0,0,0,6766,13989,0,0,0,903,0,0,24010,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,64390,0,22468,0,25861,0,0,0,0,23656,5317,0,0,0,0,0,0,23017,5445,16009 +,0,0,0,0,0,0,0,0,48006,10473,0,0,14404,0,0,0,42183,0,0,0,51270,0,0,10602,24132,0 +,0,0,0,0,43782,0,0,17834,0,0,0,25576,27205,0,0,0,0,0,0,0,0,29066,0,0,0,0,0,626, +1988,14700,0,0,0,0,0,0,0,0,0,0,0,0,57670,0,0,0,0,0,0,0,0,0,44710,0,0,0,0,3848, +7623,0,0,0,0,0,0,0,0,0,0,0,42374,0,0,0,0,0,0,0,0,19272,6436,0,0,5256,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,19685,0,0,0,0,0,0,0,0,0,0,0,0,0,39783,0,0,0,0,30984,0,0,0,0,0,0 +,28230,0,0,0,29028,10538,3205,0,0,0,0,0,0,0,0,0,0,0,5636,840,295,0,0,8488,8198,0 +,0,0,0,0,0,0,0,0,20580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4074,19526,0,0,0,0, +31144,64038,0,0,0,0,0,0,16716,0,0,0,0,0,0,0,0,0,0,0,17706,0,0,0,0,0,0,50630,0, +50503,0,0,0,0,0,0,0,0,0,0,0,25446,0,0,0,13831,0,0,0,0,0,0,2696,4039,0,0,0,0, +25288,0,12076,2054,0,48934,0,0,0,0,16969,59431,17259,35335,0,0,0,0,0,0,0,0,0,0,0 +,0,31275,0,0,0,1097,0,0,0,0,0,0,0,0,0,0,0,776,839,0,0,29386,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,5864,12134,0,0,0,0,0,0,0,25349,0,0,0,0,0,0,0,0,0,61447 +,0,0,0,0,0,0,0,0,0,24678,0,0,0,63335,0,28836,8142,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4494,0,0,0,0,0,14088,1188,0,16260,0,0,0, +16421,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,276,0,0,17060,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24076,29445,0,33543,0,4901,0 +,0,12522,0,0,62471,0,0,0,0,0,0,0,0,0,0,4046,0,0,0,0,20486,0,15460,2217,51719,0,0 +,0,0,0,23495,0,0,0,0,0,0,15370,0,15849,0,15113,0,0,0,0,0,0,0,0,27972,7337,0,0,0, +0,30342,0,0,0,0,0,0,0,0,32299,23940,0,17766,0,0,0,0,0,0,6184,0,20904,0,0,0,0,0,0 +,0,0,0,0,31492,0,0,0,5509,0,0,0,0,0,0,0,0,2669,50182,0,0,12299,0,0,0,0,0,0,0, +5257,28167,0,0,0,0,0,0,0,0,0,0,0,11750,3890,0,0,26500,0,0,0,0,0,0,0,49318,0,0,0, +0,0,0,0,10981,0,0,0,0,0,0,0,0,17961,1831,0,0,0,0,0,0,0,29638,0,0,0,0,26473,0, +6216,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,711,0,0,0,0,0,0,0,0,0,0,28683,39975 +,0,0,0,0,0,51654,0,0,0,27527,0,0,0,0,0,0,0,0,30859,3268,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28772,0,18212,0,0,0,0,25448,65446,0,0,0,0, +0,0,3337,1670,0,0,0,0,0,19332,0,0,0,0,24936,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1043,0 +,0,0,0,15814,0,21670,0,0,0,0,0,0,0,16263,0,0,0,0,0,0,0,0,0,32454,0,30630,0,0, +20170,9926,0,0,0,18247,0,0,14376,0,2056,17191,0,0,0,0,0,0,0,7812,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,22474,52806,1588,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10825,0, +0,0,0,40934,0,0,0,0,0,0,0,28677,0,0,5714,0,0,0,0,0,0,0,0,0,0,0,0,0,25865,22246,0 +,0,0,0,17256,35751,0,0,0,0,0,0,0,0,8236,0,32108,0,0,0,43,14342,0,16517,0,0,30732 +,0,4012,133,0,40583,971,23942,0,0,27275,0,0,0,204,0,0,27140,7564,44327,27592, +57958,0,0,0,0,22344,25701,0,0,0,0,0,0,0,19524,31755,0,0,28102,0,59111,0,0,0,0,0, +0,0,12261,0,44934,0,0,0,0,31560,0,11114,0,0,0,0,0,0,0,0,0,0,0,18953,18311,0, +45159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2059,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +19399,0,0,0,0,0,0,0,0,0,0,0,0,0,58534,0,0,0,0,0,0,0,0,0,0,0,0,22411,23943,0,0,0, +0,0,0,11690,0,0,4069,0,0,2668,6342,0,0,0,0,0,0,27658,1766,0,0,0,0,23240,56070,0, +0,0,0,0,0,0,0,0,0,0,0,0,34119,0,24453,0,0,0,0,21867,0,17610,9894,0,0,27976,38790 +,0,0,0,43654,0,31559,12202,23142,0,0,0,50343,0,0,0,0,0,32806,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,49895,0,0,0,0,15786,4263,0,0,0,0,4746,3814,0,0,0,0,0,0,17192, +453,17323,0,20328,4036,0,0,0,15844,0,0,0,0,27561,31940,32296,0,0,0,0,0,0,0,11499 +,11782,0,0,0,0,9738,50471,0,0,0,0,0,35430,0,0,0,0,0,29734,0,0,0,36551,0,0,0,0, +9257,5606,0,13829,0,7015,0,0,0,0,0,25127,0,0,19051,0,0,0,0,0,0,0,0,0,0,0,0,0, +2572,0,0,0,0,0,0,29797,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42342,0,0,0,0,9293, +0,17896,56038,4077,0,0,0,29899,37351,0,30823,0,8326,0,0,0,18342,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18569,54054,0,0,0,0,0,0,0,0,0,37254,0,0,31433, +61510,0,2022,0,0,0,0,0,25381,0,0,0,0,0,0,0,0,0,0,0,0,0,2149,25289,0,0,0,0,0,0,0, +0,0,0,12516,14185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8676,0,0,0,0,0 +,0,0,0,0,0,0,36486,0,0,0,0,10889,9607,0,28711,0,0,0,0,0,0,0,0,0,0,28490,0,0,0,0, +26181,10283,1701,0,0,0,0,0,0,0,0,0,14980,0,7783,0,27846,0,0,0,56486,3892,0,0,0, +5770,16583,0,26309,13422,20292,0,0,0,0,0,0,0,0,0,28742,0,0,0,0,14536,1158,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25801,0,0,0,0,0,0,0,0,0,0,0,0,42438,0,3332,0,0 +,0,0,0,0,0,0,0,8327,0,0,0,0,0,0,0,0,0,0,0,0,17353,1447,0,0,8427,48518,1359,0,0,0 +,0,0,14986,0,32168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9230,2791,0,0,0,0,0,0,0,0, +16073,31623,4269,0,0,0,0,0,0,4519,0,0,27912,58950,0,0,0,0,0,0,0,0,8361,19812,0,0 +,0,0,6056,7877,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21701,0,0,0,0,0,0,0,0,0,0,0 +,0,9128,1125,0,16548,0,0,0,0,0,0,0,0,0,0,17292,6854,21352,0,2380,0,0,4007,0,0,0, +0,0,24357,4202,0,0,0,0,0,0,0,0,0,0,0,0,0,10664,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,42823,3022,0,0,0,0,0,0,0,0,0,0,0,0,14373,0,20677,3304,2759,20522,64903,0, +0,0,38,0,0,0,0,0,0,0,0,0,0,0,27814,2802,8870,3758,1255,0,0,0,0,0,0,0,0,30027, +9510,0,0,0,0,17864,14855,0,0,0,0,0,0,0,0,0,0,23404,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +51462,0,0,0,0,0,0,0,45734,0,0,23467,32327,0,0,10826,52999,0,0,0,33222,31336, +64326,0,0,0,0,0,0,0,32166,0,0,3891,0,0,0,7017,645,0,0,0,0,0,0,27915,46087,0,0,0, +21863,0,34246,0,0,16715,0,0,0,0,14052,21416,0,0,0,0,0,0,0,0,39846,0,0,0,0,0, +38982,0,0,17512,7460,0,0,0,0,0,0,0,0,0,15428,0,0,0,0,0,0,0,28356,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,25445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11879,0,0,0,0,0,0 +,0,0,0,0,0,0,0,19911,0,20007,0,0,0,10855,943,0,0,10821,0,0,0,0,4170,0,0,0,0,0,0, +0,0,0,9836,0,0,0,0,0,0,0,0,0,0,65415,0,0,0,0,0,0,0,0,9865,24646,0,0,0,0,0,40519, +0,0,0,0,0,0,0,0,0,12804,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22091,23655,0,0,0,0,0,0, +0,31686,0,0,0,58599,0,0,0,0,0,0,0,0,0,0,0,0,0,19620,0,0,0,0,0,0,0,0,0,0,0,0,0, +24421,0,28100,0,0,0,31268,0,3204,0,0,0,0,0,0,0,0,0,14822,0,0,0,0,19947,10182,0,0 +,9480,14821,4398,0,0,14532,0,0,0,48871,1873,0,0,0,0,0,0,0,589,1541,0,0,0,0,0, +23333,0,0,0,14149,0,0,0,0,1296,14374,0,27300,0,0,0,0,0,0,7276,0,0,0,0,0,0,47718, +0,0,0,0,0,0,0,0,0,0,5164,1765,0,14405,0,37574,1994,0,6636,0,0,0,0,0,0,0,0,27815, +0,0,0,0,2568,6820,0,0,0,0,0,0,0,0,0,0,11336,26247,0,0,23912,0,0,0,30536,0,0, +34342,0,17799,0,0,0,22149,0,6118,0,25732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,26600,5190,0,0,1142,0,0,0,0,0,0,0,0,39527,0,0,0,0,0,39494,0,0,0,0,0,0,0 +,0,0,0,3085,0,0,0,0,0,0,0,4786,0,0,0,28873,6532,0,0,26664,0,9193,11719,0,0,0,0,0 +,0,31752,64646,0,0,0,0,0,0,0,0,0,0,0,11397,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25094,0 +,0,18153,20167,0,0,0,17254,0,0,878,0,0,0,0,0,0,0,0,0,0,24166,0,0,0,0,0,0,0,0,0,0 +,0,0,26059,0,0,0,0,0,0,0,0,0,0,0,0,0,31592,0,0,8167,24362,6212,0,34758,0,0,0,0,0 +,0,32520,0,0,44679,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17989,8681,29222,0,0,0, +0,0,0,0,0,10251,4902,1452,15207,0,0,0,0,0,0,0,22822,0,10469,0,0,0,0,0,0,19337, +17670,107,11494,0,0,0,0,27305,2565,0,0,0,0,0,0,0,64518,200,28389,0,0,0,0,31208,0 +,30762,0,0,0,0,0,29321,60518,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3209,3237, +12490,22663,0,0,0,18789,31464,16391,0,0,0,0,0,0,0,0,0,0,0,20646,0,0,0,27238,0,0, +0,0,0,15940,4488,6951,0,0,0,46342,0,0,0,0,0,0,0,0,0,28965,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,20584,3367,0,25350,0,0,0,0,0,0,0,0,0,0,0,0,1814,0,0,0,0,0,0,0,0,0,0,17125, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55943,0,0,0,0,0,24133,0,0,0,0,0,0,0,0,0,0,0,0,2929 +,0,0,50086,0,2918,25356,30052,115,11846,0,0,0,0,3056,0,0,0,0,17639,239,19815,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36806,0,0,0,0,0,0,0,0,0,0,0,0,0,21479,0,0,0,0,0, +28420,11786,4772,0,0,3368,36295,0,31463,0,0,14665,996,0,20582,0,0,0,9988,0,23685 +,0,0,0,52551,0,0,0,0,0,0,0,7556,0,0,0,0,0,0,0,1895,2186,0,0,0,0,0,27755,25447,0, +0,0,0,31052,63270,0,0,0,0,0,0,0,36742,0,24804,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,31048,0,0,0,0,0,0,0,0,0,21290,2276,0,0,0,0,26475,0,0,0,0,0,0,0,0,0 +,0,15332,0,0,0,0,0,0,0,0,3176,19431,0,0,0,0,0,0,0,62726,0,0,0,25380,0,0,27883, +1316,0,0,7724,3015,0,0,0,0,6697,0,0,47910,0,0,0,0,0,0,0,0,0,3141,0,0,0,14820,0,0 +,0,0,9326,0,0,0,0,0,0,0,0,0,0,31493,0,0,0,0,0,6566,0,0,0,0,0,0,6569,1348,0,25638 +,0,0,0,0,0,20324,0,0,17067,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11876,0,41030,0,0,0,26405 +,0,0,0,0,0,0,0,0,0,11431,28137,14950,0,10151,0,0,0,0,0,0,0,29574,0,0,0,0,27176, +57446,0,0,0,0,28650,57574,1387,0,0,0,0,0,0,0,0,0,0,58247,0,0,0,0,0,0,0,16805,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3526,0,15781,0,5572,13352,0,0,0,0,0,18665 +,23463,0,0,0,0,0,0,15405,6885,0,0,0,0,15272,0,0,0,0,0,0,0,0,9861,0,0,0,0,0,0,0,0 +,9512,4037,0,0,11563,49639,0,0,0,0,0,0,27880,57830,0,0,0,0,0,41831,0,21924,0,0,0 +,0,0,0,0,25509,0,27462,0,18085,0,0,0,0,0,0,0,0,0,0,0,0,13898,8068,26441,0,0,0,0, +0,0,25316,0,0,0,0,16298,7397,5706,19239,0,0,0,0,0,0,0,0,1392,50919,0,0,0,0,0, +53863,0,0,0,0,1451,0,0,0,0,0,0,0,0,0,0,35847,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,17801,15813,0,12740,0,0,0,32967,0,0,0,0,0,0,5389,0,0,0,0,0,0,0,0,0,0,31143,0, +20548,0,0,0,0,0,0,0,0,0,51686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +12109,19015,0,34983,0,21732,3600,0,0,0,0,47750,17288,43975,22857,47559,0,0,0,0, +26408,48358,0,0,0,0,0,0,0,0,0,0,0,0,0,30470,0,0,23560,4581,0,22404,0,49286,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49831,0,0,0,27525,31691,7,0,0,25835,0,0,0,0,0, +4201,16485,0,20676,0,0,0,0,3753,23303,16264,3878,0,0,0,0,0,0,11434,0,0,0,0,0,0, +7589,0,0,0,0,0,0,0,0,0,57095,0,0,0,0,0,0,0,0,0,0,0,22820,11146,49158,0,23623,0,0 +,0,0,0,0,0,13893,0,0,0,0,0,0,11722,60071,1258,0,0,0,0,0,0,18564,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,27945,0,0,0,0,5479,0,20006,17608,3431,10988,30180,0,0,0,0,0,0,0, +24581,14,0,0,0,0,0,0,25572,0,0,0,28612,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53543,0 +,0,0,0,0,0,0,0,0,0,0,33670,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8710,0,14116,0,0,116, +292,0,0,0,37831,0,43078,0,0,0,0,0,0,0,0,21832,0,0,32134,783,0,0,30982,0,0,0,68,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5932,0,0,0,18505, +15175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3630,16965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,17797,0,0,0,0,0,0,520,42150,0,0,3122,0,0,0,22506,0,0,0,0,0,0,0,0,28550,0, +0,0,50278,0,0,13641,5958,0,35238,0,0,0,0,0,0,0,0,29993,18724,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,20619,9319,0,0,0,0,23977,0,5193,0,0,12196,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,24390,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20105,677,0,0,0,0 +,0,0,0,0,29419,0,0,0,0,0,0,0,0,0,20266,0,0,0,0,10631,0,0,0,0,0,0,0,0,0,47655,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26628,12744,0,20648,0,0,0,432,0,0 +,0,0,0,0,0,0,0,0,646,0,25604,0,0,0,0,0,0,0,0,0,0,0,0,0,63782,0,0,0,0,24616,0,0,0 +,21291,0,0,0,0,0,0,0,0,0,0,45638,0,0,0,0,1931,0,0,0,20521,59975,0,20614,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,56231,0,0,0,0,0,29991,0,52871,0,20934,0,0,0,0,0,0,0,16871, +0,0,0,0,0,0,0,0,0,0,0,0,0,7237,0,0,0,0,0,47558,0,0,0,0,0,0,0,0,0,0,0,10406,0,0,0 +,0,0,0,0,43046,0,0,2930,0,12936,0,0,0,0,0,0,0,0,0,0,0,0,31141,0,0,0,0,0,0,0, +37639,0,17572,0,0,0,0,0,0,0,0,0,0,31240,0,0,0,0,0,688,0,0,0,0,0,1648,0,0,0,0, +10055,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,146,0,0,0,0,0,0,0,0,0,6345,199,0,34982,0,0 +,0,0,0,0,0,0,0,0,0,0,0,56839,0,0,0,0,0,48902,0,13412,0,0,0,0,0,0,0,0,2441,4420,0 +,0,0,0,20428,933,0,0,0,0,0,0,0,45383,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,54726,0,0,0,0,0,0,0,0,0,0,0,0,17036,741,0,0,0,0,0,0,0,27589,0,0,30282 +,18950,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2248,0,0,0,0,0,0,0,0,0,25993,0,0,0, +2443,0,0,31622,0,14150,0,0,0,28679,0,0,0,0,0,0,15464,0,0,0,0,54694,0,0,0,0,0,0, +3827,0,0,0,3756,0,9897,0,0,0,0,0,19082,31239,0,0,0,0,0,0,0,0,0,0,0,24580,0,0,0,0 +,0,0,0,0,0,16580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27625,0,0,0,784,4647,32652,0,0, +63494,0,0,0,0,0,0,0,21062,0,0,0,0,0,0,0,0,0,0,3404,58470,0,32325,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,18634,2789,0,0,0,0,0,0,0,8548,0,0,0,22501,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,15881,0,0,0,0,35879,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7978,17956,0,0,0, +0,0,0,0,24324,0,0,4937,0,0,0,8168,0,13420,10340,0,0,0,0,0,11780,0,0,0,0,0,0,0,0, +0,0,16712,0,0,0,0,0,0,0,17640,17991,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,2953,0,0,0,0,0,0,0,9100,16806,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30667,0,0, +19013,0,0,0,0,0,0,205,15334,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1969,0,0,0,0,0,0,0,26248 +,52518,0,49798,0,0,0,0,0,0,0,9668,0,0,0,0,0,4742,0,0,21641,0,0,0,0,0,0,53574,0,0 +,0,0,0,0,5707,0,0,0,0,0,0,0,3018,12454,0,0,0,0,2920,262,0,0,0,0,0,0,0,0,0,0,3593 +,0,0,0,0,0,0,0,0,0,0,23910,0,0,0,0,0,0,0,55879,0,0,0,0,0,775,0,43270,5066,48967, +0,0,22986,4165,8971,44838,0,0,0,0,0,62279,272,0,0,0,0,51430,0,0,0,0,0,0,28234,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13349,0,0,0,51111,20265,13861,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,585,7494,0,0,0,0,0,0,0,0,21768,62407,0,0,0,0,7979,166,0, +0,0,0,0,0,0,0,0,38918,0,56742,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16296,5767,0,0,0,0,0,0 +,0,32068,0,0,0,0,0,0,0,0,0,0,0,0,0,29796,0,0,0,0,0,0,0,0,23916,30183,0,58791,0,0 +,0,0,0,0,0,20518,0,0,0,0,8969,0,0,0,183,0,0,0,0,0,2314,17445,0,0,0,0,0,0,0,0,0, +23748,0,0,8139,4839,27914,0,0,0,0,0,0,0,0,0,0,0,0,29478,0,0,16552,26663,0,53767, +0,0,13960,8039,18696,0,0,0,0,0,0,0,0,0,0,0,782,16005,0,0,0,0,0,0,0,0,6258,56806, +16456,12455,0,0,0,0,0,0,0,23780,0,0,0,0,0,0,9355,0,0,0,7273,41063,24780,57766,0, +0,0,0,0,0,0,0,0,0,3820,2597,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29225,61126,0,0,0,58439, +15691,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37190,22408,967,0,0,0, +23078,26858,0,0,0,19753,0,0,0,0,0,0,0,0,0,5416,13702,0,0,0,0,0,52742,20394,38567 +,0,0,0,51079,0,0,136,8516,0,0,0,0,0,0,0,0,0,0,0,27588,0,0,0,0,0,0,0,0,0,0,531,0, +0,0,0,0,0,0,0,0,8936,5031,12520,19334,0,0,22827,30247,28074,31140,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,27497,18148,20104,59079,0,0,0,0,0,0,0,0,0,24389,0,0,6125,0,0,0,0, +9541,0,0,24553,29095,0,0,0,0,0,0,0,25444,0,0,9643,0,0,63047,0,0,0,0,0,0,0,0,0, +39558,0,0,0,0,0,0,20620,11815,499,0,5128,2278,0,0,0,0,0,46310,0,0,0,0,0,0,0,0, +23530,40166,2440,0,0,0,0,0,0,0,0,0,0,15174,0,0,0,0,0,0,0,0,0,0,26922,0,0,0,0,0,0 +,0,0,0,0,26758,0,0,0,0,0,51911,0,0,23532,0,0,0,0,51238,25737,44486,12622,0,0,0,0 +,0,0,3078,0,9253,0,0,1128,22023,0,0,0,21350,0,16420,0,0,0,0,0,0,0,65094,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22532,0,48774,0,34503,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,9797,0,0,0,0,0,0,0,13797,0,38279,0,0,1738,0,489,46343,0,45382,0,0,0,0,0,0, +0,0,0,29030,0,0,0,0,0,0,6220,56550,0,0,0,0,0,26885,0,28806,0,0,0,0,0,0,0,0,0,0,0 +,45958,0,0,0,0,20553,49927,0,0,0,0,0,0,3019,12358,0,0,0,0,0,0,0,0,0,0,26571, +13319,0,0,653,23399,0,0,0,0,0,0,0,0,22316,0,0,21188,0,0,0,0,0,0,0,0,0,27556,0,0, +0,0,0,0,0,27878,21483,27653,0,29701,237,0,10632,0,0,0,0,33766,0,0,0,0,0,0,31563, +0,0,0,0,0,1416,2439,0,0,0,0,0,0,0,0,0,0,9611,0,0,0,0,0,0,0,5611,16581,26601, +35462,0,0,0,26756,0,59271,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26984,57734,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,7882,0,0,0,19528,6469,0,0,1161,0,0,0,7688,20935,425,0, +0,0,0,0,0,0,0,12519,0,12902,0,0,0,0,0,0,0,0,0,0,2411,0,11725,26086,0,0,20201,0,0 +,0,0,0,0,0,0,11045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30471,0,0,0,0,0,0,0,0,0,0,0, +21541,1141,21190,0,9188,0,0,0,0,0,0,0,0,0,0,0,0,0,0,184,1093,0,0,0,0,0,0,0,0, +4842,0,13672,0,0,12230,0,0,0,10532,0,0,8937,0,0,0,0,0,0,0,0,0,0,28996,0,0,11720, +26982,0,46182,0,43911,31754,0,1160,3940,0,20772,0,0,0,0,0,24549,0,32582,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,31845,0,0,0,0,0,0,0,2310,11788,0,0,43047,0,0,0,18853,0 +,0,0,0,0,0,0,0,0,63622,0,0,7048,17318,0,0,0,21957,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,1039,6279,0,0,0,0,0,0,0,0,0,0,0,0,0,12197,0,0,0,0,0,0,0,0,0, +46470,0,0,24,19719,0,0,0,0,0,0,0,0,0,39335,0,0,0,0,0,0,0,0,0,0,21353,3846,0,0,0, +0,0,0,0,36679,0,0,0,0,0,0,0,0,0,0,0,11268,0,0,0,0,0,9382,0,0,0,0,0,0,0,0,0,0,0,0 +,0,29926,0,33606,0,4708,2828,0,0,29543,0,0,0,0,0,29893,0,0,0,0,0,0,0,0,3663,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10920,7111,0,0,0,0,0,0,0,0,0,0 +,9384,0,0,0,0,0,0,0,0,0,0,0,0,20388,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37094,0,0,0, +27110,0,0,0,0,0,0,21865,0,27753,30214,0,0,0,0,0,57895,0,0,0,0,0,0,0,0,0,0,12648, +5446,0,0,0,0,0,0,0,0,0,0,19784,17124,0,52007,0,0,0,0,0,0,0,0,758,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,24900,0,0,0,0,0,1476,0,65031,0,0,1205,46663,0,30023,11625, +1094,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10058,0,0,0,0,0,0,28455,0,0,0,0,0,0,0,0,0,0,0, +14788,0,0,0,0,16808,0,0,742,0,0,0,0,0,0,0,0,0,0,0,21636,0,0,0,0,0,0,0,0,0,0,0,0, +15944,23207,0,0,0,0,247,0,0,0,0,24743,0,0,0,5252,0,0,0,0,0,0,0,0,29961,18660, +21099,46791,0,7045,0,0,0,0,25707,0,0,17412,3828,0,0,0,0,0,0,0,0,0,0,0,5803,5637, +0,38151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60103,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,853,0,0,0,0,0,0,30215,0,0,0,0,0,0,0,8741,0,0,0,0,0,27366,0,0,0,0,171, +4070,0,0,0,0,0,0,0,0,24073,7366,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2184,5189,0, +20932,1545,4996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7684,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6313,0,0,0,0,0,0,0,30826,0,0,0,0,0,0, +0,0,0,0,27463,0,0,0,0,0,0,0,0,0,0,21640,63303,0,0,3275,31111,0,0,0,0,0,0,0,11556 +,0,14756,0,0,0,15108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23914,28966,0,0,0,4965,0,0,0,0, +0,0,0,0,0,0,10216,5223,0,0,0,0,0,0,0,0,0,27142,0,0,1173,20198,0,0,0,0,0,56614,0, +0,0,0,0,4612,0,0,0,0,0,0,0,0,0,0,11822,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17769,7910, +0,0,31880,0,0,6055,0,0,0,0,0,0,0,0,0,0,8970,0,0,0,0,0,0,0,0,0,0,0,16840,23879,0, +0,11051,0,0,0,32552,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20842,13701,0,0,0,37191,7373, +10471,17482,25348,0,0,0,38502,0,0,0,0,0,0,0,0,0,21509,6058,0,0,0,0,0,0,3173,0,0, +0,9543,0,0,0,0,0,0,17768,12708,0,0,0,0,0,37030,0,0,0,0,0,0,0,0,0,0,12748,48743,0 +,11718,0,0,25194,0,0,0,9033,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5028,0,30118,0,0,0,0,0, +42759,0,0,3720,0,0,0,0,0,0,25190,0,0,0,0,0,0,0,0,0,0,5450,5125,0,58086,0,0,0,0,0 +,27716,0,0,0,0,0,0,0,0,0,22052,0,0,0,0,26249,0,15947,3460,0,0,0,35814,0,0,0,7813 +,19500,32167,0,18597,0,0,0,0,0,28644,0,0,0,60743,0,0,0,0,0,29636,0,0,0,0,0,0,0,0 +,0,0,0,0,0,17220,15885,9414,9642,0,0,0,593,0,0,24228,0,0,0,0,0,40422,0,26244,0, +23109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64902,0,0,0,0,3979,60007,0,0,0,28199 +,0,0,0,43142,0,0,0,0,0,0,0,29158,0,30532,0,0,0,0,13256,0,0,0,0,16549,0,0,0,0,0, +26116,0,0,0,0,0,0,0,0,22825,0,0,0,0,0,0,0,1065,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,18985,4805,0,0,0,0,0,17702,0,0,0,0,0,0,0,0,0,0,3468,0,0,0,0,13447,0,0,0 +,0,0,0,0,0,0,0,0,56871,0,0,1776,15780,0,0,2603,0,10280,31366,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,11592,3591,0,2372,0,0,0,0,0,0,0,20004,0,0,0,0,0,0,12072,518,0,0,1960, +8999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7178,32999,0,0,0,0,0,0,1641,0,0,0,0,0,0,0,6764, +9893,490,4005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25258,5541,0,14053,306,20743,0,0, +9422,0,0,0,0,0,0,0,11977,260,0,35175,0,0,0,0,0,0,0,18405,0,0,0,16582,0,0,0,22470 +,0,0,0,0,0,0,2792,0,0,0,14026,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14858,3909,0,0,0 +,57671,0,0,0,0,0,0,15979,0,0,0,2794,15239,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26884, +9070,0,0,0,0,51846,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19499,37127,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,19205,10350,11910,0,0,0,0,15083,23108,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,169,0,0,0,0,0,0,0,0,0,0,0,15274,41735,0,56774,0,0,2825,0,14025, +389,0,0,0,0,0,0,0,0,21482,31910,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20456,710,0,0,25032, +21797,0,0,0,0,0,0,0,0,0,0,32427,21252,0,30150,0,43174,0,0,0,0,0,0,0,0,0,0,0,0, +11403,0,0,1029,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6892,9252,0,63206, +3496,14406,0,0,0,0,0,0,0,0,0,0,22568,0,0,21253,0,0,0,0,0,0,0,39623,0,0,10189,0,0 +,0,0,0,0,0,0,0,0,0,0,0,30729,59910,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3305,0,0,0,0,0,0, +0,0,0,7660,24871,0,838,0,0,0,0,0,0,0,0,0,0,0,0,12013,13252,0,551,0,0,0,43207,0, +30567,0,0,0,0,0,0,0,0,28394,30724,0,0,0,0,0,0,0,0,0,0,22665,22725,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,29414,0,0,0,0,16074,8966,245,1445,0,0,0,0,24872,0,0,0,0, +13124,0,35527,0,0,0,0,0,0,13259,10917,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +25191,0,0,0,13956,0,0,0,0,0,0,0,54631,19625,12070,3083,0,0,0,0,14436,0,0,0,0,0,0 +,0,0,0,0,0,0,0,21766,0,15463,29322,0,0,0,0,0,0,29990,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,23653,0,0,0,0,0,0,0,0,2643,0,0,21223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,4114,0,0,0,0,0,0,0,0,34790,0,0,0,0,0,0,0,16103,0,0,0,0,0,0,297,3620,3338, +10372,0,14727,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29924,22473,13895, +15529,32455,30378,13540,0,28807,0,0,0,0,0,0,0,64582,18380,0,0,0,0,0,0,0,0,0,0,0, +0,38598,0,0,0,0,0,0,0,0,1236,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32710,0,0,0,0,4590,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64935,0,0,0,0,0,0,0,0,0,0,0,0,16744,0,0, +0,0,0,0,20005,0,0,13608,1191,0,0,0,62183,0,0,0,0,0,24484,0,0,0,0,0,0,0,0,0,0, +17643,0,0,0,0,0,0,0,0,0,0,0,0,5380,0,0,32328,0,0,63814,0,0,0,2919,0,0,0,0,17034, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,60295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,7690,486,0,0,0,39270,0,49094,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12555,0,0,0,0,0,0,0,0 +,0,0,0,0,20967,17993,12647,0,0,0,16036,32616,0,0,0,0,16294,8555,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35174,0,0,0,0,0,0,30346,0,0,0,0,0,0,0, +14797,3652,0,0,8268,12934,0,54950,0,0,0,0,2632,33959,0,23175,0,0,0,0,0,36262,0,0 +,0,0,0,0,32684,26918,0,32676,0,0,0,0,0,0,0,0,0,0,15625,11943,1206,0,0,0,0,18052, +0,0,0,0,0,16422,0,0,0,26404,0,0,28777,0,0,24902,0,0,408,45351,0,35719,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,3658,17446,0,165,0,0,0,0,0,0,0,6151,0,0,24424,0,0,0,0,0,0,0, +24170,24293,0,0,0,0,0,0,0,0,0,11847,0,39591,0,0,0,0,0,0,9549,2788,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1010,0,0,0,0,0,0,26055,31724,0,24233, +1828,0,0,0,0,0,0,0,0,0,17284,0,0,0,0,19464,0,0,0,0,0,0,0,0,32452,0,0,0,28871,0,0 +,0,0,17704,53383,0,0,0,0,0,0,0,0,0,17892,1938,0,0,0,0,0,16362,0,0,21605,0,0,5003 +,0,0,0,0,0,0,22693,0,22342,0,0,0,55846,0,0,0,0,0,0,0,0,0,22853,0,0,0,0,0,0,0,0, +6600,263,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24836,0,0,0,0,0,0,0,0,0, +40711,0,0,0,0,0,33894,0,0,0,0,0,0,13000,0,0,0,0,0,0,0,0,0,0,30308,0,0,0,0,0,0, +5386,0,0,0,0,0,0,27844,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17740,0,0,0,0 +,25093,29064,0,0,0,0,0,0,0,12680,11462,0,0,0,0,0,0,0,0,84,7303,0,0,0,0,0,0,0,0,0 +,0,0,27044,457,0,22924,58246,19016,0,2606,45703,0,5157,0,25028,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,2065,0,0,0,0,0,31946,0,0,0,0,0,0,0,0,0,0,0,0,33382,0, +47878,0,0,0,0,0,0,0,0,25004,0,0,0,0,0,0,0,26153,35654,0,58055,30668,0,0,0,0, +25988,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4456,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,7560,20583,0,0,0,0,0,0,0,0,0,37510,0,0,0,0,0,0,0,0,0,42822,0,0,0,0,0,0,0,0, +0,0,0,1733,0,0,0,8196,0,0,11241,0,30572,60326,0,15013,0,0,0,40646,0,23812,0, +10022,0,0,0,0,0,0,0,0,12874,31015,0,0,0,0,0,0,1608,0,0,0,0,18308,0,0,0,0,27114,0 +,0,0,0,0,0,0,7944,1382,0,11813,0,0,0,0,0,0,0,0,0,0,0,0,0,24517,0,11621,0,0,0,0,0 +,0,0,0,0,0,0,21702,0,0,13100,8262,2644,7973,0,0,0,0,0,0,0,0,0,0,0,0,1033,12581,0 +,25221,0,0,0,40998,16301,62983,0,0,0,0,1263,9318,0,0,0,18854,0,0,1741,33895,0,0, +0,0,0,0,26377,0,0,0,0,0,0,0,0,0,0,32165,0,51143,0,0,0,0,0,29412,0,0,0,0,0,0,0,0, +1674,4230,0,0,0,0,0,10502,0,0,0,0,5545,0,0,0,0,0,2099,45158,0,0,0,0,0,0,0,0,0,0, +14157,0,26955,0,0,0,0,0,0,0,0,0,17096,0,0,0,0,0,0,0,0,0,0,0,0,0,27050,6726,0,0,0 +,0,0,0,0,0,28554,0,0,7142,0,0,0,0,16936,0,0,0,25833,0,4399,6980,0,46214,0,0,0,0, +0,10630,21164,0,0,0,0,0,0,0,2446,48551,0,0,0,0,0,0,0,0,0,0,0,13381,0,0,0,0,0,0,0 +,0,15400,12135,0,0,0,0,0,4774,586,0,0,0,0,0,0,0,0,23751,9736,4548,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25577,29607,6250,1637,0,0,0,0, +22024,0,0,0,0,22308,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37414,24044,0,0,0,14474,29735, +0,7077,0,45990,0,0,0,0,30568,40039,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +6150,0,4228,0,0,0,0,0,27687,0,0,0,0,0,0,0,24548,21513,1350,0,0,0,33607,0,0,0,0,0 +,0,0,0,11784,1414,0,0,0,0,0,0,0,18244,940,0,0,0,0,0,0,7270,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,16709,0,0,0,0,0,0,0,48935,0,0,0,0,0,0,23660,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,53350,0,0,0,0,0,0,4236,16358,0,4422,6665,32644,0,0,744,18084,0,11014,0,0,0,0,0, +29508,0,0,0,0,0,0,0,7686,0,0,13289,5478,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,12872,0,0,24134,1005,22916,0,31429,23400,0,0,0,0,0,0,0,28424,0,0,0, +25706,27109,0,0,26345,0,0,0,0,0,0,25126,0,0,88,0,0,0,0,0,0,0,17032,0,0,21799,0,0 +,10060,0,12296,21892,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20777,14311,0,58182, +32232,0,10282,0,2121,11527,0,0,0,12325,0,0,0,0,0,0,0,28804,2344,8133,0,0,0,0, +21864,62695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2771,0,0, +23204,0,0,0,0,0,6278,0,0,0,0,0,26597,0,0,0,0,23144,0,0,0,0,0,31816,20070,0,0,0,0 +,0,0,0,0,0,0,24456,2118,0,0,0,0,6570,1156,0,0,0,0,0,0,0,30406,0,0,0,28388,3572,0 +,0,26599,12426,5286,0,0,0,0,0,4967,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24970,24167,0,0,0 +,0,28745,4678,0,0,0,0,0,0,0,1444,236,0,0,0,0,0,0,0,0,19428,0,0,0,0,0,0,2092,0,0, +0,0,0,0,0,0,0,2827,0,0,0,0,0,19881,19204,0,11749,0,0,0,0,0,0,0,17958,0,17894,0, +18726,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,21510,5033,0,0,0,0,22855,0,0,0,0,0,14598,0,29605,0,0,0,0,0,0,0,0, +617,0,0,0,0,47142,0,0,0,0,0,0,0,0,0,0,3627,0,0,0,0,0,0,0,0,0,0,0,0,0,2225,14823, +0,0,2637,6182,78,15078,0,0,0,0,20264,0,0,0,0,0,0,36743,4140,44551,17352,25703,0, +0,0,0,0,0,0,0,0,0,0,0,14024,0,0,0,0,0,0,28004,0,0,0,0,0,7588,0,0,0,0,0,0,0,2087, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18028,0,0,0,300,14212,0,0,1386,40327,0,0,0,0 +,0,0,31082,0,0,22374,0,0,0,0,0,35718,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +26532,7756,0,0,18982,0,0,0,0,0,0,0,0,6440,1159,7180,0,0,0,0,0,0,45766,0,57798,0, +16740,0,0,6802,60454,0,0,0,26470,0,0,0,0,0,65382,4362,7750,0,0,0,0,0,0,9096,4743 +,334,0,0,0,0,0,0,39974,0,0,0,25828,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3027,0,0, +0,15816,0,0,0,0,0,0,0,0,48327,0,0,0,0,0,0,0,0,0,0,16168,41799,0,0,24458,8581,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12292,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,54503,0,0,0,0,5097,30852,18664,0,0,0,0,0,0,16484,0,0,27337,0,0,0, +0,0,0,0,0,0,0,0,0,35942,0,0,0,0,0,0,0,4356,0,0,0,0,0,57030,0,0,1417,41191,0,0,0, +0,0,23429,0,0,0,0,10024,21735,0,0,10126,0,0,0,0,19046,0,0,0,0,0,0,24105,4710,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4394,0,0,0,0,13253,0,56391,0,0,0,0,0,0,0,0,0,0, +0,19174,0,0,0,0,0,0,0,0,0,55974,0,0,0,52070,0,15620,0,0,0,0,0,2660,0,0,0,0,21644 +,0,0,52455,0,0,0,0,0,0,0,0,0,8902,0,0,0,0,0,0,3116,0,464,34726,0,0,0,0,0,0,25003 +,12423,0,27172,1896,7335,0,0,0,0,0,35686,0,0,0,0,3472,0,0,0,0,22406,0,0,0,0,0,0, +0,0,0,45254,0,0,0,0,0,0,0,0,0,0,0,0,0,21124,23594,33127,0,0,0,0,0,0,16684,22087, +0,0,0,0,0,0,0,0,0,0,0,0,8714,0,0,0,0,0,0,0,0,0,0,55814,0,0,0,0,0,0,4109,23460,0, +0,8874,0,0,0,0,0,0,0,0,0,147,0,0,0,0,0,0,0,0,0,0,0,0,0,29960,63398,1302,0,0,0,0, +0,0,0,0,24806,0,0,0,0,0,0,0,0,0,9799,0,0,0,0,0,0,0,31333,0,0,0,0,0,19557,0,0,0,0 +,0,5701,0,0,0,63014,0,0,0,0,0,0,0,21254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12484,0,0, +0,48326,0,0,0,0,0,0,0,0,0,0,0,15783,0,0,1202,0,0,0,0,23174,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,3086,49191,0,0,5387,15141,0,0,0,3365,0,0,0,0,20076,14021, +0,0,0,0,0,0,0,0,0,0,376,40198,0,0,0,52039,0,24932,0,0,0,0,808,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,9860,0,0,0,0,0,23719,0,21476,0,0,0,0,20776,4807,0,0,3177,16678,0,0,110 +,10853,0,0,0,17382,0,0,0,0,0,0,0,0,0,43462,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,7500,4966,0,0,0,0,0,0,0,52102,0,24516,0,0,0,0,0,0,0,0,0,0,0,0,0,26535,0,0 +,0,46247,0,0,0,15557,0,0,0,0,76,52327,0,0,0,0,17866,0,0,0,0,0,0,0,0,0,0,46758,0, +0,0,0,0,19173,0,0,0,0,0,0,0,0,0,44038,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2985,0 +,0,0,0,0,0,14310,0,0,2125,45831,0,0,0,0,0,0,9838,0,13227,19492,0,0,0,29764,0,0,0 +,0,686,30053,0,0,0,0,0,30789,139,20837,0,0,0,0,502,18533,0,0,0,0,0,19111,0,0,0,0 +,0,31396,0,0,0,17444,0,0,0,0,0,0,0,49862,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25610,550,0 +,0,561,0,29034,0,0,0,3528,0,0,0,1715,14661,18,63463,0,0,0,0,0,0,0,0,0,0,14186,0, +0,0,0,0,0,0,0,0,0,0,29578,59014,0,39430,0,0,0,0,2250,16612,0,31780,0,0,0,0,0,0, +462,16967,0,29029,0,0,0,0,0,23462,0,0,0,0,0,0,0,0,1768,0,6025,16998,1804,0,0, +54182,0,0,0,0,0,0,0,0,14124,0,6154,29702,0,0,0,0,0,7716,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,48807,0,8292,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16389,5933,0, +14857,51303,0,0,0,0,0,0,0,0,0,0,0,35623,9097,23047,0,0,23112,0,0,0,0,0,438,0,0,0 +,0,0,0,0,151,9254,1390,0,0,0,0,0,0,54215,0,0,0,0,6187,0,0,0,0,13095,0,0,0,0,0,0, +0,0,0,0,0,0,9866,0,0,59622,0,0,0,0,0,0,0,0,0,25286,0,0,23848,32069,0,0,0,0,0,0,0 +,0,0,9255,2187,15270,437,0,0,0,0,0,0,0,0,0,0,19493,0,0,0,0,0,0,0,0,0,0,0,11748,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16902,0,0,0,0,0,0,0,0,0,22212,1865,17543,0, +0,0,0,0,0,21996,0,0,0,0,55975,0,0,0,0,0,0,0,0,32138,21156,0,0,0,0,0,0,14249,0,0, +0,2388,0,0,0,0,6823,0,0,0,0,0,0,0,0,0,0,0,0,0,26694,0,0,6059,53511,0,0,0,0,0,0,0 +,49542,6159,0,0,0,0,0,0,0,0,0,0,0,0,0,1036,24036,0,2501,0,0,0,0,0,0,17419,51271, +3377,15142,0,0,0,0,0,0,5007,62374,0,56935,0,0,0,0,0,0,0,0,0,0,0,24422,0,0,0,0,0, +0,0,0,942,0,0,0,0,0,0,0,0,0,0,28263,0,0,0,0,0,0,0,15622,0,19749,0,0,1611,0,22219 +,48583,25129,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17476,0,0,0,0,0,0,0,0,0,0, +721,0,0,0,0,32518,0,0,0,18469,0,0,0,0,0,0,5896,29927,3657,23046,0,0,3214,0,0,0,0 +,0,0,0,0,0,112,0,0,0,0,0,3048,455,0,31012,0,0,0,0,0,0,0,23270,0,32677,0,0,0,0,0, +38086,0,0,0,0,0,0,0,0,0,0,0,0,0,4900,0,0,0,0,0,0,0,0,0,25541,0,18788,0,0,22248, +1351,0,61734,4524,30629,0,14887,242,29063,0,0,14408,4741,0,0,0,37318,0,0,0,0,0,0 +,0,0,0,0,0,0,8106,0,32107,0,0,0,0,0,0,0,0,0,0,0,1481,0,0,28132,0,25798,0,59783,0 +,0,0,0,0,59078,0,0,0,23366,0,0,0,0,0,0,0,30887,0,0,0,0,16200,0,0,0,335,0,0,0,714 +,0,0,0,0,0,0,0,0,0,0,0,0,0,30730,9478,0,0,0,0,0,0,0,0,0,0,0,18790,0,0,0,0,663,0, +0,0,1034,31431,0,0,0,0,0,0,0,0,0,0,30120,0,0,0,0,13925,0,0,0,0,0,0,2280,13414,0, +0,0,0,0,0,22028,23687,3017,11047,0,0,21738,18630,0,0,0,0,0,0,0,30246,0,0,0,0,0,0 +,0,0,0,0,0,0,17257,0,21896,63783,0,0,0,21094,0,18662,0,25700,0,22533,0,0,0,0,0, +6341,5800,11111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15399, +12970,6501,0,0,3179,26438,0,0,0,0,0,0,0,15750,0,13062,0,0,0,0,0,0,0,0,0,0,142,0, +0,0,0,21284,11177,4391,0,0,0,0,19595,40647,0,0,0,0,0,11877,0,0,0,26439,0,0,0,0, +695,49126,27467,11972,0,0,0,0,0,0,9961,0,0,0,31722,62982,0,0,0,0,15817,52710,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24614,0,0,0,0,0,20550,0,0,5034,3942,0,0,0, +45927,0,0,0,0,0,0,0,0,0,0,2548,0,0,0,0,0,0,45606,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,3405,12582,15563,54087,0,0,0,0,0,0,0,0,0,0,0,0,24202,5893,0,0,0, +44230,0,0,0,5605,0,47782,0,32230,0,0,0,0,0,0,0,0,0,0,0,7014,0,0,0,0,16488,3175,0 +,27237,0,0,0,0,0,40902,0,0,0,0,0,0,0,32004,31434,0,24392,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,29130,58214,0,0,0,0,0,0,29002,0,0,0,0,0,0,0,0,0,0,55366,0,0,0,0,0,0,0 +,0,0,0,0,37926,0,0,0,0,0,0,0,0,1290,0,0,0,4713,0,0,0,0,0,0,0,0,0,0,0,0,0,20812,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1803,966,0,17700,0,0,654,19109,0,51655,0,0,0,0,0, +10470,1584,0,0,0,0,0,0,0,2506,0,0,25159,4303,0,0,0,395,15879,0,0,0,0,0,0,0,0,0,0 +,1352,6535,0,19652,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4722,7909,0,0,0,0 +,30152,0,0,64742,0,0,0,0,0,0,2153,9125,0,0,279,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,41894,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,1328,17030,0,0,0,0,0,0,0,54151,0,0,0,0,1775,54535,0,0,0,0,31624,0,0,0, +7150,0,0,0,0,0,0,0,1840,35943,0,0,0,0,0,56455,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +64486,0,0,0,51174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4134 +,0,0,0,0,0,0,0,0,0,0,0,17092,0,0,0,0,0,0,0,0,0,0,0,0,12,16134,19883,39943,10281, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44711,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +14125,2407,0,0,0,0,0,0,0,0,0,0,26921,0,0,0,0,0,22188,0,20810,10053,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28170,0,15208,0,0 +,32517,5736,19271,3562,10534,0,0,0,59655,0,0,0,0,27084,60422,0,0,24969,0,0,0, +2636,0,0,0,0,26277,0,0,0,0,0,0,0,0,0,0,0,30596,3594,0,0,0,8362,14565,0,0,0,0,0,0 +,10793,12326,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5906,59686,0,0,23081,517,0,15556,0,0,0, +8486,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19877 +,0,0,0,0,0,0,0,0,7497,0,0,26085,0,0,23784,63591,6568,6310,0,0,0,0,0,0,0,0,0, +10054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7018,14470,18858,0,5641,10660,0,0,0,0,0,0,0, +35526,1515,0,0,0,0,0,0,0,0,0,0,0,27656,0,0,9606,0,39590,0,0,0,0,0,0,0,0,0,0,0, +53926,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,232,4327,12649,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,20199,0,0,0,0,0,0,26730,0,0,0,19400,14695,0,31334,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19589,0,0,0,0,0,0,0,0,5064,11908,0,27333,0, +0,0,0,0,0,0,47751,0,0,0,26662,0,0,0,0,0,0,0,55655,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,6245,0,0,0,0,0,0,0,0,23368,63911,0,0,0,0,0,0,0,0,1974,0,0,0,0,0,0,0, +8520,24037,0,0,0,0,0,0,0,26279,0,0,0,22886,0,0,0,27782,0,30694,0,0,0,0,0,0,0,0,0 +,0,0,33703,0,0,0,30405,0,34598,0,51047,0,0,0,0,1908,0,0,0,0,0,0,0,0,0,0,1511, +21897,0,0,0,0,0,0,51398,0,24870,0,32647,0,0,0,35015,0,0,0,0,0,0,0,11204,0,0,0,0, +0,0,7758,57991,0,0,0,30949,0,0,22,15140,9162,0,0,0,0,0,0,25540,20136,7108,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16427,10789,9805,0,0,0,0,0,0,0,0,0,4680,0,0,52679, +0,0,0,0,0,14884,0,0,0,16804,0,0,0,0,0,0,9578,5287,0,0,0,0,0,0,0,34054,0,0,0,0,0, +19076,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7627,55719,0,39463,14446,58374,0,0,0,0,23465, +15845,0,0,0,0,0,38534,0,0,0,17893,10922,0,7176,678,0,0,0,0,0,0,0,0,3113,46279,0, +0,0,0,0,0,0,23334,0,0,18088,23268,0,62342,0,0,0,16613,0,0,0,0,0,0,0,0,0,38182,0, +0,0,0,0,0,25292,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10344,71,6446,0,0,1893,0,0, +1106,0,28680,30756,0,41126,0,0,1492,0,15341,0,0,0,0,17575,0,21220,0,0,0,0,0, +25060,2088,21828,0,0,0,0,0,358,0,0,0,0,0,16708,0,0,0,1668,0,0,0,0,0,12260,0,0,0, +0,0,0,0,0,4078,0,0,0,0,0,12713,6215,0,0,20329,0,0,0,0,0,0,0,0,0,0,31204,0,0,0,0, +0,0,0,0,0,0,3732,0,1646,0,0,27460,0,34406,17128,14341,0,0,0,0,0,19527,0,0,0,0,0, +0,0,0,0,0,6120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8551,21546,10212,3020, +2951,0,17638,0,0,6985,44999,2218,8197,0,0,30472,63366,0,26660,0,0,0,0,0,0,0,0,0, +0,0,0,1265,0,0,0,0,0,0,0,2610,0,0,0,11278,20295,0,0,0,0,0,19780,0,0,0,0,0,0,2353 +,10852,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5421,24292,0,0,0,0,0,0,0,0,0,0,0,0,0,34407,0, +0,0,0,0,0,15432,20774,0,0,0,0,0,0,0,0,12360,10757,0,0,0,33126,0,0,0,0,0,0,0,0,0, +0,0,29573,0,2343,0,0,0,0,0,63079,0,0,0,0,0,0,0,0,0,43015,0,16038,0,0,0,0,0,0,0,0 +,1480,25573,0,0,0,0,0,0,0,8839,0,0,0,0,0,0,0,24645,0,0,0,0,0,0,0,0,0,0,0,0,0, +5063,0,0,0,0,0,45830,0,0,0,0,0,0,0,0,0,0,823,0,0,64039,0,0,0,0,0,0,0,0,0,0,0,0,0 +,15300,0,0,0,0,0,0,2924,46759,6760,19268,0,0,0,0,0,0,0,0,0,34182,0,0,3977,18149, +0,0,0,32199,0,0,0,0,0,0,0,0,0,23524,25994,0,0,10343,0,0,0,9733,0,0,0,0,0,0,0,0,0 +,4740,0,0,0,0,0,0,0,0,0,16741,0,0,4626,23367,0,0,31400,0,0,3557,0,0,4234,0,0,0,0 +,0,0,28486,0,0,0,0,0,14213,0,57191,0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,65318,29832,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29989,0,31846,0,0,8170,0,0,4421,27626,30884,0 +,0,20204,0,0,0,0,44614,534,20868,0,0,0,0,0,0,0,0,0,0,0,0,0,28710,0,10277,0,0,0,0 +,0,29511,0,19813,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27020,0,0,0,0,0,0,53094 +,0,35207,0,0,0,37542,0,61766,8584,8037,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12488 +,22757,0,0,0,0,0,0,0,0,0,0,0,0,0,23814,0,0,0,0,0,0,0,0,0,19973,0,0,0,63943,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36006,0,0,0,19012,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,8580,0,0,0,0,0,0,0,18021,0,0,0,0,0,0,0,0,80,1254,0,0,0,42630,0,0,0,0,0, +0,0,16262,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2124,25479,0,0,0,0,16873,0,0,0,0,3142, +0,0,18443,0,0,0,0,0,3917,0,8841,1190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,20645,0,0,0,0,0,0,0,0,0,0,0,9284,0,0,24394,41351,0,0,0,42087,0,62566,0,0,0,0, +0,0,0,0,0,0,6728,4199,0,0,0,0,25515,0,1231,0,374,15623,0,29956,0,14118,0,0,0,0,0 +,19047,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31718,0,0,0,0,0,0,0,0,0,0,0,20900,0,16743,0 +,0,0,28902,0,0,0,0,0,0,0,0,0,0,0,0,2578,0,0,0,0,0,0,0,0,0,13838,0,0,10052,0,0,0, +0,7432,43783,17097,0,0,0,0,0,873,0,0,0,398,0,0,0,0,0,0,0,0,0,8459,23559,0,53030, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35750,0,4071,0,0,0,38662,0,41414,0,0,0,0,11656,0,0 +,0,0,0,4011,42695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25353,0,0,0,0,0,0,0,27177,22372,0, +0,0,0,0,30980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46278,3976,12711 +,0,0,0,0,0,0,0,0,0,0,0,20517,0,0,0,0,0,0,0,0,0,0,0,0,4072,11078,0,0,16553,2405,0 +,0,0,0,0,0,0,0,2670,0,0,0,0,0,0,32998,0,0,0,0,0,0,0,47046,0,30533,0,0,11050,9734 +,13129,0,0,0,0,23494,0,0,0,0,0,58310,0,0,0,57543,0,0,0,0,0,0,0,0,0,0,0,0,0,454,0 +,0,0,0,0,0,5163,59687,2220,0,0,0,0,0,0,29510,0,0,0,0,0,0,0,0,0,0,0,17316,0,20069 +,0,0,0,0,0,0,0,0,0,5319,0,0,0,0,0,0,0,0,0,27174,0,0,0,0,0,0,0,22949,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,19208,0,0,0,0,0,0,20933,0,0,6026,8742,0,0,0,17380,0,13127,2797,0 +,0,30116,0,0,5963,8004,0,57126,0,0,0,0,0,42854,14792,30759,0,24964,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,16933,0,0,0,0,0,0,15176,40839,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +788,30341,0,0,0,0,21036,24102,0,0,0,0,30123,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +22597,31531,26789,0,59559,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9352,29863,0,0,0,0,0,0,0,0 +,0,24551,0,0,0,0,0,0,0,20516,0,0,0,39462,3665,0,28265,0,8778,64262,0,57414,9132, +0,0,18276,0,0,0,0,0,0,0,0,0,0,26344,30725,524,19751,0,13796,0,0,0,0,0,0,0,0,0,0, +18155,0,12841,0,74,24998,13579,1061,0,64199,0,0,8776,0,0,60231,0,25412,0,0,0, +59143,0,0,0,0,0,0,14344,1510,0,0,0,38374,0,0,0,0,0,0,0,0,13353,0,0,0,0,0,0,0,0,0 +,0,9446,0,0,0,0,0,0,0,32613,0,0,0,0,0,0,0,0,0,0,0,0,0,19844,0,0,0,0,14859,0,0,0, +0,6662,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14154,0,29770,0,0,0,0,0, +16520,2182,0,0,0,0,0,36102,3340,0,0,0,0,0,0,0,0,25189,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,15720,0,0,0,0,0,0,22758,0,0,304,0,3243,14117,0,0,0,0,0,0,0,0,0,0,5130, +12679,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21733,10441,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,36103,0,0,0,0,0,23590,0,57479,0,0,0,0,0,0,0,0,0,0,0,0,10824, +18372,0,0,0,0,0,35078,15722,12967,0,0,0,0,0,34599,0,0,0,0,0,0,0,0,0,0,0,0,0, +53639,0,38630,0,0,0,0,0,0,31017,11333,0,0,0,0,19144,0,9513,0,0,0,0,0,0,0,0,56711 +,24042,0,1197,0,0,58502,0,0,0,0,0,0,0,0,0,8230,6121,18628,0,0,0,0,0,0,25290,0,0, +0,0,0,1514,0,0,0,0,0,0,0,14378,9798,32363,0,0,0,0,0,9577,0,0,0,0,0,0,26788,0,0,0 +,0,0,0,330,10533,0,0,0,0,0,42246,0,0,0,0,0,0,5074,21028,0,38119,0,0,0,0,0,0,248, +0,31176,62054,0,53287,0,0,0,0,271,0,0,0,0,0,0,0,0,0,0,0,0,0,9224,2117,0,0,0,0, +15818,5607,0,52582,0,0,0,0,0,0,0,0,18248,24005,23018,0,0,0,0,0,0,0,0,0,0,0,0,0, +427,0,0,39910,0,0,7080,11399,0,0,0,0,0,0,0,0,0,0,22220,57894,0,0,0,0,0,0,0,13156 +,0,1413,1007,0,0,0,0,21415,0,21543,0,0,0,0,0,0,0,0,0,41702,22538,9573,0,0,0,8806 +,0,0,6920,56359,0,0,0,0,0,0,0,0,0,0,0,42215,0,0,13708,0,0,0,0,0,0,0,0,0,0,16453, +0,0,0,0,0,0,1582,1764,3282,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11653,0,0,0,0,12139,0, +29482,31076,1673,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40262,0,0,0,33862,0 +,0,0,0,0,20996,0,0,0,0,0,4615,0,0,0,0,0,0,0,0,0,0,0,43943,333,19367,0,0,0,0,0,0, +0,26821,0,32389,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4936,11687,0,0,0,0,0,0,0,0,0,10885,0 +,0,0,0,0,25926,0,0,0,0,0,0,15851,0,0,0,0,0,0,0,0,0,8360,0,17130,7942,0,11460,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,18150,14248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +22310,0,0,0,42758,0,0,0,0,0,0,0,0,29354,5574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,31109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11236,0,0,0,0,0,0,0,0 +,0,0,0,0,0,9156,0,0,1801,14023,0,0,0,0,0,62406,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +23620,0,0,0,0,0,0,0,0,0,0,31018,65510,0,0,0,0,0,0,0,26182,0,0,0,0,0,0,0,27717,0, +0,0,0,0,0,0,46950,0,0,0,0,0,0,0,0,0,0,0,0,0,31108,0,11366,0,0,0,3717,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8552,6054,3339,0,0,0,0,51622,0, +0,0,0,0,0,0,3718,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28358,0,2756,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,1462,0,0,27622,0,0,0,0,0,0,0,62502,14410,56743,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,12206,0,0,0,0,0,0,0,0,0,0,0,0,36550,0,38054,0,0,0, +21221,0,0,0,0,0,0,0,27077,0,0,16906,0,12587,12101,0,0,0,0,0,0,10414,28775,21769, +60167,0,56646,0,0,0,0,0,20740,0,0,0,0,0,0,5931,5351,0,65478,0,0,0,0,0,0,7977, +52647,0,4868,0,0,0,55463,0,0,0,0,0,32197,0,0,0,0,0,13445,0,0,0,26631,0,0,0,0,0, +11237,0,0,0,0,209,1285,0,0,1928,0,0,0,0,43334,23849,23172,0,0,0,0,0,0,0,0,24712, +62439,8811,3463,20457,0,0,0,0,0,0,0,0,0,16008,56263,0,0,0,0,0,0,0,0,0,0,0,60358, +22761,6565,0,0,30888,27686,0,0,0,17093,0,0,0,0,22121,0,0,0,7593,14182,0,28103,0, +0,0,0,0,45126,0,0,0,0,0,0,0,0,0,0,0,0,0,31844,0,0,0,0,0,0,0,0,0,0,0,0,0,18500,0, +0,0,0,28202,0,0,0,0,0,0,0,0,26308,0,29541,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +29572,0,0,0,21285,0,0,0,0,0,60839,0,0,0,0,0,30407,15949,2981,0,0,0,46439,0,0,0,0 +,0,23911,26505,25222,12811,5895,0,6343,0,0,0,0,0,0,0,0,0,0,0,31815,0,0,0,0,0,0,0 +,0,19688,10245,0,0,0,31301,26985,28964,0,0,0,0,0,0,0,0,27208,31172,0,0,0,0,216,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16292,0,0,0,0,0,8743,0,0,0,0,0,0,0,0, +0,0,0,0,0,6438,0,0,0,33319,0,0,0,33286,0,0,0,0,0,0,0,0,0,22181,7499,24774,0, +10756,0,44775,724,0,25768,25669,24873,5349,25257,0,0,54566,0,0,0,0,0,0,0,0,0,0,0 +,327,439,357,0,0,6536,8452,0,0,1802,0,0,61350,0,15045,0,0,0,0,0,0,0,0,0,0,0, +38343,0,0,0,0,0,0,0,0,0,0,32491,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +22885,0,0,32073,0,0,0,9546,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27748,0,0,23176,0,0,0 +,0,0,0,0,0,0,0,0,0,24583,0,0,0,0,0,34118,0,0,0,0,2158,0,5586,30340,0,0,0,0,0,0,0 +,0,0,0,0,0,0,24452,0,0,0,0,2409,4390,0,24196,0,0,0,0,0,0,32264,26948,20587,0,0,0 +,2155,0,0,0,0,0,0,0,0,0,0,0,4328,26276,0,0,0,0,0,0,0,0,23564,0,12458,11367,0,0, +25162,0,0,0,0,0,0,65414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32966,0,0,0, +34662,0,0,0,0,0,39238,0,0,0,0,11400,10214,266,12452,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,15173,0,0,0,13668,0,13222,0,23364,0,0,0,0,0,11941,0,0,0,0,0,0,0,0,0, +25575,0,0,0,57383,0,0,0,10308,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,2865,9287,75,0,0,0,0,0,0,0,0,0,0,21508,22380,59526,0,0,0,23589,0,0,0,51590 +,0,0,0,0,0,0,0,0,0,0,0,4645,3980,28295,0,0,0,0,0,12388,0,0,0,0,0,0,0,0,0,0,0, +21734,0,17607,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41767,0,0,0,0,0,0,0,18436,0,0,0,0,0, +0,0,21958,0,19430,0,0,1204,0,0,0,0,0,0,0,0,0,3240,55239,0,0,0,0,0,30660,0,0,0, +28901,0,0,0,0,4716,0,0,0,0,0,0,0,0,0,0,0,11754,0,0,0,0,22086,0,22564,8749,0,0, +28391,0,0,0,0,0,0,0,0,0,0,0,2886,0,0,0,0,0,0,0,29062,0,0,0,0,0,0,0,40358,0,0, +15916,39526,0,13735,0,0,0,0,28938,0,407,4006,0,0,0,26916,0,0,0,0,0,27526,30280,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24586,0,24649,5126, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8684,0,0,0,0,0,0,0,23019,0,22377,18599,0 +,0,0,0,0,0,0,0,0,0,27593,9735,0,20196,0,0,0,0,28168,48423,0,0,0,0,0,31399,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,13892,0,0,0,0,0,17606,0,0,15242,29767,26378,17701,0,0, +14472,0,4840,0,0,0,0,0,0,24708,0,9349,4330,0,0,0,0,0,0,0,16137,0,0,34854,0,0,0,0 +,0,0,0,0,0,0,0,25063,0,0,0,0,0,0,6603,12583,0,0,0,0,0,0,0,0,7433,29188,0,0,0,0,0 +,31270,0,0,22920,3143,0,0,0,0,0,23461,0,0,0,0,0,0,0,0,618,0,0,0,0,21381,0,11524, +0,0,0,0,0,0,21004,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,312,23239,0,0,0,0,0,0,0,0,0,0,0, +0,2313,0,0,40614,0,0,14825,0,0,0,0,0,0,46535,0,41190,7853,0,31656,0,0,0,0,0,0,0, +0,0,3433,5255,0,0,0,0,0,0,0,33958,0,0,0,0,72,15493,0,0,0,0,0,0,0,36070,0,0,0,0,0 +,0,0,14724,0,0,0,0,0,29828,0,0,0,0,0,0,0,18822,20008,0,0,0,0,2438,2952,0,0,0,0,0 +,0,0,0,0,0,0,0,0,3342,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24420,0,19908,0,0,0,8101,0, +17479,0,0,3530,0,8202,29319,0,0,1132,6789,0,0,23881,0,0,0,4810,0,0,46918,0,0,0, +41574,0,0,0,0,0,0,0,0,0,48582,0,0,0,0,0,0,0,0,0,0,0,0,0,39334,0,0,0,26117,0,0,0, +0,0,0,5100,0,0,0,0,0,23496,27813,4045,54918,0,0,0,0,0,0,6473,7428,0,0,0,0,6792,0 +,0,0,0,0,3560,32103,0,0,0,0,0,0,0,0,0,0,0,54790,0,0,6926,0,0,0,0,16518,0,0,0,0,0 +,20806,0,0,0,0,1841,3174,0,0,0,0,9612,18374,0,0,0,0,32744,0,0,9671,0,59879,0, +23300,8073,0,0,14758,0,0,0,10342,0,0,0,0,0,0,24808,14759,0,0,0,0,0,0,5515,0,0, +14852,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2354,23271,0,32740,0,0,0,0,0,0,0,0 +,0,0,18472,0,0,0,0,0,0,0,0,33190,0,0,0,0,0,0,0,0,8972,21669,0,0,0,0,0,0,0,0,0,0, +0,25574,0,0,0,0,5096,0,14283,55367,0,0,0,0,0,0,0,0,0,12644,0,0,0,0,4651,0,0,0,0, +0,0,0,661,0,0,13638,19466,0,0,0,0,0,31273,0,8010,0,0,0,0,0,3211,0,0,0,0,63430,0, +0,0,0,0,15237,0,0,0,0,0,0,19018,2437,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14312,0 +,0,0,0,16836,0,0,471,35975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,6023,0,0,0,0,0,0,0,0,11593,9639,0,0,0,55783,0,5700,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27908,0,26598,0,0,6667,6470,0,0,0,0,0,0,0, +62534,0,0,0,0,16522,27911,0,0,10025,7172,0,0,779,0,360,17477,0,0,0,61991,7752, +7717,1494,0,0,0,26569,40742,0,0,0,0,0,0,0,26406,10474,32196,0,0,0,0,0,50567, +16521,11716,0,0,0,0,0,55558,0,0,0,0,0,0,0,0,0,0,0,61926,0,26436,0,0,0,0,4459, +10598,0,0,0,0,0,0,0,0,0,0,0,9223,0,29318,0,0,0,0,0,60423,0,0,0,0,0,0,0,47078,0, +50246,0,12612,0,0,0,0,0,0,0,61799,0,55015,0,21060,7309,0,0,0,0,0,11976,0,0,0,0, +23527,0,0,0,0,0,0,10347,15942,0,34023,0,0,0,0,4969,0,0,0,0,0,0,0,0,28997,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36454,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3466,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19716, +28872,0,0,0,0,0,22152,0,0,0,0,0,0,26342,0,0,0,9764,0,0,0,0,0,0,0,21798,0,0,0,0, +13,6853,32136,0,0,0,0,0,0,0,750,0,0,54502,0,0,0,0,0,0,0,0,0,46183,0,0,625,22854, +0,0,0,0,2061,23588,0,0,11049,56262,0,0,18538,1509,0,0,17258,4453,0,0,0,0,12429,0 +,0,0,0,8102,0,0,0,0,0,0,8074,0,23852,0,0,0,0,0,0,0,0,0,0,0,16136,3428,0,27876,0, +0,0,7332,0,0,0,0,0,28900,0,0,2284,0,0,17573,201,1508,0,0,0,0,0,0,0,0,0,31365, +27688,22565,0,0,0,5159,0,0,0,0,4584,42599,0,0,0,44422,1068,23173,0,0,0,613,0,0,0 +,12645,0,0,0,0,0,27076,6732,0,0,0,3913,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,22244,29992,15911,0,0,0,0,0,22982,0,0,0,0,0,0,0,50598,0,0 +,0,0,0,0,5161,1574,0,0,0,0,0,0,0,0,0,19108,0,0,0,35014,0,0,0,25956,29067,0,0,0,0 +,0,0,0,0,0,0,47079,0,0,0,0,0,0,0,0,0,0,1356,61927,0,0,0,64455,2122,64231,0,0, +18763,0,0,0,0,0,0,0,0,0,907,34471,0,0,0,39078,0,0,1995,0,0,0,0,0,0,0,0,0,0,56518 +,0,0,0,0,0,0,0,0,0,0,0,0,822,0,15978,44423,0,0,3112,325,0,0,0,0,0,15397,0,0,0,0, +0,0,0,0,0,0,1193,4294,4968,15559,0,46150,0,0,0,0,0,18917,0,0,0,0,0,0,9928,37543, +0,0,0,0,13097,36999,0,0,0,15430,0,0,8424,29639,0,0,0,0,0,0,0,0,0,0,0,0,0,25734,0 +,0,0,0,0,0,0,0,0,0,0,0,0,40487,0,13284,0,11141,0,0,0,32388,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5298,57702,0,0,0,0,0,0,0,13060,0,0,0,0,0,0, +8233,42278,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36422,0,0,0,7972,0,0,0, +18437,0,0,0,0,7406,0,0,0,9225,0,0,0,0,0,0,0,0,0,13865,47591,18220,53703,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2796,0,0,0,0,0,24940,17223,0,0,0 +,13221,0,0,0,0,0,0,0,0,0,0,15848,0,0,0,0,0,6122,1735,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,16968,18151,0,0,0,0,0,47494,0,0,0,0,0,0,26089,19494,0,0,0,0,0,15494,0,0 +,0,0,0,0,0,0,0,0,28809,0,0,0,0,42727,0,55174,0,0,0,0,0,0,0,0,0,0,0,20485,0,0,0,0 +,0,0,0,0,0,0,0,58598,0,0,0,0,0,0,0,0,0,0,0,0,0,15172,0,0,0,0,0,0,0,0,0,35302,0, +48135,20972,33094,0,0,0,0,0,9765,0,0,0,0,0,0,0,0,0,39559,0,0,13736,6950,0,0,0,0, +23658,8903,0,0,0,0,0,0,0,22662,0,0,0,0,0,58886,7468,0,0,0,0,0,0,0,0,64550,0,0,0, +0,0,47622,0,0,0,50886,0,0,0,0,0,57606,912,0,0,0,0,0,0,0,0,0,1449,0,1169,0,718, +46151,12104,0,0,0,0,0,0,48230,0,0,0,0,0,0,0,0,0,0,1259,0,0,33734,23208,62567,0, +65158,0,0,0,0,0,0,0,0,0,0,28684,59878,0,0,0,0,0,0,0,0,0,0,25769,0,0,0,0,65479,0, +0,0,0,555,22789,0,19748,1769,10246,8680,0,0,0,0,0,0,0,0,0,14250,0,5899,3303,0,0, +0,0,0,0,0,0,21097,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21638,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,10795,0,0,0,16204,0,0,0,0,0,26986,2469,0,14660,0,0,0,0,0,45447, +12234,3494,4555,10566,0,0,0,0,0,0,0,0,0,0,0,0,2801,0,0,0,15755,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,39654,0,0,0,0,0,0,6763,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +33574,0,10279,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63527,0,0,3912,0,0,7492,0,0,0,35142, +0,0,0,0,0,0,17576,8103,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16713,4198,0,0,4782,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,16228,0,0,0,0,25961,20166,0,0,0,10980,0,0,0,0,0,14340, +18922,14567,0,44199,0,0,0,0,0,0,0,18406,0,0,0,0,0,37606,0,0,0,0,0,0,0,0,0,20902, +0,0,0,56358,0,38342,0,0,0,0,9514,36071,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21700,0,0, +5266,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1134,0,1453,0,0,0,0,0,3882,0,0,0, +0,0,0,0,0,4004,0,0,0,51910,0,0,0,0,0,23076,4648,0,0,0,31051,25351,0,0,0,22884,0, +0,0,0,0,63975,0,0,2376,16997,0,0,2096,0,0,0,3373,7046,0,0,0,0,0,0,0,30726,0,0,0, +0,20,0,13707,614,0,0,12840,3079,0,0,0,0,0,51046,3729,0,32680,0,0,0,0,0,24008, +62759,0,0,4745,0,0,0,0,0,0,0,0,0,0,0,0,0,2414,0,0,44262,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,24937,0,0,0,0,0,0,0,0,19140,0,13575,0,0,0,0,0,0,0,39110,0,0,0,28036,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,4261,0,0,0,0,5992,0,264,0,0,0,0,0,0,0,13739,0,21928,0, +0,0,0,0,0,0,0,0,0,0,4232,15110,0,0,0,0,0,0,0,0,0,30022,0,0,27977,0,0,0,0,0,24776 +,0,0,0,0,0,2962,0,0,0,0,0,0,26564,22441,0,0,0,0,0,13640,11205,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,19305,1894,0,0,0,0,0,0,0,0,0,0,9389,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14119, +5224,135,0,0,0,0,0,0,0,0,0,25796,0,0,0,0,0,0,7470,0,0,0,0,63815,0,55654,0,0, +12584,0,1524,33223,0,0,0,9895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11624, +0,0,0,5614,0,0,0,0,0,0,0,21320,0,0,53607,0,51206,0,0,0,25863,0,0,0,0,0,0,0,0,0,0 +,0,8964,1740,0,0,0,0,0,0,0,0,13476,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7975,0, +0,3306,8134,0,8389,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25766,0,0,0,0,0,0,0,0,0, +52166,0,0,0,0,0,0,0,0,0,0,0,0,0,21477,31112,31652,0,0,0,0,0,0,0,28452,0,0,0, +44231,0,0,0,0,0,0,0,24805,0,0,0,0,0,0,0,0,0,0,12428,6471,0,0,0,0,525,17926,0,0,0 +,26919,0,0,18120,0,0,0,30024,0,0,0,0,0,0,0,0,0,0,29189,0,0,0,43559,0,0,0,0,0,0, +19787,7557,0,59334,0,0,10184,6085,0,44039,0,0,0,0,0,0,0,11175,0,0,0,0,30440, +63110,0,0,0,0,0,0,11017,0,0,0,0,0,0,0,0,27204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,29126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,622,0,5226,2727,0,15588,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4650,0,2675,0,0,32420,0,0,0,61511,0,0, +5419,17829,2123,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38183,2640,0,11274,14533,1842,0,0, +42663,12681,3430,0,11845,0,0,0,0,0,0,0,0,0,6533,0,0,0,0,0,54598,0,0,0,0,0,0,0,0, +0,0,0,0,12616,38535,0,0,0,0,0,32229,0,0,0,54279,0,48614,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,31401,0,0,0,0,34310,0,0,0,22788,0,52134,0,0,0,0,0,0,0,23302,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,40678,0,0,0,51463,535,0,0,0,0,15525,0,0,0,0,0,0,4904,869,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63718,0,0,0,0,0,0,0,0,1678,0,692,0,0,0, +0,0,0,0,0,0,26216,0,0,0,0,0,29355,0,0,0,0,25095,0,0,0,0,4335,0,0,0,0,0,14538,0,0 +,0,0,0,0,0,0,0,27273,55014,0,0,0,0,0,27271,0,0,0,0,0,30468,0,0,0,0,18186,0,0,0,0 +,0,14345,0,0,0,2152,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58438,21034,0,23339,21318,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,21412,0,0,0,0,0,0,0,12869,0,0,4875,0,0,0,0,29191,0,0,0,0 +,0,0,1640,10247,0,14244,0,0,0,0,9867,0,0,0,0,0,12363,0,0,7653,0,0,4168,2663,0, +4580,0,11143,0,0,0,0,0,0,0,30662,0,0,0,0,0,6724,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,13764,0,0,0,0,0,0,0,0,0,0,0,0,234,6821,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,25639,0,0,0,0,0,0,0,0,0,29958,0,3461,0,0,0,0,0,0,0,0,0,28324, +18795,7013,12746,11655,0,37287,0,0,10953,7718,9705,0,0,0,0,0,0,0,0,0,0,46534,0,0 +,0,0,0,0,0,0,0,0,8137,17988,0,25156,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41415,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15784,6918,0,0,0,0,7019,10919,0,0,0, +0,0,0,0,0,0,0,4171,55495,4940,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22440,19333,0,0, +28136,0,6249,21317,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53414,0,0,0,57318,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39303,0,0,0,0,0,19940,0,0,0,0,0,0,0,25543,0,0,0 +,0,0,0,0,0,0,0,0,0,2698,3911,0,0,0,26790,0,0,0,0,0,0,32424,0,0,18470,0,0,0,14726 +,29834,0,0,0,0,0,0,0,0,0,0,0,1000,4197,0,0,0,19366,0,0,0,39878,0,0,0,0,2185,8901 +,5288,9829,25000,0,0,0,0,0,0,1062,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35622,0, +0,23048,62503,6506,0,0,0,0,0,0,0,13609,10438,0,0,0,0,0,0,0,0,0,0,7723,42119,0,0, +0,0,0,13317,0,0,0,41606,0,27111,0,0,21194,11461,0,0,0,0,26856,58342,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,20940,48710,0,0,0,0,0,0,5227,0,0,0,0,0,10061,31300,0,0,0,19236,0 +,0,0,0,0,30277,13896,0,0,0,12876,13159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,428, +46951,13134,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15462,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,21668,0,0,0,0,0,0,0,0,0,0,0,0,2249,0,0,0,0,44967,0,0,0,0 +,0,0,3465,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24868,0,0,0,0,0,23909,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,2190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16164,0, +10437,0,0,5263,20102,20938,0,0,0,1192,1030,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,21385,4870,0,0,0,0,0,0,0,0,0,0,0,18596,0,0,0,0,1422,4038,2858,0,0,0,0,0,0,0,0 +,48998,0,0,0,0,0,0,0,0,6508,37350,0,0,0,0,0,0,0,0,17001,39431,0,0,0,0,0,30182,0, +21445,7403,28164,0,51750,0,0,0,62631,0,0,0,0,0,0,0,31206,0,0,0,0,0,0,0,0,0,0,0, +7751,0,0,0,0,0,0,0,0,0,13477,0,0,456,26693,0,0,0,0,0,0,0,0,0,0,0,0,14890,0,0,0,0 +,0,26697,22022,13225,27364,0,0,0,18884,0,0,0,0,0,0,0,0,3659,0,0,0,0,0,0,0,0,0,0, +0,1448,5413,0,0,0,0,0,0,0,0,0,0,0,6340,0,0,18091,18725,0,0,0,0,0,0,0,0,0,0,0,0,0 +,22118,0,0,0,18981,0,0,0,0,0,0,0,0,0,29223,3724,0,0,0,0,43526,0,0,0,25668,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21545,9862,0,22692,32201,60646,0,7300,0,0, +0,58887,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19460,0,0,0,0,0,0,0,0,0,50342,0, +65255,4360,17286,0,0,0,0,0,0,0,28708,0,0,30025,60102,0,0,0,0,0,0,0,0,0,47014,0, +31973,0,9572,0,0,0,0,0,0,0,18501,0,0,0,0,0,14597,0,0,0,53735,5228,22183,0,0,0,0, +0,0,1554,24164,0,0,0,0,0,0,0,0,0,0,0,0,10827,0,0,0,0,34918,0,0,0,0,22252,0,0, +46855,0,0,0,0,0,31207,0,0,10733,0,0,63334,0,0,0,0,8616,50119,20169,12678,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58087,20298,5,0,0,30920,0,0,0,0,0,0,0,296,13190,0 +,30663,0,0,18536,12228,0,6788,0,0,0,0,30890,21796,0,0,526,0,0,0,0,0,0,0,0,0,0,0, +0,20965,0,0,0,0,2161,0,0,0,0,0,0,24038,0,0,0,0,13544,7398,0,0,32522,9605,0,0,0,0 +,3208,7590,0,0,0,43846,0,0,0,38663,0,0,0,0,0,39014,4142,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,6373,0,0,13676,0,0,0,0,30374,21288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22791,0,0,0,0,0,37958,0,0,0,0,0,0,0,0,0,0,9452, +9990,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4841,0,0,0,0,18820,152,0,0,0,0,0,13260,3334,0,0 +,24234,8422,0,17957,0,0,0,10244,0,0,0,0,0,0,0,0,0,0,0,7204,0,0,0,0,1201,26151,0, +31173,0,0,0,0,0,0,0,0,0,0,0,0,0,64838,4203,7525,521,0,18888,37031,0,0,0,0,0,0,0, +0,7082,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4490,12487,0,0,0,0,0,0,0,36615,0,0, +0,14854,0,0,0,0,0,0,0,0,0,0,0,0,6539,13029,9704,38983,0,0,0,0,168,10405,0,0,0,0, +394,25607,0,57063,0,0,0,0,0,0,0,0,0,0,16141,19878,0,0,0,0,0,0,0,0,0,29446,0, +12036,0,0,0,0,0,6982,18572,0,24584,14535,0,0,0,0,0,0,0,0,0,0,16,0,21642,0,0,0,0, +0,0,5254,0,0,0,0,0,0,0,0,1622,0,0,0,0,0,0,0,0,0,0,0,0,0,3853,9126,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,7241,10982,0,0,0,0,0,0,0,0,0,0,0,0,0,0,950,0,0,57990,0,0,277,0 +,0,0,694,36007,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42470,0,0,0,0,18409, +51142,0,0,0,0,0,0,0,0,0,28646,0,0,0,30693,0,0,0,0,0,56295,5544,0,0,0,0,8518,8366 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45670,0,0, +9608,33062,0,0,0,0,0,0,0,0,0,0,0,18694,0,0,0,0,1672,23493,0,0,6955,7655,0,36134, +0,0,0,0,0,0,0,0,23432,647,0,0,0,0,0,0,0,0,0,0,0,13382,0,0,0,19621,0,0,0,0,0,0,0, +0,0,20228,0,0,2728,31495,0,0,0,0,29096,22213,235,35495,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,5348,0,0,0,0,8968,1989,0,0,1066,0,0,11492,5965,31367,0,0,0,0,0,0,0,0,0,0,0, +18727,0,0,0,6757,0,0,10765,4646,0,36166,0,27943,0,0,26888,8420,0,0,0,0,0,0,0,0,0 +,29316,0,0,0,0,0,0,0,0,0,0,4975,0,0,0,14762,3111,0,0,0,0,0,43399,0,0,0,0,0,0,0, +18980,0,0,0,0,0,44550,0,0,0,0,4051,0,0,0,0,37734,0,0,0,0,0,5188,0,0,0,0,0,24486, +0,5989,0,41159,0,0,0,0,0,0,0,0,0,20326,0,0,747,6884,0,0,0,41798,0,0,3117,22919,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21032,0,0,0,0,0,0,0,0,9574,0,0,0,0,0,0, +4302,0,0,0,0,0,0,0,0,0,0,0,21068,34630,0,0,0,0,0,64071,0,0,0,0,0,0,26667,7943,0, +0,0,0,0,52934,0,0,17002,0,0,0,0,0,0,20294,0,0,0,0,0,0,0,0,0,27301,18347,7974,0,0 +,0,0,0,0,0,0,16874,0,0,0,0,45414,0,0,0,0,0,0,648,1575,0,0,0,31749,0,0,0,23301,0, +0,0,0,0,0,0,0,0,0,0,0,15912,50535,0,0,0,0,1993,8582,0,0,0,0,0,0,0,38438,0,0,0,0, +0,0,0,0,0,0,0,0,15850,6183,0,0,0,0,3402,0,0,27494,0,0,749,0,0,0,0,0,0,0,26025, +29606,0,0,7144,19622,30504,0,0,0,0,0,0,0,0,21316,0,0,0,0,0,0,0,0,0,21444,0,0, +1289,6919,0,0,0,0,0,0,8299,0,0,0,14090,35655,0,0,0,0,0,0,0,0,2377,15206,0,0,6028 +,4452,0,25508,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50310,0,0,0,0,1269,0,0,0,0,0,0,0,0,0 +,0,0,0,51014,0,0,0,0,0,0,0,9286,0,7429,0,0,28393,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,16680,452,0,0,0,0,0,23718,0,0,0,31750,0,0,0,0,0,0,0,0,3568,0,0,13604,0,0, +0,0,0,25255,0,0,0,50982,0,56582,0,0,7467,0,0,0,0,30181,0,0,0,0,0,0,0,30564,7208, +7845,0,0,0,0,0,0,7726,0,0,0,0,62182,0,0,0,41094,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,22695,0,0,0,0,0,0,17736,0,0,0,0,0,0,0,0,50054,0,0,0,14180,0,0,0,0, +0,0,8974,0,0,0,0,0,0,0,0,23332,0,0,0,11140,0,0,0,0,0,0,0,24262,27145,9540,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,26537,45510,6062,3879,0,0,20233,25991,0,0,17803,0,0,0,0,0, +13962,5508,16971,27013,7437,31494,0,0,0,0,0,0,0,0,0,0,4714,0,0,0,0,0,0,0,0,17189 +,0,0,0,0,0,27492,0,0,26953,0,0,0,0,0,0,0,0,0,0,41319,0,0,0,0,0,0,0,0,0,0,0,47430 +,19596,12549,0,0,0,8390,1006,0,0,0,0,0,0,0,0,0,0,24100,17577,4,0,0,0,0,0,22277,0 +,0,0,0,0,0,0,26692,0,0,0,0,0,24676,0,0,0,0,0,0,0,0,0,0,0,0,0,29477,0,0,0,21573,0 +,0,0,0,0,0,0,0,0,0,9864,14214,0,0,0,0,0,0,25771,5766,0,0,8909,8679,0,0,6861, +16166,0,38887,0,0,0,0,0,0,12392,8678,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +52646,1354,2950,0,14692,0,0,10572,49830,0,0,0,0,0,0,0,0,3626,582,0,0,0,55750,0,0 +,0,30885,0,0,0,0,0,0,0,0,0,0,0,0,0,5830,0,0,2090,0,0,0,0,0,0,0,0,0,0,0,0,31142,0 +,0,0,0,0,10503,0,0,18825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +57158,0,0,30792,63526,0,0,0,9863,16267,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,18824,0,0,0,0,0,0,19653,25388,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9292,0,0,0,0,0,0,0,0,0,0,36358,0,0,0,0,0,0,0,0, +0,0,25480,23015,0,0,10440,6725,0,0,0,22436,24265,15109,0,0,0,62311,8906,34534,0, +0,0,0,0,0,15913,1319,0,0,20296,1477,30760,0,25928,16772,0,0,1069,0,0,0,0,0,0,0,0 +,0,0,0,0,17029,0,31909,0,0,0,0,0,0,0,0,0,0,0,41638,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,41542,0,21478,0,0,0,9796,0,0,0,0,0,0,0,0,0,0,22187,58343,0,0,0,24295,0, +0,0,0,0,61831,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2833,5829,0,0,0,62855,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,16676,0,0,0,0,0,0,13577,27431,0,0,0,0,21480,10501,0,16932, +0,0,0,0,0,22918,0,48294,2574,2150,0,0,0,0,1897,4518,0,0,0,0,0,0,25064,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47942,0,0,0,0,10990,13767, +25705,37863,21672,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43430,1712,0,0,0,0, +18886,0,0,0,0,0,0,0,0,0,0,0,0,0,10535,0,0,0,0,0,0,0,15012,0,0,0,0,0,0,0,0,0,0, +14734,0,0,55782,0,0,30824,10886,0,0,0,0,0,51302,0,0,8012,0,0,0,0,0,20680,6981,0, +57415,11,0,0,18277,0,14564,0,0,0,32390,0,0,0,0,0,0,0,0,0,0,0,0,19113,5158,0, +11172,0,16774,0,0,0,0,0,0,0,0,0,0,0,0,10315,13830,0,0,0,0,0,0,10410,7141,0,0,0,0 +,0,18116,0,0,0,44615,15403,13958,0,1540,14632,19525,24201,19781,0,0,0,24165,0, +38951,0,0,0,0,0,6308,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17416,15749,3438,13255,0,0,0,0, +0,0,0,0,0,0,0,32228,0,0,0,0,176,0,0,50566,0,0,0,0,0,0,0,0,0,0,0,0,0,21540,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,58982,0,0,0,0,0,0,0,0,0,5284,0,0,0,0,0,0,25897,28326,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15945,0,0,0,9804,293,0,0,0,0,0,0,0,13988,23082,4677 +,0,0,0,0,0,0,0,0,0,0,0,5670,0,0,0,0,0,0,0,44070,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,6405,0,30692,0,0,0,61702,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,45926,0,15398,0,0,0,0,0,0,4554,2692,0,0,0,0,0,32485,0,0,0,10084,0,0,0,0,0,0, +24297,0,0,0,0,0,0,0,0,22790,0,0,0,55110,0,0,0,0,0,0,0,0,0,0,0,0,7112,0,31530, +45255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40743,17226,22599,0, +0,0,0,0,0,0,0,3695,0,0,0,0,0,0,0,0,0,0,56999,0,0,0,0,0,13799,3114,21287,1353, +7591,0,0,0,8455,0,0,6824,0,0,0,0,0,0,0,14569,0,0,0,29000,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,19979,0,18376,0,0,0,0,0,0,0,0,0,0,0,0,11332,0,0,0,49863,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,2191,7527,23148,58022,0,0,0,30631,0,26565,0,0,0,0,0,0,0,0,0,0,0,0,754 +,0,0,15877,0,0,0,0,0,0,0,17510,7657,2821,0,0,0,0,0,0,0,0,0,41927,0,0,0,0,0,0,0,0 +,2569,34439,0,0,3790,0,0,0,15339,8775,0,0,0,0,0,0,0,0,0,0,0,15908,0,0,21419,8359 +,0,0,0,0,424,0,0,0,0,0,0,25318,8008,20551,0,0,0,45735,30058,30372,0,0,0,0,0,0,0, +0,0,0,0,0,0,26180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31432,10567,0,0,0,0, +17450,0,0,0,0,0,0,30310,0,38022,0,0,0,0,0,28932,0,0,0,0,0,43910,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,22180,12075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22247,0,0,22826, +12359,0,0,0,0,4105,50407,0,0,0,0,0,0,13581,28583,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,28936,0,0,0,0,0,17673,10310,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,905,57862, +1580,0,0,0,0,58630,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13479,0,0, +14153,13286,0,0,9259,0,0,0,0,0,6606,3524,0,0,0,0,0,6567,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,631,49255,0,0,0,0,0,42886,0,38215,0,0,0,0,0,0,0,0,17580, +0,0,0,0,0,0,0,0,55046,0,0,0,0,0,0,0,0,0,10213,0,0,0,0,3604,37767,0,0,0,0,0,0,0,0 +,0,0,0,30950,0,0,0,0,0,0,0,0,0,62087,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23528,0 +,0,0,0,0,0,0,0,0,28715,4229,0,0,0,0,0,0,0,0,0,0,1226,26820,0,0,0,12133,6984,261, +21130,32548,0,0,0,0,0,0,3565,12390,20713,28071,0,0,1706,25287,0,0,0,0,0,0,0,0, +14670,0,0,0,0,0,0,30534,0,0,0,12615,0,43750,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28228, +0,0,0,0,0,0,0,45095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1224,3975,10954,6375,0,0,0,0 +,0,0,0,0,0,0,23180,20100,0,0,0,0,25736,8519,0,0,0,0,0,6663,0,2534,0,0,0,0,0,0,0, +0,23720,0,0,0,0,0,0,0,0,0,0,19398,0,47814,26281,49702,0,0,4332,12965,0,0,5704, +3206,0,0,0,0,0,0,0,0,0,0,0,0,0,15396,0,0,0,44102,0,0,0,0,0,0,0,0,0,0,0,0,0,25317 +,1064,39271,27433,0,14952,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14308,0,0,0,0,0,0,2763 +,4100,0,0,0,0,0,0,18792,0,0,0,22154,32583,0,6244,0,0,0,0,0,0,0,49478,0,0,0,0,0,0 +,0,0,0,0,0,21894,0,0,11048,0,0,0,0,0,0,11685,0,53862,0,0,15114,0,13870,0,0,0,0,0 +,0,0,919,0,0,0,31916,0,22570,101,0,0,0,0,0,0,0,0,0,7333,0,0,0,0,3272,0,0,0,0, +27718,32712,0,0,0,0,0,0,0,0,0,1782,0,3688,0,0,0,0,29862,0,0,0,0,0,0,0,22469,0,0, +0,0,0,0,0,55302,850,15492,0,0,0,5927,19786,13350,0,25702,0,0,0,0,0,0,0,0,0,0,0, +40390,0,0,0,0,0,0,0,0,0,0,0,0,0,20260,0,0,0,0,0,0,0,0,0,0,0,0,0,15335,8394,0,0,0 +,0,0,0,26566,0,0,0,0,843,2245,0,0,0,0,0,0,0,0,6959,0,20488,1638,0,0,11533,50759, +0,0,0,0,0,20871,0,0,0,0,0,24519,0,0,0,0,9544,23591,0,0,0,0,0,0,0,0,0,0,20969, +7109,29001,0,0,32422,31720,64294,0,0,0,0,16106,0,0,0,6930,4933,0,0,0,22917,0, +27015,0,0,0,0,19880,8070,0,0,0,0,23945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3310,0,87,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18439,0,0,0,20742,0,0,0,10597,0,0,0,0,0,0, +0,0,0,0,0,0,20236,0,0,0,16584,3429,0,0,0,0,0,0,0,0,27241,0,0,0,0,16132,0,0,0,0,0 +,0,0,0,0,0,0,0,244,28261,0,0,0,0,0,0,0,29509,0,0,0,0,0,0,0,0,2921,31781,0,0,0,0, +0,0,6408,4196,344,0,0,0,0,0,0,0,0,0,0,0,0,0,11689,45863,0,0,0,0,906,3301,0,0, +25544,32421,0,0,0,0,0,0,0,0,1260,61607,0,27302,0,0,8682,16614,0,0,0,0,10830,0,0, +9604,15049,13413,0,0,0,0,0,0,26761,0,0,0,0,0,0,61990,0,0,0,0,0,12580,0,0,11432,0 +,0,0,0,0,22507,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12389,0,0,0,0,0,0, +2408,22661,14507,43239,0,9700,0,0,24714,0,0,0,0,0,0,0,0,23972,0,0,0,0,0,0,0,0,0, +0,0,0,0,34086,0,0,22955,7238,0,0,0,0,0,28485,13806,20038,0,0,0,0,22602,0,0,0, +1645,22340,0,0,0,0,0,0,0,0,0,0,0,26502,0,0,554,0,0,0,0,61735,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,2694,0,0,0,0,0,0,0,0,0,0,0,0,0,0,883,27879,15948,0,3242,57382,0,0 +,0,0,0,0,13930,0,0,0,0,0,30922,0,4137,52615,0,0,0,0,0,0,0,0,0,0,0,0,0,31911, +16072,0,0,0,0,0,0,0,0,0,0,0,0,26340,0,61671,0,0,0,0,3145,56199,0,0,0,0,0,0,0,0,0 +,0,0,0,280,0,5131,33479,0,15751,0,0,0,0,0,0,4136,1446,0,0,0,0,0,0,11304,17863,0, +0,0,0,0,25125,0,0,0,36646,6057,0,0,0,855,11301,0,0,0,0,0,64774,0,0,0,19397,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,1040,27367,0,0,0,0,0,0,0,0,0,0,0,0,0,64358,0,0,178, +132,0,0,14763,24455,0,0,0,46374,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46246,0,0,0,37382, +0,0,0,7462,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8166,0,0,6921,0,0,0,9163,0,0,0,119, +0,0,0,23146,17156,0,0,0,0,0,9127,0,0,0,17927,0,0,0,0,0,22084,0,0,0,0,0,39879,0,0 +,2035,0,1067,0,0,0,0,0,16652,59591,0,0,0,0,0,0,0,0,0,0,0,0,20171,0,0,0,0,17733,0 +,0,0,0,0,32037,0,0,0,0,0,14277,0,0,0,0,0,0,0,42022,0,0,26793,20358,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,8907,0,0,0,0,0,0,0,0,27780,0,0,0,0,32330,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,39399,0,9732,0,16199,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,854,0,2984,45063,25418,26980,22539,0,9133,3653,15528,28743,4649,0,616, +65127,0,0,0,61863,0,0,0,0,0,0,0,55303,0,0,0,0,0,0,0,0,23880,0,0,0,0,0,0,0,31848, +62854,0,0,0,0,0,0,0,0,0,0,0,49606,0,27974,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,32580,0,0,0,26052,4043,0,0,40454,0,0,26056,30565,0,0,0,0,0,0,0,31398,0,0,0,0 +,0,0,0,0,29288,1797,0,0,3220,0,0,0,0,0,0,0,0,0,20427,0,0,0,0,23621,0,0,0,0,0,0,0 +,0,0,24261,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35591,0,0,6862,0,0,0,4265,0,6285, +5383,0,0,0,0,0,36870,0,39847,0,0,17224,5414,27882,58118,0,0,13224,4262,0,0,0, +31302,0,0,1388,2982,11881,0,0,0,0,0,0,16837,809,0,24140,10724,0,0,0,0,5835,0,0,0 +,0,0,0,0,0,0,0,0,1256,19237,0,0,0,0,0,0,0,5796,11848,0,0,52870,11464,0,0,0,0,0,0 +,0,0,0,5645,9158,0,25223,0,0,0,0,0,39142,24968,8135,32104,28678,0,0,0,46311,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23820,0,0,0,0,0,4050,0,1323,25220,0,0,0,20133,0, +0,0,0,0,0,0,0,0,0,0,9381,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,13444,1198,60806,0,0,0,0,17356,50247,30632,0,0,0,0,0,0,0,11944, +999,0,0,0,0,4010,10404,0,0,0,0,0,0,10346,0,0,49510,0,0,0,0,0,0,0,0,0,0,0,0,0, +38919,0,0,0,0,0,0,6351,60966,20137,487,0,0,0,0,0,0,655,2406,17387,43303,0,0,0, +17063,0,0,213,0,0,0,0,0,0,17221,0,0,0,0,0,0,0,0,0,0,0,10820,0,0,0,0,369,6,0,0, +9098,21093,0,31653,0,0,0,0,0,0,0,0,0,27143,0,0,16234,0,0,0,0,0,0,0,0,6020,31723, +28293,0,0,0,0,1936,30695,0,0,0,0,0,52902,0,0,29512,10791,0,20420,0,0,16010,0,0,0 +,0,0,0,0,0,0,0,0,5324,0,0,0,0,0,0,0,0,0,0,0,0,13383,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,24328,0,0,0,0,0,0,40870,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,24648,0,0,0,0,0,0,0,7786,2852,0,0,0,0,0,0,0,0,0,44678,0,17925,0,0,105,53062, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18762,0,0,40679,0,0,0,16165,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,20390,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62310,1322, +14247,0,0,0,0,0,0,0,0,1832,6052,0,0,11882,0,0,0,0,17668,0,28262,0,29542,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28007,0,0,0,57223, +1585,0,0,0,0,0,0,0,0,0,0,0,21162,0,0,62247,0,0,0,0,0,25414,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,36326,0,0,0,23845,0,0,0,0,0,0,0,2693,0,0,0,0,0,0,0, +13125,0,31236,0,0,0,0,0,22502,0,0,0,0,0,0,5994,10309,0,0,0,7269,0,0,0,0,17929,0, +1011,44647,0,0,0,0,0,14919,0,0,0,0,20586,5350,0,0,0,45702,0,13189,0,0,0,0,0,0,0, +0,0,35782,17992,0,0,0,0,0,8203,0,0,0,0,0,0,56678,0,0,0,0,0,38087,4233,0,2127,0,0 +,0,0,0,0,0,0,0,0,10148,0,0,0,2021,0,0,0,0,0,0,0,47206,0,0,0,0,0,0,0,9220,0,0,0,0 +,19465,0,0,0,0,0,0,0,0,39206,0,38055,0,0,0,0,0,0,0,46982,0,0,0,0,0,22054,3850,0, +0,0,0,0,0,0,55,0,10542,0,0,0,0,7239,0,0,0,0,0,59367,0,0,14761,0,0,0,0,43079,0,0, +0,0,0,2726,0,0,9582,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37478,0, +0,0,31364,0,0,0,0,0,0,0,0,20393,8933,0,0,0,0,0,9380,0,0,0,0,16905,549,0,0,0,0, +182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1558,0,0,0,0,0,0,0,19242,0 +,0,0,0,0,0,24933,0,6276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42310,23595, +24068,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13191,6158,2567,0,0,268,47047,0,0,0,0,0,0,0, +0,0,27940,0,0,0,0,0,26726,0,0,0,0,8200,1222,31562,0,0,0,0,0,0,0,0,0,2922,8231, +8904,29157,0,0,0,0,0,0,0,0,23976,4836,0,0,0,0,0,0,0,0,0,0,0,0,31658,0,0,31685,0, +0,2889,6213,0,0,0,0,0,13605,0,0,0,0,0,24772,0,0,0,0,0,0,0,0,0,0,20684,26468, +24075,0,0,0,21193,0,715,679,0,0,0,0,0,0,3050,7654,0,0,0,13798,0,0,0,0,15,27973,0 +,0,8491,2086,0,0,0,43206,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60391,0,0,0,0,0,0 +,0,25892,0,22276,0,34374,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20165,0,0,25672,0 +,0,0,1811,24839,0,31044,0,0,25513,0,0,0,0,0,12810,0,0,62438,0,0,1325,0,364,3782, +0,0,0,0,0,0,0,0,8042,19687,0,0,0,33415,0,0,0,0,0,0,0,0,0,0,0,7205,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,11844,0,0,0,0,3341,1543,6698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,29766,0,0,0,0,0,0,0,0,0,0,0,41158,0,24294,0,3844,12329, +0,0,0,13738,0,0,0,0,0,0,0,0,26245,0,0,0,0,0,0,6378,0,343,4838,0,0,0,24358,11688, +0,0,0,0,0,0,0,0,0,1489,34759,0,0,0,0,363,51974,1878,11013,0,0,32265,59782,0,0,0, +28421,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22756,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14089,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,29257,61222,0,30661,0,28327,0,0,0,0,0,0,0,0,0,0,0,0,0, +27108,8843,0,9673,2084,0,0,0,16327,0,48455,0,0,0,0,0,0,4876,9316,0,0,0,0,0,0,0,0 +,0,0,0,0,9035,18852,0,0,0,0,0,0,0,0,0,0,0,0,0,4164,0,0,14827,1349,0,0,0,0,0, +11909,0,0,0,0,0,0,0,0,0,21765,0,0,0,0,0,0,0,0,31272,63910,0,0,0,25924,0,0,0,0,0, +0,0,0,0,44487,0,0,0,20612,0,0,27754,31428,0,0,0,0,0,0,0,17287,0,3943,0,0,0,63302 +,0,0,0,0,25256,19942,0,55142,0,39046,0,0,0,0,0,0,0,15367,0,0,0,0,0,0,0,0,0,0,0, +28422,0,0,0,0,0,0,0,0,0,0,0,0,9576,63847,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,25226,5734,0,0,0,0,0,0,13801,4997,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,43942,1270,2566,6284,0,0,16230,0,0,0,20678,0,0,0,0,0,38855,0,0,0,0, +29643,0,0,0,41,3655,0,0,0,0,0,14276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,15686,0,0,0,15718,0,50694,0,0,16232,8007,0,0,0,5060, +329,11591,51,0,0,0,0,0,0,0,0,0,13065,7302,27530,15366,0,24934,0,0,0,17828,0,0, +4552,6311,0,0,0,0,0,0,0,0,0,0,0,47686,368,12103,10122,33830,0,0,599,18534,9579, +49479,0,5668,0,0,0,0,0,0,0,0,0,13157,0,0,0,0,23274,14055,0,0,0,0,0,48903,0,0,0,0 +,0,0,1871,0,15434,0,0,0,16174,62470,0,0,0,0,0,0,0,0,0,0,0,7749,0,0,0,0,0,0,0, +30501,0,0,0,0,25675,0,0,0,0,0,0,0,0,0,0,9285,0,0,25323,1669,0,0,0,0,0,0,0,0,0,0, +0,3588,0,0,0,0,0,32902,0,0,4426,0,0,0,0,57959,0,0,0,0,0,0,29898,58278,0,0,0,0, +11880,1220,0,0,0,41479,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23141,0,0,0,0,0,0,0,0,0,0,0 +,0,0,42566,0,0,0,0,0,0,0,40167,9484,3493,0,0,0,0,0,21126,0,0,0,0,8649,18918,0,0, +0,0,0,0,0,34886,2601,0,0,0,0,12518,0,0,0,0,7976,10311,0,0,0,0,0,0,0,45190,0,0,0, +0,0,0,0,0,0,0,16842,20229,0,0,0,0,0,0,7528,4614,0,0,0,0,0,30086,0,0,0,1671,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,9896,6277,0,0,0,0,0,61191,0,41287,0,21956,0,0,20010,0,0,0 +,0,0,0,0,0,0,0,0,13195,0,0,0,0,1381,0,0,0,0,365,30951,24268,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,7044,0,0,0,0,0,0,0,0,0,0,27944,359,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,28487,0,0,77,0,0,0,0,0,0,0,0,56775,12586,8421,0,0,0,0,0,0,26185,14599,0,0, +8040,5702,12585,3109,0,0,0,0,0,21574,5388,0,0,0,0,0,0,0,5106,52454,0,0,0,0,0,0,0 +,0,1907,29895,0,6116,0,0,0,0,11081,5285,0,28069,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4104 +,0,0,0,0,0,0,41511,0,0,0,0,0,0,5262,0,0,0,503,4231,7720,34343,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7304,10374,1718,0,0,29127,0,0,0,0,0,0,0,0,23497, +22567,6952,2340,0,0,0,0,0,0,0,0,20360,12453,0,45094,0,0,0,0,0,28582,0,0,0,0,680, +0,0,0,0,0,0,0,0,0,0,0,0,0,23084,0,0,0,30696,0,0,0,0,45862,0,0,0,0,0,0,0,0,0,0,0, +0,5580,6053,0,0,0,0,0,0,0,0,0,0,712,70,0,0,26091,11335,0,0,0,0,13612,0,13160, +1926,435,51559,0,0,0,0,0,0,0,0,0,0,0,0,0,47302,19083,0,0,12742,0,1607,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,6155,37095,0,0,0,0,0,18948,7146,0,0,0,0,0,0,0,7848, +2055,0,0,0,0,8910,0,19336,0,0,48070,8490,0,0,0,0,0,0,0,9932,56423,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,4133,0,0,0,0,0,0,0,0,0,43398,0,0,0,0,0,0,0,0,16173,0,0,0,0,0 +,0,0,32011,0,0,30918,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26854,0,0,0,0,0,0,0,0,0,0,0,0 +,0,20389,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18889,0,0,0,0,8965,0,0,0,44358,0,0,0,8997,0 +,34055,0,0,0,0,0,29350,0,0,501,17767,0,0,32457,60262,0,0,0,30886,0,0,3757,1063,0 +,0,0,25637,0,0,0,0,0,28068,0,26374,0,0,0,0,0,0,0,0,0,0,0,11684,0,0,0,0,0,0,24779 +,229,0,13766,0,0,7402,11525,0,0,0,0,0,0,0,0,26313,23686,0,0,29736,47527,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27268,0,0,0,0,553,0,0,0,0,0,0,32038,0,0,0,0,1135, +26596,0,0,12300,14631,0,0,0,43238,0,871,0,0,31496,0,8457,17669,0,12836,0,0,0, +22726,0,38758,0,0,375,6564,0,0,0,0,0,0,0,0,0,0,0,0,170,18535,0,22948,0,0,32360,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,25764,0,0,0,0,0,0,0,0,0,0,0,15652,0,0,0,32774,0,0,0,0 +,0,0,0,0,0,28551,0,0,0,0,0,0,0,0,0,0,0,0,15145,0,0,0,21100,27654,0,0,0,0,0,0, +4874,26215,0,1639,0,0,0,0,0,0,0,0,0,0,4169,0,0,0,0,0,7336,0,0,0,0,21572,0,0,0,0, +0,0,0,0,0,24644,1675,2533,0,0,0,53318,0,13094,0,0,0,0,0,0,0,6246,0,22020,0,0,0,0 +,0,0,0,0,0,0,0,28453,5576,5124,0,0,0,0,0,0,0,0,0,0,0,0,0,27910,0,29382,18216, +8583,0,0,0,39174,0,43558,0,0,0,0,0,0,0,0,0,11973,0,0,0,0,0,23397,0,0,0,0,6091,0, +0,0,0,0,0,0,6474,16197,14217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,26728,0,567,48839,0,0,0,0,0,15271,0,0,31818,43974,2450,0,0,0,0,0,0,0, +11368,9191,0,44454,0,0,0,0,0,0,14568,12293,0,0,0,8453,0,0,0,0,0,0,0,0,0,0,0,0, +32040,0,0,0,0,0,0,0,0,0,0,0,0,902,0,0,0,27236,5612,11495,0,0,0,0,0,0,0,0,9194, +23684,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27430,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +26217,44870,0,0,0,0,0,0,5581,7173,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +52775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20968,18340,0,0,0,0,0,0,0,0,4107,11239 +,0,0,0,0,0,0,0,0,0,0,0,29381,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21990,0,0,0,0 +,0,0,0,0,0,48806,0,0,0,32292,0,0,0,0,0,0,0,10884,0,0,0,0,0,0,0,0,0,0,27562,0, +5643,0,0,0,0,0,0,0,0,0,3089,31525,0,19684,0,0,0,0,0,0,0,61415,0,0,0,0,0,36198,0, +0,0,0,0,0,0,7908,0,0,0,0,872,743,0,0,0,0,0,0,0,0,1229,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,32484,0,0,0,0,0,34822,0,0,0,0,0,50726,0,0,0,0,7274,0,0,0,15304, +11526,0,0,0,3047,0,0,0,0,0,0,22376,0,0,0,846,0,0,0,0,35815,0,0,0,23652,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,23721,2148,0,0,0,0,0,0,14856,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,1358,0,3082,0,0,0,848,10949,0,0,0,0,0,0,6504,0,0,14372,0,0,0,0,0,0 +,0,0,0,0,8201,9958,0,0,0,0,0,0,24266,0,0,0,0,0,0,0,0,26469,0,0,0,0,18604,2053,0, +33511,0,0,0,0,0,9222,0,0,0,0,0,44006,0,0,0,0,0,0,0,0,0,0,0,41895,0,0,0,0,0,0,0,0 +,12044,390,0,0,0,0,0,4935,0,48646,0,56102,3052,16070,0,0,0,0,0,0,0,8612,9320, +38311,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,500,0,0,0,0,42918,0, +32550,0,0,0,0,0,0,0,0,27434,57926,17064,0,0,46502,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,26760,6756,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,0,5000,0,0,0,0,32293,0, +0,0,0,0,0,0,0,0,0,0,0,0,26246,0,0,0,0,0,0,0,0,23,7301,0,0,0,36199,0,40838,0,0,0, +0,0,0,0,0,0,0,0,0,27178,57350,0,0,12457,9317,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16810,0,0,0,14510,0,0,0,0,21319,0,0,0,13508,17, +11365,0,0,0,0,5291,0,8329,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27685,0,0,0,0,0,0,0, +52006,0,0,0,7493,0,44263,0,0,0,0,0,0,0,0,9800,0,0,0,25676,61478,0,0,0,0,0,0,5773 +,0,0,0,0,41991,26057,0,0,0,0,0,0,0,0,0,0,22629,0,0,0,47783,362,1959,23468,0,0,0, +10921,0,0,0,3150,0,0,0,0,0,0,0,0,0,0,0,32456,0,0,0,0,0,0,0,4559,3270,0,0,983,0,0 +,26343,0,33446,0,0,0,61767,0,48390,0,0,0,0,0,0,0,2790,0,39782,7849,0,0,0,0,0,0,0 +,1544,2183,0,0,0,0,0,0,0,0,4040,2471,20009,30020,0,0,11242,0,0,0,5578,53382,0, +22631,0,0,0,0,0,0,0,0,0,0,0,12901,0,0,0,0,0,0,0,0,0,0,0,0,215,0,0,9030,0,0,0,0,0 +,0,265,1412,0,0,11626,3687,0,0,0,0,0,0,0,0,0,0,0,0,17449,24359,0,0,26729,40134,0 +,0,0,0,29768,61958,0,0,0,0,0,0,0,0,20908,0,0,0,0,0,11016,0,0,47462,21547,5926,0, +0,14728,2983,24104,15301,0,0,0,0,0,32645,0,0,0,0,0,0,0,3300,0,0,0,15972,0,0,0,0, +0,0,6634,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3076,0,30983,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,106,0,0,0,0,12775,0,0,0,0,7177,18022,0,0,0,0,0,22534,0,0,0,0,0,0,0,0,0,0,0, +49894,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27560,0,0,0,0,30278,10668,23877,0, +0,0,0,0,0,0,29124,0,0,0,0,0,0,0,0,0,0,0,0,0,20870,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,44582,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48454,0,0,0,0,6442,0,16330,22951,0,0 +,16904,0,0,0,0,644,0,0,0,40038,0,0,0,37222,0,0,0,9830,0,0,0,0,0,34919,0,0,0,0,0, +0,0,0,0,0,0,13733,0,0,0,28196,0,0,0,0,0,19876,0,0,0,0,0,0,0,23558,0,11142,0, +27781,0,0,0,0,13864,0,0,0,24682,47847,0,0,0,0,6890,0,0,0,0,0,3981,0,0,0,0,0,0,0, +0,0,0,0,1772,0,0,0,0,0,0,0,3603,1991,0,27396,8652,0,18312,0,0,0,0,30054,0,0,0,0, +0,0,0,11270,0,0,0,0,0,0,0,0,0,20708,0,0,0,0,338,0,0,0,0,0,0,0,7050,0,0,0,0,0,0,0 +,0,0,0,0,0,0,14862,0,0,3492,0,0,0,55878,0,0,0,16486,0,0,0,18119,0,0,0,0,0,0,2154 +,1284,0,0,23113,31751,0,0,29547,0,0,0,0,0,0,36647,0,0,0,0,0,0,0,0,0,0,0,18183,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,7913,0,0,0,0,20644,0,0,10508,0,0,0,0,0,0,0,0,0,0,0,0, +43622,0,0,0,0,0,40966,0,0,0,0,0,0,0,0,0,0,246,901,11529,5191,0,0,0,0,0,0,0,0,0,0 +,0,24454,0,0,26665,27590,0,27397,0,0,0,0,0,0,23562,2949,0,0,30344,62214,0,47334, +2026,18885,0,0,0,48678,0,0,0,22694,0,0,1972,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,15465,0,0,0,0,38822,0,0,0,0,945,32708,0,54791,0,14918,0,0,0,0,0,0, +0,0,0,0,0,0,0,23396,0,0,0,0,0,0,5486,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7722,0,0, +0,0,0,0,0,0,0,0,0,30856,64166,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35206,0,0,0,30535,0, +0,0,0,0,0,0,0,0,62663,0,0,1096,17574,31820,0,0,14375,4402,27207,0,0,21448,4676,0 +,0,0,0,16585,5094,0,0,0,0,0,0,0,0,4845,0,0,32870,0,0,0,0,0,0,0,0,0,0,31466,0,0,0 +,0,31783,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4522,16039,0,0,0,0,0,0,0,0, +0,14469,0,0,0,0,0,0,0,0,0,0,7464,4773,0,0,0,0,0,0,0,0,18636,0,0,0,25640,0,0,0,0, +0,0,2244,0,0,11818,0,1168,0,0,0,0,0,0,0,6540,23079,13770,7719,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58150,528, +34502,32682,0,0,12997,0,0,0,0,0,2214,0,0,0,0,0,58567,0,0,0,26375,0,0,0,0,0,0,0,0 +,0,26437,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,32005,22952,59047,0,13543,0,0,0,0,0,0,0,0,16328,0,0,33542,0,0,0,19782,0,0,0, +16644,0,0,0,0,31688,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10276,0,0,0, +0,0,0,0,36327,0,0,29480,0,0,0,777,12709,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27398,0,0, +0,4455,9037,31397,0,9221,0,0,0,60487,20840,1796,0,0,0,0,0,0,0,0,8364,0,0,0,0,0,0 +,0,0,0,0,0,19752,44902,0,38566,0,0,18027,0,0,0,0,0,0,0,0,10662,0,0,0,0,0,11812,0 +,0,0,0,0,0,0,0,0,19910,0,0,0,45030,0,0,0,0,0,0,0,0,0,0,0,0,19978,5127,0,11620,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1357,53,0,0,0,0,590,0,0,0,0,0,0,0,0,0,0, -0,0,0,329,0,0,0,0,0,0,0,469,0,0,0,0,0,0,0,0,0,0,460,0,0,1743,0,0,963,340,0,0,0, -0,0,1603,0,0,250,0,0,0,0,0,646,218,0,1794,0,0,0,571,0,455,0,0,0,1012,0,0,0,0,0, -0,0,0,0,0,0,0,597,161,0,349,0,524,0,0,0,0,0,0,0,0,0,0,0,0,322,432,0,0,0,0,0,0, -325,223,0,0,0,0,0,566,0,0,0,1394,481,436,0,48,457,610,756,618,0,0,0,755,0,1217, -0,0,0,0,0,197,0,0,0,0,0,0,0,0,0,0,0,0,0,0,544,492,107,414,0,0,0,0,0,0,0,0,0,0,0, -1007,0,0,0,0,5,0,0,1580,0,0,0,0,0,0,0,0,0,0,0,0,0,673,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,1843,0,0,0,0,0,0,0,0,0,165,0,0,0,0,0,0,809,885,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,498,0,0,0,306,9,0,0,0,0,0,0,0,437,721,146,0,0,0,0,0,0,0,0,0,0,0,177,0,0,0,0, -0,0,0,1377,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,959,0,0,0,1928,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1435,0,481,0,0,0,0,0,0,142,84,0,0,0,0,0, -1015,0,0,0,315,0,0,0,0,0,0,759,0,0,0,0,0,0,0,0,712,0,0,0,1722,0,0,0,0,0,0,0,0,0, -0,0,0,222,0,985,1414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1273, -538,706,0,0,0,0,0,0,0,0,115,0,0,0,0,0,0,0,0,0,0,1781,0,0,0,0,0,431,97,665,42, -237,0,0,0,264,0,0,213,0,0,0,0,0,0,0,455,0,0,0,906,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -624,0,574,0,0,0,0,0,0,0,0,0,0,0,0,354,0,0,0,1558,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68, -235,723,1813,0,0,0,957,0,830,0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,496,0,0,0,0,0,0,0, -547,239,88,0,0,0,0,0,0,0,0,0,1310,0,0,0,0,0,0,0,0,80,1076,0,0,118,0,0,0,479,274, -0,0,0,0,0,0,0,0,0,0,0,497,0,0,669,261,0,0,0,0,13,0,0,0,0,0,0,791,250,642,0,0,0, -1429,939,949,0,0,0,0,0,0,0,0,0,0,0,0,0,818,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,982,330,0,0,0,0,545,0,0,0,0,0,0,947,0,1188,0,0,0,0,0,904,0,0,0,0,0,1372,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,693,377,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0, -713,386,0,0,0,0,128,1575,0,0,0,0,0,0,424,893,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,904,0,0,0,0,0,552,322,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,1808,49,0,0,0,0, -1832,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,421,0,0,442,415,0,0,289, -0,0,0,0,0,206,110,0,0,0,0,0,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -19,1539,0,0,0,0,0,1340,0,1194,0,0,0,0,0,0,0,0,549,0,0,0,0,0,0,0,0,1720,0,0,0,0, -0,0,0,0,0,319,0,0,0,0,112,1180,0,0,0,0,0,0,0,0,0,0,0,967,0,0,0,0,0,0,0,0,0,1940, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,735,0,0,0,0,0,0,0,0,0,897,132,0,0,0,0,0,0,0, -0,0,0,38,838,0,0,0,379,218,8,660,1017,0,0,0,0,0,0,111,387,647,877,0,0,53,790,0, -0,0,0,0,0,0,0,458,0,0,0,0,0,0,954,0,0,0,394,0,1367,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,882,0,0,0,0,0,0,0,1409,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,124,342,199,0,0,0,0, -0,0,0,0,0,0,724,628,0,0,0,0,804,266,0,0,0,0,0,208,0,79,0,0,0,0,0,0,0,0,741,0,0, -0,0,0,0,0,0,0,0,606,0,1494,821,1553,0,0,135,405,0,0,178,100,0,0,0,0,0,0,0,0,0,0, -0,0,0,481,0,0,0,1378,0,0,0,0,0,0,0,0,0,0,0,0,0,791,33,1227,857,0,467,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,447,0,0,0,0,0,0,86,128,0,0,0,0,0,0,587,0,0,0,692,1018,0, -195,0,0,0,0,0,0,0,1546,0,0,0,0,0,0,0,0,0,0,0,684,0,0,345,0,0,0,0,0,0,365,0,1683, -0,0,472,0,433,0,0,0,0,0,0,0,28,0,0,0,997,0,705,3,0,0,0,0,0,0,0,0,0,229,0,0,0,0, -102,0,0,0,0,866,1022,0,0,0,0,0,0,0,0,0,55,0,115,0,0,0,0,933,0,0,0,0,0,0,0,702,0, -0,0,0,0,0,0,1728,26,484,0,0,0,185,618,417,0,803,0,0,0,0,0,0,0,0,0,0,0,1262,0,0, -0,0,0,0,0,0,0,0,0,0,0,633,0,0,0,0,0,0,0,0,0,0,0,0,0,479,262,0,0,0,0,0,0,830,0,0, -0,0,26,70,0,0,0,0,0,0,0,0,217,0,640,51,0,0,360,1586,0,0,0,0,0,652,0,0,0,0,0,766, -0,0,0,0,298,737,0,0,0,0,0,0,0,0,0,0,655,222,906,0,0,1013,991,2009,0,0,0,0,503,0, -0,0,216,154,0,0,0,716,0,844,0,0,0,0,621,252,0,0,0,0,748,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,103,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,576,0,0,0,648,0,0,0,331,0,0,0, -0,0,0,0,0,0,0,0,0,632,0,0,0,518,107,0,0,0,0,0,0,0,0,851,0,0,0,0,504,0,0,0,0,0,0, -0,0,0,0,0,0,7,883,0,0,0,0,0,0,0,922,0,0,0,0,0,0,0,0,91,993,0,0,0,0,0,0,200,131, -10,0,0,0,0,0,0,0,0,0,0,0,0,0,365,1433,0,0,0,0,28,103,0,0,798,1013,0,0,0,0,0,0,0, -0,39,1925,0,853,0,0,271,519,0,0,0,0,338,0,0,300,470,419,0,0,0,0,0,0,836,0,0,0,0, -0,0,1937,0,0,0,0,0,393,0,0,357,0,0,0,0,0,703,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,387,0,0,0,0,0,0,75,708,453,1351,0,303,0,0,772,0,0,0,0,0,0,0,0,749,0,0, -0,0,0,0,0,0,0,0,0,0,0,1065,0,0,717,226,0,0,0,0,0,890,431,626,0,0,0,0,706,0,0,0, -51,698,0,0,0,0,0,0,0,0,0,0,0,828,0,0,17,0,0,0,0,1929,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,871,498,0,101,1793,0,0,0,0,0,0,435,0, -0,0,0,0,966,0,129,1644,0,0,0,0,0,0,0,0,0,0,0,0,0,997,502,0,0,0,0,0,0,0,0,0,0,0, -0,823,0,1927,0,0,0,0,98,1756,0,0,0,0,0,0,0,0,0,0,0,0,8,0,160,1046,0,492,0,0,0,0, -0,0,129,45,0,0,0,0,0,0,353,558,0,0,0,0,0,785,0,0,0,1145,189,0,0,0,26,353,0,0,0, -0,0,2024,0,0,0,606,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,855,0,0,0,0,0,0,0,0,0,0,0, -0,0,2011,0,0,5,4,0,0,461,764,0,0,0,1449,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1445,0,0, -0,1168,0,0,0,233,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,216,0,0,0,286,0,0,0, -3,0,0,0,723,536,0,0,0,0,0,285,0,0,0,560,0,0,0,0,0,690,0,0,0,0,0,1246,0,0,63,0, -33,0,0,0,0,0,520,1862,0,0,0,0,0,0,0,0,0,0,0,0,630,0,0,0,0,554,0,0,0,0,0,1001,0, -0,0,0,0,446,0,0,0,0,0,0,0,1313,0,0,837,636,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,278, -0,0,0,0,0,0,0,0,868,0,0,0,0,1010,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -1231,0,304,0,506,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,93,1408,794, -843,704,0,285,114,485,898,145,0,19,2035,0,0,0,1933,0,0,0,0,0,0,0,1728,0,0,0,0,0, -0,0,0,746,0,0,0,0,0,0,0,995,1964,0,0,0,0,0,0,0,0,0,0,0,1550,0,874,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,1018,0,0,0,814,126,0,0,1264,0,0,814,955,0,0,0,0,0,0, -0,981,0,0,0,0,0,0,0,0,915,56,0,0,100,0,0,0,0,0,0,0,0,0,638,0,0,0,0,738,0,0,0,0, -0,0,0,0,0,758,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1112,0,0,214,0,0,0,133,0,196, -168,0,0,0,0,0,1152,0,1245,0,0,538,169,871,1816,0,0,413,133,0,0,0,978,0,0,43,93, -371,0,0,0,0,0,0,526,25,0,754,335,0,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,39,601,0,0,0, -0,0,0,0,181,370,0,0,1652,358,0,0,0,0,0,0,0,0,0,176,286,0,788,0,0,0,0,0,1223,780, -254,1003,896,0,0,0,1447,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,744,0,0,0,0,0,126,0, -41,788,0,0,0,629,0,0,0,0,0,0,0,0,0,0,0,293,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,420,37,1900,0,0,0,0,542,1570,957,0,0,0,0,0,0, -0,373,31,0,0,0,0,125,325,0,0,0,0,0,0,323,0,0,1547,0,0,0,0,0,0,0,0,0,0,0,0,0, -1216,0,0,0,0,0,0,198,1905,629,15,0,0,0,0,0,0,20,75,543,1353,0,0,0,533,0,0,6,0,0, -0,0,0,0,538,0,0,0,0,0,0,0,0,0,0,0,338,0,0,0,0,11,0,0,0,284,659,0,989,0,0,0,0,0, -0,0,0,0,848,0,0,507,0,0,0,0,0,0,0,0,188,991,884,0,0,0,0,60,959,0,0,0,0,0,1653,0, -0,922,337,0,638,0,0,500,0,0,0,0,0,0,0,0,0,0,0,166,0,0,0,0,0,0,0,0,0,0,0,0,418,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,760,0,0,0,0,0,0,1277,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,770,0,0,0,0,0,0,0,243,89,0,0,0,0,0,0,0,0,0,1396,0, -560,0,0,3,1658,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,586,0,0,1271,0,0,0,505,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,637,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1947, -41,445,0,0,0,0,0,0,0,0,57,189,0,0,371,0,0,0,0,552,0,883,0,923,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,875,0,0,0,1788,49,0,0,0,0,0, -0,0,0,0,0,0,661,0,0,1945,0,0,0,0,0,794,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,1135,0,0,0,745,0,0,0,0,0,0,0,84,0,0,0,0,0,0,0,410,0,976,0,0,0,0,0,703,0,0, -0,0,0,0,187,322,0,0,0,227,0,0,0,0,560,0,31,1395,0,0,0,0,0,466,0,0,0,0,643,167,0, -0,0,1428,0,412,0,0,0,0,0,0,0,0,0,1118,562,0,0,0,0,0,256,0,0,0,0,0,0,1771,0,0,0, -0,0,1190,132,0,66,0,0,0,0,0,0,0,0,0,0,317,0,0,0,63,0,0,0,0,0,0,0,1475,0,0,0,0,0, -0,0,288,0,0,0,0,608,0,0,0,0,0,0,0,0,1225,0,1189,0,0,0,0,0,0,0,1468,0,0,0,0,0, -689,120,0,0,0,0,0,0,0,1,0,329,0,0,0,0,226,0,0,0,0,0,1855,0,0,461,0,0,0,0,1346,0, -0,0,0,0,85,0,0,299,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1171,0,0, -0,980,0,0,0,0,0,0,0,0,637,279,0,0,0,0,0,293,0,0,0,0,528,17,0,0,0,0,5,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,601,0,0,0,0,0,0,779,0, -196,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1322,737,752,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,412,192,80,0,0,8,1470,0,0,0,0,0,0,0,0,0,873,0,0,0,0,0,835,0,0,0,0,256, -38,986,0,0,0,0,0,0,0,0,0,91,257,278,911,0,0,0,0,0,0,0,0,749,151,0,0,0,0,0,0,0,0, -0,0,0,0,989,0,0,990,0,0,90,194,0,0,0,0,0,425,0,0,0,0,0,774,0,0,0,0,0,0,0,0,0,0, -646,827,752,0,0,0,662,0,22,21,0,0,0,0,0,0,95,239,0,0,0,431,0,0,0,0,0,874,0,0, -265,65,0,0,0,1350,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1887,0,0,0,0,0,0,0,809, -0,696,0,1074,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,0,0,802,0,0,0,56,776,0, -970,0,0,797,0,0,0,0,0,400,0,0,1951,0,0,41,0,11,118,0,0,0,0,0,0,0,0,251,615,0,0, -0,1044,0,0,0,0,0,0,0,0,0,0,0,225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,370,0,0,0,0, -104,48,209,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,930,0,0,0,0, -0,0,0,0,0,0,0,1286,0,759,0,120,385,0,0,0,429,0,0,0,0,0,0,0,0,820,0,0,0,0,0,0, -199,0,10,151,0,0,0,761,365,0,0,0,0,0,0,0,0,0,46,1086,0,0,0,0,11,1624,58,344,0,0, -1008,1868,0,0,0,888,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,711,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,440,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,914,1913,0,958,0,885,0,0,0,0,0,0,0,0,0,0,0, -0,0,847,276,0,302,65,0,0,0,510,0,1514,0,0,0,0,0,0,152,291,0,0,0,0,0,0,0,0,0,0,0, -0,282,589,0,0,0,0,0,0,0,0,0,0,0,0,0,130,0,0,463,42,0,0,0,0,0,372,0,0,0,0,0,0,0, -0,0,680,0,0,0,0,0,0,0,0,977,1997,0,0,0,810,0,0,0,0,0,0,0,0,0,1390,0,0,0,644,0,0, -867,982,0,0,0,0,0,0,0,540,0,123,0,0,0,1978,0,0,0,0,789,623,0,1723,0,1220,0,0,0, -0,0,0,0,480,0,0,0,0,0,0,0,0,0,0,0,888,0,0,0,0,0,0,0,0,0,0,0,0,299,1995,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,788,179,0,0,0,0,0,0,431,156,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1373,39,80,196,0,0,507,0,0,0,646,0,0,0,0, -0,1214,0,0,0,0,926,0,0,0,1,114,0,0,0,0,0,446,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,490,0,0,0,491,0,1584,0,0,507,250,0,0,0,158, -10,362,1,0,0,0,0,0,0,0,0,0,408,228,860,480,0,779,0,0,0,557,0,0,142,197,0,0,0,0, -0,0,0,0,0,0,0,1490,11,378,316,1057,0,0,18,579,299,1546,0,177,0,0,0,0,0,0,0,0,0, -411,0,0,0,0,727,439,0,0,0,0,0,1528,0,0,0,0,0,0,58,0,482,0,0,0,505,1952,0,0,0,0, -0,0,0,0,0,0,0,242,0,0,0,0,0,0,0,953,0,0,0,0,802,0,0,0,0,0,0,0,0,0,0,290,0,0,791, -52,0,0,0,0,0,0,0,0,0,0,0,112,0,0,0,0,0,1028,0,0,138,0,0,0,0,1811,0,0,0,0,0,0, -934,1821,0,0,0,0,371,38,0,0,0,1296,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,723,0,0,0,0,0, -0,0,0,0,0,0,0,0,1330,0,0,0,0,0,0,0,1255,296,109,0,0,0,0,0,660,0,0,0,0,270,591,0, -0,0,0,0,0,0,1090,81,0,0,0,0,391,0,0,0,0,249,322,0,0,0,0,0,0,0,1412,0,0,0,0,0,0, -0,0,0,0,526,632,0,0,0,0,0,0,235,144,0,0,0,0,0,940,0,0,0,52,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,309,196,0,0,0,0,0,1912,0,1290,0,686,0,0,625,0,0,0,0,0,0,0,0,0,0,0,412,0, -0,0,0,43,0,0,0,0,11,967,758,0,0,0,0,0,0,0,0,0,0,0,0,0,0,220,0,0,0,0,0,0,0,0,0,0, -873,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,890,0,0,2,0,0,0,0,0,0,0,0,1774, -393,263,0,0,0,0,0,0,818,456,0,0,251,178,393,97,0,0,0,0,0,674,168,0,0,0,0,0,0,0, -159,1639,0,0,0,0,0,0,0,0,59,934,0,191,0,0,0,0,346,165,0,877,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,128,0,0,0,0,0,0,1297,0,0,0,0,0,0,164,0,0,0,15,132,241,1073,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,228,324,53,0,0,910,0,0,0,0,0,0,0,0,734,705, -217,73,0,0,0,0,0,0,0,0,636,389,0,1409,0,0,0,0,0,893,0,0,0,0,21,0,0,0,0,0,0,0,0, -0,0,0,0,0,721,0,0,0,959,0,0,0,0,1433,0,0,0,0,0,0,0,0,0,0,0,0,174,189,0,0,0,0,0, -0,0,0,0,0,22,2,0,0,815,354,0,0,0,0,425,0,411,60,13,1611,0,0,0,0,0,0,0,0,0,0,0,0, -0,1478,596,0,0,398,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,1159,0,0,0,0,0, -592,223,0,0,0,0,0,0,0,245,64,0,0,0,0,278,0,604,0,0,1502,265,0,0,0,0,0,0,0,310, -1763,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,129,0,0,0,0,0,0,0,0,0,1356,0,0,0,0,0,0,0, -0,505,0,0,0,0,0,0,0,1000,0,0,966,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,839,0,0,0,0,0,0, -0,0,0,0,0,0,0,637,0,0,0,0,0,0,0,0,0,0,0,0,0,0,590,0,0,0,0,280,0,0,0,1386,0,0,0, -281,0,1064,0,0,0,0,0,917,0,0,15,555,0,0,1014,1883,0,0,0,965,0,0,117,33,0,0,0, -801,0,0,0,0,0,877,0,824,0,0,0,0,0,0,0,0,0,0,0,365,0,0,0,0,0,0,774,7,0,430,0,0, -231,360,0,0,0,0,0,0,0,0,822,740,0,0,929,1485,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,852,0,0,0,0,17,0,0,0,0,0,0,1001,0,0,0,0,35,831,0,0,384,457,0,0,0,1351,0,27, -0,0,984,0,264,552,0,401,0,0,0,710,0,1211,0,0,11,205,0,0,0,0,0,0,0,0,0,0,0,0,5, -579,0,717,0,0,1011,0,0,0,0,0,0,0,0,0,0,0,0,0,0,805,0,0,0,0,0,0,0,0,0,0,0,489,0, -0,0,1024,0,0,0,0,0,0,0,0,0,892,0,0,0,0,0,0,0,0,0,0,0,0,473,0,0,0,659,864,0,0,0, -0,0,0,152,819,0,51,0,0,0,0,0,0,0,0,0,0,130,0,0,0,0,0,229,0,0,0,0,674,0,0,0,0,0, -0,0,0,0,770,52,79,0,0,0,1666,0,409,0,0,0,0,0,0,0,195,0,688,0,0,0,0,0,0,0,0,0,0, -0,889,174,160,0,0,0,0,0,0,0,0,0,0,0,0,0,872,0,918,569,268,0,0,0,1224,0,1361,0,0, -0,0,0,0,0,0,0,374,0,0,0,0,0,731,0,0,0,0,190,0,0,0,0,0,0,0,202,506,444,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,835,0,17,1526,0,0,0,0,0,477,0,0, -994,1374,76,0,0,0,0,0,0,0,355,287,0,1389,0,0,0,0,0,0,455,384,0,0,0,264,0,0,0,0, -0,0,0,0,0,0,0,0,1001,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,851,175,359,0,0,0,0,0,0,0, -0,287,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,857,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -819,1402,0,0,0,0,0,0,174,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1649, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,573,0,0,0,0,0,0,0,0,128,351,0,0,0,0,0,0, -0,0,0,0,0,918,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,687,0,0,0,0,0,0,0,0,0,1525, -0,0,0,1009,0,0,0,0,0,0,0,340,0,0,0,0,0,0,0,0,0,0,861,0,176,0,0,0,0,0,0,0,0,0,96, -985,0,615,0,0,0,0,0,0,0,1919,0,0,0,0,0,1131,0,0,0,0,0,0,0,247,0,0,0,0,27,23,0,0, -0,0,0,0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1015,0,0,0,0,0,1088,0,0, -0,0,0,1585,0,0,0,0,227,0,0,0,478,360,0,0,0,95,0,0,0,0,0,0,699,0,0,0,26,0,0,0,0, -1119,0,0,0,739,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,741,67,0,0,0,0,0,0,464,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,96,0,0,0,26,342,0,0,0,0,0,0,203,0,0,449,0, -0,0,0,0,0,0,0,0,0,256,311,0,0,0,0,0,0,758,0,0,0,0,0,0,0,0,827,0,0,0,0,581,64,0, -1047,0,0,0,0,0,288,0,0,0,0,0,1375,0,0,0,0,0,0,0,0,0,0,0,1309,0,0,0,0,0,0,0,0, -376,12,0,0,0,0,0,154,0,1520,0,1753,95,502,0,0,0,0,0,0,0,269,291,1197,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,1341,0,1017,0,0,0,0,0,0,0, -0,857,1810,533,0,0,1453,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,836,211,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,19,0,156,0,0,0,0,1009,0,0,0,0,0,0,0,0,0,0,0,0,0,820,0,0, -0,0,0,0,0,0,0,228,0,0,0,1131,0,1276,0,0,0,0,0,0,0,0,0,0,0,0,849,1792,0,0,389, -291,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,525,0,0, -0,453,0,0,0,0,666,0,0,0,422,0,355,0,0,0,0,165,0,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,865,0,0,0,0,0,0,0,1625,0,0,0,234,0,1383,0,0,0,0,0,0,0,0,306,0,0,0,802,1921, -0,0,0,0,0,0,180,0,0,0,0,1312,814,0,0,0,0,0,0,0,0,0,0,707,0,0,0,1493,11,61,733,0, -0,0,341,0,0,0,98,0,0,0,0,0,0,0,0,0,0,0,1014,0,0,0,0,0,0,0,142,102,0,0,30,0,0, -823,0,1045,0,0,0,1930,0,1512,0,0,0,0,0,0,0,87,0,1243,245,0,0,0,0,0,0,0,48,68,0, -0,0,0,0,0,0,0,126,77,625,938,0,0,351,0,0,0,174,1668,0,707,0,0,0,0,0,0,0,0,0,0,0, -403,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,282,0,0,0,0,0,0,8,44,0,0,363,115,0,0,0,0,0,0, -0,0,0,0,0,0,545,761,0,0,835,1254,0,0,0,0,930,1936,0,0,0,0,0,0,0,0,653,0,0,0,0,0, -344,0,0,1483,673,185,0,0,460,93,753,478,0,0,0,0,0,1020,0,0,0,0,0,0,0,103,0,0,0, -499,0,0,0,0,0,0,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,968,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,3,0,0,0,0,399,0,0,0,0,224,563,0,0,0,0,0,704,0,0,0,0,0,0,0,0,0,0,0, -1559,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,861,0,0,0,0,946,333,746,0,0,0,0,0, -0,0,910,0,0,0,0,0,0,0,0,0,0,0,0,0,652,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -1393,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1514,0,0,0,0,201,0,510,717,0,0,528,0,0,0,0, -20,0,0,0,1251,0,0,0,1163,0,0,0,307,0,0,0,0,0,1091,0,0,0,0,0,0,0,0,0,0,0,429,0,0, -0,881,0,0,0,0,0,621,0,0,0,0,0,0,0,736,0,348,0,868,0,0,0,0,433,0,0,0,771,1495,0, -0,0,0,215,0,0,0,0,0,124,0,0,0,0,0,0,0,0,0,0,0,55,0,0,0,0,0,0,0,112,62,0,856,270, -0,572,0,0,0,0,939,0,0,0,0,0,0,0,352,0,0,0,0,0,0,0,0,0,647,0,0,0,0,10,0,0,0,0,0, -0,0,220,0,0,0,0,0,0,0,0,0,0,0,0,0,464,0,0,109,0,0,0,1746,0,0,0,515,0,0,0,566,0, -0,0,0,0,0,67,40,0,0,722,992,0,0,923,0,0,0,0,0,0,1145,0,0,0,0,0,0,0,0,0,0,0,568, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,0,0,0,0,645,0,0,328,0,0,0,0,0,0,0,0,0,0,0,0, -1363,0,0,0,0,0,1280,0,0,0,0,0,0,0,0,0,0,7,28,360,162,0,0,0,0,0,0,0,0,0,0,0,764, -0,0,833,862,0,856,0,0,0,0,0,0,736,92,0,0,948,1944,0,1479,63,590,0,0,0,1521,0,0, -0,709,0,0,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,483,0,0,0,0,1213, -0,0,0,0,29,1022,0,1712,0,466,0,0,0,0,0,0,0,0,0,0,0,0,0,731,0,0,0,0,0,0,171,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,241,0,0,0,0,0,0,0,0,0,0,0,964,2005,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,1100,0,0,0,954,0,0,0,0,0,0,0,0,0,1958,0,0,34,549,994,0,0,449, -137,850,0,0,670,146,0,0,0,0,518,159,0,0,0,0,0,0,0,0,151,0,0,1027,0,0,0,0,0,0,0, -0,0,0,983,0,0,0,0,993,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,141,501,0,0,0, -0,0,0,0,0,0,452,0,0,0,0,0,0,0,0,0,0,233,149,0,0,0,0,0,0,0,0,582,0,0,0,801,0,0,0, -0,0,0,70,0,0,369,0,36,0,0,0,0,0,0,0,204,721,430,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1817,16,1078,1021,0,0, -406,0,0,0,0,0,69,0,0,0,0,0,1830,0,0,0,824,0,0,0,0,0,0,0,0,0,826,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,816,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1000,717,1845,0,423,0,0, -0,0,0,0,0,0,510,0,0,1048,0,0,0,618,0,0,0,520,0,0,0,0,990,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,321,0,0,0,0,0,0,0,1135,0,0,921,0,0,0,24,397,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,856,0,0,0,139,282,981,0,288,0,0,0,1890,651,56,0,0,0,0,0,0,0, -0,261,0,0,0,0,0,0,0,0,0,0,0,617,1403,0,1205,0,0,563,0,0,0,0,0,0,0,0,333,0,0,0,0, -0,369,0,0,0,0,0,0,0,0,0,622,0,0,0,1407,0,0,0,0,0,0,0,0,0,0,0,0,624,160,0,363,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,619,0,174,292,0,0,656,616,0,0,0,685,0,0,0,0,0,0,0,0,0,0,0,0,0,647,0,0,0,631,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1267,0,0,0,1797,0,0,0,1684,0,0,469,0,531, -1230,73,0,0,0,0,0,0,0,0,0,268,0,0,0,0,0,102,558,109,65,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,595,0,0,0,0,0,374,1832,0,0,0,0,0,0,16,0,405,6,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,881,0,1495,0,0,0,0,0,0,0,0,0,142,0,0,0,0,0,0,0,0,0,0,21,466,23, -257,0,0,0,0,0,0,77,404,0,0,0,0,0,0,712,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,860, -1848,0,0,652,629,0,0,0,0,13,377,0,1842,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1501,0, -0,0,1906,0,0,0,0,0,0,0,0,0,0,0,0,0,491,234,171,0,0,0,0,631,1186,0,0,0,0,0,0,0,0, -0,0,0,0,931,0,170,0,0,0,0,0,0,0,0,0,0,1587,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,424,0,0,714,0,0,0,0,685,0,0,0,0,0, -0,285,0,0,0,0,0,0,429,0,0,0,0,0,0,0,0,0,0,71,18,0,0,0,0,0,0,0,0,0,0,116,828,0,0, -0,0,0,0,289,0,0,0,0,0,0,0,0,675,0,0,0,1424,0,0,0,0,0,647,0,0,0,1334,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,36,209,0,0,0,0,0,0,0,342,0,0,0,928,0,0,0,0,0,1838,118,856,654, -318,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,915,895,454,0,0,513,1425,0,0, -0,0,0,0,791,0,153,0,0,0,0,0,0,796,909,445,345,0,0,0,0,0,0,0,0,578,0,0,0,1387,0, -0,0,555,0,0,0,0,0,0,766,0,0,0,0,0,0,0,0,0,0,541,0,0,0,0,0,0,0,0,0,0,0,0,0,880,0, -0,0,0,0,1506,0,0,983,0,768,0,0,0,0,584,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,737, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,226,30,426,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -117,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,462,0,0,0,385,0,398,0,0,0,0,0,0, -0,0,0,347,0,0,0,0,125,1259,644,136,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,469,0,0,0,0,0, -1367,0,0,0,0,0,0,0,0,0,0,0,719,0,0,0,0,0,0,0,0,0,0,0,0,0,1423,0,0,0,0,0,0,0,0,0, -749,0,0,0,0,546,645,0,0,0,0,0,0,277,0,0,1275,0,0,0,0,0,0,0,453,536,555,0,0,987, -1107,0,0,90,0,0,0,0,0,0,0,0,860,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -257,0,1768,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1071,0,0,0,0,0,0,0,0,0,0,0,0,0,83, -0,835,0,0,0,0,0,0,0,2006,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,696,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,95,1718,0,0,0,0,0,0,0,26,0,550,0,0,0,0,0,901,0,0,0,0,0, -0,822,0,0,122,0,0,0,807,0,0,0,0,0,262,0,620,601,34,0,0,170,0,0,0,0,537,0,0,0,0, -0,0,0,0,0,332,0,0,208,1909,182,261,0,0,0,1721,0,0,0,0,0,933,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,1609,0,895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,0,0,942,1916,0,0,0,0, -0,0,0,778,0,0,0,137,0,1314,0,0,0,0,0,0,0,1661,0,0,0,0,0,0,0,1591,0,0,0,0,0,0, -820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,185,89,0,1160,230,6,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,63,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1740,0,0,177, -170,0,1961,0,0,0,0,0,0,0,0,0,0,0,0,91,0,17,44,0,0,0,0,0,0,0,0,0,270,0,296,0,0,0, -0,0,0,0,1523,0,0,0,0,0,0,0,0,0,0,757,7,0,0,0,0,0,0,0,0,0,0,530,588,0,0,0,0,0,0, -0,0,0,786,0,0,0,0,0,580,627,88,447,57,0,0,0,0,0,0,0,0,845,735,0,0,0,0,0,31,15,0, -460,521,12,424,0,0,0,1302,0,0,0,0,0,0,0,595,0,0,0,13,548,97,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,1472,452,1767,0,0,0,0,0,0,0,0,0,0,115,0,0,0,0,0,0,1543,0,1111,0,0,0,0, -1,0,359,488,0,267,0,0,0,1983,0,0,0,0,0,0,0,1155,0,1575,0,1438,31,0,0,377,101,0, -0,0,0,0,0,0,0,0,0,0,0,0,476,0,0,0,0,0,0,0,0,2023,0,0,0,0,0,1836,0,0,0,0,35,843, -0,0,0,0,0,0,0,554,0,0,0,536,625,207,0,1371,0,0,0,424,785,336,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,896,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,750,0,0,0,0,238,0,0, -0,0,0,383,0,0,0,0,0,0,0,0,603,725,11,0,0,0,0,0,0,0,0,0,476,0,0,0,0,0,1552,0,0,0, -0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -1431,0,0,13,112,0,0,356,0,0,0,0,0,0,0,0,0,0,1963,0,0,0,1244,18,0,0,0,0,0,0,867, -0,0,0,0,0,0,50,708,73,592,0,502,0,0,0,0,0,0,161,347,0,0,0,0,470,33,0,246,571,10, -0,465,614,0,237,0,0,0,0,0,24,18,0,506,0,0,0,0,0,0,33,309,0,0,0,0,0,0,0,0,0,0, -140,0,0,0,0,1056,0,0,0,1704,0,0,0,0,0,0,0,1036,0,0,0,0,0,0,0,0,0,1315,432,86, -264,524,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,107,0,0,0,0,0,123,927,0,0,957,1149,0,0, -0,0,0,778,0,502,196,0,0,0,0,1312,0,0,0,0,0,0,0,855,0,0,0,0,0,0,0,0,0,0,45,1400, -0,0,0,1003,0,0,0,0,0,1097,0,0,0,0,0,0,0,0,545,612,0,0,0,0,0,0,0,0,0,0,0,0,54,0, -0,0,0,172,0,0,0,1029,0,0,0,0,0,0,0,0,0,568,0,0,0,732,617,0,0,974,94,989,733,0,0, -0,0,0,0,1789,0,0,665,2015,0,0,0,0,0,0,806,287,0,0,0,0,0,1539,0,0,0,0,0,0,0,0,0, -0,182,1563,0,0,0,0,0,0,0,0,0,484,0,0,0,0,0,1623,0,0,0,0,0,0,0,0,878,1833,0,1569, -0,0,0,0,0,0,0,0,93,0,715,994,0,0,0,0,0,63,0,591,0,0,0,0,0,0,0,749,0,0,0,0,547, -366,0,0,0,1747,0,0,0,0,0,0,0,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1463,0,772, -893,0,0,0,48,0,0,941,0,0,690,1785,106,440,0,0,0,0,0,0,0,0,0,0,32,0,332,216,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,852,0, -0,416,564,0,918,0,1764,0,0,3,0,0,274,0,0,0,0,501,0,0,0,0,0,0,0,851,743,0,49,0, -879,0,0,47,0,0,0,0,0,0,865,0,1202,0,0,0,0,0,0,47,272,0,0,0,0,0,0,0,0,0,0,0,1455, -0,0,0,0,891,1911,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,761,0,0,0,0,0,0,0,0,0,407,0, -183,0,0,490,0,0,0,0,0,0,0,35,731,0,0,0,0,0,0,0,819,0,0,0,0,0,0,0,0,0,0,0,0,0, -575,0,0,0,0,45,818,0,0,77,222,0,0,0,0,849,1880,0,0,0,633,0,1308,0,0,0,0,0,0,0,0, -0,0,86,0,0,0,0,0,0,0,0,0,0,0,0,0,0,817,0,0,0,0,0,0,0,0,0,882,0,0,0,914,0,0,0,0, -0,0,0,0,0,0,865,0,0,426,399,58,0,0,0,0,0,0,538,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,876,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,139,566,0,63,12,0,0,0, -0,0,0,0,0,0,0,0,0,0,3,114,0,0,0,0,0,0,0,0,576,0,0,0,0,0,0,0,0,933,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,752,0,0,0,0, -0,0,0,0,375,0,1011,0,0,96,0,0,0,0,0,0,0,0,0,148,0,0,0,0,0,0,0,0,0,0,0,337,56, -666,0,246,394,0,0,0,0,0,0,0,0,437,0,0,0,506,0,0,0,0,1003,0,1163,0,328,0,0,0,0,0, -0,0,0,1000,0,0,0,0,0,744,101,0,0,0,0,0,726,0,0,176,0,146,9,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,839,0,0,0,0,0,0,223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,246,1931,29,0,0,1771,0,0,0,0,0,846,6,157,0,0,0,0,0,0,0,0,0,875,0,0,477, -773,177,639,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1747,0,0,0,0,158,873,0,659,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,391,0,0,0,0,0,0,0,0,0,0,0,0,668,883,0,78,628,0,0,0, -0,0,0,0,0,0,0,0,0,1460,0,962,0,0,0,0,0,460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,199,0, -0,0,388,474,0,271,0,333,608,0,0,0,0,0,0,49,0,988,0,707,617,0,0,0,0,0,0,0,756,0, -0,0,0,0,1583,0,0,0,0,0,0,0,0,0,0,285,0,0,0,0,0,0,0,0,0,0,0,0,0,0,344,0,0,0,0,0, -0,0,0,515,1709,0,0,0,0,0,0,0,0,404,0,0,0,0,500,0,0,0,0,0,0,0,0,0,68,216,0,0,0,0, -0,0,0,488,353,0,0,177,236,0,0,458,490,0,0,0,0,0,0,756,1504,0,757,0,1735,0,0,108, -598,0,0,0,0}; -BROTLI_INTERNAL const uint8_t kStaticDictionaryHashLengths[32768] = { -8,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,19048,0,0,0,0,0,11978,58631,0,0,0,0 +,0,0,523,0,12969,198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28197,0,47846,0,0,0,0,0,0 +,0,0,0,4549,0,0,0,0,0,0,0,0,0,0,687,14917,748,8229,0,0,0,0,0,0,2476,12935,0,0,0, +0,0,0,22792,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27528,59142,0,0,20876,20134,0,0,0, +0,440,12068,0,58951,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48038,0,0,0,60999,0,0,0,0, +0,0,0,0,0,0,0,0,0,15716,7498,5476,0,0,0,0,20202,37959,0,0,0,0,0,0,0,0,0,0,0,0, +29801,0,5451,0,0,0,0,0,0,0,0,0,0,50790,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24485,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13573,0,0,22856,0,0,0,0,21927,0,0,0,0,0 +,0,9130,0,0,0,0,0,0,13732,0,0,0,0,0,0,0,0,0,0,2282,583,0,0,0,0,0,0,0,0,0,0,3726, +26503,0,0,0,0,0,0,9258,0,0,0,0,0,0,0,0,21604,0,0,0,45574,0,0,0,0,0,20710,0,0,0, +42694,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1163,6694,0,0,0,0,0,0,0,10948,0,0,0,29700,0,0, +0,0,0,58823,3796,27399,20939,10180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +19,29287,28649,14534,0,0,16428,45607,0,0,0,0,0,0,25322,0,4908,0,0,0,0,0,0,25476, +29097,14246,11053,0,0,0,0,0,0,0,0,18502,0,0,0,44390,0,0,0,17765,0,0,0,0,0,0, +24520,0,0,0,0,0,0,0,0,0,0,17319,0,0,0,0,0,0,0,0,0,0,0,0,0,28166,0,0,0,0,0,48198, +0,0,31467,0,24585,0,0,0,0,18692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23596,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,7236,968,13637,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3763,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14791,0,0,0,12324,0,12741,0,0,0 +,0,0,0,0,0,0,11108,0,0,0,0,4009,40295,20616,4357,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +15015,0,0,0,0,0,43751,0,0,0,0,0,0,0,0,0,0,0,23013,0,0,0,0,0,0,0,0,0,0,0,0,0, +45542,0,0,0,0,0,0,0,0,0,23974,0,0,0,0,17480,20647,0,0,0,0,0,0,8876,0,0,40806,0,0 +,0,0,0,0,0,14502,17160,17764,0,0,31594,35431,0,0,2890,0,0,0,0,0,0,0,0,27524,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8228,0,56583,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,34278,0,0,0,0,0,0,0,0,0,0,0,0,0,2662,0,26724,0,0,0,0,0,0,0,64198,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22281,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3049, +54983,0,0,0,0,0,0,0,837,0,17604,0,0,0,0,0,28838,0,0,0,0,0,0,26312,0,0,3910,0,0,0 +,25830,0,0,0,0,0,8391,0,19845,19240,1092,0,0,5449,0,0,0,0,17188,0,0,0,0,0,0,0,0, +0,10629,0,0,6671,61094,5832,8358,0,0,0,55078,0,0,0,0,0,29860,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,51494,0,28647,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25989,0,0,30153,61318 +,0,0,0,0,0,0,0,24903,0,0,0,4388,0,42054,0,0,0,0,0,0,0,53158,0,0,0,0,0,0,0,50918, +0,0,0,0,0,0,26251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5929,2853,0,37126, +7372,197,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2027,934,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,55686,0,0,5672,5447,0,62758,0,0,0,0,0,0,0,0,0,0,0,0,2923,0,556,1415, +0,0,0,0,0,0,0,0,0,8645,0,9477,0,0,0,0,0,0,0,48742,0,0,0,0,0,0,0,0,0,0,24235,228, +0,0,0,0,0,0,0,0,0,0,16970,18823,0,0,0,0,0,0,0,0,0,25158,0,0,0,0,0,18567,20072, +2823,14313,1830,0,0,0,0,0,0,0,0,27048,23526,0,0,0,0,0,997,492,0,14730,16677,396, +13574,0,0,0,41671,0,0,0,0,0,0,0,19045,0,0,0,421,17545,3110,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,47111,14475,56551,0,0,0,0,0,0,0,0,0,0,3697,0,0,0,0,0,0,49382,0,35559,0, +0,0,0,40,0,11496,15621,0,8550,0,0,0,63462,0,0,0,0,0,0,0,36966,0,50406,0,46022, +1001,0,0,12069,3249,0,0,0,0,0,0,0,0,0,0,0,0,0,15241,0,0,0,0,0,0,0,0,64743,0,0,0, +0,0,58759,0,0,0,0,1136,26981,0,0,0,0,0,0,0,17732,0,0,0,17157,20011,6629,0,43879, +0,0,0,13572,25128,10759,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28676,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,875,24007,0,0,0,0,7628,0,0,0,0,0,12268,0,0,0,0,0,0,0,0,19300 +,23210,356,0,0,0,0,0,0,0,0,0,15236,0,0,0,0,0,49670,0,0,0,0,0,0,0,21764,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,13931,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45799,0,0,436,3589, +0,0,11402,0,0,0,0,0,0,0,0,0,0,62822,0,0,0,39814,588,0,0,0,0,0,0,27750,0,0,0,0,0, +0,1609,22660,2346,18951,0,16068,0,0,0,0,0,0,5162,11110,0,0,0,0,15048,1060,0,7879 +,18280,326,0,14886,19656,0,7594,0,0,0,0,0,781,581,0,16198,0,0,0,0,0,0,1078,9892, +0,0,0,0,0,0,0,0,0,0,4489,0,0,0,0,33798,0,0,0,54534,0,0,0,0,0,0,0,33158,0,0,0,0,0 +,0,0,0,0,42086,13834,2757,8456,16773,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3434,0,0,0, +0,0,3946,29668,0,0,30634,36775,0,0,0,0,0,24901,0,16069,6280,0,0,0,0,41990,0,0,0, +0,0,0,0,27365,0,0,0,0,0,0,0,0,0,0,1450,44807,0,0,0,32100,0,0,0,0,0,35110,0,0,0,0 +,0,0,0,0,17448,19591,0,0,0,0,0,0,0,0,0,0,0,0,1739,0,0,0,0,5511,0,0,0,32934,0,0,0 +,0,0,0,0,0,0,18180,0,0,0,23428,19754,0,0,31174,3021,31655,23464,0,0,0,0,0,0, +57255,0,0,21292,64487,0,0,0,0,0,0,25802,9189,0,0,0,0,0,49254,0,0,0,0,0,0,0,0,0,0 +,5837,50023,0,0,0,0,0,0,0,0,0,15495,0,0,0,0,0,51942,0,0,0,0,0,0,0,0,28104,58662, +0,50214,0,0,0,0,0,0,0,0,2988,0,22888,31812,0,0,0,0,0,2020,0,18916,0,0,0,0,0,0,0, +23973,0,0,0,0,17516,11717,0,0,0,55911,0,0,0,0,0,0,0,2855,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,46822,0,24710,28586,0,0,0,1556,0,0,30117,0,0,22090,57127,3403,14087,0 +,0,0,0,0,0,0,0,0,0,1041,0,10633,6916,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27269,0,0,13322,18055,0,29380,0,56454,0,0,120 +,0,0,8773,0,0,0,0,16040,0,0,0,0,0,0,0,27242,23781,0,1572,0,28134,0,0,1512,0,0,0, +0,0,0,27684,0,38470,0,0,0,0,0,0,1513,8709,0,0,0,0,0,0,0,0,0,0,0,46566,0,0,0,0, +28521,61159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24356,0,0,0,0,0,0,0,0,0,13028,0, +5863,0,0,15693,0,0,0,0,0,0,0,1131,23398,0,0,0,0,0,0,0,26212,0,0,0,0,0,0,0,0,0,0, +0,0,0,18404,0,0,0,0,1457,26183,0,0,2475,7110,0,0,0,0,27180,60166,0,0,0,20262,0, +41862,0,0,0,0,0,0,0,0,0,0,2762,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26148,0,0,0,0,0,0,0,0 +,0,28229,0,0,0,29254,0,0,0,0,0,0,0,0,0,0,27690,0,0,13636,12776,1862,0,0,0,0,0,0, +17225,3271,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28039,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,4457,18117,0,2023,402,0,0,0,0,0,0,0,0,0,0,0,0,0,104,3654,0,0, +0,0,0,0,0,0,18440,0,0,0,0,0,0,0,0,29861,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,22150,0,0,0,0,0,0,0,0,0,0,0,0,24074,0,0,0,0,0,0,0,0,12004,0,32358, +0,0,3081,0,0,0,0,0,0,0,0,0,4749,0,0,0,0,0,0,0,0,0,0,0,10792,1799,21322,0,7880, +12613,0,0,0,0,0,0,0,0,13993,0,0,0,16202,0,0,0,0,32102,0,37223,0,10500,0,0,0,0,0, +0,0,0,32008,0,0,0,0,0,23816,3236,0,0,0,0,0,23237,0,0,5642,0,4684,294,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,26852,0,0,0,0,0,0,7148,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,7890,61798,939,0,0,56679,0,0,0,0,0,27078,202,5029,0,0,0,0,0, +0,0,0,0,28005,0,0,15273,24741,5676,20452,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55910,0,0 +,0,0,5069,27942,0,21092,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12517,0,0,0,0,0,0, +0,0,0,0,0,0,21384,28260,0,2502,20108,0,0,0,0,0,0,0,0,0,0,0,0,46726,0,30790,0,0,0 +,0,0,14725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1099,6372,0,0,0,12422,15182,0,8683,0, +10665,19462,0,0,0,0,0,0,1590,0,31628,0,22632,19750,0,0,0,0,0,0,0,24198,0,0,0,0,0 +,50662,0,0,0,0,0,0,0,0,0,0,9131,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11015,0,0,0,0,0,0,0, +0,16490,54695,0,0,0,0,0,0,0,0,12937,0,0,0,0,16004,0,0,0,0,0,0,0,0,0,2181,6923,0, +0,0,0,0,0,0,15624,11302,0,0,5673,7559,0,0,14668,15684,0,0,0,0,0,0,24204,48134,0, +24230,0,55527,0,0,3464,19141,0,0,0,0}; #if defined(__cplusplus) || defined(c_plusplus) } /* extern "C" */ diff --git a/deps/brotli/c/enc/dictionary_hash.h b/deps/brotli/c/enc/dictionary_hash.h index e553ea5d4efb20..b3bb9599f43b33 100644 --- a/deps/brotli/c/enc/dictionary_hash.h +++ b/deps/brotli/c/enc/dictionary_hash.h @@ -15,8 +15,7 @@ extern "C" { #endif -extern const uint16_t kStaticDictionaryHashWords[32768]; -extern const uint8_t kStaticDictionaryHashLengths[32768]; +extern const uint16_t kStaticDictionaryHash[32768]; #if defined(__cplusplus) || defined(c_plusplus) } /* extern "C" */ diff --git a/deps/brotli/c/enc/encode.c b/deps/brotli/c/enc/encode.c index 8d90937b43689b..141e70aa2a3134 100644 --- a/deps/brotli/c/enc/encode.c +++ b/deps/brotli/c/enc/encode.c @@ -54,19 +54,12 @@ typedef enum BrotliEncoderStreamState { BROTLI_STREAM_METADATA_BODY = 4 } BrotliEncoderStreamState; -typedef enum BrotliEncoderFlintState { - BROTLI_FLINT_NEEDS_2_BYTES = 2, - BROTLI_FLINT_NEEDS_1_BYTE = 1, - BROTLI_FLINT_WAITING_FOR_PROCESSING = 0, - BROTLI_FLINT_WAITING_FOR_FLUSHING = -1, - BROTLI_FLINT_DONE = -2 -} BrotliEncoderFlintState; - typedef struct BrotliEncoderStateStruct { BrotliEncoderParams params; MemoryManager memory_manager_; + HasherHandle hasher_; uint64_t input_pos_; RingBuffer ringbuffer_; size_t cmd_alloc_size_; @@ -80,17 +73,10 @@ typedef struct BrotliEncoderStateStruct { int saved_dist_cache_[4]; uint16_t last_bytes_; uint8_t last_bytes_bits_; - /* "Flint" is a tiny uncompressed block emitted before the continuation - block to unwire literal context from previous data. Despite being int8_t, - field is actually BrotliEncoderFlintState enum. */ - int8_t flint_; uint8_t prev_byte_; uint8_t prev_byte2_; size_t storage_size_; uint8_t* storage_; - - Hasher hasher_; - /* Hash table for FAST_ONE_PASS_COMPRESSION_QUALITY mode. */ int small_table_[1 << 10]; /* 4KiB */ int* large_table_; /* Allocated only when needed */ @@ -128,6 +114,8 @@ typedef struct BrotliEncoderStateStruct { BROTLI_BOOL is_initialized_; } BrotliEncoderStateStruct; +static BROTLI_BOOL EnsureInitialized(BrotliEncoderState* s); + static size_t InputBlockSize(BrotliEncoderState* s) { return (size_t)1 << s->params.lgblock; } @@ -186,11 +174,6 @@ BROTLI_BOOL BrotliEncoderSetParameter( state->params.dist.num_direct_distance_codes = value; return BROTLI_TRUE; - case BROTLI_PARAM_STREAM_OFFSET: - if (value > (1u << 30)) return BROTLI_FALSE; - state->params.stream_offset = value; - return BROTLI_TRUE; - default: return BROTLI_FALSE; } } @@ -212,7 +195,7 @@ static uint8_t* GetBrotliStorage(BrotliEncoderState* s, size_t size) { if (s->storage_size_ < size) { BROTLI_FREE(m, s->storage_); s->storage_ = BROTLI_ALLOC(m, uint8_t, size); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(s->storage_)) return NULL; + if (BROTLI_IS_OOM(m)) return NULL; s->storage_size_ = size; } return s->storage_; @@ -251,7 +234,7 @@ static int* GetHashTable(BrotliEncoderState* s, int quality, s->large_table_size_ = htsize; BROTLI_FREE(m, s->large_table_); s->large_table_ = BROTLI_ALLOC(m, int, htsize); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(s->large_table_)) return 0; + if (BROTLI_IS_OOM(m)) return 0; } table = s->large_table_; } @@ -516,7 +499,7 @@ static BROTLI_BOOL ShouldCompress( /* TODO: find more precise minimal block overhead. */ if (bytes <= 2) return BROTLI_FALSE; if (num_commands < (bytes >> 8) + 2) { - if ((double)num_literals > 0.99 * (double)bytes) { + if (num_literals > 0.99 * (double)bytes) { uint32_t literal_histo[256] = { 0 }; static const uint32_t kSampleRate = 13; static const double kMinEntropy = 7.92; @@ -634,7 +617,11 @@ static void WriteMetaBlockInternal(MemoryManager* m, /* The number of distance symbols effectively used for distance histograms. It might be less than distance alphabet size for "Large Window Brotli" (32-bit). */ - BrotliOptimizeHistograms(block_params.dist.alphabet_size_limit, &mb); + uint32_t num_effective_dist_codes = block_params.dist.alphabet_size; + if (num_effective_dist_codes > BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS) { + num_effective_dist_codes = BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS; + } + BrotliOptimizeHistograms(num_effective_dist_codes, &mb); } BrotliStoreMetaBlock(m, data, wrapped_last_flush_pos, bytes, mask, prev_byte, prev_byte2, @@ -691,23 +678,12 @@ static BROTLI_BOOL EnsureInitialized(BrotliEncoderState* s) { s->last_bytes_bits_ = 0; s->last_bytes_ = 0; - s->flint_ = BROTLI_FLINT_DONE; s->remaining_metadata_bytes_ = BROTLI_UINT32_MAX; SanitizeParams(&s->params); s->params.lgblock = ComputeLgBlock(&s->params); ChooseDistanceParams(&s->params); - if (s->params.stream_offset != 0) { - s->flint_ = BROTLI_FLINT_NEEDS_2_BYTES; - /* Poison the distance cache. -16 +- 3 is still less than zero (invalid). */ - s->dist_cache_[0] = -16; - s->dist_cache_[1] = -16; - s->dist_cache_[2] = -16; - s->dist_cache_[3] = -16; - memcpy(s->saved_dist_cache_, s->dist_cache_, sizeof(s->saved_dist_cache_)); - } - RingBufferSetup(&s->params, &s->ringbuffer_); /* Initialize last byte with stream header. */ @@ -717,14 +693,8 @@ static BROTLI_BOOL EnsureInitialized(BrotliEncoderState* s) { s->params.quality == FAST_TWO_PASS_COMPRESSION_QUALITY) { lgwin = BROTLI_MAX(int, lgwin, 18); } - if (s->params.stream_offset == 0) { - EncodeWindowBits(lgwin, s->params.large_window, - &s->last_bytes_, &s->last_bytes_bits_); - } else { - /* Bigger values have the same effect, but could cause overflows. */ - s->params.stream_offset = BROTLI_MIN(size_t, - s->params.stream_offset, BROTLI_MAX_BACKWARD_LIMIT(lgwin)); - } + EncodeWindowBits(lgwin, s->params.large_window, + &s->last_bytes_, &s->last_bytes_bits_); } if (s->params.quality == FAST_ONE_PASS_COMPRESSION_QUALITY) { @@ -742,15 +712,13 @@ static void BrotliEncoderInitParams(BrotliEncoderParams* params) { params->quality = BROTLI_DEFAULT_QUALITY; params->lgwin = BROTLI_DEFAULT_WINDOW; params->lgblock = 0; - params->stream_offset = 0; params->size_hint = 0; params->disable_literal_context_modeling = BROTLI_FALSE; BrotliInitEncoderDictionary(¶ms->dictionary); params->dist.distance_postfix_bits = 0; params->dist.num_direct_distance_codes = 0; - params->dist.alphabet_size_max = + params->dist.alphabet_size = BROTLI_DISTANCE_ALPHABET_SIZE(0, 0, BROTLI_MAX_DISTANCE_BITS); - params->dist.alphabet_size_limit = params->dist.alphabet_size_max; params->dist.max_distance = BROTLI_MAX_DISTANCE; } @@ -766,7 +734,7 @@ static void BrotliEncoderInitState(BrotliEncoderState* s) { s->prev_byte2_ = 0; s->storage_size_ = 0; s->storage_ = 0; - HasherInit(&s->hasher_); + s->hasher_ = NULL; s->large_table_ = NULL; s->large_table_size_ = 0; s->cmd_code_numbits_ = 0; @@ -934,7 +902,6 @@ static void ExtendLastCommand(BrotliEncoderState* s, uint32_t* bytes, (*bytes)--; (*wrapped_last_processed_pos)++; } - } else { } /* The copy length is at most the metablock size, and thus expressible. */ GetLengthCode(last_command->insert_len_, @@ -967,7 +934,6 @@ static BROTLI_BOOL EncodeData( uint32_t mask; MemoryManager* m = &s->memory_manager_; ContextType literal_context_mode; - ContextLut literal_context_lut; data = s->ringbuffer_.buffer_; mask = s->ringbuffer_.mask_; @@ -985,10 +951,7 @@ static BROTLI_BOOL EncodeData( BROTLI_ALLOC(m, uint32_t, kCompressFragmentTwoPassBlockSize); s->literal_buf_ = BROTLI_ALLOC(m, uint8_t, kCompressFragmentTwoPassBlockSize); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(s->command_buf_) || - BROTLI_IS_NULL(s->literal_buf_)) { - return BROTLI_FALSE; - } + if (BROTLI_IS_OOM(m)) return BROTLI_FALSE; } if (s->params.quality == FAST_ONE_PASS_COMPRESSION_QUALITY || @@ -1046,7 +1009,7 @@ static BROTLI_BOOL EncodeData( newsize += (bytes / 4) + 16; s->cmd_alloc_size_ = newsize; new_commands = BROTLI_ALLOC(m, Command, newsize); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(new_commands)) return BROTLI_FALSE; + if (BROTLI_IS_OOM(m)) return BROTLI_FALSE; if (s->commands_) { memcpy(new_commands, s->commands_, sizeof(Command) * s->num_commands_); BROTLI_FREE(m, s->commands_); @@ -1061,7 +1024,6 @@ static BROTLI_BOOL EncodeData( literal_context_mode = ChooseContextMode( &s->params, data, WrapPosition(s->last_flush_pos_), mask, (size_t)(s->input_pos_ - s->last_flush_pos_)); - literal_context_lut = BROTLI_CONTEXT_LUT(literal_context_mode); if (BROTLI_IS_OOM(m)) return BROTLI_FALSE; @@ -1072,23 +1034,20 @@ static BROTLI_BOOL EncodeData( if (s->params.quality == ZOPFLIFICATION_QUALITY) { BROTLI_DCHECK(s->params.hasher.type == 10); BrotliCreateZopfliBackwardReferences(m, bytes, wrapped_last_processed_pos, - data, mask, literal_context_lut, &s->params, - &s->hasher_, s->dist_cache_, + data, mask, &s->params, s->hasher_, s->dist_cache_, &s->last_insert_len_, &s->commands_[s->num_commands_], &s->num_commands_, &s->num_literals_); if (BROTLI_IS_OOM(m)) return BROTLI_FALSE; } else if (s->params.quality == HQ_ZOPFLIFICATION_QUALITY) { BROTLI_DCHECK(s->params.hasher.type == 10); BrotliCreateHqZopfliBackwardReferences(m, bytes, wrapped_last_processed_pos, - data, mask, literal_context_lut, &s->params, - &s->hasher_, s->dist_cache_, + data, mask, &s->params, s->hasher_, s->dist_cache_, &s->last_insert_len_, &s->commands_[s->num_commands_], &s->num_commands_, &s->num_literals_); if (BROTLI_IS_OOM(m)) return BROTLI_FALSE; } else { BrotliCreateBackwardReferences(bytes, wrapped_last_processed_pos, - data, mask, literal_context_lut, &s->params, - &s->hasher_, s->dist_cache_, + data, mask, &s->params, s->hasher_, s->dist_cache_, &s->last_insert_len_, &s->commands_[s->num_commands_], &s->num_commands_, &s->num_literals_); } @@ -1113,7 +1072,7 @@ static BROTLI_BOOL EncodeData( s->num_commands_ < max_commands) { /* Merge with next input block. Everything will happen later. */ if (UpdateLastProcessedPos(s)) { - HasherReset(&s->hasher_); + HasherReset(s->hasher_); } *out_size = 0; return BROTLI_TRUE; @@ -1154,7 +1113,7 @@ static BROTLI_BOOL EncodeData( s->last_bytes_bits_ = storage_ix & 7u; s->last_flush_pos_ = s->input_pos_; if (UpdateLastProcessedPos(s)) { - HasherReset(&s->hasher_); + HasherReset(s->hasher_); } if (s->last_flush_pos_ > 0) { s->prev_byte_ = data[((uint32_t)s->last_flush_pos_ - 1) & mask]; @@ -1215,6 +1174,7 @@ static BROTLI_BOOL BrotliCompressBufferQuality10( size_t total_out_size = 0; uint16_t last_bytes; uint8_t last_bytes_bits; + HasherHandle hasher = NULL; const size_t hasher_eff_size = BROTLI_MIN(size_t, input_size, BROTLI_MAX_BACKWARD_LIMIT(lgwin) + BROTLI_WINDOW_GAP); @@ -1230,9 +1190,6 @@ static BROTLI_BOOL BrotliCompressBufferQuality10( uint8_t prev_byte = 0; uint8_t prev_byte2 = 0; - Hasher hasher; - HasherInit(&hasher); - BrotliEncoderInitParams(¶ms); params.quality = 10; params.lgwin = lgwin; @@ -1269,7 +1226,6 @@ static BROTLI_BOOL BrotliCompressBufferQuality10( ContextType literal_context_mode = ChooseContextMode(¶ms, input_buffer, metablock_start, mask, metablock_end - metablock_start); - ContextLut literal_context_lut = BROTLI_CONTEXT_LUT(literal_context_mode); size_t block_start; for (block_start = metablock_start; block_start < metablock_end; ) { @@ -1278,12 +1234,12 @@ static BROTLI_BOOL BrotliCompressBufferQuality10( ZopfliNode* nodes = BROTLI_ALLOC(m, ZopfliNode, block_size + 1); size_t path_size; size_t new_cmd_alloc_size; - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(nodes)) goto oom; + if (BROTLI_IS_OOM(m)) goto oom; BrotliInitZopfliNodes(nodes, block_size + 1); - StitchToPreviousBlockH10(&hasher.privat._H10, block_size, block_start, + StitchToPreviousBlockH10(hasher, block_size, block_start, input_buffer, mask); path_size = BrotliZopfliComputeShortestPath(m, block_size, block_start, - input_buffer, mask, literal_context_lut, ¶ms, dist_cache, &hasher, + input_buffer, mask, ¶ms, dist_cache, hasher, nodes); if (BROTLI_IS_OOM(m)) goto oom; /* We allocate a command buffer in the first iteration of this loop that @@ -1298,7 +1254,7 @@ static BROTLI_BOOL BrotliCompressBufferQuality10( num_commands + path_size + 1); if (cmd_alloc_size != new_cmd_alloc_size) { Command* new_commands = BROTLI_ALLOC(m, Command, new_cmd_alloc_size); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(new_commands)) goto oom; + if (BROTLI_IS_OOM(m)) goto oom; cmd_alloc_size = new_cmd_alloc_size; if (commands) { memcpy(new_commands, commands, sizeof(Command) * num_commands); @@ -1330,7 +1286,7 @@ static BROTLI_BOOL BrotliCompressBufferQuality10( if (metablock_size == 0) { /* Write the ISLAST and ISEMPTY bits. */ storage = BROTLI_ALLOC(m, uint8_t, 16); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(storage)) goto oom; + if (BROTLI_IS_OOM(m)) goto oom; storage[0] = (uint8_t)last_bytes; storage[1] = (uint8_t)(last_bytes >> 8); BrotliWriteBits(2, 3, &storage_ix, storage); @@ -1341,7 +1297,7 @@ static BROTLI_BOOL BrotliCompressBufferQuality10( CreateBackwardReferences is now unused. */ memcpy(dist_cache, saved_dist_cache, 4 * sizeof(dist_cache[0])); storage = BROTLI_ALLOC(m, uint8_t, metablock_size + 16); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(storage)) goto oom; + if (BROTLI_IS_OOM(m)) goto oom; storage[0] = (uint8_t)last_bytes; storage[1] = (uint8_t)(last_bytes >> 8); BrotliStoreUncompressedMetaBlock(is_last, input_buffer, @@ -1362,10 +1318,14 @@ static BROTLI_BOOL BrotliCompressBufferQuality10( /* The number of distance symbols effectively used for distance histograms. It might be less than distance alphabet size for "Large Window Brotli" (32-bit). */ - BrotliOptimizeHistograms(block_params.dist.alphabet_size_limit, &mb); + uint32_t num_effective_dist_codes = block_params.dist.alphabet_size; + if (num_effective_dist_codes > BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS) { + num_effective_dist_codes = BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS; + } + BrotliOptimizeHistograms(num_effective_dist_codes, &mb); } storage = BROTLI_ALLOC(m, uint8_t, 2 * metablock_size + 503); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(storage)) goto oom; + if (BROTLI_IS_OOM(m)) goto oom; storage[0] = (uint8_t)last_bytes; storage[1] = (uint8_t)(last_bytes >> 8); BrotliStoreMetaBlock(m, input_buffer, metablock_start, metablock_size, @@ -1616,10 +1576,7 @@ static BROTLI_BOOL BrotliEncoderCompressStreamFast( BROTLI_ALLOC(m, uint32_t, kCompressFragmentTwoPassBlockSize); s->literal_buf_ = BROTLI_ALLOC(m, uint8_t, kCompressFragmentTwoPassBlockSize); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(s->command_buf_) || - BROTLI_IS_NULL(s->literal_buf_)) { - return BROTLI_FALSE; - } + if (BROTLI_IS_OOM(m)) return BROTLI_FALSE; } if (s->command_buf_) { command_buf = s->command_buf_; @@ -1627,10 +1584,7 @@ static BROTLI_BOOL BrotliEncoderCompressStreamFast( } else { tmp_command_buf = BROTLI_ALLOC(m, uint32_t, buf_size); tmp_literal_buf = BROTLI_ALLOC(m, uint8_t, buf_size); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(tmp_command_buf) || - BROTLI_IS_NULL(tmp_literal_buf)) { - return BROTLI_FALSE; - } + if (BROTLI_IS_OOM(m)) return BROTLI_FALSE; command_buf = tmp_command_buf; literal_buf = tmp_literal_buf; } @@ -1686,10 +1640,8 @@ static BROTLI_BOOL BrotliEncoderCompressStreamFast( &storage_ix, storage); if (BROTLI_IS_OOM(m)) return BROTLI_FALSE; } - if (block_size != 0) { - *next_in += block_size; - *available_in -= block_size; - } + *next_in += block_size; + *available_in -= block_size; if (inplace) { size_t out_bytes = storage_ix >> 3; BROTLI_DCHECK(out_bytes <= *available_out); @@ -1834,10 +1786,6 @@ BROTLI_BOOL BrotliEncoderCompressStream( } while (BROTLI_TRUE) { size_t remaining_block_size = RemainingInputBlockSize(s); - /* Shorten input to flint size. */ - if (s->flint_ >= 0 && remaining_block_size > (size_t)s->flint_) { - remaining_block_size = (size_t)s->flint_; - } if (remaining_block_size != 0 && *available_in != 0) { size_t copy_input_size = @@ -1845,18 +1793,10 @@ BROTLI_BOOL BrotliEncoderCompressStream( CopyInputToRingBuffer(s, copy_input_size, *next_in); *next_in += copy_input_size; *available_in -= copy_input_size; - if (s->flint_ > 0) s->flint_ = (int8_t)(s->flint_ - (int)copy_input_size); continue; } if (InjectFlushOrPushOutput(s, available_out, next_out, total_out)) { - /* Exit the "emit flint" workflow. */ - if (s->flint_ == BROTLI_FLINT_WAITING_FOR_FLUSHING) { - CheckFlushComplete(s); - if (s->stream_state_ == BROTLI_STREAM_PROCESSING) { - s->flint_ = BROTLI_FLINT_DONE; - } - } continue; } @@ -1870,11 +1810,6 @@ BROTLI_BOOL BrotliEncoderCompressStream( BROTLI_BOOL force_flush = TO_BROTLI_BOOL( (*available_in == 0) && op == BROTLI_OPERATION_FLUSH); BROTLI_BOOL result; - /* Force emitting (uncompressed) piece containing flint. */ - if (!is_last && s->flint_ == 0) { - s->flint_ = BROTLI_FLINT_WAITING_FOR_FLUSHING; - force_flush = BROTLI_TRUE; - } UpdateSizeHint(s, *available_in); result = EncodeData(s, is_last, force_flush, &s->available_out_, &s->next_out_); diff --git a/deps/brotli/c/enc/encoder_dict.c b/deps/brotli/c/enc/encoder_dict.c index c9e963b89d202e..8b2f6ad4a4753d 100644 --- a/deps/brotli/c/enc/encoder_dict.c +++ b/deps/brotli/c/enc/encoder_dict.c @@ -17,15 +17,14 @@ extern "C" { void BrotliInitEncoderDictionary(BrotliEncoderDictionary* dict) { dict->words = BrotliGetDictionary(); - dict->num_transforms = (uint32_t)BrotliGetTransforms()->num_transforms; - dict->hash_table_words = kStaticDictionaryHashWords; - dict->hash_table_lengths = kStaticDictionaryHashLengths; + dict->hash_table = kStaticDictionaryHash; dict->buckets = kStaticDictionaryBuckets; dict->dict_words = kStaticDictionaryWords; dict->cutoffTransformsCount = kCutoffTransformsCount; dict->cutoffTransforms = kCutoffTransforms; + } #if defined(__cplusplus) || defined(c_plusplus) diff --git a/deps/brotli/c/enc/encoder_dict.h b/deps/brotli/c/enc/encoder_dict.h index a1c329fbf498a1..3cb6b0ac152b4c 100644 --- a/deps/brotli/c/enc/encoder_dict.h +++ b/deps/brotli/c/enc/encoder_dict.h @@ -19,15 +19,13 @@ extern "C" { /* Dictionary data (words and transforms) for 1 possible context */ typedef struct BrotliEncoderDictionary { const BrotliDictionary* words; - uint32_t num_transforms; /* cut off for fast encoder */ uint32_t cutoffTransformsCount; uint64_t cutoffTransforms; /* from dictionary_hash.h, for fast encoder */ - const uint16_t* hash_table_words; - const uint8_t* hash_table_lengths; + const uint16_t* hash_table; /* from static_dict_lut.h, for slow encoder */ const uint16_t* buckets; diff --git a/deps/brotli/c/enc/entropy_encode.c b/deps/brotli/c/enc/entropy_encode.c index b50ccb5d1f69a5..97f9dfb82aa6ef 100644 --- a/deps/brotli/c/enc/entropy_encode.c +++ b/deps/brotli/c/enc/entropy_encode.c @@ -18,8 +18,6 @@ extern "C" { #endif -const size_t kBrotliShellGaps[] = {132, 57, 23, 10, 4, 1}; - BROTLI_BOOL BrotliSetDepth( int p0, HuffmanTree* pool, uint8_t* depth, int max_depth) { int stack[16]; diff --git a/deps/brotli/c/enc/entropy_encode.h b/deps/brotli/c/enc/entropy_encode.h index 9618e1d3592eb9..f23d9c379d0613 100644 --- a/deps/brotli/c/enc/entropy_encode.h +++ b/deps/brotli/c/enc/entropy_encode.h @@ -76,12 +76,12 @@ BROTLI_INTERNAL void BrotliConvertBitDepthsToSymbols(const uint8_t* depth, size_t len, uint16_t* bits); -BROTLI_INTERNAL extern const size_t kBrotliShellGaps[6]; /* Input size optimized Shell sort. */ typedef BROTLI_BOOL (*HuffmanTreeComparator)( const HuffmanTree*, const HuffmanTree*); static BROTLI_INLINE void SortHuffmanTreeItems(HuffmanTree* items, const size_t n, HuffmanTreeComparator comparator) { + static const size_t gaps[] = {132, 57, 23, 10, 4, 1}; if (n < 13) { /* Insertion sort. */ size_t i; @@ -101,7 +101,7 @@ static BROTLI_INLINE void SortHuffmanTreeItems(HuffmanTree* items, /* Shell sort. */ int g = n < 57 ? 2 : 0; for (; g < 6; ++g) { - size_t gap = kBrotliShellGaps[g]; + size_t gap = gaps[g]; size_t i; for (i = gap; i < n; ++i) { size_t j = i; diff --git a/deps/brotli/c/enc/fast_log.c b/deps/brotli/c/enc/fast_log.c deleted file mode 100644 index 2319baeb74093d..00000000000000 --- a/deps/brotli/c/enc/fast_log.c +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright 2013 Google Inc. All Rights Reserved. - - Distributed under MIT license. - See file LICENSE for detail or copy at https://opensource.org/licenses/MIT -*/ - -#include "./fast_log.h" - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -/* ", ".join(["%.16ff" % x for x in [0.0]+[log2(x) for x in range(1, 256)]]) */ -const double kBrotliLog2Table[BROTLI_LOG2_TABLE_SIZE] = { - 0.0000000000000000f, 0.0000000000000000f, 1.0000000000000000f, - 1.5849625007211563f, 2.0000000000000000f, 2.3219280948873622f, - 2.5849625007211561f, 2.8073549220576042f, 3.0000000000000000f, - 3.1699250014423126f, 3.3219280948873626f, 3.4594316186372978f, - 3.5849625007211565f, 3.7004397181410922f, 3.8073549220576037f, - 3.9068905956085187f, 4.0000000000000000f, 4.0874628412503400f, - 4.1699250014423122f, 4.2479275134435852f, 4.3219280948873626f, - 4.3923174227787607f, 4.4594316186372973f, 4.5235619560570131f, - 4.5849625007211570f, 4.6438561897747244f, 4.7004397181410926f, - 4.7548875021634691f, 4.8073549220576037f, 4.8579809951275728f, - 4.9068905956085187f, 4.9541963103868758f, 5.0000000000000000f, - 5.0443941193584534f, 5.0874628412503400f, 5.1292830169449664f, - 5.1699250014423122f, 5.2094533656289501f, 5.2479275134435852f, - 5.2854022188622487f, 5.3219280948873626f, 5.3575520046180838f, - 5.3923174227787607f, 5.4262647547020979f, 5.4594316186372973f, - 5.4918530963296748f, 5.5235619560570131f, 5.5545888516776376f, - 5.5849625007211570f, 5.6147098441152083f, 5.6438561897747244f, - 5.6724253419714961f, 5.7004397181410926f, 5.7279204545631996f, - 5.7548875021634691f, 5.7813597135246599f, 5.8073549220576046f, - 5.8328900141647422f, 5.8579809951275719f, 5.8826430493618416f, - 5.9068905956085187f, 5.9307373375628867f, 5.9541963103868758f, - 5.9772799234999168f, 6.0000000000000000f, 6.0223678130284544f, - 6.0443941193584534f, 6.0660891904577721f, 6.0874628412503400f, - 6.1085244567781700f, 6.1292830169449672f, 6.1497471195046822f, - 6.1699250014423122f, 6.1898245588800176f, 6.2094533656289510f, - 6.2288186904958804f, 6.2479275134435861f, 6.2667865406949019f, - 6.2854022188622487f, 6.3037807481771031f, 6.3219280948873617f, - 6.3398500028846252f, 6.3575520046180847f, 6.3750394313469254f, - 6.3923174227787598f, 6.4093909361377026f, 6.4262647547020979f, - 6.4429434958487288f, 6.4594316186372982f, 6.4757334309663976f, - 6.4918530963296748f, 6.5077946401986964f, 6.5235619560570131f, - 6.5391588111080319f, 6.5545888516776376f, 6.5698556083309478f, - 6.5849625007211561f, 6.5999128421871278f, 6.6147098441152092f, - 6.6293566200796095f, 6.6438561897747253f, 6.6582114827517955f, - 6.6724253419714952f, 6.6865005271832185f, 6.7004397181410917f, - 6.7142455176661224f, 6.7279204545631988f, 6.7414669864011465f, - 6.7548875021634691f, 6.7681843247769260f, 6.7813597135246599f, - 6.7944158663501062f, 6.8073549220576037f, 6.8201789624151887f, - 6.8328900141647422f, 6.8454900509443757f, 6.8579809951275719f, - 6.8703647195834048f, 6.8826430493618416f, 6.8948177633079437f, - 6.9068905956085187f, 6.9188632372745955f, 6.9307373375628867f, - 6.9425145053392399f, 6.9541963103868758f, 6.9657842846620879f, - 6.9772799234999168f, 6.9886846867721664f, 7.0000000000000000f, - 7.0112272554232540f, 7.0223678130284544f, 7.0334230015374501f, - 7.0443941193584534f, 7.0552824355011898f, 7.0660891904577721f, - 7.0768155970508317f, 7.0874628412503400f, 7.0980320829605272f, - 7.1085244567781700f, 7.1189410727235076f, 7.1292830169449664f, - 7.1395513523987937f, 7.1497471195046822f, 7.1598713367783891f, - 7.1699250014423130f, 7.1799090900149345f, 7.1898245588800176f, - 7.1996723448363644f, 7.2094533656289492f, 7.2191685204621621f, - 7.2288186904958804f, 7.2384047393250794f, 7.2479275134435861f, - 7.2573878426926521f, 7.2667865406949019f, 7.2761244052742384f, - 7.2854022188622487f, 7.2946207488916270f, 7.3037807481771031f, - 7.3128829552843557f, 7.3219280948873617f, 7.3309168781146177f, - 7.3398500028846243f, 7.3487281542310781f, 7.3575520046180847f, - 7.3663222142458151f, 7.3750394313469254f, 7.3837042924740528f, - 7.3923174227787607f, 7.4008794362821844f, 7.4093909361377026f, - 7.4178525148858991f, 7.4262647547020979f, 7.4346282276367255f, - 7.4429434958487288f, 7.4512111118323299f, 7.4594316186372973f, - 7.4676055500829976f, 7.4757334309663976f, 7.4838157772642564f, - 7.4918530963296748f, 7.4998458870832057f, 7.5077946401986964f, - 7.5156998382840436f, 7.5235619560570131f, 7.5313814605163119f, - 7.5391588111080319f, 7.5468944598876373f, 7.5545888516776376f, - 7.5622424242210728f, 7.5698556083309478f, 7.5774288280357487f, - 7.5849625007211561f, 7.5924570372680806f, 7.5999128421871278f, - 7.6073303137496113f, 7.6147098441152075f, 7.6220518194563764f, - 7.6293566200796095f, 7.6366246205436488f, 7.6438561897747244f, - 7.6510516911789290f, 7.6582114827517955f, 7.6653359171851765f, - 7.6724253419714952f, 7.6794800995054464f, 7.6865005271832185f, - 7.6934869574993252f, 7.7004397181410926f, 7.7073591320808825f, - 7.7142455176661224f, 7.7210991887071856f, 7.7279204545631996f, - 7.7347096202258392f, 7.7414669864011465f, 7.7481928495894596f, - 7.7548875021634691f, 7.7615512324444795f, 7.7681843247769260f, - 7.7747870596011737f, 7.7813597135246608f, 7.7879025593914317f, - 7.7944158663501062f, 7.8008998999203047f, 7.8073549220576037f, - 7.8137811912170374f, 7.8201789624151887f, 7.8265484872909159f, - 7.8328900141647422f, 7.8392037880969445f, 7.8454900509443757f, - 7.8517490414160571f, 7.8579809951275719f, 7.8641861446542798f, - 7.8703647195834048f, 7.8765169465650002f, 7.8826430493618425f, - 7.8887432488982601f, 7.8948177633079446f, 7.9008668079807496f, - 7.9068905956085187f, 7.9128893362299619f, 7.9188632372745955f, - 7.9248125036057813f, 7.9307373375628867f, 7.9366379390025719f, - 7.9425145053392399f, 7.9483672315846778f, 7.9541963103868758f, - 7.9600019320680806f, 7.9657842846620870f, 7.9715435539507720f, - 7.9772799234999168f, 7.9829935746943104f, 7.9886846867721664f, - 7.9943534368588578f -}; - -#if defined(__cplusplus) || defined(c_plusplus) -} /* extern "C" */ -#endif diff --git a/deps/brotli/c/enc/fast_log.h b/deps/brotli/c/enc/fast_log.h index 2094f13e5569f6..cade1235adeb7a 100644 --- a/deps/brotli/c/enc/fast_log.h +++ b/deps/brotli/c/enc/fast_log.h @@ -19,8 +19,10 @@ extern "C" { #endif static BROTLI_INLINE uint32_t Log2FloorNonZero(size_t n) { -#if defined(BROTLI_BSR32) - return BROTLI_BSR32((uint32_t)n); + /* TODO: generalize and move to platform.h */ +#if BROTLI_GNUC_HAS_BUILTIN(__builtin_clz, 3, 4, 0) || \ + BROTLI_INTEL_VERSION_CHECK(16, 0, 0) + return 31u ^ (uint32_t)__builtin_clz((uint32_t)n); #else uint32_t result = 0; while (n >>= 1) result++; @@ -28,31 +30,110 @@ static BROTLI_INLINE uint32_t Log2FloorNonZero(size_t n) { #endif } -#define BROTLI_LOG2_TABLE_SIZE 256 - /* A lookup table for small values of log2(int) to be used in entropy - computation. */ -BROTLI_INTERNAL extern const double kBrotliLog2Table[BROTLI_LOG2_TABLE_SIZE]; + computation. -/* Visual Studio 2012 and Android API levels < 18 do not have the log2() - * function defined, so we use log() and a multiplication instead. */ -#if !defined(BROTLI_HAVE_LOG2) -#if ((defined(_MSC_VER) && _MSC_VER <= 1700) || \ - (defined(__ANDROID_API__) && __ANDROID_API__ < 18)) -#define BROTLI_HAVE_LOG2 0 -#else -#define BROTLI_HAVE_LOG2 1 -#endif -#endif + ", ".join(["%.16ff" % x for x in [0.0]+[log2(x) for x in range(1, 256)]]) */ +static const float kLog2Table[] = { + 0.0000000000000000f, 0.0000000000000000f, 1.0000000000000000f, + 1.5849625007211563f, 2.0000000000000000f, 2.3219280948873622f, + 2.5849625007211561f, 2.8073549220576042f, 3.0000000000000000f, + 3.1699250014423126f, 3.3219280948873626f, 3.4594316186372978f, + 3.5849625007211565f, 3.7004397181410922f, 3.8073549220576037f, + 3.9068905956085187f, 4.0000000000000000f, 4.0874628412503400f, + 4.1699250014423122f, 4.2479275134435852f, 4.3219280948873626f, + 4.3923174227787607f, 4.4594316186372973f, 4.5235619560570131f, + 4.5849625007211570f, 4.6438561897747244f, 4.7004397181410926f, + 4.7548875021634691f, 4.8073549220576037f, 4.8579809951275728f, + 4.9068905956085187f, 4.9541963103868758f, 5.0000000000000000f, + 5.0443941193584534f, 5.0874628412503400f, 5.1292830169449664f, + 5.1699250014423122f, 5.2094533656289501f, 5.2479275134435852f, + 5.2854022188622487f, 5.3219280948873626f, 5.3575520046180838f, + 5.3923174227787607f, 5.4262647547020979f, 5.4594316186372973f, + 5.4918530963296748f, 5.5235619560570131f, 5.5545888516776376f, + 5.5849625007211570f, 5.6147098441152083f, 5.6438561897747244f, + 5.6724253419714961f, 5.7004397181410926f, 5.7279204545631996f, + 5.7548875021634691f, 5.7813597135246599f, 5.8073549220576046f, + 5.8328900141647422f, 5.8579809951275719f, 5.8826430493618416f, + 5.9068905956085187f, 5.9307373375628867f, 5.9541963103868758f, + 5.9772799234999168f, 6.0000000000000000f, 6.0223678130284544f, + 6.0443941193584534f, 6.0660891904577721f, 6.0874628412503400f, + 6.1085244567781700f, 6.1292830169449672f, 6.1497471195046822f, + 6.1699250014423122f, 6.1898245588800176f, 6.2094533656289510f, + 6.2288186904958804f, 6.2479275134435861f, 6.2667865406949019f, + 6.2854022188622487f, 6.3037807481771031f, 6.3219280948873617f, + 6.3398500028846252f, 6.3575520046180847f, 6.3750394313469254f, + 6.3923174227787598f, 6.4093909361377026f, 6.4262647547020979f, + 6.4429434958487288f, 6.4594316186372982f, 6.4757334309663976f, + 6.4918530963296748f, 6.5077946401986964f, 6.5235619560570131f, + 6.5391588111080319f, 6.5545888516776376f, 6.5698556083309478f, + 6.5849625007211561f, 6.5999128421871278f, 6.6147098441152092f, + 6.6293566200796095f, 6.6438561897747253f, 6.6582114827517955f, + 6.6724253419714952f, 6.6865005271832185f, 6.7004397181410917f, + 6.7142455176661224f, 6.7279204545631988f, 6.7414669864011465f, + 6.7548875021634691f, 6.7681843247769260f, 6.7813597135246599f, + 6.7944158663501062f, 6.8073549220576037f, 6.8201789624151887f, + 6.8328900141647422f, 6.8454900509443757f, 6.8579809951275719f, + 6.8703647195834048f, 6.8826430493618416f, 6.8948177633079437f, + 6.9068905956085187f, 6.9188632372745955f, 6.9307373375628867f, + 6.9425145053392399f, 6.9541963103868758f, 6.9657842846620879f, + 6.9772799234999168f, 6.9886846867721664f, 7.0000000000000000f, + 7.0112272554232540f, 7.0223678130284544f, 7.0334230015374501f, + 7.0443941193584534f, 7.0552824355011898f, 7.0660891904577721f, + 7.0768155970508317f, 7.0874628412503400f, 7.0980320829605272f, + 7.1085244567781700f, 7.1189410727235076f, 7.1292830169449664f, + 7.1395513523987937f, 7.1497471195046822f, 7.1598713367783891f, + 7.1699250014423130f, 7.1799090900149345f, 7.1898245588800176f, + 7.1996723448363644f, 7.2094533656289492f, 7.2191685204621621f, + 7.2288186904958804f, 7.2384047393250794f, 7.2479275134435861f, + 7.2573878426926521f, 7.2667865406949019f, 7.2761244052742384f, + 7.2854022188622487f, 7.2946207488916270f, 7.3037807481771031f, + 7.3128829552843557f, 7.3219280948873617f, 7.3309168781146177f, + 7.3398500028846243f, 7.3487281542310781f, 7.3575520046180847f, + 7.3663222142458151f, 7.3750394313469254f, 7.3837042924740528f, + 7.3923174227787607f, 7.4008794362821844f, 7.4093909361377026f, + 7.4178525148858991f, 7.4262647547020979f, 7.4346282276367255f, + 7.4429434958487288f, 7.4512111118323299f, 7.4594316186372973f, + 7.4676055500829976f, 7.4757334309663976f, 7.4838157772642564f, + 7.4918530963296748f, 7.4998458870832057f, 7.5077946401986964f, + 7.5156998382840436f, 7.5235619560570131f, 7.5313814605163119f, + 7.5391588111080319f, 7.5468944598876373f, 7.5545888516776376f, + 7.5622424242210728f, 7.5698556083309478f, 7.5774288280357487f, + 7.5849625007211561f, 7.5924570372680806f, 7.5999128421871278f, + 7.6073303137496113f, 7.6147098441152075f, 7.6220518194563764f, + 7.6293566200796095f, 7.6366246205436488f, 7.6438561897747244f, + 7.6510516911789290f, 7.6582114827517955f, 7.6653359171851765f, + 7.6724253419714952f, 7.6794800995054464f, 7.6865005271832185f, + 7.6934869574993252f, 7.7004397181410926f, 7.7073591320808825f, + 7.7142455176661224f, 7.7210991887071856f, 7.7279204545631996f, + 7.7347096202258392f, 7.7414669864011465f, 7.7481928495894596f, + 7.7548875021634691f, 7.7615512324444795f, 7.7681843247769260f, + 7.7747870596011737f, 7.7813597135246608f, 7.7879025593914317f, + 7.7944158663501062f, 7.8008998999203047f, 7.8073549220576037f, + 7.8137811912170374f, 7.8201789624151887f, 7.8265484872909159f, + 7.8328900141647422f, 7.8392037880969445f, 7.8454900509443757f, + 7.8517490414160571f, 7.8579809951275719f, 7.8641861446542798f, + 7.8703647195834048f, 7.8765169465650002f, 7.8826430493618425f, + 7.8887432488982601f, 7.8948177633079446f, 7.9008668079807496f, + 7.9068905956085187f, 7.9128893362299619f, 7.9188632372745955f, + 7.9248125036057813f, 7.9307373375628867f, 7.9366379390025719f, + 7.9425145053392399f, 7.9483672315846778f, 7.9541963103868758f, + 7.9600019320680806f, 7.9657842846620870f, 7.9715435539507720f, + 7.9772799234999168f, 7.9829935746943104f, 7.9886846867721664f, + 7.9943534368588578f +}; #define LOG_2_INV 1.4426950408889634 /* Faster logarithm for small integers, with the property of log2(0) == 0. */ static BROTLI_INLINE double FastLog2(size_t v) { - if (v < BROTLI_LOG2_TABLE_SIZE) { - return kBrotliLog2Table[v]; + if (v < sizeof(kLog2Table) / sizeof(kLog2Table[0])) { + return kLog2Table[v]; } -#if !(BROTLI_HAVE_LOG2) +#if (defined(_MSC_VER) && _MSC_VER <= 1700) || \ + (defined(__ANDROID_API__) && __ANDROID_API__ < 18) + /* Visual Studio 2012 and Android API levels < 18 do not have the log2() + * function defined, so we use log() and a multiplication instead. */ return log((double)v) * LOG_2_INV; #else return log2((double)v); diff --git a/deps/brotli/c/enc/find_match_length.h b/deps/brotli/c/enc/find_match_length.h index f8853a70fbb82d..bc428cffdaf17c 100644 --- a/deps/brotli/c/enc/find_match_length.h +++ b/deps/brotli/c/enc/find_match_length.h @@ -17,7 +17,8 @@ extern "C" { #endif /* Separate implementation for little-endian 64-bit targets, for speed. */ -#if defined(BROTLI_TZCNT64) && BROTLI_64_BITS && BROTLI_LITTLE_ENDIAN +#if defined(__GNUC__) && defined(_LP64) && defined(BROTLI_LITTLE_ENDIAN) + static BROTLI_INLINE size_t FindMatchLengthWithLimit(const uint8_t* s1, const uint8_t* s2, size_t limit) { @@ -31,7 +32,7 @@ static BROTLI_INLINE size_t FindMatchLengthWithLimit(const uint8_t* s1, } else { uint64_t x = BROTLI_UNALIGNED_LOAD64LE(s2) ^ BROTLI_UNALIGNED_LOAD64LE(s1 + matched); - size_t matching_bits = (size_t)BROTLI_TZCNT64(x); + size_t matching_bits = (size_t)__builtin_ctzll(x); matched += matching_bits >> 3; return matched; } diff --git a/deps/brotli/c/enc/hash.h b/deps/brotli/c/enc/hash.h index 6362f69b9f5b59..8c5a7bb5ad5d55 100644 --- a/deps/brotli/c/enc/hash.h +++ b/deps/brotli/c/enc/hash.h @@ -27,19 +27,34 @@ extern "C" { #endif -typedef struct { - /* Dynamically allocated area; first member for quickest access. */ - void* extra; - - size_t dict_num_lookups; - size_t dict_num_matches; +/* Pointer to hasher data. + * + * Excluding initialization and destruction, hasher can be passed as + * HasherHandle by value. + * + * Typically hasher data consists of 3 sections: + * * HasherCommon structure + * * private structured hasher data, depending on hasher type + * * private dynamic hasher data, depending on hasher type and parameters + * + * Using "define" instead of "typedef", because on MSVC __restrict does not work + * on typedef pointer types. */ +#define HasherHandle uint8_t* +typedef struct { BrotliHasherParams params; /* False if hasher needs to be "prepared" before use. */ BROTLI_BOOL is_prepared_; + + size_t dict_num_lookups; + size_t dict_num_matches; } HasherCommon; +static BROTLI_INLINE HasherCommon* GetHasherCommon(HasherHandle handle) { + return (HasherCommon*)handle; +} + #define score_t size_t static const uint32_t kCutoffTransformsCount = 10; @@ -134,13 +149,17 @@ static BROTLI_INLINE score_t BackwardReferencePenaltyUsingLastDistance( } static BROTLI_INLINE BROTLI_BOOL TestStaticDictionaryItem( - const BrotliEncoderDictionary* dictionary, size_t len, size_t word_idx, + const BrotliEncoderDictionary* dictionary, size_t item, const uint8_t* data, size_t max_length, size_t max_backward, size_t max_distance, HasherSearchResult* out) { + size_t len; + size_t word_idx; size_t offset; size_t matchlen; size_t backward; score_t score; + len = item & 0x1F; + word_idx = item >> 5; offset = dictionary->words->offsets_by_length[len] + len * word_idx; if (len > max_length) { return BROTLI_FALSE; @@ -174,24 +193,25 @@ static BROTLI_INLINE BROTLI_BOOL TestStaticDictionaryItem( static BROTLI_INLINE void SearchInStaticDictionary( const BrotliEncoderDictionary* dictionary, - HasherCommon* common, const uint8_t* data, size_t max_length, + HasherHandle handle, const uint8_t* data, size_t max_length, size_t max_backward, size_t max_distance, HasherSearchResult* out, BROTLI_BOOL shallow) { size_t key; size_t i; - if (common->dict_num_matches < (common->dict_num_lookups >> 7)) { + HasherCommon* self = GetHasherCommon(handle); + if (self->dict_num_matches < (self->dict_num_lookups >> 7)) { return; } key = Hash14(data) << 1; for (i = 0; i < (shallow ? 1u : 2u); ++i, ++key) { - common->dict_num_lookups++; - if (dictionary->hash_table_lengths[key] != 0) { + size_t item = dictionary->hash_table[key]; + self->dict_num_lookups++; + if (item != 0) { BROTLI_BOOL item_matches = TestStaticDictionaryItem( - dictionary, dictionary->hash_table_lengths[key], - dictionary->hash_table_words[key], data, + dictionary, item, data, max_length, max_backward, max_distance, out); if (item_matches) { - common->dict_num_matches++; + self->dict_num_matches++; } } } @@ -240,37 +260,37 @@ static BROTLI_INLINE size_t BackwardMatchLengthCode(const BackwardMatch* self) { /* MAX_NUM_MATCHES == 64 + MAX_TREE_SEARCH_DEPTH */ #define MAX_NUM_MATCHES_H10 128 -/* For BUCKET_SWEEP_BITS == 0, enabling the dictionary lookup makes compression +/* For BUCKET_SWEEP == 1, enabling the dictionary lookup makes compression a little faster (0.5% - 1%) and it compresses 0.15% better on small text and HTML inputs. */ #define HASHER() H2 #define BUCKET_BITS 16 -#define BUCKET_SWEEP_BITS 0 +#define BUCKET_SWEEP 1 #define HASH_LEN 5 #define USE_DICTIONARY 1 #include "./hash_longest_match_quickly_inc.h" /* NOLINT(build/include) */ -#undef BUCKET_SWEEP_BITS +#undef BUCKET_SWEEP #undef USE_DICTIONARY #undef HASHER #define HASHER() H3 -#define BUCKET_SWEEP_BITS 1 +#define BUCKET_SWEEP 2 #define USE_DICTIONARY 0 #include "./hash_longest_match_quickly_inc.h" /* NOLINT(build/include) */ #undef USE_DICTIONARY -#undef BUCKET_SWEEP_BITS +#undef BUCKET_SWEEP #undef BUCKET_BITS #undef HASHER #define HASHER() H4 #define BUCKET_BITS 17 -#define BUCKET_SWEEP_BITS 2 +#define BUCKET_SWEEP 4 #define USE_DICTIONARY 1 #include "./hash_longest_match_quickly_inc.h" /* NOLINT(build/include) */ #undef USE_DICTIONARY #undef HASH_LEN -#undef BUCKET_SWEEP_BITS +#undef BUCKET_SWEEP #undef BUCKET_BITS #undef HASHER @@ -314,13 +334,13 @@ static BROTLI_INLINE size_t BackwardMatchLengthCode(const BackwardMatch* self) { #define HASHER() H54 #define BUCKET_BITS 20 -#define BUCKET_SWEEP_BITS 2 +#define BUCKET_SWEEP 4 #define HASH_LEN 7 #define USE_DICTIONARY 0 #include "./hash_longest_match_quickly_inc.h" /* NOLINT(build/include) */ #undef USE_DICTIONARY #undef HASH_LEN -#undef BUCKET_SWEEP_BITS +#undef BUCKET_SWEEP #undef BUCKET_BITS #undef HASHER @@ -373,107 +393,97 @@ static BROTLI_INLINE size_t BackwardMatchLengthCode(const BackwardMatch* self) { #undef CAT #undef EXPAND_CAT -#define FOR_SIMPLE_HASHERS(H) H(2) H(3) H(4) H(5) H(6) H(40) H(41) H(42) H(54) -#define FOR_COMPOSITE_HASHERS(H) H(35) H(55) H(65) -#define FOR_GENERIC_HASHERS(H) FOR_SIMPLE_HASHERS(H) FOR_COMPOSITE_HASHERS(H) +#define FOR_GENERIC_HASHERS(H) H(2) H(3) H(4) H(5) H(6) H(40) H(41) H(42) H(54)\ + H(35) H(55) H(65) #define FOR_ALL_HASHERS(H) FOR_GENERIC_HASHERS(H) H(10) -typedef struct { - HasherCommon common; - - union { -#define MEMBER_(N) \ - H ## N _H ## N; - FOR_ALL_HASHERS(MEMBER_) -#undef MEMBER_ - } privat; -} Hasher; - -/* MUST be invoked before any other method. */ -static BROTLI_INLINE void HasherInit(Hasher* hasher) { - hasher->common.extra = NULL; +static BROTLI_INLINE void DestroyHasher( + MemoryManager* m, HasherHandle* handle) { + if (*handle == NULL) return; + BROTLI_FREE(m, *handle); } -static BROTLI_INLINE void DestroyHasher(MemoryManager* m, Hasher* hasher) { - if (hasher->common.extra == NULL) return; - BROTLI_FREE(m, hasher->common.extra); -} - -static BROTLI_INLINE void HasherReset(Hasher* hasher) { - hasher->common.is_prepared_ = BROTLI_FALSE; +static BROTLI_INLINE void HasherReset(HasherHandle handle) { + if (handle == NULL) return; + GetHasherCommon(handle)->is_prepared_ = BROTLI_FALSE; } static BROTLI_INLINE size_t HasherSize(const BrotliEncoderParams* params, BROTLI_BOOL one_shot, const size_t input_size) { + size_t result = sizeof(HasherCommon); switch (params->hasher.type) { -#define SIZE_(N) \ - case N: \ - return HashMemAllocInBytesH ## N(params, one_shot, input_size); +#define SIZE_(N) \ + case N: \ + result += HashMemAllocInBytesH ## N(params, one_shot, input_size); \ + break; FOR_ALL_HASHERS(SIZE_) #undef SIZE_ default: break; } - return 0; /* Default case. */ + return result; } -static BROTLI_INLINE void HasherSetup(MemoryManager* m, Hasher* hasher, +static BROTLI_INLINE void HasherSetup(MemoryManager* m, HasherHandle* handle, BrotliEncoderParams* params, const uint8_t* data, size_t position, size_t input_size, BROTLI_BOOL is_last) { + HasherHandle self = NULL; + HasherCommon* common = NULL; BROTLI_BOOL one_shot = (position == 0 && is_last); - if (hasher->common.extra == NULL) { + if (*handle == NULL) { size_t alloc_size; ChooseHasher(params, ¶ms->hasher); alloc_size = HasherSize(params, one_shot, input_size); - hasher->common.extra = BROTLI_ALLOC(m, uint8_t, alloc_size); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(hasher->common.extra)) return; - hasher->common.params = params->hasher; - switch (hasher->common.params.type) { -#define INITIALIZE_(N) \ - case N: \ - InitializeH ## N(&hasher->common, \ - &hasher->privat._H ## N, params); \ + self = BROTLI_ALLOC(m, uint8_t, alloc_size); + if (BROTLI_IS_OOM(m)) return; + *handle = self; + common = GetHasherCommon(self); + common->params = params->hasher; + switch (common->params.type) { +#define INITIALIZE_(N) \ + case N: \ + InitializeH ## N(*handle, params); \ break; FOR_ALL_HASHERS(INITIALIZE_); #undef INITIALIZE_ default: break; } - HasherReset(hasher); + HasherReset(*handle); } - if (!hasher->common.is_prepared_) { - switch (hasher->common.params.type) { -#define PREPARE_(N) \ - case N: \ - PrepareH ## N( \ - &hasher->privat._H ## N, \ - one_shot, input_size, data); \ + self = *handle; + common = GetHasherCommon(self); + if (!common->is_prepared_) { + switch (common->params.type) { +#define PREPARE_(N) \ + case N: \ + PrepareH ## N(self, one_shot, input_size, data); \ break; FOR_ALL_HASHERS(PREPARE_) #undef PREPARE_ default: break; } if (position == 0) { - hasher->common.dict_num_lookups = 0; - hasher->common.dict_num_matches = 0; + common->dict_num_lookups = 0; + common->dict_num_matches = 0; } - hasher->common.is_prepared_ = BROTLI_TRUE; + common->is_prepared_ = BROTLI_TRUE; } } static BROTLI_INLINE void InitOrStitchToPreviousBlock( - MemoryManager* m, Hasher* hasher, const uint8_t* data, size_t mask, + MemoryManager* m, HasherHandle* handle, const uint8_t* data, size_t mask, BrotliEncoderParams* params, size_t position, size_t input_size, BROTLI_BOOL is_last) { - HasherSetup(m, hasher, params, data, position, input_size, is_last); + HasherHandle self; + HasherSetup(m, handle, params, data, position, input_size, is_last); if (BROTLI_IS_OOM(m)) return; - switch (hasher->common.params.type) { -#define INIT_(N) \ - case N: \ - StitchToPreviousBlockH ## N( \ - &hasher->privat._H ## N, \ - input_size, position, data, mask); \ + self = *handle; + switch (GetHasherCommon(self)->params.type) { +#define INIT_(N) \ + case N: \ + StitchToPreviousBlockH ## N(self, input_size, position, data, mask); \ break; FOR_ALL_HASHERS(INIT_) #undef INIT_ diff --git a/deps/brotli/c/enc/hash_composite_inc.h b/deps/brotli/c/enc/hash_composite_inc.h index cba156c0e2305f..b266aa2f8da470 100644 --- a/deps/brotli/c/enc/hash_composite_inc.h +++ b/deps/brotli/c/enc/hash_composite_inc.h @@ -28,25 +28,20 @@ static BROTLI_INLINE size_t FN(StoreLookahead)(void) { } typedef struct HashComposite { - HASHER_A ha; - HASHER_B hb; - HasherCommon hb_common; - - /* Shortcuts. */ - void* extra; - HasherCommon* common; - - BROTLI_BOOL fresh; + HasherHandle ha; + HasherHandle hb; const BrotliEncoderParams* params; } HashComposite; -static void FN(Initialize)(HasherCommon* common, - HashComposite* BROTLI_RESTRICT self, const BrotliEncoderParams* params) { - self->common = common; - self->extra = common->extra; +static BROTLI_INLINE HashComposite* FN(Self)(HasherHandle handle) { + return (HashComposite*)&(GetHasherCommon(handle)[1]); +} - self->hb_common = *self->common; - self->fresh = BROTLI_TRUE; +static void FN(Initialize)( + HasherHandle handle, const BrotliEncoderParams* params) { + HashComposite* self = FN(Self)(handle); + self->ha = 0; + self->hb = 0; self->params = params; /* TODO: Initialize of the hashers is defered to Prepare (and params remembered here) because we don't get the one_shot and input_size params @@ -54,71 +49,87 @@ static void FN(Initialize)(HasherCommon* common, those params to all hashers FN(Initialize) */ } -static void FN(Prepare)( - HashComposite* BROTLI_RESTRICT self, BROTLI_BOOL one_shot, - size_t input_size, const uint8_t* BROTLI_RESTRICT data) { - if (self->fresh) { - self->fresh = BROTLI_FALSE; - self->hb_common.extra = (uint8_t*)self->extra + - FN_A(HashMemAllocInBytes)(self->params, one_shot, input_size); - - FN_A(Initialize)(self->common, &self->ha, self->params); - FN_B(Initialize)(&self->hb_common, &self->hb, self->params); +static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot, + size_t input_size, const uint8_t* data) { + HashComposite* self = FN(Self)(handle); + if (!self->ha) { + HasherCommon* common_a; + HasherCommon* common_b; + + self->ha = handle + sizeof(HasherCommon) + sizeof(HashComposite); + common_a = (HasherCommon*)self->ha; + common_a->params = self->params->hasher; + common_a->is_prepared_ = BROTLI_FALSE; + common_a->dict_num_lookups = 0; + common_a->dict_num_matches = 0; + FN_A(Initialize)(self->ha, self->params); + + self->hb = self->ha + sizeof(HasherCommon) + FN_A(HashMemAllocInBytes)( + self->params, one_shot, input_size); + common_b = (HasherCommon*)self->hb; + common_b->params = self->params->hasher; + common_b->is_prepared_ = BROTLI_FALSE; + common_b->dict_num_lookups = 0; + common_b->dict_num_matches = 0; + FN_B(Initialize)(self->hb, self->params); } - FN_A(Prepare)(&self->ha, one_shot, input_size, data); - FN_B(Prepare)(&self->hb, one_shot, input_size, data); + FN_A(Prepare)(self->ha, one_shot, input_size, data); + FN_B(Prepare)(self->hb, one_shot, input_size, data); } static BROTLI_INLINE size_t FN(HashMemAllocInBytes)( const BrotliEncoderParams* params, BROTLI_BOOL one_shot, size_t input_size) { - return FN_A(HashMemAllocInBytes)(params, one_shot, input_size) + + return sizeof(HashComposite) + 2 * sizeof(HasherCommon) + + FN_A(HashMemAllocInBytes)(params, one_shot, input_size) + FN_B(HashMemAllocInBytes)(params, one_shot, input_size); } -static BROTLI_INLINE void FN(Store)(HashComposite* BROTLI_RESTRICT self, +static BROTLI_INLINE void FN(Store)(HasherHandle BROTLI_RESTRICT handle, const uint8_t* BROTLI_RESTRICT data, const size_t mask, const size_t ix) { - FN_A(Store)(&self->ha, data, mask, ix); - FN_B(Store)(&self->hb, data, mask, ix); + HashComposite* self = FN(Self)(handle); + FN_A(Store)(self->ha, data, mask, ix); + FN_B(Store)(self->hb, data, mask, ix); } -static BROTLI_INLINE void FN(StoreRange)( - HashComposite* BROTLI_RESTRICT self, const uint8_t* BROTLI_RESTRICT data, - const size_t mask, const size_t ix_start, +static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle, + const uint8_t* data, const size_t mask, const size_t ix_start, const size_t ix_end) { - FN_A(StoreRange)(&self->ha, data, mask, ix_start, ix_end); - FN_B(StoreRange)(&self->hb, data, mask, ix_start, ix_end); + HashComposite* self = FN(Self)(handle); + FN_A(StoreRange)(self->ha, data, mask, ix_start, ix_end); + FN_B(StoreRange)(self->hb, data, mask, ix_start, ix_end); } -static BROTLI_INLINE void FN(StitchToPreviousBlock)( - HashComposite* BROTLI_RESTRICT self, +static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle, size_t num_bytes, size_t position, const uint8_t* ringbuffer, size_t ring_buffer_mask) { - FN_A(StitchToPreviousBlock)(&self->ha, num_bytes, position, - ringbuffer, ring_buffer_mask); - FN_B(StitchToPreviousBlock)(&self->hb, num_bytes, position, - ringbuffer, ring_buffer_mask); + HashComposite* self = FN(Self)(handle); + FN_A(StitchToPreviousBlock)(self->ha, num_bytes, position, ringbuffer, + ring_buffer_mask); + FN_B(StitchToPreviousBlock)(self->hb, num_bytes, position, ringbuffer, + ring_buffer_mask); } static BROTLI_INLINE void FN(PrepareDistanceCache)( - HashComposite* BROTLI_RESTRICT self, int* BROTLI_RESTRICT distance_cache) { - FN_A(PrepareDistanceCache)(&self->ha, distance_cache); - FN_B(PrepareDistanceCache)(&self->hb, distance_cache); + HasherHandle handle, int* BROTLI_RESTRICT distance_cache) { + HashComposite* self = FN(Self)(handle); + FN_A(PrepareDistanceCache)(self->ha, distance_cache); + FN_B(PrepareDistanceCache)(self->hb, distance_cache); } -static BROTLI_INLINE void FN(FindLongestMatch)( - HashComposite* BROTLI_RESTRICT self, +static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle, const BrotliEncoderDictionary* dictionary, const uint8_t* BROTLI_RESTRICT data, const size_t ring_buffer_mask, const int* BROTLI_RESTRICT distance_cache, const size_t cur_ix, const size_t max_length, const size_t max_backward, - const size_t dictionary_distance, const size_t max_distance, + const size_t gap, const size_t max_distance, HasherSearchResult* BROTLI_RESTRICT out) { - FN_A(FindLongestMatch)(&self->ha, dictionary, data, ring_buffer_mask, - distance_cache, cur_ix, max_length, max_backward, dictionary_distance, + HashComposite* self = FN(Self)(handle); + FN_A(FindLongestMatch)(self->ha, dictionary, data, ring_buffer_mask, + distance_cache, cur_ix, max_length, max_backward, gap, max_distance, out); - FN_B(FindLongestMatch)(&self->hb, dictionary, data, ring_buffer_mask, - distance_cache, cur_ix, max_length, max_backward, dictionary_distance, + FN_B(FindLongestMatch)(self->hb, dictionary, data, ring_buffer_mask, + distance_cache, cur_ix, max_length, max_backward, gap, max_distance, out); } diff --git a/deps/brotli/c/enc/hash_forgetful_chain_inc.h b/deps/brotli/c/enc/hash_forgetful_chain_inc.h index bfae6ba6a2080e..41cb3ff03ac5fc 100644 --- a/deps/brotli/c/enc/hash_forgetful_chain_inc.h +++ b/deps/brotli/c/enc/hash_forgetful_chain_inc.h @@ -28,7 +28,7 @@ static BROTLI_INLINE size_t FN(HashTypeLength)(void) { return 4; } static BROTLI_INLINE size_t FN(StoreLookahead)(void) { return 4; } /* HashBytes is the function that chooses the bucket to place the address in.*/ -static BROTLI_INLINE size_t FN(HashBytes)(const uint8_t* BROTLI_RESTRICT data) { +static BROTLI_INLINE size_t FN(HashBytes)(const uint8_t* data) { const uint32_t h = BROTLI_UNALIGNED_LOAD32LE(data) * kHashMul32; /* The higher bits contain more mixture from the multiplication, so we take our results from there. */ @@ -45,56 +45,28 @@ typedef struct FN(Bank) { } FN(Bank); typedef struct HashForgetfulChain { - uint16_t free_slot_idx[NUM_BANKS]; /* Up to 1KiB. Move to dynamic? */ - size_t max_hops; - - /* Shortcuts. */ - void* extra; - HasherCommon* common; - - /* --- Dynamic size members --- */ - - /* uint32_t addr[BUCKET_SIZE]; */ - - /* uint16_t head[BUCKET_SIZE]; */ - + uint32_t addr[BUCKET_SIZE]; + uint16_t head[BUCKET_SIZE]; /* Truncated hash used for quick rejection of "distance cache" candidates. */ - /* uint8_t tiny_hash[65536];*/ - - /* FN(Bank) banks[NUM_BANKS]; */ + uint8_t tiny_hash[65536]; + FN(Bank) banks[NUM_BANKS]; + uint16_t free_slot_idx[NUM_BANKS]; + size_t max_hops; } HashForgetfulChain; -static uint32_t* FN(Addr)(void* extra) { - return (uint32_t*)extra; -} - -static uint16_t* FN(Head)(void* extra) { - return (uint16_t*)(&FN(Addr)(extra)[BUCKET_SIZE]); -} - -static uint8_t* FN(TinyHash)(void* extra) { - return (uint8_t*)(&FN(Head)(extra)[BUCKET_SIZE]); -} - -static FN(Bank)* FN(Banks)(void* extra) { - return (FN(Bank)*)(&FN(TinyHash)(extra)[65536]); +static BROTLI_INLINE HashForgetfulChain* FN(Self)(HasherHandle handle) { + return (HashForgetfulChain*)&(GetHasherCommon(handle)[1]); } static void FN(Initialize)( - HasherCommon* common, HashForgetfulChain* BROTLI_RESTRICT self, - const BrotliEncoderParams* params) { - self->common = common; - self->extra = common->extra; - - self->max_hops = (params->quality > 6 ? 7u : 8u) << (params->quality - 4); + HasherHandle handle, const BrotliEncoderParams* params) { + FN(Self)(handle)->max_hops = + (params->quality > 6 ? 7u : 8u) << (params->quality - 4); } -static void FN(Prepare)( - HashForgetfulChain* BROTLI_RESTRICT self, BROTLI_BOOL one_shot, - size_t input_size, const uint8_t* BROTLI_RESTRICT data) { - uint32_t* BROTLI_RESTRICT addr = FN(Addr)(self->extra); - uint16_t* BROTLI_RESTRICT head = FN(Head)(self->extra); - uint8_t* BROTLI_RESTRICT tiny_hash = FN(TinyHash)(self->extra); +static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot, + size_t input_size, const uint8_t* data) { + HashForgetfulChain* self = FN(Self)(handle); /* Partial preparation is 100 times slower (per socket). */ size_t partial_prepare_threshold = BUCKET_SIZE >> 6; if (one_shot && input_size <= partial_prepare_threshold) { @@ -102,17 +74,17 @@ static void FN(Prepare)( for (i = 0; i < input_size; ++i) { size_t bucket = FN(HashBytes)(&data[i]); /* See InitEmpty comment. */ - addr[bucket] = 0xCCCCCCCC; - head[bucket] = 0xCCCC; + self->addr[bucket] = 0xCCCCCCCC; + self->head[bucket] = 0xCCCC; } } else { /* Fill |addr| array with 0xCCCCCCCC value. Because of wrapping, position processed by hasher never reaches 3GB + 64M; this makes all new chains to be terminated after the first node. */ - memset(addr, 0xCC, sizeof(uint32_t) * BUCKET_SIZE); - memset(head, 0, sizeof(uint16_t) * BUCKET_SIZE); + memset(self->addr, 0xCC, sizeof(self->addr)); + memset(self->head, 0, sizeof(self->head)); } - memset(tiny_hash, 0, sizeof(uint8_t) * 65536); + memset(self->tiny_hash, 0, sizeof(self->tiny_hash)); memset(self->free_slot_idx, 0, sizeof(self->free_slot_idx)); } @@ -122,58 +94,51 @@ static BROTLI_INLINE size_t FN(HashMemAllocInBytes)( BROTLI_UNUSED(params); BROTLI_UNUSED(one_shot); BROTLI_UNUSED(input_size); - return sizeof(uint32_t) * BUCKET_SIZE + sizeof(uint16_t) * BUCKET_SIZE + - sizeof(uint8_t) * 65536 + sizeof(FN(Bank)) * NUM_BANKS; + return sizeof(HashForgetfulChain); } /* Look at 4 bytes at &data[ix & mask]. Compute a hash from these, and prepend node to corresponding chain; also update tiny_hash for current position. */ -static BROTLI_INLINE void FN(Store)(HashForgetfulChain* BROTLI_RESTRICT self, +static BROTLI_INLINE void FN(Store)(HasherHandle BROTLI_RESTRICT handle, const uint8_t* BROTLI_RESTRICT data, const size_t mask, const size_t ix) { - uint32_t* BROTLI_RESTRICT addr = FN(Addr)(self->extra); - uint16_t* BROTLI_RESTRICT head = FN(Head)(self->extra); - uint8_t* BROTLI_RESTRICT tiny_hash = FN(TinyHash)(self->extra); - FN(Bank)* BROTLI_RESTRICT banks = FN(Banks)(self->extra); + HashForgetfulChain* self = FN(Self)(handle); const size_t key = FN(HashBytes)(&data[ix & mask]); const size_t bank = key & (NUM_BANKS - 1); const size_t idx = self->free_slot_idx[bank]++ & (BANK_SIZE - 1); - size_t delta = ix - addr[key]; - tiny_hash[(uint16_t)ix] = (uint8_t)key; + size_t delta = ix - self->addr[key]; + self->tiny_hash[(uint16_t)ix] = (uint8_t)key; if (delta > 0xFFFF) delta = CAPPED_CHAINS ? 0 : 0xFFFF; - banks[bank].slots[idx].delta = (uint16_t)delta; - banks[bank].slots[idx].next = head[key]; - addr[key] = (uint32_t)ix; - head[key] = (uint16_t)idx; + self->banks[bank].slots[idx].delta = (uint16_t)delta; + self->banks[bank].slots[idx].next = self->head[key]; + self->addr[key] = (uint32_t)ix; + self->head[key] = (uint16_t)idx; } -static BROTLI_INLINE void FN(StoreRange)( - HashForgetfulChain* BROTLI_RESTRICT self, - const uint8_t* BROTLI_RESTRICT data, const size_t mask, - const size_t ix_start, const size_t ix_end) { +static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle, + const uint8_t* data, const size_t mask, const size_t ix_start, + const size_t ix_end) { size_t i; for (i = ix_start; i < ix_end; ++i) { - FN(Store)(self, data, mask, i); + FN(Store)(handle, data, mask, i); } } -static BROTLI_INLINE void FN(StitchToPreviousBlock)( - HashForgetfulChain* BROTLI_RESTRICT self, +static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle, size_t num_bytes, size_t position, const uint8_t* ringbuffer, size_t ring_buffer_mask) { if (num_bytes >= FN(HashTypeLength)() - 1 && position >= 3) { /* Prepare the hashes for three last bytes of the last write. These could not be calculated before, since they require knowledge of both the previous and the current block. */ - FN(Store)(self, ringbuffer, ring_buffer_mask, position - 3); - FN(Store)(self, ringbuffer, ring_buffer_mask, position - 2); - FN(Store)(self, ringbuffer, ring_buffer_mask, position - 1); + FN(Store)(handle, ringbuffer, ring_buffer_mask, position - 3); + FN(Store)(handle, ringbuffer, ring_buffer_mask, position - 2); + FN(Store)(handle, ringbuffer, ring_buffer_mask, position - 1); } } static BROTLI_INLINE void FN(PrepareDistanceCache)( - HashForgetfulChain* BROTLI_RESTRICT self, - int* BROTLI_RESTRICT distance_cache) { - BROTLI_UNUSED(self); + HasherHandle handle, int* BROTLI_RESTRICT distance_cache) { + BROTLI_UNUSED(handle); PrepareDistanceCache(distance_cache, NUM_LAST_DISTANCES_TO_CHECK); } @@ -188,18 +153,14 @@ static BROTLI_INLINE void FN(PrepareDistanceCache)( Does not look for matches further away than max_backward. Writes the best match into |out|. |out|->score is updated only if a better match is found. */ -static BROTLI_INLINE void FN(FindLongestMatch)( - HashForgetfulChain* BROTLI_RESTRICT self, +static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle, const BrotliEncoderDictionary* dictionary, const uint8_t* BROTLI_RESTRICT data, const size_t ring_buffer_mask, const int* BROTLI_RESTRICT distance_cache, const size_t cur_ix, const size_t max_length, const size_t max_backward, - const size_t dictionary_distance, const size_t max_distance, + const size_t gap, const size_t max_distance, HasherSearchResult* BROTLI_RESTRICT out) { - uint32_t* BROTLI_RESTRICT addr = FN(Addr)(self->extra); - uint16_t* BROTLI_RESTRICT head = FN(Head)(self->extra); - uint8_t* BROTLI_RESTRICT tiny_hashes = FN(TinyHash)(self->extra); - FN(Bank)* BROTLI_RESTRICT banks = FN(Banks)(self->extra); + HashForgetfulChain* self = FN(Self)(handle); const size_t cur_ix_masked = cur_ix & ring_buffer_mask; /* Don't accept a short copy from far away. */ score_t min_score = out->score; @@ -215,7 +176,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)( const size_t backward = (size_t)distance_cache[i]; size_t prev_ix = (cur_ix - backward); /* For distance code 0 we want to consider 2-byte matches. */ - if (i > 0 && tiny_hashes[(uint16_t)prev_ix] != tiny_hash) continue; + if (i > 0 && self->tiny_hash[(uint16_t)prev_ix] != tiny_hash) continue; if (prev_ix >= cur_ix || backward > max_backward) { continue; } @@ -243,16 +204,16 @@ static BROTLI_INLINE void FN(FindLongestMatch)( const size_t bank = key & (NUM_BANKS - 1); size_t backward = 0; size_t hops = self->max_hops; - size_t delta = cur_ix - addr[key]; - size_t slot = head[key]; + size_t delta = cur_ix - self->addr[key]; + size_t slot = self->head[key]; while (hops--) { size_t prev_ix; size_t last = slot; backward += delta; if (backward > max_backward || (CAPPED_CHAINS && !delta)) break; prev_ix = (cur_ix - backward) & ring_buffer_mask; - slot = banks[bank].slots[last].next; - delta = banks[bank].slots[last].delta; + slot = self->banks[bank].slots[last].next; + delta = self->banks[bank].slots[last].delta; if (cur_ix_masked + best_len > ring_buffer_mask || prev_ix + best_len > ring_buffer_mask || data[cur_ix_masked + best_len] != data[prev_ix + best_len]) { @@ -277,11 +238,11 @@ static BROTLI_INLINE void FN(FindLongestMatch)( } } } - FN(Store)(self, data, ring_buffer_mask, cur_ix); + FN(Store)(handle, data, ring_buffer_mask, cur_ix); } if (out->score == min_score) { SearchInStaticDictionary(dictionary, - self->common, &data[cur_ix_masked], max_length, dictionary_distance, + handle, &data[cur_ix_masked], max_length, max_backward + gap, max_distance, out, BROTLI_FALSE); } } diff --git a/deps/brotli/c/enc/hash_longest_match64_inc.h b/deps/brotli/c/enc/hash_longest_match64_inc.h index 956fb304b3621f..cb953a644fcae7 100644 --- a/deps/brotli/c/enc/hash_longest_match64_inc.h +++ b/deps/brotli/c/enc/hash_longest_match64_inc.h @@ -20,7 +20,7 @@ static BROTLI_INLINE size_t FN(HashTypeLength)(void) { return 8; } static BROTLI_INLINE size_t FN(StoreLookahead)(void) { return 8; } /* HashBytes is the function that chooses the bucket to place the address in. */ -static BROTLI_INLINE uint32_t FN(HashBytes)(const uint8_t* BROTLI_RESTRICT data, +static BROTLI_INLINE uint32_t FN(HashBytes)(const uint8_t* data, const uint64_t mask, const int shift) { const uint64_t h = (BROTLI_UNALIGNED_LOAD64LE(data) & mask) * kHashMul64Long; @@ -42,43 +42,43 @@ typedef struct HashLongestMatch { /* Mask for accessing entries in a block (in a ring-buffer manner). */ uint32_t block_mask_; - int block_bits_; - int num_last_distances_to_check_; - - /* Shortcuts. */ - HasherCommon* common_; - /* --- Dynamic size members --- */ /* Number of entries in a particular bucket. */ - uint16_t* num_; /* uint16_t[bucket_size]; */ + /* uint16_t num[bucket_size]; */ /* Buckets containing block_size_ of backward references. */ - uint32_t* buckets_; /* uint32_t[bucket_size * block_size]; */ + /* uint32_t* buckets[bucket_size * block_size]; */ } HashLongestMatch; -static void FN(Initialize)( - HasherCommon* common, HashLongestMatch* BROTLI_RESTRICT self, - const BrotliEncoderParams* params) { - self->common_ = common; +static BROTLI_INLINE HashLongestMatch* FN(Self)(HasherHandle handle) { + return (HashLongestMatch*)&(GetHasherCommon(handle)[1]); +} +static BROTLI_INLINE uint16_t* FN(Num)(HashLongestMatch* self) { + return (uint16_t*)(&self[1]); +} + +static BROTLI_INLINE uint32_t* FN(Buckets)(HashLongestMatch* self) { + return (uint32_t*)(&FN(Num)(self)[self->bucket_size_]); +} + +static void FN(Initialize)( + HasherHandle handle, const BrotliEncoderParams* params) { + HasherCommon* common = GetHasherCommon(handle); + HashLongestMatch* self = FN(Self)(handle); BROTLI_UNUSED(params); self->hash_shift_ = 64 - common->params.bucket_bits; self->hash_mask_ = (~((uint64_t)0U)) >> (64 - 8 * common->params.hash_len); self->bucket_size_ = (size_t)1 << common->params.bucket_bits; - self->block_bits_ = common->params.block_bits; self->block_size_ = (size_t)1 << common->params.block_bits; self->block_mask_ = (uint32_t)(self->block_size_ - 1); - self->num_last_distances_to_check_ = - common->params.num_last_distances_to_check; - self->num_ = (uint16_t*)common->extra; - self->buckets_ = (uint32_t*)&self->num_[self->bucket_size_]; } -static void FN(Prepare)( - HashLongestMatch* BROTLI_RESTRICT self, BROTLI_BOOL one_shot, - size_t input_size, const uint8_t* BROTLI_RESTRICT data) { - uint16_t* BROTLI_RESTRICT num = self->num_; +static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot, + size_t input_size, const uint8_t* data) { + HashLongestMatch* self = FN(Self)(handle); + uint16_t* num = FN(Num)(self); /* Partial preparation is 100 times slower (per socket). */ size_t partial_prepare_threshold = self->bucket_size_ >> 6; if (one_shot && input_size <= partial_prepare_threshold) { @@ -100,52 +100,50 @@ static BROTLI_INLINE size_t FN(HashMemAllocInBytes)( size_t block_size = (size_t)1 << params->hasher.block_bits; BROTLI_UNUSED(one_shot); BROTLI_UNUSED(input_size); - return sizeof(uint16_t) * bucket_size + - sizeof(uint32_t) * bucket_size * block_size; + return sizeof(HashLongestMatch) + bucket_size * (2 + 4 * block_size); } /* Look at 4 bytes at &data[ix & mask]. Compute a hash from these, and store the value of ix at that position. */ -static BROTLI_INLINE void FN(Store)( - HashLongestMatch* BROTLI_RESTRICT self, const uint8_t* BROTLI_RESTRICT data, +static BROTLI_INLINE void FN(Store)(HasherHandle handle, const uint8_t* data, const size_t mask, const size_t ix) { - uint16_t* BROTLI_RESTRICT num = self->num_; - uint32_t* BROTLI_RESTRICT buckets = self->buckets_; + HashLongestMatch* self = FN(Self)(handle); + uint16_t* num = FN(Num)(self); const uint32_t key = FN(HashBytes)(&data[ix & mask], self->hash_mask_, self->hash_shift_); const size_t minor_ix = num[key] & self->block_mask_; - const size_t offset = minor_ix + (key << self->block_bits_); + const size_t offset = + minor_ix + (key << GetHasherCommon(handle)->params.block_bits); + FN(Buckets)(self)[offset] = (uint32_t)ix; ++num[key]; - buckets[offset] = (uint32_t)ix; } -static BROTLI_INLINE void FN(StoreRange)(HashLongestMatch* BROTLI_RESTRICT self, - const uint8_t* BROTLI_RESTRICT data, const size_t mask, - const size_t ix_start, const size_t ix_end) { +static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle, + const uint8_t* data, const size_t mask, const size_t ix_start, + const size_t ix_end) { size_t i; for (i = ix_start; i < ix_end; ++i) { - FN(Store)(self, data, mask, i); + FN(Store)(handle, data, mask, i); } } -static BROTLI_INLINE void FN(StitchToPreviousBlock)( - HashLongestMatch* BROTLI_RESTRICT self, +static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle, size_t num_bytes, size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask) { if (num_bytes >= FN(HashTypeLength)() - 1 && position >= 3) { /* Prepare the hashes for three last bytes of the last write. These could not be calculated before, since they require knowledge of both the previous and the current block. */ - FN(Store)(self, ringbuffer, ringbuffer_mask, position - 3); - FN(Store)(self, ringbuffer, ringbuffer_mask, position - 2); - FN(Store)(self, ringbuffer, ringbuffer_mask, position - 1); + FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 3); + FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 2); + FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 1); } } static BROTLI_INLINE void FN(PrepareDistanceCache)( - HashLongestMatch* BROTLI_RESTRICT self, - int* BROTLI_RESTRICT distance_cache) { - PrepareDistanceCache(distance_cache, self->num_last_distances_to_check_); + HasherHandle handle, int* BROTLI_RESTRICT distance_cache) { + PrepareDistanceCache(distance_cache, + GetHasherCommon(handle)->params.num_last_distances_to_check); } /* Find a longest backward match of &data[cur_ix] up to the length of @@ -159,16 +157,17 @@ static BROTLI_INLINE void FN(PrepareDistanceCache)( Does not look for matches further away than max_backward. Writes the best match into |out|. |out|->score is updated only if a better match is found. */ -static BROTLI_INLINE void FN(FindLongestMatch)( - HashLongestMatch* BROTLI_RESTRICT self, +static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle, const BrotliEncoderDictionary* dictionary, const uint8_t* BROTLI_RESTRICT data, const size_t ring_buffer_mask, const int* BROTLI_RESTRICT distance_cache, const size_t cur_ix, const size_t max_length, const size_t max_backward, - const size_t dictionary_distance, const size_t max_distance, + const size_t gap, const size_t max_distance, HasherSearchResult* BROTLI_RESTRICT out) { - uint16_t* BROTLI_RESTRICT num = self->num_; - uint32_t* BROTLI_RESTRICT buckets = self->buckets_; + HasherCommon* common = GetHasherCommon(handle); + HashLongestMatch* self = FN(Self)(handle); + uint16_t* num = FN(Num)(self); + uint32_t* buckets = FN(Buckets)(self); const size_t cur_ix_masked = cur_ix & ring_buffer_mask; /* Don't accept a short copy from far away. */ score_t min_score = out->score; @@ -178,7 +177,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)( out->len = 0; out->len_code_delta = 0; /* Try last distance first. */ - for (i = 0; i < (size_t)self->num_last_distances_to_check_; ++i) { + for (i = 0; i < (size_t)common->params.num_last_distances_to_check; ++i) { const size_t backward = (size_t)distance_cache[i]; size_t prev_ix = (size_t)(cur_ix - backward); if (prev_ix >= cur_ix) { @@ -219,7 +218,8 @@ static BROTLI_INLINE void FN(FindLongestMatch)( { const uint32_t key = FN(HashBytes)( &data[cur_ix_masked], self->hash_mask_, self->hash_shift_); - uint32_t* BROTLI_RESTRICT bucket = &buckets[key << self->block_bits_]; + uint32_t* BROTLI_RESTRICT bucket = + &buckets[key << common->params.block_bits]; const size_t down = (num[key] > self->block_size_) ? (num[key] - self->block_size_) : 0u; @@ -259,7 +259,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)( } if (min_score == out->score) { SearchInStaticDictionary(dictionary, - self->common_, &data[cur_ix_masked], max_length, dictionary_distance, + handle, &data[cur_ix_masked], max_length, max_backward + gap, max_distance, out, BROTLI_FALSE); } } diff --git a/deps/brotli/c/enc/hash_longest_match_inc.h b/deps/brotli/c/enc/hash_longest_match_inc.h index 27f4463d7f3a1c..457f5a9ed2e221 100644 --- a/deps/brotli/c/enc/hash_longest_match_inc.h +++ b/deps/brotli/c/enc/hash_longest_match_inc.h @@ -20,8 +20,7 @@ static BROTLI_INLINE size_t FN(HashTypeLength)(void) { return 4; } static BROTLI_INLINE size_t FN(StoreLookahead)(void) { return 4; } /* HashBytes is the function that chooses the bucket to place the address in. */ -static uint32_t FN(HashBytes)( - const uint8_t* BROTLI_RESTRICT data, const int shift) { +static uint32_t FN(HashBytes)(const uint8_t* data, const int shift) { uint32_t h = BROTLI_UNALIGNED_LOAD32LE(data) * kHashMul32; /* The higher bits contain more mixture from the multiplication, so we take our results from there. */ @@ -39,46 +38,42 @@ typedef struct HashLongestMatch { /* Mask for accessing entries in a block (in a ring-buffer manner). */ uint32_t block_mask_; - int block_bits_; - int num_last_distances_to_check_; - - /* Shortcuts. */ - HasherCommon* common_; - /* --- Dynamic size members --- */ /* Number of entries in a particular bucket. */ - uint16_t* num_; /* uint16_t[bucket_size]; */ + /* uint16_t num[bucket_size]; */ /* Buckets containing block_size_ of backward references. */ - uint32_t* buckets_; /* uint32_t[bucket_size * block_size]; */ + /* uint32_t* buckets[bucket_size * block_size]; */ } HashLongestMatch; -static BROTLI_INLINE uint16_t* FN(Num)(void* extra) { - return (uint16_t*)extra; +static BROTLI_INLINE HashLongestMatch* FN(Self)(HasherHandle handle) { + return (HashLongestMatch*)&(GetHasherCommon(handle)[1]); } -static void FN(Initialize)( - HasherCommon* common, HashLongestMatch* BROTLI_RESTRICT self, - const BrotliEncoderParams* params) { - self->common_ = common; +static BROTLI_INLINE uint16_t* FN(Num)(HashLongestMatch* self) { + return (uint16_t*)(&self[1]); +} +static BROTLI_INLINE uint32_t* FN(Buckets)(HashLongestMatch* self) { + return (uint32_t*)(&FN(Num)(self)[self->bucket_size_]); +} + +static void FN(Initialize)( + HasherHandle handle, const BrotliEncoderParams* params) { + HasherCommon* common = GetHasherCommon(handle); + HashLongestMatch* self = FN(Self)(handle); BROTLI_UNUSED(params); self->hash_shift_ = 32 - common->params.bucket_bits; self->bucket_size_ = (size_t)1 << common->params.bucket_bits; self->block_size_ = (size_t)1 << common->params.block_bits; self->block_mask_ = (uint32_t)(self->block_size_ - 1); - self->num_ = (uint16_t*)common->extra; - self->buckets_ = (uint32_t*)(&self->num_[self->bucket_size_]); - self->block_bits_ = common->params.block_bits; - self->num_last_distances_to_check_ = - common->params.num_last_distances_to_check; } -static void FN(Prepare)( - HashLongestMatch* BROTLI_RESTRICT self, BROTLI_BOOL one_shot, - size_t input_size, const uint8_t* BROTLI_RESTRICT data) { - uint16_t* BROTLI_RESTRICT num = self->num_; +static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot, + size_t input_size, const uint8_t* data) { + HashLongestMatch* self = FN(Self)(handle); + uint16_t* num = FN(Num)(self); /* Partial preparation is 100 times slower (per socket). */ size_t partial_prepare_threshold = self->bucket_size_ >> 6; if (one_shot && input_size <= partial_prepare_threshold) { @@ -99,49 +94,49 @@ static BROTLI_INLINE size_t FN(HashMemAllocInBytes)( size_t block_size = (size_t)1 << params->hasher.block_bits; BROTLI_UNUSED(one_shot); BROTLI_UNUSED(input_size); - return sizeof(uint16_t) * bucket_size + - sizeof(uint32_t) * bucket_size * block_size; + return sizeof(HashLongestMatch) + bucket_size * (2 + 4 * block_size); } /* Look at 4 bytes at &data[ix & mask]. Compute a hash from these, and store the value of ix at that position. */ -static BROTLI_INLINE void FN(Store)( - HashLongestMatch* BROTLI_RESTRICT self, const uint8_t* BROTLI_RESTRICT data, +static BROTLI_INLINE void FN(Store)(HasherHandle handle, const uint8_t* data, const size_t mask, const size_t ix) { + HashLongestMatch* self = FN(Self)(handle); + uint16_t* num = FN(Num)(self); const uint32_t key = FN(HashBytes)(&data[ix & mask], self->hash_shift_); - const size_t minor_ix = self->num_[key] & self->block_mask_; - const size_t offset = minor_ix + (key << self->block_bits_); - self->buckets_[offset] = (uint32_t)ix; - ++self->num_[key]; + const size_t minor_ix = num[key] & self->block_mask_; + const size_t offset = + minor_ix + (key << GetHasherCommon(handle)->params.block_bits); + FN(Buckets)(self)[offset] = (uint32_t)ix; + ++num[key]; } -static BROTLI_INLINE void FN(StoreRange)(HashLongestMatch* BROTLI_RESTRICT self, - const uint8_t* BROTLI_RESTRICT data, const size_t mask, - const size_t ix_start, const size_t ix_end) { +static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle, + const uint8_t* data, const size_t mask, const size_t ix_start, + const size_t ix_end) { size_t i; for (i = ix_start; i < ix_end; ++i) { - FN(Store)(self, data, mask, i); + FN(Store)(handle, data, mask, i); } } -static BROTLI_INLINE void FN(StitchToPreviousBlock)( - HashLongestMatch* BROTLI_RESTRICT self, +static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle, size_t num_bytes, size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask) { if (num_bytes >= FN(HashTypeLength)() - 1 && position >= 3) { /* Prepare the hashes for three last bytes of the last write. These could not be calculated before, since they require knowledge of both the previous and the current block. */ - FN(Store)(self, ringbuffer, ringbuffer_mask, position - 3); - FN(Store)(self, ringbuffer, ringbuffer_mask, position - 2); - FN(Store)(self, ringbuffer, ringbuffer_mask, position - 1); + FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 3); + FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 2); + FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 1); } } static BROTLI_INLINE void FN(PrepareDistanceCache)( - HashLongestMatch* BROTLI_RESTRICT self, - int* BROTLI_RESTRICT distance_cache) { - PrepareDistanceCache(distance_cache, self->num_last_distances_to_check_); + HasherHandle handle, int* BROTLI_RESTRICT distance_cache) { + PrepareDistanceCache(distance_cache, + GetHasherCommon(handle)->params.num_last_distances_to_check); } /* Find a longest backward match of &data[cur_ix] up to the length of @@ -155,16 +150,17 @@ static BROTLI_INLINE void FN(PrepareDistanceCache)( Does not look for matches further away than max_backward. Writes the best match into |out|. |out|->score is updated only if a better match is found. */ -static BROTLI_INLINE void FN(FindLongestMatch)( - HashLongestMatch* BROTLI_RESTRICT self, +static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle, const BrotliEncoderDictionary* dictionary, const uint8_t* BROTLI_RESTRICT data, const size_t ring_buffer_mask, const int* BROTLI_RESTRICT distance_cache, const size_t cur_ix, const size_t max_length, const size_t max_backward, - const size_t dictionary_distance, const size_t max_distance, + const size_t gap, const size_t max_distance, HasherSearchResult* BROTLI_RESTRICT out) { - uint16_t* BROTLI_RESTRICT num = self->num_; - uint32_t* BROTLI_RESTRICT buckets = self->buckets_; + HasherCommon* common = GetHasherCommon(handle); + HashLongestMatch* self = FN(Self)(handle); + uint16_t* num = FN(Num)(self); + uint32_t* buckets = FN(Buckets)(self); const size_t cur_ix_masked = cur_ix & ring_buffer_mask; /* Don't accept a short copy from far away. */ score_t min_score = out->score; @@ -174,7 +170,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)( out->len = 0; out->len_code_delta = 0; /* Try last distance first. */ - for (i = 0; i < (size_t)self->num_last_distances_to_check_; ++i) { + for (i = 0; i < (size_t)common->params.num_last_distances_to_check; ++i) { const size_t backward = (size_t)distance_cache[i]; size_t prev_ix = (size_t)(cur_ix - backward); if (prev_ix >= cur_ix) { @@ -215,7 +211,8 @@ static BROTLI_INLINE void FN(FindLongestMatch)( { const uint32_t key = FN(HashBytes)(&data[cur_ix_masked], self->hash_shift_); - uint32_t* BROTLI_RESTRICT bucket = &buckets[key << self->block_bits_]; + uint32_t* BROTLI_RESTRICT bucket = + &buckets[key << common->params.block_bits]; const size_t down = (num[key] > self->block_size_) ? (num[key] - self->block_size_) : 0u; for (i = num[key]; i > down;) { @@ -254,7 +251,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)( } if (min_score == out->score) { SearchInStaticDictionary(dictionary, - self->common_, &data[cur_ix_masked], max_length, dictionary_distance, + handle, &data[cur_ix_masked], max_length, max_backward + gap, max_distance, out, BROTLI_FALSE); } } diff --git a/deps/brotli/c/enc/hash_longest_match_quickly_inc.h b/deps/brotli/c/enc/hash_longest_match_quickly_inc.h index e5ba840ab9777a..a7b9639febffdf 100644 --- a/deps/brotli/c/enc/hash_longest_match_quickly_inc.h +++ b/deps/brotli/c/enc/hash_longest_match_quickly_inc.h @@ -5,16 +5,15 @@ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ -/* template parameters: FN, BUCKET_BITS, BUCKET_SWEEP_BITS, HASH_LEN, +/* template parameters: FN, BUCKET_BITS, BUCKET_SWEEP, HASH_LEN, USE_DICTIONARY */ #define HashLongestMatchQuickly HASHER() #define BUCKET_SIZE (1 << BUCKET_BITS) -#define BUCKET_MASK (BUCKET_SIZE - 1) -#define BUCKET_SWEEP (1 << BUCKET_SWEEP_BITS) -#define BUCKET_SWEEP_MASK ((BUCKET_SWEEP - 1) << 3) + +#define HASH_MAP_SIZE (4 << BUCKET_BITS) static BROTLI_INLINE size_t FN(HashTypeLength)(void) { return 8; } static BROTLI_INLINE size_t FN(StoreLookahead)(void) { return 8; } @@ -33,50 +32,39 @@ static uint32_t FN(HashBytes)(const uint8_t* data) { /* A (forgetful) hash table to the data seen by the compressor, to help create backward references to previous data. - This is a hash map of fixed size (BUCKET_SIZE). */ + This is a hash map of fixed size (BUCKET_SIZE). Starting from the + given index, BUCKET_SWEEP buckets are used to store values of a key. */ typedef struct HashLongestMatchQuickly { - /* Shortcuts. */ - HasherCommon* common; - - /* --- Dynamic size members --- */ - - uint32_t* buckets_; /* uint32_t[BUCKET_SIZE]; */ + uint32_t buckets_[BUCKET_SIZE + BUCKET_SWEEP]; } HashLongestMatchQuickly; -static void FN(Initialize)( - HasherCommon* common, HashLongestMatchQuickly* BROTLI_RESTRICT self, - const BrotliEncoderParams* params) { - self->common = common; +static BROTLI_INLINE HashLongestMatchQuickly* FN(Self)(HasherHandle handle) { + return (HashLongestMatchQuickly*)&(GetHasherCommon(handle)[1]); +} +static void FN(Initialize)( + HasherHandle handle, const BrotliEncoderParams* params) { + BROTLI_UNUSED(handle); BROTLI_UNUSED(params); - self->buckets_ = (uint32_t*)common->extra; } -static void FN(Prepare)( - HashLongestMatchQuickly* BROTLI_RESTRICT self, BROTLI_BOOL one_shot, - size_t input_size, const uint8_t* BROTLI_RESTRICT data) { - uint32_t* BROTLI_RESTRICT buckets = self->buckets_; +static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot, + size_t input_size, const uint8_t* data) { + HashLongestMatchQuickly* self = FN(Self)(handle); /* Partial preparation is 100 times slower (per socket). */ - size_t partial_prepare_threshold = BUCKET_SIZE >> 5; + size_t partial_prepare_threshold = HASH_MAP_SIZE >> 7; if (one_shot && input_size <= partial_prepare_threshold) { size_t i; for (i = 0; i < input_size; ++i) { const uint32_t key = FN(HashBytes)(&data[i]); - if (BUCKET_SWEEP == 1) { - buckets[key] = 0; - } else { - uint32_t j; - for (j = 0; j < BUCKET_SWEEP; ++j) { - buckets[(key + (j << 3)) & BUCKET_MASK] = 0; - } - } + memset(&self->buckets_[key], 0, BUCKET_SWEEP * sizeof(self->buckets_[0])); } } else { /* It is not strictly necessary to fill this buffer here, but not filling will make the results of the compression stochastic (but correct). This is because random data would cause the system to find accidentally good backward references here and there. */ - memset(buckets, 0, sizeof(uint32_t) * BUCKET_SIZE); + memset(&self->buckets_[0], 0, sizeof(self->buckets_)); } } @@ -86,53 +74,45 @@ static BROTLI_INLINE size_t FN(HashMemAllocInBytes)( BROTLI_UNUSED(params); BROTLI_UNUSED(one_shot); BROTLI_UNUSED(input_size); - return sizeof(uint32_t) * BUCKET_SIZE; + return sizeof(HashLongestMatchQuickly); } /* Look at 5 bytes at &data[ix & mask]. Compute a hash from these, and store the value somewhere within [ix .. ix+3]. */ -static BROTLI_INLINE void FN(Store)( - HashLongestMatchQuickly* BROTLI_RESTRICT self, - const uint8_t* BROTLI_RESTRICT data, const size_t mask, const size_t ix) { +static BROTLI_INLINE void FN(Store)(HasherHandle handle, + const uint8_t* data, const size_t mask, const size_t ix) { const uint32_t key = FN(HashBytes)(&data[ix & mask]); - if (BUCKET_SWEEP == 1) { - self->buckets_[key] = (uint32_t)ix; - } else { - /* Wiggle the value with the bucket sweep range. */ - const uint32_t off = ix & BUCKET_SWEEP_MASK; - self->buckets_[(key + off) & BUCKET_MASK] = (uint32_t)ix; - } + /* Wiggle the value with the bucket sweep range. */ + const uint32_t off = (ix >> 3) % BUCKET_SWEEP; + FN(Self)(handle)->buckets_[key + off] = (uint32_t)ix; } -static BROTLI_INLINE void FN(StoreRange)( - HashLongestMatchQuickly* BROTLI_RESTRICT self, - const uint8_t* BROTLI_RESTRICT data, const size_t mask, - const size_t ix_start, const size_t ix_end) { +static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle, + const uint8_t* data, const size_t mask, const size_t ix_start, + const size_t ix_end) { size_t i; for (i = ix_start; i < ix_end; ++i) { - FN(Store)(self, data, mask, i); + FN(Store)(handle, data, mask, i); } } static BROTLI_INLINE void FN(StitchToPreviousBlock)( - HashLongestMatchQuickly* BROTLI_RESTRICT self, - size_t num_bytes, size_t position, + HasherHandle handle, size_t num_bytes, size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask) { if (num_bytes >= FN(HashTypeLength)() - 1 && position >= 3) { /* Prepare the hashes for three last bytes of the last write. These could not be calculated before, since they require knowledge of both the previous and the current block. */ - FN(Store)(self, ringbuffer, ringbuffer_mask, position - 3); - FN(Store)(self, ringbuffer, ringbuffer_mask, position - 2); - FN(Store)(self, ringbuffer, ringbuffer_mask, position - 1); + FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 3); + FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 2); + FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 1); } } static BROTLI_INLINE void FN(PrepareDistanceCache)( - HashLongestMatchQuickly* BROTLI_RESTRICT self, - int* BROTLI_RESTRICT distance_cache) { - BROTLI_UNUSED(self); + HasherHandle handle, int* BROTLI_RESTRICT distance_cache) { + BROTLI_UNUSED(handle); BROTLI_UNUSED(distance_cache); } @@ -145,19 +125,17 @@ static BROTLI_INLINE void FN(PrepareDistanceCache)( Writes the best match into |out|. |out|->score is updated only if a better match is found. */ static BROTLI_INLINE void FN(FindLongestMatch)( - HashLongestMatchQuickly* BROTLI_RESTRICT self, - const BrotliEncoderDictionary* dictionary, + HasherHandle handle, const BrotliEncoderDictionary* dictionary, const uint8_t* BROTLI_RESTRICT data, const size_t ring_buffer_mask, const int* BROTLI_RESTRICT distance_cache, const size_t cur_ix, const size_t max_length, const size_t max_backward, - const size_t dictionary_distance, const size_t max_distance, + const size_t gap, const size_t max_distance, HasherSearchResult* BROTLI_RESTRICT out) { - uint32_t* BROTLI_RESTRICT buckets = self->buckets_; + HashLongestMatchQuickly* self = FN(Self)(handle); const size_t best_len_in = out->len; const size_t cur_ix_masked = cur_ix & ring_buffer_mask; + const uint32_t key = FN(HashBytes)(&data[cur_ix_masked]); int compare_char = data[cur_ix_masked + best_len_in]; - size_t key = FN(HashBytes)(&data[cur_ix_masked]); - size_t key_out; score_t min_score = out->score; score_t best_score = out->score; size_t best_len = best_len_in; @@ -167,21 +145,21 @@ static BROTLI_INLINE void FN(FindLongestMatch)( if (prev_ix < cur_ix) { prev_ix &= (uint32_t)ring_buffer_mask; if (compare_char == data[prev_ix + best_len]) { - const size_t len = FindMatchLengthWithLimit( - &data[prev_ix], &data[cur_ix_masked], max_length); + size_t len = FindMatchLengthWithLimit(&data[prev_ix], + &data[cur_ix_masked], + max_length); if (len >= 4) { const score_t score = BackwardReferenceScoreUsingLastDistance(len); if (best_score < score) { + best_score = score; + best_len = len; out->len = len; out->distance = cached_backward; - out->score = score; + out->score = best_score; + compare_char = data[cur_ix_masked + best_len]; if (BUCKET_SWEEP == 1) { - buckets[key] = (uint32_t)cur_ix; + self->buckets_[key] = (uint32_t)cur_ix; return; - } else { - best_len = len; - best_score = score; - compare_char = data[cur_ix_masked + len]; } } } @@ -191,8 +169,8 @@ static BROTLI_INLINE void FN(FindLongestMatch)( size_t backward; size_t len; /* Only one to look for, don't bother to prepare for a loop. */ - prev_ix = buckets[key]; - buckets[key] = (uint32_t)cur_ix; + prev_ix = self->buckets_[key]; + self->buckets_[key] = (uint32_t)cur_ix; backward = cur_ix - prev_ix; prev_ix &= (uint32_t)ring_buffer_mask; if (compare_char != data[prev_ix + best_len_in]) { @@ -214,17 +192,12 @@ static BROTLI_INLINE void FN(FindLongestMatch)( } } } else { - size_t keys[BUCKET_SWEEP]; - size_t i; - for (i = 0; i < BUCKET_SWEEP; ++i) { - keys[i] = (key + (i << 3)) & BUCKET_MASK; - } - key_out = keys[(cur_ix & BUCKET_SWEEP_MASK) >> 3]; - for (i = 0; i < BUCKET_SWEEP; ++i) { + uint32_t* bucket = self->buckets_ + key; + int i; + prev_ix = *bucket++; + for (i = 0; i < BUCKET_SWEEP; ++i, prev_ix = *bucket++) { + const size_t backward = cur_ix - prev_ix; size_t len; - size_t backward; - prev_ix = buckets[keys[i]]; - backward = cur_ix - prev_ix; prev_ix &= (uint32_t)ring_buffer_mask; if (compare_char != data[prev_ix + best_len]) { continue; @@ -238,29 +211,25 @@ static BROTLI_INLINE void FN(FindLongestMatch)( if (len >= 4) { const score_t score = BackwardReferenceScore(len, backward); if (best_score < score) { - best_len = len; - out->len = len; - compare_char = data[cur_ix_masked + len]; best_score = score; - out->score = score; + best_len = len; + out->len = best_len; out->distance = backward; + out->score = score; + compare_char = data[cur_ix_masked + best_len]; } } } } if (USE_DICTIONARY && min_score == out->score) { SearchInStaticDictionary(dictionary, - self->common, &data[cur_ix_masked], max_length, dictionary_distance, + handle, &data[cur_ix_masked], max_length, max_backward + gap, max_distance, out, BROTLI_TRUE); } - if (BUCKET_SWEEP != 1) { - buckets[key_out] = (uint32_t)cur_ix; - } + self->buckets_[key + ((cur_ix >> 3) % BUCKET_SWEEP)] = (uint32_t)cur_ix; } -#undef BUCKET_SWEEP_MASK -#undef BUCKET_SWEEP -#undef BUCKET_MASK +#undef HASH_MAP_SIZE #undef BUCKET_SIZE #undef HashLongestMatchQuickly diff --git a/deps/brotli/c/enc/hash_rolling_inc.h b/deps/brotli/c/enc/hash_rolling_inc.h index 586ae738591da0..17f8a408e246e8 100644 --- a/deps/brotli/c/enc/hash_rolling_inc.h +++ b/deps/brotli/c/enc/hash_rolling_inc.h @@ -51,9 +51,13 @@ typedef struct HashRolling { uint32_t factor_remove; } HashRolling; +static BROTLI_INLINE HashRolling* FN(Self)(HasherHandle handle) { + return (HashRolling*)&(GetHasherCommon(handle)[1]); +} + static void FN(Initialize)( - HasherCommon* common, HashRolling* BROTLI_RESTRICT self, - const BrotliEncoderParams* params) { + HasherHandle handle, const BrotliEncoderParams* params) { + HashRolling* self = FN(Self)(handle); size_t i; self->state = 0; self->next_ix = 0; @@ -67,7 +71,7 @@ static void FN(Initialize)( self->factor_remove *= self->factor; } - self->table = (uint32_t*)common->extra; + self->table = (uint32_t*)((HasherHandle)self + sizeof(HashRolling)); for (i = 0; i < NUMBUCKETS; i++) { self->table[i] = FN(kInvalidPos); } @@ -75,8 +79,9 @@ static void FN(Initialize)( BROTLI_UNUSED(params); } -static void FN(Prepare)(HashRolling* BROTLI_RESTRICT self, BROTLI_BOOL one_shot, - size_t input_size, const uint8_t* BROTLI_RESTRICT data) { +static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot, + size_t input_size, const uint8_t* data) { + HashRolling* self = FN(Self)(handle); size_t i; /* Too small size, cannot use this hasher. */ if (input_size < CHUNKLEN) return; @@ -91,36 +96,36 @@ static void FN(Prepare)(HashRolling* BROTLI_RESTRICT self, BROTLI_BOOL one_shot, static BROTLI_INLINE size_t FN(HashMemAllocInBytes)( const BrotliEncoderParams* params, BROTLI_BOOL one_shot, size_t input_size) { - return NUMBUCKETS * sizeof(uint32_t); + return sizeof(HashRolling) + NUMBUCKETS * sizeof(uint32_t); BROTLI_UNUSED(params); BROTLI_UNUSED(one_shot); BROTLI_UNUSED(input_size); } -static BROTLI_INLINE void FN(Store)(HashRolling* BROTLI_RESTRICT self, +static BROTLI_INLINE void FN(Store)(HasherHandle BROTLI_RESTRICT handle, const uint8_t* BROTLI_RESTRICT data, const size_t mask, const size_t ix) { - BROTLI_UNUSED(self); + BROTLI_UNUSED(handle); BROTLI_UNUSED(data); BROTLI_UNUSED(mask); BROTLI_UNUSED(ix); } -static BROTLI_INLINE void FN(StoreRange)(HashRolling* BROTLI_RESTRICT self, - const uint8_t* BROTLI_RESTRICT data, const size_t mask, - const size_t ix_start, const size_t ix_end) { - BROTLI_UNUSED(self); +static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle, + const uint8_t* data, const size_t mask, const size_t ix_start, + const size_t ix_end) { + BROTLI_UNUSED(handle); BROTLI_UNUSED(data); BROTLI_UNUSED(mask); BROTLI_UNUSED(ix_start); BROTLI_UNUSED(ix_end); } -static BROTLI_INLINE void FN(StitchToPreviousBlock)( - HashRolling* BROTLI_RESTRICT self, +static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle, size_t num_bytes, size_t position, const uint8_t* ringbuffer, size_t ring_buffer_mask) { /* In this case we must re-initialize the hasher from scratch from the current position. */ + HashRolling* self = FN(Self)(handle); size_t position_masked; size_t available = num_bytes; if ((position & (JUMP - 1)) != 0) { @@ -134,29 +139,28 @@ static BROTLI_INLINE void FN(StitchToPreviousBlock)( available = ring_buffer_mask - position_masked; } - FN(Prepare)(self, BROTLI_FALSE, available, + FN(Prepare)(handle, BROTLI_FALSE, available, ringbuffer + (position & ring_buffer_mask)); self->next_ix = position; BROTLI_UNUSED(num_bytes); } static BROTLI_INLINE void FN(PrepareDistanceCache)( - HashRolling* BROTLI_RESTRICT self, - int* BROTLI_RESTRICT distance_cache) { - BROTLI_UNUSED(self); + HasherHandle handle, int* BROTLI_RESTRICT distance_cache) { + BROTLI_UNUSED(handle); BROTLI_UNUSED(distance_cache); } -static BROTLI_INLINE void FN(FindLongestMatch)( - HashRolling* BROTLI_RESTRICT self, +static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle, const BrotliEncoderDictionary* dictionary, const uint8_t* BROTLI_RESTRICT data, const size_t ring_buffer_mask, const int* BROTLI_RESTRICT distance_cache, const size_t cur_ix, const size_t max_length, const size_t max_backward, - const size_t dictionary_distance, const size_t max_distance, + const size_t gap, const size_t max_distance, HasherSearchResult* BROTLI_RESTRICT out) { + HashRolling* self = FN(Self)(handle); const size_t cur_ix_masked = cur_ix & ring_buffer_mask; - size_t pos; + size_t pos = self->next_ix; if ((cur_ix & (JUMP - 1)) != 0) return; @@ -205,7 +209,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)( backup-hasher, the main hasher already searches in it. */ BROTLI_UNUSED(dictionary); BROTLI_UNUSED(distance_cache); - BROTLI_UNUSED(dictionary_distance); + BROTLI_UNUSED(gap); BROTLI_UNUSED(max_distance); } diff --git a/deps/brotli/c/enc/hash_to_binary_tree_inc.h b/deps/brotli/c/enc/hash_to_binary_tree_inc.h index 9880e0aef684de..7fb0356f5560e2 100644 --- a/deps/brotli/c/enc/hash_to_binary_tree_inc.h +++ b/deps/brotli/c/enc/hash_to_binary_tree_inc.h @@ -24,7 +24,7 @@ static BROTLI_INLINE size_t FN(StoreLookahead)(void) { return MAX_TREE_COMP_LENGTH; } -static uint32_t FN(HashBytes)(const uint8_t* BROTLI_RESTRICT data) { +static uint32_t FN(HashBytes)(const uint8_t* data) { uint32_t h = BROTLI_UNALIGNED_LOAD32LE(data) * kHashMul32; /* The higher bits contain more mixture from the multiplication, so we take our results from there. */ @@ -38,7 +38,7 @@ typedef struct HashToBinaryTree { /* Hash table that maps the 4-byte hashes of the sequence to the last position where this hash was found, which is the root of the binary tree of sequences that share this hash bucket. */ - uint32_t* buckets_; /* uint32_t[BUCKET_SIZE]; */ + uint32_t buckets_[BUCKET_SIZE]; /* A position used to mark a non-existent sequence, i.e. a tree is empty if its root is at invalid_pos_ and a node is a leaf if both its children @@ -51,30 +51,34 @@ typedef struct HashToBinaryTree { corresponding to a hash is a sequence starting at buckets_[hash] and the left and right children of a sequence starting at pos are forest_[2 * pos] and forest_[2 * pos + 1]. */ - uint32_t* forest_; /* uint32_t[2 * num_nodes] */ + /* uint32_t forest[2 * num_nodes] */ } HashToBinaryTree; -static void FN(Initialize)( - HasherCommon* common, HashToBinaryTree* BROTLI_RESTRICT self, - const BrotliEncoderParams* params) { - self->buckets_ = (uint32_t*)common->extra; - self->forest_ = &self->buckets_[BUCKET_SIZE]; +static BROTLI_INLINE HashToBinaryTree* FN(Self)(HasherHandle handle) { + return (HashToBinaryTree*)&(GetHasherCommon(handle)[1]); +} +static BROTLI_INLINE uint32_t* FN(Forest)(HashToBinaryTree* self) { + return (uint32_t*)(&self[1]); +} + +static void FN(Initialize)( + HasherHandle handle, const BrotliEncoderParams* params) { + HashToBinaryTree* self = FN(Self)(handle); self->window_mask_ = (1u << params->lgwin) - 1u; self->invalid_pos_ = (uint32_t)(0 - self->window_mask_); } -static void FN(Prepare) - (HashToBinaryTree* BROTLI_RESTRICT self, BROTLI_BOOL one_shot, - size_t input_size, const uint8_t* BROTLI_RESTRICT data) { +static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot, + size_t input_size, const uint8_t* data) { + HashToBinaryTree* self = FN(Self)(handle); uint32_t invalid_pos = self->invalid_pos_; uint32_t i; - uint32_t* BROTLI_RESTRICT buckets = self->buckets_; BROTLI_UNUSED(data); BROTLI_UNUSED(one_shot); BROTLI_UNUSED(input_size); for (i = 0; i < BUCKET_SIZE; i++) { - buckets[i] = invalid_pos; + self->buckets_[i] = invalid_pos; } } @@ -85,17 +89,15 @@ static BROTLI_INLINE size_t FN(HashMemAllocInBytes)( if (one_shot && input_size < num_nodes) { num_nodes = input_size; } - return sizeof(uint32_t) * BUCKET_SIZE + 2 * sizeof(uint32_t) * num_nodes; + return sizeof(HashToBinaryTree) + 2 * sizeof(uint32_t) * num_nodes; } -static BROTLI_INLINE size_t FN(LeftChildIndex)( - HashToBinaryTree* BROTLI_RESTRICT self, +static BROTLI_INLINE size_t FN(LeftChildIndex)(HashToBinaryTree* self, const size_t pos) { return 2 * (pos & self->window_mask_); } -static BROTLI_INLINE size_t FN(RightChildIndex)( - HashToBinaryTree* BROTLI_RESTRICT self, +static BROTLI_INLINE size_t FN(RightChildIndex)(HashToBinaryTree* self, const size_t pos) { return 2 * (pos & self->window_mask_) + 1; } @@ -111,7 +113,7 @@ static BROTLI_INLINE size_t FN(RightChildIndex)( This function must be called with increasing cur_ix positions. */ static BROTLI_INLINE BackwardMatch* FN(StoreAndFindMatches)( - HashToBinaryTree* BROTLI_RESTRICT self, const uint8_t* BROTLI_RESTRICT data, + HashToBinaryTree* self, const uint8_t* const BROTLI_RESTRICT data, const size_t cur_ix, const size_t ring_buffer_mask, const size_t max_length, const size_t max_backward, size_t* const BROTLI_RESTRICT best_len, BackwardMatch* BROTLI_RESTRICT matches) { @@ -121,9 +123,8 @@ static BROTLI_INLINE BackwardMatch* FN(StoreAndFindMatches)( const BROTLI_BOOL should_reroot_tree = TO_BROTLI_BOOL(max_length >= MAX_TREE_COMP_LENGTH); const uint32_t key = FN(HashBytes)(&data[cur_ix_masked]); - uint32_t* BROTLI_RESTRICT buckets = self->buckets_; - uint32_t* BROTLI_RESTRICT forest = self->forest_; - size_t prev_ix = buckets[key]; + uint32_t* forest = FN(Forest)(self); + size_t prev_ix = self->buckets_[key]; /* The forest index of the rightmost node of the left subtree of the new root, updated as we traverse and re-root the tree of the hash bucket. */ size_t node_left = FN(LeftChildIndex)(self, cur_ix); @@ -138,7 +139,7 @@ static BROTLI_INLINE BackwardMatch* FN(StoreAndFindMatches)( size_t best_len_right = 0; size_t depth_remaining; if (should_reroot_tree) { - buckets[key] = (uint32_t)cur_ix; + self->buckets_[key] = (uint32_t)cur_ix; } for (depth_remaining = MAX_TREE_SEARCH_DEPTH; ; --depth_remaining) { const size_t backward = cur_ix - prev_ix; @@ -198,13 +199,11 @@ static BROTLI_INLINE BackwardMatch* FN(StoreAndFindMatches)( matches in matches[0] to matches[*num_matches - 1]. The matches will be sorted by strictly increasing length and (non-strictly) increasing distance. */ -static BROTLI_INLINE size_t FN(FindAllMatches)( - HashToBinaryTree* BROTLI_RESTRICT self, - const BrotliEncoderDictionary* dictionary, - const uint8_t* BROTLI_RESTRICT data, +static BROTLI_INLINE size_t FN(FindAllMatches)(HasherHandle handle, + const BrotliEncoderDictionary* dictionary, const uint8_t* data, const size_t ring_buffer_mask, const size_t cur_ix, const size_t max_length, const size_t max_backward, - const size_t dictionary_distance, const BrotliEncoderParams* params, + const size_t gap, const BrotliEncoderParams* params, BackwardMatch* matches) { BackwardMatch* const orig_matches = matches; const size_t cur_ix_masked = cur_ix & ring_buffer_mask; @@ -237,7 +236,7 @@ static BROTLI_INLINE size_t FN(FindAllMatches)( } } if (best_len < max_length) { - matches = FN(StoreAndFindMatches)(self, data, cur_ix, + matches = FN(StoreAndFindMatches)(FN(Self)(handle), data, cur_ix, ring_buffer_mask, max_length, max_backward, &best_len, matches); } for (i = 0; i <= BROTLI_MAX_STATIC_DICTIONARY_MATCH_LEN; ++i) { @@ -253,7 +252,7 @@ static BROTLI_INLINE size_t FN(FindAllMatches)( for (l = minlen; l <= maxlen; ++l) { uint32_t dict_id = dict_matches[l]; if (dict_id < kInvalidMatch) { - size_t distance = dictionary_distance + (dict_id >> 5) + 1; + size_t distance = max_backward + gap + (dict_id >> 5) + 1; if (distance <= params->dist.max_distance) { InitDictionaryBackwardMatch(matches++, distance, l, dict_id & 31); } @@ -267,18 +266,18 @@ static BROTLI_INLINE size_t FN(FindAllMatches)( /* Stores the hash of the next 4 bytes and re-roots the binary tree at the current sequence, without returning any matches. REQUIRES: ix + MAX_TREE_COMP_LENGTH <= end-of-current-block */ -static BROTLI_INLINE void FN(Store)(HashToBinaryTree* BROTLI_RESTRICT self, - const uint8_t* BROTLI_RESTRICT data, +static BROTLI_INLINE void FN(Store)(HasherHandle handle, const uint8_t* data, const size_t mask, const size_t ix) { + HashToBinaryTree* self = FN(Self)(handle); /* Maximum distance is window size - 16, see section 9.1. of the spec. */ const size_t max_backward = self->window_mask_ - BROTLI_WINDOW_GAP + 1; FN(StoreAndFindMatches)(self, data, ix, mask, MAX_TREE_COMP_LENGTH, max_backward, NULL, NULL); } -static BROTLI_INLINE void FN(StoreRange)(HashToBinaryTree* BROTLI_RESTRICT self, - const uint8_t* BROTLI_RESTRICT data, const size_t mask, - const size_t ix_start, const size_t ix_end) { +static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle, + const uint8_t* data, const size_t mask, const size_t ix_start, + const size_t ix_end) { size_t i = ix_start; size_t j = ix_start; if (ix_start + 63 <= ix_end) { @@ -286,18 +285,18 @@ static BROTLI_INLINE void FN(StoreRange)(HashToBinaryTree* BROTLI_RESTRICT self, } if (ix_start + 512 <= i) { for (; j < i; j += 8) { - FN(Store)(self, data, mask, j); + FN(Store)(handle, data, mask, j); } } for (; i < ix_end; ++i) { - FN(Store)(self, data, mask, i); + FN(Store)(handle, data, mask, i); } } -static BROTLI_INLINE void FN(StitchToPreviousBlock)( - HashToBinaryTree* BROTLI_RESTRICT self, +static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle, size_t num_bytes, size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask) { + HashToBinaryTree* self = FN(Self)(handle); if (num_bytes >= FN(HashTypeLength)() - 1 && position >= MAX_TREE_COMP_LENGTH) { /* Store the last `MAX_TREE_COMP_LENGTH - 1` positions in the hasher. diff --git a/deps/brotli/c/enc/memory.h b/deps/brotli/c/enc/memory.h index 832e7b2b6e3701..ab928d019be8d9 100644 --- a/deps/brotli/c/enc/memory.h +++ b/deps/brotli/c/enc/memory.h @@ -56,18 +56,6 @@ BROTLI_INTERNAL void BrotliFree(MemoryManager* m, void* p); #define BROTLI_IS_OOM(M) (!!(M)->is_oom) #endif /* BROTLI_ENCODER_EXIT_ON_OOM */ -/* -BROTLI_IS_NULL is a fake check, BROTLI_IS_OOM does the heavy lifting. -The only purpose of it is to explain static analyzers the state of things. -NB: use ONLY together with BROTLI_IS_OOM - AND ONLY for allocations in the current scope. - */ -#if defined(__clang_analyzer__) && !defined(BROTLI_ENCODER_EXIT_ON_OOM) -#define BROTLI_IS_NULL(A) ((A) == nullptr) -#else /* defined(__clang_analyzer__) */ -#define BROTLI_IS_NULL(A) (!!0) -#endif /* defined(__clang_analyzer__) */ - BROTLI_INTERNAL void BrotliWipeOutMemoryManager(MemoryManager* m); /* @@ -78,18 +66,18 @@ A: array C: capacity R: requested size */ -#define BROTLI_ENSURE_CAPACITY(M, T, A, C, R) { \ - if (C < (R)) { \ - size_t _new_size = (C == 0) ? (R) : C; \ - T* new_array; \ - while (_new_size < (R)) _new_size *= 2; \ - new_array = BROTLI_ALLOC((M), T, _new_size); \ - if (!BROTLI_IS_OOM(M) && !BROTLI_IS_NULL(new_array) && C != 0) \ - memcpy(new_array, A, C * sizeof(T)); \ - BROTLI_FREE((M), A); \ - A = new_array; \ - C = _new_size; \ - } \ +#define BROTLI_ENSURE_CAPACITY(M, T, A, C, R) { \ + if (C < (R)) { \ + size_t _new_size = (C == 0) ? (R) : C; \ + T* new_array; \ + while (_new_size < (R)) _new_size *= 2; \ + new_array = BROTLI_ALLOC((M), T, _new_size); \ + if (!BROTLI_IS_OOM(M) && C != 0) \ + memcpy(new_array, A, C * sizeof(T)); \ + BROTLI_FREE((M), A); \ + A = new_array; \ + C = _new_size; \ + } \ } /* diff --git a/deps/brotli/c/enc/metablock.c b/deps/brotli/c/enc/metablock.c index 5aa4d4f17c8423..4e80044f3186cc 100644 --- a/deps/brotli/c/enc/metablock.c +++ b/deps/brotli/c/enc/metablock.c @@ -28,30 +28,34 @@ extern "C" { void BrotliInitDistanceParams(BrotliEncoderParams* params, uint32_t npostfix, uint32_t ndirect) { BrotliDistanceParams* dist_params = ¶ms->dist; - uint32_t alphabet_size_max; - uint32_t alphabet_size_limit; - uint32_t max_distance; + uint32_t alphabet_size, max_distance; dist_params->distance_postfix_bits = npostfix; dist_params->num_direct_distance_codes = ndirect; - alphabet_size_max = BROTLI_DISTANCE_ALPHABET_SIZE( + alphabet_size = BROTLI_DISTANCE_ALPHABET_SIZE( npostfix, ndirect, BROTLI_MAX_DISTANCE_BITS); - alphabet_size_limit = alphabet_size_max; max_distance = ndirect + (1U << (BROTLI_MAX_DISTANCE_BITS + npostfix + 2)) - (1U << (npostfix + 2)); if (params->large_window) { - BrotliDistanceCodeLimit limit = BrotliCalculateDistanceCodeLimit( - BROTLI_MAX_ALLOWED_DISTANCE, npostfix, ndirect); - alphabet_size_max = BROTLI_DISTANCE_ALPHABET_SIZE( + static const uint32_t bound[BROTLI_MAX_NPOSTFIX + 1] = {0, 4, 12, 28}; + uint32_t postfix = 1U << npostfix; + alphabet_size = BROTLI_DISTANCE_ALPHABET_SIZE( npostfix, ndirect, BROTLI_LARGE_MAX_DISTANCE_BITS); - alphabet_size_limit = limit.max_alphabet_size; - max_distance = limit.max_distance; + /* The maximum distance is set so that no distance symbol used can encode + a distance larger than BROTLI_MAX_ALLOWED_DISTANCE with all + its extra bits set. */ + if (ndirect < bound[npostfix]) { + max_distance = BROTLI_MAX_ALLOWED_DISTANCE - (bound[npostfix] - ndirect); + } else if (ndirect >= bound[npostfix] + postfix) { + max_distance = (3U << 29) - 4 + (ndirect - bound[npostfix]); + } else { + max_distance = BROTLI_MAX_ALLOWED_DISTANCE; + } } - dist_params->alphabet_size_max = alphabet_size_max; - dist_params->alphabet_size_limit = alphabet_size_limit; + dist_params->alphabet_size = alphabet_size; dist_params->max_distance = max_distance; } @@ -196,7 +200,7 @@ void BrotliBuildMetaBlock(MemoryManager* m, literal_context_multiplier = 1 << BROTLI_LITERAL_CONTEXT_BITS; literal_context_modes = BROTLI_ALLOC(m, ContextType, mb->literal_split.num_types); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(literal_context_modes)) return; + if (BROTLI_IS_OOM(m)) return; for (i = 0; i < mb->literal_split.num_types; ++i) { literal_context_modes[i] = literal_context_mode; } @@ -206,21 +210,21 @@ void BrotliBuildMetaBlock(MemoryManager* m, mb->literal_split.num_types * literal_context_multiplier; literal_histograms = BROTLI_ALLOC(m, HistogramLiteral, literal_histograms_size); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(literal_histograms)) return; + if (BROTLI_IS_OOM(m)) return; ClearHistogramsLiteral(literal_histograms, literal_histograms_size); distance_histograms_size = mb->distance_split.num_types << BROTLI_DISTANCE_CONTEXT_BITS; distance_histograms = BROTLI_ALLOC(m, HistogramDistance, distance_histograms_size); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(distance_histograms)) return; + if (BROTLI_IS_OOM(m)) return; ClearHistogramsDistance(distance_histograms, distance_histograms_size); BROTLI_DCHECK(mb->command_histograms == 0); mb->command_histograms_size = mb->command_split.num_types; mb->command_histograms = BROTLI_ALLOC(m, HistogramCommand, mb->command_histograms_size); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->command_histograms)) return; + if (BROTLI_IS_OOM(m)) return; ClearHistogramsCommand(mb->command_histograms, mb->command_histograms_size); BrotliBuildHistogramsWithContext(cmds, num_commands, @@ -234,13 +238,13 @@ void BrotliBuildMetaBlock(MemoryManager* m, mb->literal_split.num_types << BROTLI_LITERAL_CONTEXT_BITS; mb->literal_context_map = BROTLI_ALLOC(m, uint32_t, mb->literal_context_map_size); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->literal_context_map)) return; + if (BROTLI_IS_OOM(m)) return; BROTLI_DCHECK(mb->literal_histograms == 0); mb->literal_histograms_size = mb->literal_context_map_size; mb->literal_histograms = BROTLI_ALLOC(m, HistogramLiteral, mb->literal_histograms_size); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->literal_histograms)) return; + if (BROTLI_IS_OOM(m)) return; BrotliClusterHistogramsLiteral(m, literal_histograms, literal_histograms_size, kMaxNumberOfHistograms, mb->literal_histograms, @@ -265,13 +269,13 @@ void BrotliBuildMetaBlock(MemoryManager* m, mb->distance_split.num_types << BROTLI_DISTANCE_CONTEXT_BITS; mb->distance_context_map = BROTLI_ALLOC(m, uint32_t, mb->distance_context_map_size); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->distance_context_map)) return; + if (BROTLI_IS_OOM(m)) return; BROTLI_DCHECK(mb->distance_histograms == 0); mb->distance_histograms_size = mb->distance_context_map_size; mb->distance_histograms = BROTLI_ALLOC(m, HistogramDistance, mb->distance_histograms_size); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->distance_histograms)) return; + if (BROTLI_IS_OOM(m)) return; BrotliClusterHistogramsDistance(m, distance_histograms, mb->distance_context_map_size, @@ -369,7 +373,7 @@ static void InitContextBlockSplitter( *histograms_size = max_num_types * num_contexts; *histograms = BROTLI_ALLOC(m, HistogramLiteral, *histograms_size); self->histograms_ = *histograms; - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(*histograms)) return; + if (BROTLI_IS_OOM(m)) return; /* Clear only current histogram. */ ClearHistogramsLiteral(&self->histograms_[0], num_contexts); self->last_histogram_ix_[0] = self->last_histogram_ix_[1] = 0; @@ -419,7 +423,7 @@ static void ContextBlockSplitterFinishBlock( double combined_entropy[2 * BROTLI_MAX_STATIC_CONTEXTS]; double diff[2] = { 0.0 }; size_t i; - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(combined_histo)) return; + if (BROTLI_IS_OOM(m)) return; for (i = 0; i < num_contexts; ++i) { size_t curr_histo_ix = self->curr_histogram_ix_ + i; size_t j; @@ -523,7 +527,7 @@ static void MapStaticContexts(MemoryManager* m, mb->literal_split.num_types << BROTLI_LITERAL_CONTEXT_BITS; mb->literal_context_map = BROTLI_ALLOC(m, uint32_t, mb->literal_context_map_size); - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->literal_context_map)) return; + if (BROTLI_IS_OOM(m)) return; for (i = 0; i < mb->literal_split.num_types; ++i) { uint32_t offset = (uint32_t)(i * num_contexts); diff --git a/deps/brotli/c/enc/metablock_inc.h b/deps/brotli/c/enc/metablock_inc.h index ed507ef5ef46c2..dcc9d3c4a642c5 100644 --- a/deps/brotli/c/enc/metablock_inc.h +++ b/deps/brotli/c/enc/metablock_inc.h @@ -71,7 +71,7 @@ static void FN(InitBlockSplitter)( *histograms_size = max_num_types; *histograms = BROTLI_ALLOC(m, HistogramType, *histograms_size); self->histograms_ = *histograms; - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(*histograms)) return; + if (BROTLI_IS_OOM(m)) return; /* Clear only current histogram. */ FN(HistogramClear)(&self->histograms_[0]); self->last_histogram_ix_[0] = self->last_histogram_ix_[1] = 0; diff --git a/deps/brotli/c/enc/params.h b/deps/brotli/c/enc/params.h index 54a7f007363f8a..6ecf1d3f995d2f 100644 --- a/deps/brotli/c/enc/params.h +++ b/deps/brotli/c/enc/params.h @@ -23,8 +23,7 @@ typedef struct BrotliHasherParams { typedef struct BrotliDistanceParams { uint32_t distance_postfix_bits; uint32_t num_direct_distance_codes; - uint32_t alphabet_size_max; - uint32_t alphabet_size_limit; + uint32_t alphabet_size; size_t max_distance; } BrotliDistanceParams; @@ -34,7 +33,6 @@ typedef struct BrotliEncoderParams { int quality; int lgwin; int lgblock; - size_t stream_offset; size_t size_hint; BROTLI_BOOL disable_literal_context_modeling; BROTLI_BOOL large_window; diff --git a/deps/brotli/c/enc/ringbuffer.h b/deps/brotli/c/enc/ringbuffer.h index 8dce1480399c0c..86079a89d35b9a 100644 --- a/deps/brotli/c/enc/ringbuffer.h +++ b/deps/brotli/c/enc/ringbuffer.h @@ -75,7 +75,7 @@ static BROTLI_INLINE void RingBufferInitBuffer( uint8_t* new_data = BROTLI_ALLOC( m, uint8_t, 2 + buflen + kSlackForEightByteHashingEverywhere); size_t i; - if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(new_data)) return; + if (BROTLI_IS_OOM(m)) return; if (rb->data_) { memcpy(new_data, rb->data_, 2 + rb->cur_size_ + kSlackForEightByteHashingEverywhere); @@ -125,9 +125,6 @@ static BROTLI_INLINE void RingBufferWrite( later when we copy the last two bytes to the first two positions. */ rb->buffer_[rb->size_ - 2] = 0; rb->buffer_[rb->size_ - 1] = 0; - /* Initialize tail; might be touched by "best_len++" optimization when - ring buffer is "full". */ - rb->buffer_[rb->size_] = 241; } { const size_t masked_pos = rb->pos_ & rb->mask_; diff --git a/deps/brotli/c/enc/utf8_util.c b/deps/brotli/c/enc/utf8_util.c index e802b6a7517352..04a7805161b87d 100644 --- a/deps/brotli/c/enc/utf8_util.c +++ b/deps/brotli/c/enc/utf8_util.c @@ -77,7 +77,7 @@ BROTLI_BOOL BrotliIsMostlyUTF8( i += bytes_read; if (symbol < 0x110000) size_utf8 += bytes_read; } - return TO_BROTLI_BOOL((double)size_utf8 > min_fraction * (double)length); + return TO_BROTLI_BOOL(size_utf8 > min_fraction * (double)length); } #if defined(__cplusplus) || defined(c_plusplus) diff --git a/deps/brotli/c/enc/write_bits.h b/deps/brotli/c/enc/write_bits.h index f6f88b45be06c3..36515a6893f8cb 100644 --- a/deps/brotli/c/enc/write_bits.h +++ b/deps/brotli/c/enc/write_bits.h @@ -16,6 +16,8 @@ extern "C" { #endif +/*#define BIT_WRITER_DEBUG */ + /* This function writes bits into bytes in increasing addresses, and within a byte least-significant-bit first. @@ -26,7 +28,7 @@ extern "C" { 0000 0RRR 0000 0000 0000 0000 - Now, we could write 5 or less bits in MSB by just shifting by 3 + Now, we could write 5 or less bits in MSB by just sifting by 3 and OR'ing to BYTE-0. For n bits, we take the last 5 bits, OR that with high bits in BYTE-0, @@ -35,41 +37,37 @@ static BROTLI_INLINE void BrotliWriteBits(size_t n_bits, uint64_t bits, size_t* BROTLI_RESTRICT pos, uint8_t* BROTLI_RESTRICT array) { - BROTLI_LOG(("WriteBits %2d 0x%08x%08x %10d\n", (int)n_bits, - (uint32_t)(bits >> 32), (uint32_t)(bits & 0xFFFFFFFF), - (int)*pos)); - BROTLI_DCHECK((bits >> n_bits) == 0); - BROTLI_DCHECK(n_bits <= 56); #if defined(BROTLI_LITTLE_ENDIAN) /* This branch of the code can write up to 56 bits at a time, 7 bits are lost by being perhaps already in *p and at least 1 bit is needed to initialize the bit-stream ahead (i.e. if 7 bits are in *p and we write 57 bits, then the next write will access a byte that was never initialized). */ - { - uint8_t* p = &array[*pos >> 3]; - uint64_t v = (uint64_t)(*p); /* Zero-extend 8 to 64 bits. */ - v |= bits << (*pos & 7); - BROTLI_UNALIGNED_STORE64LE(p, v); /* Set some bits. */ - *pos += n_bits; - } + uint8_t* p = &array[*pos >> 3]; + uint64_t v = (uint64_t)(*p); /* Zero-extend 8 to 64 bits. */ + BROTLI_LOG(("WriteBits %2d 0x%08x%08x %10d\n", (int)n_bits, + (uint32_t)(bits >> 32), (uint32_t)(bits & 0xFFFFFFFF), + (int)*pos)); + BROTLI_DCHECK((bits >> n_bits) == 0); + BROTLI_DCHECK(n_bits <= 56); + v |= bits << (*pos & 7); + BROTLI_UNALIGNED_STORE64LE(p, v); /* Set some bits. */ + *pos += n_bits; #else /* implicit & 0xFF is assumed for uint8_t arithmetics */ - { - uint8_t* array_pos = &array[*pos >> 3]; - const size_t bits_reserved_in_first_byte = (*pos & 7); - size_t bits_left_to_write; - bits <<= bits_reserved_in_first_byte; - *array_pos++ |= (uint8_t)bits; - for (bits_left_to_write = n_bits + bits_reserved_in_first_byte; - bits_left_to_write >= 9; - bits_left_to_write -= 8) { - bits >>= 8; - *array_pos++ = (uint8_t)bits; - } - *array_pos = 0; - *pos += n_bits; + uint8_t* array_pos = &array[*pos >> 3]; + const size_t bits_reserved_in_first_byte = (*pos & 7); + size_t bits_left_to_write; + bits <<= bits_reserved_in_first_byte; + *array_pos++ |= (uint8_t)bits; + for (bits_left_to_write = n_bits + bits_reserved_in_first_byte; + bits_left_to_write >= 9; + bits_left_to_write -= 8) { + bits >>= 8; + *array_pos++ = (uint8_t)bits; } + *array_pos = 0; + *pos += n_bits; #endif } diff --git a/deps/brotli/c/include/brotli/encode.h b/deps/brotli/c/include/brotli/encode.h index b2774cb6316269..0ced7e55be7745 100644 --- a/deps/brotli/c/include/brotli/encode.h +++ b/deps/brotli/c/include/brotli/encode.h @@ -201,23 +201,7 @@ typedef enum BrotliEncoderParameter { * * Range is from 0 to (15 << NPOSTFIX) in steps of (1 << NPOSTFIX). */ - BROTLI_PARAM_NDIRECT = 8, - /** - * Number of bytes of input stream already processed by a different instance. - * - * @note It is important to configure all the encoder instances with same - * parameters (except this one) in order to allow all the encoded parts - * obey the same restrictions implied by header. - * - * If offset is not 0, then stream header is omitted. - * In any case output start is byte aligned, so for proper streams stitching - * "predecessor" stream must be flushed. - * - * Range is not artificially limited, but all the values greater or equal to - * maximal window size have the same effect. Values greater than 2**30 are not - * allowed. - */ - BROTLI_PARAM_STREAM_OFFSET = 9 + BROTLI_PARAM_NDIRECT = 8 } BrotliEncoderParameter; /** @@ -290,11 +274,6 @@ BROTLI_ENC_API size_t BrotliEncoderMaxCompressedSize(size_t input_size); * @note If ::BrotliEncoderMaxCompressedSize(@p input_size) returns non-zero * value, then output is guaranteed to be no longer than that. * - * @note If @p lgwin is greater than ::BROTLI_MAX_WINDOW_BITS then resulting - * stream might be incompatible with RFC 7932; to decode such streams, - * decoder should be configured with - * ::BROTLI_DECODER_PARAM_LARGE_WINDOW = @c 1 - * * @param quality quality parameter value, e.g. ::BROTLI_DEFAULT_QUALITY * @param lgwin lgwin parameter value, e.g. ::BROTLI_DEFAULT_WINDOW * @param mode mode parameter value, e.g. ::BROTLI_DEFAULT_MODE diff --git a/deps/brotli/c/include/brotli/port.h b/deps/brotli/c/include/brotli/port.h index 825237a3357931..20dc2314d8021b 100644 --- a/deps/brotli/c/include/brotli/port.h +++ b/deps/brotli/c/include/brotli/port.h @@ -218,20 +218,6 @@ BROTLI_GNUC_VERSION_CHECK(major, minor, patch) #endif -#if defined(__has_feature) -#define BROTLI_HAS_FEATURE(feature) __has_feature(feature) -#else -#define BROTLI_HAS_FEATURE(feature) (0) -#endif - -#if defined(ADDRESS_SANITIZER) || BROTLI_HAS_FEATURE(address_sanitizer) || \ - defined(THREAD_SANITIZER) || BROTLI_HAS_FEATURE(thread_sanitizer) || \ - defined(MEMORY_SANITIZER) || BROTLI_HAS_FEATURE(memory_sanitizer) -#define BROTLI_SANITIZED 1 -#else -#define BROTLI_SANITIZED 0 -#endif - #if defined(_WIN32) || defined(__CYGWIN__) #define BROTLI_PUBLIC #elif BROTLI_GNUC_VERSION_CHECK(3, 3, 0) || \ diff --git a/deps/cares/include/ares_version.h b/deps/cares/include/ares_version.h index c041d574dee09e..7758a48148a804 100644 --- a/deps/cares/include/ares_version.h +++ b/deps/cares/include/ares_version.h @@ -7,11 +7,11 @@ #define ARES_VERSION_MAJOR 1 #define ARES_VERSION_MINOR 16 -#define ARES_VERSION_PATCH 1 +#define ARES_VERSION_PATCH 0 #define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\ (ARES_VERSION_MINOR<<8)|\ (ARES_VERSION_PATCH)) -#define ARES_VERSION_STR "1.16.1" +#define ARES_VERSION_STR "1.16.0" #if (ARES_VERSION >= 0x010700) # define CARES_HAVE_ARES_LIBRARY_INIT 1 diff --git a/deps/cares/src/RELEASE-NOTES b/deps/cares/src/RELEASE-NOTES index 7a9d75fe788e84..0d8573ae8dd933 100644 --- a/deps/cares/src/RELEASE-NOTES +++ b/deps/cares/src/RELEASE-NOTES @@ -1,30 +1,85 @@ -c-ares version 1.16.1 - -Security: - o Prevent possible use-after-free and double-free in ares_getaddrinfo() if - ares_destroy() is called prior to ares_getaddrinfo() completing. Reported - by Jann Horn at Google Project Zero. +c-ares version 1.16.0 Changes: - o Allow TXT records on CHAOS qclass. Used for retriving things like - version.bind, version.server, authoris.bind, hostname.bind, and id.server. - [3] + o Introduction of ares_getaddrinfo() API which provides similar output + (including proper sorting as per RFC 6724) to the system native API, but + utilizes different data structures in order to provide additional information + such as TTLs and all aliases. Please reference the respective man pages for + usage details. [3] [4] [5] [7] [8] [13] [14] [15] [16] [17] [22] + o Parse SOA records from ns_t_any response [29] [30] + o CMake: Provide c-ares version in package export file [24] + o CMake: Add CPACK functionality for DEB and RPM [28] + o CMake: Generate PDB files during build [33] [34] + o CMake: Support manpage installation [37] [38] Bug fixes: - o Fix Windows Unicode incompatibilities with ares_getaddrinfo() [1] - o Silence false cast-align compiler warnings due to valid casts of - struct sockaddr to struct sockaddr_in and struct sockaddr_in6. - o MacOS should use libresolv for retrieving DNS servers, like iOS - o CMake build system should populate the INCLUDE_DIRECTORIES property of - installed targets [2] - o Correct macros in use for the ares_getaddrinfo.3 man page + o Fix bad expectation in IPv6 localhost test. [1] [2] + o AutoTools: use XC_CHECK_BUILD_FLAGS instead of XC_CHECK_USER_FLAGS to prevent + complaints about CPPFLAGS in CFLAGS. [6] + o Fix .onion handling + o Command line usage was out of date for adig and ahost. [18] + o Typos in manpages [19] [20] + o If ares_getenv is defined, it must return a value on all platforms [21] + o If /etc/resolv.conf has invalid lookup values, use the defaults. [23] + o Tests: Separate live tests from SetServers* tests as only live tests should + require internet access. [25] + o ares_gethostbyname() should return ENODATA if no valid A or AAAA record is + found, but a CNAME was found. [26] [27] + o CMake: Rework library function checking to prevent unintended linking with + system libraries that aren't needed. [31] [32] + o Due to use of inet_addr() it was not possible to return 255.255.255.255 from + ares_gethostbyname(). [35] [36] + o CMake: Fix building of tests on Windows Thanks go to these friendly people for their efforts and contributions: - Brad House (@bradh352), Daniel Stenberg (@bagder), Dmitry Igrishin (@dmitigr), - Jann Horn, Shelly Vohr, Teemu R (@rytilahti) - (6 contributors) + Abhishek Arya (@inferno-chromium), Adam Majer (@AdamMajer), + Andrew Selivanov (@ki11roy), Ben Noordhuis (@bnoordhuis), + Brad House (@bradh352), Christian Ammer (@ChristianAmmer), Dan Noé (@dnoe), + Daniel Stenberg (@bagder), Darrin Cullop (@dwcullop), + Dron Rathore (@DronRathore), Fabrice Fontaine (@ffontaine), + Gregor Jasny (@gjasny), @kedixa, Khaidi Chu (@XadillaX), + Kyle Edwards (@KyleFromKitware), @lifenjoiner, Michal Rostecki (@mrostecki), + Peter Eisentraut (@petere), Piotr Pietraszkiewicz (@ppietrasa), + Stephen Bryant (@bf-bryants), @tjwalton, Vy Nguyen (@oontvoo) + (22 contributors) References to bug reports and discussions on issues: - [1] = https://github.com/c-ares/c-ares/pull/328 - [2] = https://github.com/c-ares/c-ares/pull/323 - [3] = https://github.com/c-ares/c-ares/pull/321 + [1] = https://github.com/c-ares/c-ares/pull/227 + [2] = https://github.com/c-ares/c-ares/issues/85 + [3] = https://github.com/c-ares/c-ares/pull/112 + [4] = https://github.com/c-ares/c-ares/pull/233 + [5] = https://github.com/c-ares/c-ares/pull/234 + [6] = https://github.com/c-ares/c-ares/pull/236 + [7] = https://github.com/c-ares/c-ares/pull/235 + [8] = https://github.com/c-ares/c-ares/pull/239 + [9] = https://github.com/c-ares/c-ares/pull/241 + [10] = https://github.com/c-ares/c-ares/pull/187 + [11] = https://github.com/c-ares/c-ares/pull/252 + [12] = https://github.com/c-ares/c-ares/issues/251 + [13] = https://github.com/c-ares/c-ares/pull/258 + [14] = https://github.com/c-ares/c-ares/pull/257 + [15] = https://github.com/c-ares/c-ares/pull/262 + [16] = https://github.com/c-ares/c-ares/pull/264 + [17] = https://github.com/c-ares/c-ares/pull/265 + [18] = https://github.com/c-ares/c-ares/pull/256 + [19] = https://github.com/c-ares/c-ares/pull/269 + [20] = https://github.com/c-ares/c-ares/pull/275 + [21] = https://github.com/c-ares/c-ares/pull/279 + [22] = https://github.com/c-ares/c-ares/pull/290 + [23] = https://github.com/c-ares/c-ares/pull/274 + [24] = https://github.com/c-ares/c-ares/pull/296 + [25] = https://github.com/c-ares/c-ares/pull/299 + [26] = https://github.com/c-ares/c-ares/pull/304 + [27] = https://github.com/c-ares/c-ares/issues/303 + [28] = https://github.com/c-ares/c-ares/pull/283 + [29] = https://github.com/c-ares/c-ares/pull/103 + [30] = https://github.com/c-ares/c-ares/issues/102 + [31] = https://github.com/c-ares/c-ares/pull/310 + [32] = https://github.com/c-ares/c-ares/issues/307 + [33] = https://github.com/c-ares/c-ares/pull/311 + [34] = https://github.com/c-ares/c-ares/issues/245 + [35] = https://github.com/c-ares/c-ares/issues/309 + [36] = https://github.com/c-ares/c-ares/pull/312 + [37] = https://github.com/c-ares/c-ares/issues/297 + [38] = https://github.com/c-ares/c-ares/pull/314 + diff --git a/deps/cares/src/ares_getaddrinfo.c b/deps/cares/src/ares_getaddrinfo.c index be168068b1d424..8265e4afc20f60 100644 --- a/deps/cares/src/ares_getaddrinfo.c +++ b/deps/cares/src/ares_getaddrinfo.c @@ -408,11 +408,11 @@ static void end_hquery(struct host_query *hquery, int status) { if (next->ai_family == AF_INET) { - (CARES_INADDR_CAST(struct sockaddr_in *, next->ai_addr))->sin_port = htons(hquery->port); + ((struct sockaddr_in *)next->ai_addr)->sin_port = htons(hquery->port); } else { - (CARES_INADDR_CAST(struct sockaddr_in6 *, next->ai_addr))->sin6_port = htons(hquery->port); + ((struct sockaddr_in6 *)next->ai_addr)->sin6_port = htons(hquery->port); } next = next->ai_next; } @@ -456,18 +456,18 @@ static int file_lookup(struct host_query *hquery) char tmp[MAX_PATH]; HKEY hkeyHosts; - if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hkeyHosts) == ERROR_SUCCESS) { DWORD dwLength = MAX_PATH; - RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp, + RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp, &dwLength); - ExpandEnvironmentStringsA(tmp, PATH_HOSTS, MAX_PATH); + ExpandEnvironmentStrings(tmp, PATH_HOSTS, MAX_PATH); RegCloseKey(hkeyHosts); } } else if (platform == WIN_9X) - GetWindowsDirectoryA(PATH_HOSTS, MAX_PATH); + GetWindowsDirectory(PATH_HOSTS, MAX_PATH); else return ARES_ENOTFOUND; @@ -548,7 +548,6 @@ static void host_callback(void *arg, int status, int timeouts, else if (status == ARES_EDESTRUCTION) { end_hquery(hquery, status); - return; } if (!hquery->remaining) diff --git a/deps/cares/src/ares_getnameinfo.c b/deps/cares/src/ares_getnameinfo.c index 53f91ca8459fc1..aa089417060fec 100644 --- a/deps/cares/src/ares_getnameinfo.c +++ b/deps/cares/src/ares_getnameinfo.c @@ -92,13 +92,13 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, if ((sa->sa_family == AF_INET) && (salen == sizeof(struct sockaddr_in))) { - addr = CARES_INADDR_CAST(struct sockaddr_in *, sa); + addr = (struct sockaddr_in *)sa; port = addr->sin_port; } else if ((sa->sa_family == AF_INET6) && (salen == sizeof(struct sockaddr_in6))) { - addr6 = CARES_INADDR_CAST(struct sockaddr_in6 *, sa); + addr6 = (struct sockaddr_in6 *)sa; port = addr6->sin6_port; } else diff --git a/deps/cares/src/ares_parse_a_reply.c b/deps/cares/src/ares_parse_a_reply.c index d8a9e9b578363b..920ba24af42129 100644 --- a/deps/cares/src/ares_parse_a_reply.c +++ b/deps/cares/src/ares_parse_a_reply.c @@ -163,7 +163,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, { hostent->h_addr_list[i] = (char *)&addrs[i]; memcpy(hostent->h_addr_list[i], - &(CARES_INADDR_CAST(struct sockaddr_in *, next->ai_addr)->sin_addr), + &(((struct sockaddr_in *)next->ai_addr)->sin_addr), sizeof(struct in_addr)); if (naddrttls && i < *naddrttls) { @@ -173,7 +173,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, addrttls[i].ttl = next->ai_ttl; memcpy(&addrttls[i].ipaddr, - &(CARES_INADDR_CAST(struct sockaddr_in *, next->ai_addr)->sin_addr), + &(((struct sockaddr_in *)next->ai_addr)->sin_addr), sizeof(struct in_addr)); } ++i; diff --git a/deps/cares/src/ares_parse_aaaa_reply.c b/deps/cares/src/ares_parse_aaaa_reply.c index 0d39bfa8268bc0..d39e138d4c3304 100644 --- a/deps/cares/src/ares_parse_aaaa_reply.c +++ b/deps/cares/src/ares_parse_aaaa_reply.c @@ -165,7 +165,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, { hostent->h_addr_list[i] = (char*)&addrs[i]; memcpy(hostent->h_addr_list[i], - &(CARES_INADDR_CAST(struct sockaddr_in6 *, next->ai_addr)->sin6_addr), + &(((struct sockaddr_in6 *)next->ai_addr)->sin6_addr), sizeof(struct ares_in6_addr)); if (naddrttls && i < *naddrttls) { @@ -175,7 +175,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, addrttls[i].ttl = next->ai_ttl; memcpy(&addrttls[i].ip6addr, - &(CARES_INADDR_CAST(struct sockaddr_in6 *, next->ai_addr)->sin6_addr), + &(((struct sockaddr_in6 *)next->ai_addr)->sin6_addr), sizeof(struct ares_in6_addr)); } ++i; diff --git a/deps/cares/src/ares_parse_txt_reply.c b/deps/cares/src/ares_parse_txt_reply.c index 3f47e23f08637f..4856b4cea31f9f 100644 --- a/deps/cares/src/ares_parse_txt_reply.c +++ b/deps/cares/src/ares_parse_txt_reply.c @@ -113,7 +113,7 @@ ares__parse_txt_reply (const unsigned char *abuf, int alen, } /* Check if we are really looking at a TXT record */ - if ((rr_class == C_IN || rr_class == C_CHAOS) && rr_type == T_TXT) + if (rr_class == C_IN && rr_type == T_TXT) { /* * There may be multiple substrings in a single TXT record. Each diff --git a/deps/cares/src/ares_private.h b/deps/cares/src/ares_private.h index 1884c1659681c1..2ee54e5ecd8e21 100644 --- a/deps/cares/src/ares_private.h +++ b/deps/cares/src/ares_private.h @@ -50,11 +50,6 @@ #define STATIC_TESTABLE static #endif -/* By using a double cast, we can get rid of the bogus warning of - * warning: cast from 'const struct sockaddr *' to 'const struct sockaddr_in6 *' increases required alignment from 1 to 4 [-Wcast-align] - */ -#define CARES_INADDR_CAST(type, var) ((type)((void *)var)) - #if defined(WIN32) && !defined(WATT32) #define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP" diff --git a/deps/cares/src/ares_process.c b/deps/cares/src/ares_process.c index ff71f66a1ecce0..c86d3f2026b20b 100644 --- a/deps/cares/src/ares_process.c +++ b/deps/cares/src/ares_process.c @@ -1337,13 +1337,13 @@ static int same_address(struct sockaddr *sa, struct ares_addr *aa) { case AF_INET: addr1 = &aa->addrV4; - addr2 = &(CARES_INADDR_CAST(struct sockaddr_in *, sa))->sin_addr; + addr2 = &((struct sockaddr_in *)sa)->sin_addr; if (memcmp(addr1, addr2, sizeof(aa->addrV4)) == 0) return 1; /* match */ break; case AF_INET6: addr1 = &aa->addrV6; - addr2 = &(CARES_INADDR_CAST(struct sockaddr_in6 *, sa))->sin6_addr; + addr2 = &((struct sockaddr_in6 *)sa)->sin6_addr; if (memcmp(addr1, addr2, sizeof(aa->addrV6)) == 0) return 1; /* match */ break; diff --git a/deps/cjs-module-lexer/.gitignore b/deps/cjs-module-lexer/.gitignore deleted file mode 100755 index 55ee2f0d6cfb5d..00000000000000 --- a/deps/cjs-module-lexer/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -node_modules -*.lock -test -.* -Makefile -bench -build.js -include-wasm -include -lib -src diff --git a/deps/cjs-module-lexer/LICENSE b/deps/cjs-module-lexer/LICENSE deleted file mode 100755 index 935b357962d08b..00000000000000 --- a/deps/cjs-module-lexer/LICENSE +++ /dev/null @@ -1,10 +0,0 @@ -MIT License ------------ - -Copyright (C) 2018-2020 Guy Bedford - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/cjs-module-lexer/README.md b/deps/cjs-module-lexer/README.md deleted file mode 100755 index 726dd407769398..00000000000000 --- a/deps/cjs-module-lexer/README.md +++ /dev/null @@ -1,331 +0,0 @@ -# CJS Module Lexer - -[![Build Status][travis-image]][travis-url] - -A [very fast](#benchmarks) JS CommonJS module syntax lexer used to detect the most likely list of named exports of a CommonJS module. - -Outputs the list of named exports (`exports.name = ...`) and possible module reexports (`module.exports = require('...')`), including the common transpiler variations of these cases. - -Forked from https://github.com/guybedford/es-module-lexer. - -_Comprehensively handles the JS language grammar while remaining small and fast. - ~90ms per MB of JS cold and ~15ms per MB of JS warm, [see benchmarks](#benchmarks) for more info._ - -### Usage - -``` -npm install cjs-module-lexer -``` - -For use in CommonJS: - -```js -const parse = require('cjs-module-lexer'); - -const { exports, reexports } = parse(` - // named exports detection - module.exports.a = 'a'; - (function () { - exports.b = 'b'; - })(); - Object.defineProperty(exports, 'c', { value: 'c' }); - /* exports.d = 'not detected'; */ - - // reexports detection - if (maybe) module.exports = require('./dep1.js'); - if (another) module.exports = require('./dep2.js'); - - // literal exports assignments - module.exports = { a, b: c, d, 'e': f } - - // __esModule detection - Object.defineProperty(module.exports, '__esModule', { value: true }) -`); - -// exports === ['a', 'b', 'c', '__esModule'] -// reexports === ['./dep1.js', './dep2.js'] -``` - -When using the ESM version, Wasm is supported instead: - -```js -import { parse, init } from 'cjs-module-lexer'; -// init needs to be called and waited upon -await init(); -const { exports, reexports } = parse(source); -``` - -The Wasm build is around 1.5x faster and without a cold start. - -### Grammar - -CommonJS exports matches are run against the source token stream. - -The token grammar is: - -``` -IDENTIFIER: As defined by ECMA-262, without support for identifier `\` escapes, filtered to remove strict reserved words: - "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "enum" - -STRING_LITERAL: A `"` or `'` bounded ECMA-262 string literal. - -IDENTIFIER_STRING: ( `"` IDENTIFIER `"` | `'` IDENTIFIER `'` ) - -COMMENT_SPACE: Any ECMA-262 whitespace, ECMA-262 block comment or ECMA-262 line comment - -MODULE_EXPORTS: `module` COMMENT_SPACE `.` COMMENT_SPACE `exports` - -EXPORTS_IDENTIFIER: MODULE_EXPORTS_IDENTIFIER | `exports` - -EXPORTS_DOT_ASSIGN: EXPORTS_IDENTIFIER COMMENT_SPACE `.` COMMENT_SPACE IDENTIFIER COMMENT_SPACE `=` - -EXPORTS_LITERAL_COMPUTED_ASSIGN: EXPORTS_IDENTIFIER COMMENT_SPACE `[` COMMENT_SPACE IDENTIFIER_STRING COMMENT_SPACE `]` COMMENT_SPACE `=` - -EXPORTS_LITERAL_PROP: (IDENTIFIER (COMMENT_SPACE `:` COMMENT_SPACE IDENTIFIER)?) | (IDENTIFIER_STRING COMMENT_SPACE `:` COMMENT_SPACE IDENTIFIER) - -EXPORTS_MEMBER: EXPORTS_DOT_ASSIGN | EXPORTS_LITERAL_COMPUTED_ASSIGN - -EXPORTS_DEFINE: `Object` COMMENT_SPACE `.` COMMENT_SPACE `defineProperty COMMENT_SPACE `(` EXPORTS_IDENTIFIER COMMENT_SPACE `,` COMMENT_SPACE IDENTIFIER_STRING - -EXPORTS_LITERAL: MODULE_EXPORTS COMMENT_SPACE `=` COMMENT_SPACE `{` COMMENT_SPACE (EXPORTS_LITERAL_PROP COMMENT_SPACE `,` COMMENT_SPACE)+ `}` - -REQUIRE: `require` COMMENT_SPACE `(` COMMENT_SPACE STRING_LITERAL COMMENT_SPACE `)` - -EXPORTS_ASSIGN: (`var` | `const` | `let`) IDENTIFIER `=` REQUIRE - -MODULE_EXPORTS_ASSIGN: MODULE_EXPORTS COMMENT_SPACE `=` COMMENT_SPACE REQUIRE - -EXPORT_STAR: (`__export` | `__exportStar`) `(` REQUIRE - -EXPORT_STAR_LIB: `Object.keys(` IDENTIFIER$1 `).forEach(function (` IDENTIFIER$2 `) {` - ( - `if (` IDENTIFIER$2 `===` ( `'default'` | `"default"` ) `||` IDENTIFIER$2 `===` ( '__esModule' | `"__esModule"` ) `) return` `;`? | - `if (` IDENTIFIER$2 `!==` ( `'default'` | `"default"` ) `)` - ) - ( - EXPORTS_IDENTIFIER `[` IDENTIFIER$2 `] =` IDENTIFIER$1 `[` IDENTIFIER$2 `]` `;`? | - `Object.defineProperty(` EXPORTS_IDENTIFIER `, ` IDENTIFIER$2 `, { enumerable: true, get: function () { return ` IDENTIFIER$1 `[` IDENTIFIER$2 `]` `;`? } })` `;`? - ) - `})` -``` - -* The returned export names are the matched `IDENTIFIER` and `IDENTIFIER_STRING` slots for all `EXPORTS_MEMBER`, `EXPORTS_DEFINE` and `EXPORTS_LITERAL` matches. -* The reexport specifiers are taken to be the `STRING_LITERAL` slots of all `MODULE_EXPORTS_ASSIGN` as well as all _top-level_ `EXPORT_STAR` `REQUIRE` matches and `EXPORTS_ASSIGN` matches whose `IDENTIFIER` also matches the first `IDENTIFIER` in `EXPORT_STAR_LIB`. - -### Parsing Examples - -#### Named Exports Parsing - -The basic matching rules for named exports are `exports.name`, `exports['name']` or `Object.defineProperty(exports, 'name', ...)`. This matching is done without scope analysis and regardless of the expression position: - -```js -// DETECTS EXPORTS: a, b, c -(function (exports) { - exports.a = 'a'; - exports['b'] = 'b'; - Object.defineProperty(exports, 'c', { value: 'c' }); -})(exports); -``` - -Because there is no scope analysis, the above detection may overclassify: - -```js -// DETECTS EXPORTS: a, b, c -(function (exports, Object) { - exports.a = 'a'; - exports['b'] = 'b'; - if (false) - Object.defineProperty(exports, 'c', { value: 'c' }); -})(NOT_EXPORTS, NOT_OBJECT); -``` - -It will in turn underclassify in cases where the identifiers are renamed: - -```js -// DETECTS: NO EXPORTS -(function (e, defineProperty) { - e.a = 'a'; - e['b'] = 'b'; - defineProperty(e, 'c', { value: 'c' }); -})(exports, defineProperty); -``` - -#### Exports Object Assignment - -A best-effort is made to detect `module.exports` object assignments, but because this is not a full parser, arbitrary expressions are not handled in the -object parsing process. - -Simple object definitions are supported: - -```js -// DETECTS EXPORTS: a, b, c -module.exports = { - a, - b: 'c', - c: c -}; -``` - -Object properties that are not identifiers or string expressions will bail out of the object detection: - -```js -// DETECTS EXPORTS: a, b -module.exports = { - a, - b: require('c'), - c: "not detected since require('c') above bails the object detection" -} -``` - -`Object.defineProperties` is not currently supported either. - -#### module.exports reexport assignment - -Any `module.exports = require('mod')` assignment is detected as a reexport: - -```js -// DETECTS REEXPORTS: a, b, c -module.exports = require('a'); -(module => module.exports = require('b'))(NOT_MODULE); -if (false) module.exports = require('c'); -``` - -As a result, the total list of exports would be inferred as the union of all of these reexported modules, which can lead to possible over-classification. - -#### Transpiler Re-exports - -For named exports, transpiler output works well with the rules described above. - -But for star re-exports, special care is taken to support common patterns of transpiler outputs from Babel and TypeScript as well as bundlers like RollupJS. -These reexport and star reexport patterns are restricted to only be detected at the top-level as provided by the direct output of these tools. - -For example, `export * from 'external'` is output by Babel as: - -```js -"use strict"; - -exports.__esModule = true; - -var _external = require("external"); - -Object.keys(_external).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - exports[key] = _external[key]; -}); -``` - -Where the `var _external = require("external")` is specifically detected as well as the `Object.keys(_external)` statement, down to the exact -for of that entire expression including minor variations of the output. The `_external` and `key` identifiers are carefully matched in this -detection. - -Similarly for TypeScript, `export * from 'external'` is output as: - -```js -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("external")); -``` - -Where the `__export(require("external"))` statement is explicitly detected as a reexport, including variations `tslib.__export` and `__exportStar`. - -### Environment Support - -Node.js 10+, and [all browsers with Web Assembly support](https://caniuse.com/#feat=wasm). - -### JS Grammar Support - -* Token state parses all line comments, block comments, strings, template strings, blocks, parens and punctuators. -* Division operator / regex token ambiguity is handled via backtracking checks against punctuator prefixes, including closing brace or paren backtracking. -* Always correctly parses valid JS source, but may parse invalid JS source without errors. - -### Benchmarks - -Benchmarks can be run with `npm run bench`. - -Current results: - -JS Build: - -``` -Module load time -> 2ms -Cold Run, All Samples -test/samples/*.js (3635 KiB) -> 333ms - -Warm Runs (average of 25 runs) -test/samples/angular.js (1410 KiB) -> 16.48ms -test/samples/angular.min.js (303 KiB) -> 5.36ms -test/samples/d3.js (553 KiB) -> 8.32ms -test/samples/d3.min.js (250 KiB) -> 4.28ms -test/samples/magic-string.js (34 KiB) -> 1ms -test/samples/magic-string.min.js (20 KiB) -> 0.36ms -test/samples/rollup.js (698 KiB) -> 10.48ms -test/samples/rollup.min.js (367 KiB) -> 6.64ms - -Warm Runs, All Samples (average of 25 runs) -test/samples/*.js (3635 KiB) -> 49.28ms -``` - -Wasm Build: -``` -Module load time -> 11ms -Cold Run, All Samples -test/samples/*.js (3635 KiB) -> 48ms - -Warm Runs (average of 25 runs) -test/samples/angular.js (1410 KiB) -> 12.32ms -test/samples/angular.min.js (303 KiB) -> 3.76ms -test/samples/d3.js (553 KiB) -> 6.08ms -test/samples/d3.min.js (250 KiB) -> 3ms -test/samples/magic-string.js (34 KiB) -> 0.24ms -test/samples/magic-string.min.js (20 KiB) -> 0ms -test/samples/rollup.js (698 KiB) -> 7.2ms -test/samples/rollup.min.js (367 KiB) -> 4.2ms - -Warm Runs, All Samples (average of 25 runs) -test/samples/*.js (3635 KiB) -> 33.6ms -``` - -### Wasm Build Steps - -To build download the WASI SDK from https://github.com/CraneStation/wasi-sdk/releases. - -The Makefile assumes the existence of "wasi-sdk-10.0", "binaryen" and "wabt" (both optional) as sibling folders to this project. - -The build through the Makefile is then run via `make lib/lexer.wasm`, which can also be triggered via `npm run build-wasm` to create `dist/lexer.js`. - -On Windows it may be preferable to use the Linux subsystem. - -After the Web Assembly build, the CJS build can be triggered via `npm run build`. - -Optimization passes are run with [Binaryen](https://github.com/WebAssembly/binaryen) prior to publish to reduce the Web Assembly footprint. - -### License - -MIT - -[travis-url]: https://travis-ci.org/guybedford/es-module-lexer -[travis-image]: https://travis-ci.org/guybedford/es-module-lexer.svg?branch=master diff --git a/deps/cjs-module-lexer/lexer.js b/deps/cjs-module-lexer/lexer.js deleted file mode 100755 index 7f7c971fcc15bd..00000000000000 --- a/deps/cjs-module-lexer/lexer.js +++ /dev/null @@ -1,1169 +0,0 @@ -let source, pos, end; -let openTokenDepth, - templateDepth, - lastTokenPos, - lastSlashWasDivision, - templateStack, - templateStackDepth, - openTokenPosStack, - openClassPosStack, - nextBraceIsClass, - starExportMap, - lastStarExportSpecifier, - lastExportsAssignSpecifier, - _exports, - reexports; - -function resetState () { - openTokenDepth = 0; - templateDepth = -1; - lastTokenPos = -1; - lastSlashWasDivision = false; - templateStack = new Array(1024); - templateStackDepth = 0; - openTokenPosStack = new Array(1024); - openClassPosStack = new Array(1024); - nextBraceIsClass = false; - starExportMap = Object.create(null); - lastStarExportSpecifier = null; - lastExportsAssignSpecifier = null; - - _exports = new Set(); - reexports = new Set(); -} - -// RequireType -const Import = 0; -const ExportAssign = 1; -const ExportStar = 2; - -const strictReserved = new Set(['implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', 'yield', 'enum']); - -module.exports = function parseCJS (source, name = '@') { - resetState(); - try { - parseSource(source); - } - catch (e) { - e.message += `\n at ${name}:${source.slice(0, pos).split('\n').length}:${pos - source.lastIndexOf('\n', pos - 1)}`; - e.loc = pos; - throw e; - } - if (lastExportsAssignSpecifier) - reexports.add(lastExportsAssignSpecifier); - const result = { exports: [..._exports], reexports: [...reexports] }; - resetState(); - return result; -} - -function addExport (name) { - if (!strictReserved.has(name)) - _exports.add(name); -} - -function parseSource (cjsSource) { - source = cjsSource; - pos = -1; - end = source.length - 1; - let ch = 0; - - // Handle #! - if (source.charCodeAt(0) === 35/*#*/ && source.charCodeAt(1) === 33/*!*/) { - if (source.length === 2) - return true; - pos += 2; - while (pos++ < end) { - ch = source.charCodeAt(pos); - if (ch === 10/*\n*/ || ch === 13/*\r*/) - break; - } - } - - while (pos++ < end) { - ch = source.charCodeAt(pos); - - if (ch === 32 || ch < 14 && ch > 8) - continue; - - if (openTokenDepth === 0) { - switch (ch) { - case 105/*i*/: - if (source.startsWith('mport', pos + 1) && keywordStart(pos)) - throwIfImportStatement(); - lastTokenPos = pos; - continue; - case 114/*r*/: - const startPos = pos; - if (tryParseRequire(Import) && keywordStart(startPos)) - tryBacktrackAddStarExportBinding(startPos - 1); - lastTokenPos = pos; - continue; - case 95/*_*/: - if (source.startsWith('_export', pos + 1) && (keywordStart(pos) || source.charCodeAt(pos - 1) === 46/*.*/)) { - pos += 8; - if (source.startsWith('Star', pos)) - pos += 4; - if (source.charCodeAt(pos) === 40/*(*/) { - openTokenPosStack[openTokenDepth++] = lastTokenPos; - if (source.charCodeAt(++pos) === 114/*r*/) - tryParseRequire(ExportStar); - } - } - lastTokenPos = pos; - continue; - } - } - - switch (ch) { - case 101/*e*/: - if (source.startsWith('xport', pos + 1) && keywordStart(pos)) { - if (source.charCodeAt(pos + 6) === 115/*s*/) - tryParseExportsDotAssign(false); - else if (openTokenDepth === 0) - throwIfExportStatement(); - } - break; - case 99/*c*/: - if (keywordStart(pos) && source.startsWith('lass', pos + 1) && isBrOrWs(source.charCodeAt(pos + 5))) - nextBraceIsClass = true; - break; - case 109/*m*/: - if (source.startsWith('odule', pos + 1) && keywordStart(pos)) - tryParseModuleExportsDotAssign(); - break; - case 79/*O*/: - if (source.startsWith('bject', pos + 1) && keywordStart(pos)) - tryParseObjectDefineOrKeys(openTokenDepth === 0); - break; - case 40/*(*/: - openTokenPosStack[openTokenDepth++] = lastTokenPos; - break; - case 41/*)*/: - if (openTokenDepth === 0) - throw new Error('Unexpected closing bracket.'); - openTokenDepth--; - break; - case 123/*{*/: - openClassPosStack[openTokenDepth] = nextBraceIsClass; - nextBraceIsClass = false; - openTokenPosStack[openTokenDepth++] = lastTokenPos; - break; - case 125/*}*/: - if (openTokenDepth === 0) - throw new Error('Unexpected closing brace.'); - if (openTokenDepth-- === templateDepth) { - templateDepth = templateStack[--templateStackDepth]; - templateString(); - } - else { - if (templateDepth !== -1 && openTokenDepth < templateDepth) - throw new Error('Unexpected closing brace.'); - } - break; - case 60/*>*/: - // TODO: In order to be loaded from multiple Node.js environments, such as a main thread and a Worker thread, an add-on needs to either: @@ -256,14 +250,9 @@ void AddEnvironmentCleanupHook(v8::Isolate* isolate, ``` This function adds a hook that will run before a given Node.js instance shuts -down. If necessary, such hooks can be removed before they are run using -`RemoveEnvironmentCleanupHook()`, which has the same signature. Callbacks are -run in last-in first-out order. - -If necessary, there is an additional pair of `AddEnvironmentCleanupHook()` -and `RemoveEnvironmentCleanupHook()` overloads, where the cleanup hook takes a -callback function. This can be used for shutting down asynchronous resources, -such as any libuv handles registered by the addon. +down. If necessary, such hooks can be removed using +`RemoveEnvironmentCleanupHook()` before they are run, which has the same +signature. Callbacks are run in last-in first-out order. The following `addon.cc` uses `AddEnvironmentCleanupHook`: @@ -421,7 +410,7 @@ and load it instead. ## Native abstractions for Node.js -Each of the examples illustrated in this document directly use the +Each of the examples illustrated in this document make direct use of the Node.js and V8 APIs for implementing addons. The V8 API can, and has, changed dramatically from one V8 release to the next (and one major Node.js release to the next). With each change, addons may need to be updated and recompiled in @@ -452,7 +441,7 @@ in the N-API are used. Creating and maintaining an addon that benefits from the ABI stability provided by N-API carries with it certain -[implementation considerations](n-api.md#n_api_implications_of_abi_stability). +[implementation considerations](n-api.html#n_api_implications_of_abi_stability). To use N-API in the above "Hello world" example, replace the content of `hello.cc` with the following. All other instructions remain the same. @@ -490,12 +479,12 @@ NAPI_MODULE(NODE_GYP_MODULE_NAME, init) ``` The functions available and how to use them are documented in -[C/C++ addons with N-API](n-api.md). +[C/C++ addons with N-API](n-api.html). ## Addon examples Following are some example addons intended to help developers get started. The -examples use the V8 APIs. Refer to the online [V8 reference][v8-docs] +examples make use of the V8 APIs. Refer to the online [V8 reference][v8-docs] for help with the various V8 calls, and V8's [Embedder's Guide][] for an explanation of several concepts used such as handles, scopes, function templates, etc. @@ -1356,16 +1345,16 @@ console.log(result); // Prints: 30 ``` +[`Worker`]: worker_threads.html#worker_threads_class_worker [Electron]: https://electronjs.org/ [Embedder's Guide]: https://github.com/v8/v8/wiki/Embedder's%20Guide [Linking to libraries included with Node.js]: #addons_linking_to_libraries_included_with_node_js [Native Abstractions for Node.js]: https://github.com/nodejs/nan -[`Worker`]: worker_threads.md#worker_threads_class_worker [bindings]: https://github.com/TooTallNate/node-bindings [download]: https://github.com/nodejs/node-addon-examples [examples]: https://github.com/nodejs/nan/tree/master/examples/ [installation instructions]: https://github.com/nodejs/node-gyp#installation [libuv]: https://github.com/libuv/libuv [node-gyp]: https://github.com/nodejs/node-gyp -[require]: modules.md#modules_require_id +[require]: modules.html#modules_require_id [v8-docs]: https://v8docs.nodesource.com/ diff --git a/doc/api/assert.md b/doc/api/assert.md index 77456b614818d2..1175648f89b5ad 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -70,7 +70,7 @@ assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]); To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS` environment variables. This will also deactivate the colors in the REPL. For more on color support in terminal environments, read the tty -[getColorDepth()](tty.md#tty_writestream_getcolordepth_env) documentation. +[getColorDepth()](tty.html#tty_writestream_getcolordepth_env) documentation. ## Legacy assertion mode @@ -166,7 +166,7 @@ added: v14.2.0 This feature is currently experimental and behavior might still change. -### `new assert.CallTracker()` +### `new assert.CallTracker()` @@ -1562,22 +1562,17 @@ assert.throws(throwingFirst, /Second$/); Due to the confusing error-prone notation, avoid a string as the second argument. -[Abstract Equality Comparison]: https://tc39.github.io/ecma262/#sec-abstract-equality-comparison -[Object wrappers]: https://developer.mozilla.org/en-US/docs/Glossary/Primitive#Primitive_wrapper_objects_in_JavaScript -[Object.prototype.toString()]: https://tc39.github.io/ecma262/#sec-object.prototype.tostring -[SameValue Comparison]: https://tc39.github.io/ecma262/#sec-samevalue -[Strict Equality Comparison]: https://tc39.github.io/ecma262/#sec-strict-equality-comparison [`AssertionError`]: #assert_class_assert_assertionerror [`Class`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes -[`ERR_INVALID_RETURN_VALUE`]: errors.md#errors_err_invalid_return_value -[`Error.captureStackTrace`]: errors.md#errors_error_capturestacktrace_targetobject_constructoropt -[`Error`]: errors.md#errors_class_error +[`ERR_INVALID_RETURN_VALUE`]: errors.html#errors_err_invalid_return_value +[`Error.captureStackTrace`]: errors.html#errors_error_capturestacktrace_targetobject_constructoropt +[`Error`]: errors.html#errors_class_error [`Map`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map [`Object.is()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is [`RegExp`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions [`Set`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set [`Symbol`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol -[`TypeError`]: errors.md#errors_class_typeerror +[`TypeError`]: errors.html#errors_class_typeerror [`WeakMap`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap [`WeakSet`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet [`CallTracker`]: #assert_class_assert_calltracker @@ -1592,9 +1587,14 @@ argument. [`assert.ok()`]: #assert_assert_ok_value_message [`assert.strictEqual()`]: #assert_assert_strictequal_actual_expected_message [`assert.throws()`]: #assert_assert_throws_fn_error_message -[`process.on('exit')`]: process.md#process_event_exit -[`tracker.calls()`]: #assert_tracker_calls_fn_exact -[`tracker.verify()`]: #assert_tracker_verify +[`process.on('exit')`]: process.html#process_event_exit +[`tracker.calls()`]: #assert_class_assert_CallTracker#tracker_calls +[`tracker.verify()`]: #assert_class_assert_CallTracker#tracker_verify [strict assertion mode]: #assert_strict_assertion_mode +[Abstract Equality Comparison]: https://tc39.github.io/ecma262/#sec-abstract-equality-comparison +[Object wrappers]: https://developer.mozilla.org/en-US/docs/Glossary/Primitive#Primitive_wrapper_objects_in_JavaScript +[Object.prototype.toString()]: https://tc39.github.io/ecma262/#sec-object.prototype.tostring +[SameValue Comparison]: https://tc39.github.io/ecma262/#sec-samevalue +[Strict Equality Comparison]: https://tc39.github.io/ecma262/#sec-strict-equality-comparison [enumerable "own" properties]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties [prototype-spec]: https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index da000ae845cf6e..ebab01f6f79ed4 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -182,7 +182,7 @@ of asynchronous operations. * Returns: {AsyncHook} A reference to `asyncHook`. Enable the callbacks for a given `AsyncHook` instance. If no callbacks are -provided, enabling is a no-op. +provided enabling is a noop. The `AsyncHook` instance is disabled by default. If the `AsyncHook` instance should be enabled immediately after creation, the following pattern can be used. @@ -273,8 +273,7 @@ async_hooks.createHook({ init(asyncId, type, triggerAsyncId) { const eid = async_hooks.executionAsyncId(); fs.writeSync( - process.stdout.fd, - `${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}\n`); + 1, `${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}\n`); } }).enable(); @@ -326,7 +325,7 @@ async_hooks.createHook({ const eid = async_hooks.executionAsyncId(); const indentStr = ' '.repeat(indent); fs.writeSync( - process.stdout.fd, + 1, `${indentStr}${type}(${asyncId}):` + ` trigger: ${triggerAsyncId} execution: ${eid}\n`); }, @@ -730,9 +729,9 @@ class DBQuery extends AsyncResource { } ``` -#### Static method: `AsyncResource.bind(fn[, type])` +#### `static AsyncResource.bind(fn[, type])` * `fn` {Function} The function to bind to the current execution context. @@ -746,7 +745,7 @@ the `AsyncResource` to which the function is bound. #### `asyncResource.bind(fn)` * `fn` {Function} The function to bind to the current `AsyncResource`. @@ -1173,26 +1172,26 @@ functions called by `foo`. Outside of `run`, calling `getStore` will return In most cases your application or library code should have no issues with `AsyncLocalStorage`. But in rare cases you may face situations when the -current store is lost in one of asynchronous operations. In those cases, +current store is lost in one of asynchronous operations. Then you should consider the following options. If your code is callback-based, it is enough to promisify it with [`util.promisify()`][], so it starts working with native promises. If you need to keep using callback-based API, or your code assumes -a custom thenable implementation, use the [`AsyncResource`][] class +a custom thenable implementation, you should use [`AsyncResource`][] class to associate the asynchronous operation with the correct execution context. -[Hook Callbacks]: #async_hooks_hook_callbacks -[PromiseHooks]: https://docs.google.com/document/d/1rda3yKGHimKIhg5YeoAmCOtyURgsbTH_qaYR79FELlk/edit [`AsyncResource`]: #async_hooks_class_asyncresource [`after` callback]: #async_hooks_after_asyncid [`before` callback]: #async_hooks_before_asyncid [`destroy` callback]: #async_hooks_destroy_asyncid [`init` callback]: #async_hooks_init_asyncid_type_triggerasyncid_resource [`promiseResolve` callback]: #async_hooks_promiseresolve_asyncid -[`EventEmitter`]: events.md#events_class_eventemitter -[`Stream`]: stream.md#stream_stream -[`Worker`]: worker_threads.md#worker_threads_class_worker -[`util.promisify()`]: util.md#util_util_promisify_original +[`EventEmitter`]: events.html#events_class_eventemitter +[Hook Callbacks]: #async_hooks_hook_callbacks +[PromiseHooks]: https://docs.google.com/document/d/1rda3yKGHimKIhg5YeoAmCOtyURgsbTH_qaYR79FELlk/edit +[`Stream`]: stream.html#stream_stream +[`Worker`]: worker_threads.html#worker_threads_class_worker [promise execution tracking]: #async_hooks_promise_execution_tracking +[`util.promisify()`]: util.html#util_util_promisify_original diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 2e13cec0244387..22ecfc867c5e5a 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -107,14 +107,14 @@ string into a `Buffer` as decoding. tabs, and new lines contained within the base64-encoded string are ignored. * `'hex'`: Encode each byte as two hexadecimal characters. Data truncation - may occur when decoding strings that do exclusively contain valid hexadecimal + may occur when decoding string that do exclusively contain valid hexadecimal characters. See below for an example. The following legacy character encodings are also supported: * `'ascii'`: For 7-bit [ASCII][] data only. When encoding a string into a `Buffer`, this is equivalent to using `'latin1'`. When decoding a `Buffer` - into a string, using this encoding will additionally unset the highest bit of + into a string, using encoding this will additionally unset the highest bit of each byte before decoding as `'latin1'`. Generally, there should be no reason to use this encoding, as `'utf8'` (or, if the data is known to always be ASCII-only, `'latin1'`) will be a @@ -176,7 +176,7 @@ In particular: There are two ways to create new [`TypedArray`][] instances from a `Buffer`: * Passing a `Buffer` to a [`TypedArray`][] constructor will copy the `Buffer`s - contents, interpreted as an array of integers, and not as a byte sequence + contents, interpreted an array array of integers, and not as a byte sequence of the target type. ```js @@ -284,14 +284,10 @@ Additionally, the [`buf.values()`][], [`buf.keys()`][], and The `Buffer` class is a global type for dealing with binary data directly. It can be constructed in a variety of ways. -### Static method: `Buffer.alloc(size[, fill[, encoding]])` +### Class Method: `Buffer.alloc(size[, fill[, encoding]])` * `size` {integer} The desired length of the new `Buffer`. Allocates a new `Buffer` of `size` bytes. If `size` is larger than -[`buffer.constants.MAX_LENGTH`][] or smaller than 0, [`ERR_INVALID_ARG_VALUE`][] +[`buffer.constants.MAX_LENGTH`][] or smaller than 0, [`ERR_INVALID_OPT_VALUE`][] is thrown. A zero-length `Buffer` is created if `size` is 0. The underlying memory for `Buffer` instances created in this way is *not @@ -459,7 +446,7 @@ socket.on('readable', () => { A `TypeError` will be thrown if `size` is not a number. -### Static method: `Buffer.byteLength(string[, encoding])` +### Class Method: `Buffer.byteLength(string[, encoding])` @@ -594,7 +581,7 @@ appropriate for `Buffer.from()` variants. `Buffer.from(array)` and [`Buffer.from(string)`][] may also use the internal `Buffer` pool like [`Buffer.allocUnsafe()`][] does. -### Static method: `Buffer.from(arrayBuffer[, byteOffset[, length]])` +### Class Method: `Buffer.from(arrayBuffer[, byteOffset[, length]])` @@ -645,7 +632,7 @@ A `TypeError` will be thrown if `arrayBuffer` is not an [`ArrayBuffer`][] or a [`SharedArrayBuffer`][] or another type appropriate for `Buffer.from()` variants. -### Static method: `Buffer.from(buffer)` +### Class Method: `Buffer.from(buffer)` @@ -670,7 +657,7 @@ console.log(buf2.toString()); A `TypeError` will be thrown if `buffer` is not a `Buffer` or another type appropriate for `Buffer.from()` variants. -### Static method: `Buffer.from(object[, offsetOrEncoding[, length]])` +### Class Method: `Buffer.from(object[, offsetOrEncoding[, length]])` @@ -704,7 +691,7 @@ const buf = Buffer.from(new Foo(), 'utf8'); A `TypeError` will be thrown if `object` does not have the mentioned methods or is not of another type appropriate for `Buffer.from()` variants. -### Static method: `Buffer.from(string[, encoding])` +### Class Method: `Buffer.from(string[, encoding])` @@ -730,7 +717,7 @@ console.log(buf1.toString('latin1')); A `TypeError` will be thrown if `string` is not a string or another type appropriate for `Buffer.from()` variants. -### Static method: `Buffer.isBuffer(obj)` +### Class Method: `Buffer.isBuffer(obj)` @@ -740,7 +727,7 @@ added: v0.1.101 Returns `true` if `obj` is a `Buffer`, `false` otherwise. -### Static method: `Buffer.isEncoding(encoding)` +### Class Method: `Buffer.isEncoding(encoding)` @@ -1392,10 +1379,6 @@ values. added: - v12.0.0 - v10.20.0 -changes: - - version: v14.10.0 - pr-url: https://github.com/nodejs/node/pull/34960 - description: This function is also available as `buf.readBigUint64BE()`. --> * `offset` {integer} Number of bytes to skip before starting to read. Must @@ -1417,10 +1400,6 @@ console.log(buf.readBigUInt64BE(0)); added: - v12.0.0 - v10.20.0 -changes: - - version: v14.10.0 - pr-url: https://github.com/nodejs/node/pull/34960 - description: This function is also available as `buf.readBigUint64LE()`. --> * `offset` {integer} Number of bytes to skip before starting to read. Must @@ -1730,9 +1709,6 @@ console.log(buf.readIntLE(0, 6).toString(16)); * `value` {bigint} Number to be written to `buf`. @@ -2352,10 +2306,6 @@ console.log(buf); added: - v12.0.0 - v10.20.0 -changes: - - version: v14.10.0 - pr-url: https://github.com/nodejs/node/pull/34960 - description: This function is also available as `buf.writeBigUint64LE()`. --> * `value` {bigint} Number to be written to `buf`. @@ -2701,9 +2651,6 @@ console.log(buf); -Node.js can be started using the `--zero-fill-buffers` command-line option to +Node.js can be started using the `--zero-fill-buffers` command line option to cause all newly-allocated `Buffer` instances to be zero-filled upon creation by default. Without the option, buffers created with [`Buffer.allocUnsafe()`][], [`Buffer.allocUnsafeSlow()`][], and `new SlowBuffer(size)` are not zero-filled. @@ -3274,35 +3203,30 @@ While there are clear performance advantages to using [`Buffer.allocUnsafe()`][], extra care *must* be taken in order to avoid introducing security vulnerabilities into an application. -[ASCII]: https://en.wikipedia.org/wiki/ASCII -[Base64]: https://en.wikipedia.org/wiki/Base64 -[ISO-8859-1]: https://en.wikipedia.org/wiki/ISO-8859-1 [RFC 4648, Section 5]: https://tools.ietf.org/html/rfc4648#section-5 -[UTF-16]: https://en.wikipedia.org/wiki/UTF-16 -[UTF-8]: https://en.wikipedia.org/wiki/UTF-8 [WHATWG Encoding Standard]: https://encoding.spec.whatwg.org/ [`ArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer -[`Buffer.alloc()`]: #buffer_static_method_buffer_alloc_size_fill_encoding -[`Buffer.allocUnsafe()`]: #buffer_static_method_buffer_allocunsafe_size -[`Buffer.allocUnsafeSlow()`]: #buffer_static_method_buffer_allocunsafeslow_size -[`Buffer.from(array)`]: #buffer_static_method_buffer_from_array -[`Buffer.from(arrayBuf)`]: #buffer_static_method_buffer_from_arraybuffer_byteoffset_length -[`Buffer.from(buffer)`]: #buffer_static_method_buffer_from_buffer -[`Buffer.from(string)`]: #buffer_static_method_buffer_from_string_encoding +[`Buffer.alloc()`]: #buffer_class_method_buffer_alloc_size_fill_encoding +[`Buffer.allocUnsafe()`]: #buffer_class_method_buffer_allocunsafe_size +[`Buffer.allocUnsafeSlow()`]: #buffer_class_method_buffer_allocunsafeslow_size +[`Buffer.from(array)`]: #buffer_class_method_buffer_from_array +[`Buffer.from(arrayBuf)`]: #buffer_class_method_buffer_from_arraybuffer_byteoffset_length +[`Buffer.from(buffer)`]: #buffer_class_method_buffer_from_buffer +[`Buffer.from(string)`]: #buffer_class_method_buffer_from_string_encoding [`Buffer.poolSize`]: #buffer_class_property_buffer_poolsize [`DataView`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView -[`ERR_INVALID_ARG_VALUE`]: errors.md#ERR_INVALID_ARG_VALUE -[`ERR_INVALID_BUFFER_SIZE`]: errors.md#ERR_INVALID_BUFFER_SIZE -[`ERR_OUT_OF_RANGE`]: errors.md#ERR_OUT_OF_RANGE +[`ERR_INVALID_BUFFER_SIZE`]: errors.html#ERR_INVALID_BUFFER_SIZE +[`ERR_INVALID_OPT_VALUE`]: errors.html#ERR_INVALID_OPT_VALUE +[`ERR_OUT_OF_RANGE`]: errors.html#ERR_OUT_OF_RANGE [`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify [`SharedArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer [`String#indexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf [`String#lastIndexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf [`String.prototype.length`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length +[`TypedArray.from()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from [`TypedArray#set()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set [`TypedArray#slice()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice [`TypedArray#subarray()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray -[`TypedArray.from()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from [`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray [`Uint8Array`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array [`buf.buffer`]: #buffer_buf_buffer @@ -3318,7 +3242,12 @@ introducing security vulnerabilities into an application. [`buffer.constants.MAX_LENGTH`]: #buffer_buffer_constants_max_length [`buffer.constants.MAX_STRING_LENGTH`]: #buffer_buffer_constants_max_string_length [`buffer.kMaxLength`]: #buffer_buffer_kmaxlength -[`util.inspect()`]: util.md#util_util_inspect_object_options +[`util.inspect()`]: util.html#util_util_inspect_object_options +[ASCII]: https://en.wikipedia.org/wiki/ASCII +[Base64]: https://en.wikipedia.org/wiki/Base64 +[ISO-8859-1]: https://en.wikipedia.org/wiki/ISO-8859-1 +[UTF-8]: https://en.wikipedia.org/wiki/UTF-8 +[UTF-16]: https://en.wikipedia.org/wiki/UTF-16 [binary strings]: https://developer.mozilla.org/en-US/docs/Web/API/DOMString/Binary [endianness]: https://en.wikipedia.org/wiki/Endianness [iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols diff --git a/doc/api/child_process.md b/doc/api/child_process.md index c180176353d4a4..d88adf49885b11 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -6,7 +6,7 @@ -The `child_process` module provides the ability to spawn subprocesses in +The `child_process` module provides the ability to spawn child processes in a manner that is similar, but not identical, to popen(3). This capability is primarily provided by the [`child_process.spawn()`][] function: @@ -28,23 +28,20 @@ ls.on('close', (code) => { ``` By default, pipes for `stdin`, `stdout`, and `stderr` are established between -the parent Node.js process and the spawned subprocess. These pipes have -limited (and platform-specific) capacity. If the subprocess writes to -stdout in excess of that limit without the output being captured, the -subprocess blocks waiting for the pipe buffer to accept more data. This is +the parent Node.js process and the spawned child. These pipes have +limited (and platform-specific) capacity. If the child process writes to +stdout in excess of that limit without the output being captured, the child +process will block waiting for the pipe buffer to accept more data. This is identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }` option if the output will not be consumed. -The command lookup is performed using the `options.env.PATH` environment -variable if it is in the `options` object. Otherwise, `process.env.PATH` is -used. - -On Windows, environment variables are case-insensitive. Node.js -lexicographically sorts the `env` keys and uses the first one that -case-insensitively matches. Only first (in lexicographic order) entry will be -passed to the subprocess. This might lead to issues on Windows when passing -objects to the `env` option that have multiple variants of the same key, such as -`PATH` and `Path`. +The command lookup will be performed using `options.env.PATH` environment +variable if passed in `options` object, otherwise `process.env.PATH` will be +used. To account for the fact that Windows environment variables are +case-insensitive Node.js will lexicographically sort all `env` keys and choose +the first one case-insensitively matching `PATH` to perform command lookup. +This may lead to issues on Windows when passing objects to `env` option that +have multiple variants of `PATH` variable. The [`child_process.spawn()`][] method spawns the child process asynchronously, without blocking the Node.js event loop. The [`child_process.spawnSync()`][] @@ -452,7 +449,7 @@ changes: * Returns: {ChildProcess} The `child_process.spawn()` method spawns a new process using the given -`command`, with command-line arguments in `args`. If omitted, `args` defaults +`command`, with command line arguments in `args`. If omitted, `args` defaults to an empty array. **If the `shell` option is enabled, do not pass unsanitized user input to this @@ -1392,16 +1389,16 @@ connection to the child. ### `subprocess.signalCode` -* {string|null} +* {integer} -The `subprocess.signalCode` property indicates the signal received by +The `subprocess.signalCode` property indicates the signal number received by the child process if any, else `null`. ### `subprocess.spawnargs` * {Array} -The `subprocess.spawnargs` property represents the full list of command-line +The `subprocess.spawnargs` property represents the full list of command line arguments the child process was launched with. ### `subprocess.spawnfile` @@ -1550,7 +1547,7 @@ to `stdout` although there are only 4 characters. ## Shell requirements The shell should understand the `-c` switch. If the shell is `'cmd.exe'`, it -should understand the `/d /s /c` switches and command-line parsing should be +should understand the `/d /s /c` switches and command line parsing should be compatible. ## Default Windows shell @@ -1583,16 +1580,13 @@ Therefore, this feature requires opting in by setting the or [`child_process.fork()`][]. [Advanced serialization]: #child_process_advanced_serialization -[Default Windows shell]: #child_process_default_windows_shell -[HTML structured clone algorithm]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm -[Shell requirements]: #child_process_shell_requirements -[`'disconnect'`]: process.md#process_event_disconnect +[`'disconnect'`]: process.html#process_event_disconnect [`'error'`]: #child_process_event_error [`'exit'`]: #child_process_event_exit -[`'message'`]: process.md#process_event_message +[`'message'`]: process.html#process_event_message [`ChildProcess`]: #child_process_child_process -[`Error`]: errors.md#errors_class_error -[`EventEmitter`]: events.md#events_class_eventemitter +[`Error`]: errors.html#errors_class_error +[`EventEmitter`]: events.html#events_class_eventemitter [`child_process.exec()`]: #child_process_child_process_exec_command_options_callback [`child_process.execFile()`]: #child_process_child_process_execfile_file_args_options_callback [`child_process.execFileSync()`]: #child_process_child_process_execfilesync_file_args_options @@ -1601,13 +1595,13 @@ or [`child_process.fork()`][]. [`child_process.spawn()`]: #child_process_child_process_spawn_command_args_options [`child_process.spawnSync()`]: #child_process_child_process_spawnsync_command_args_options [`maxBuffer` and Unicode]: #child_process_maxbuffer_and_unicode -[`net.Server`]: net.md#net_class_net_server -[`net.Socket`]: net.md#net_class_net_socket +[`net.Server`]: net.html#net_class_net_server +[`net.Socket`]: net.html#net_class_net_socket [`options.detached`]: #child_process_options_detached -[`process.disconnect()`]: process.md#process_process_disconnect -[`process.env`]: process.md#process_process_env -[`process.execPath`]: process.md#process_process_execpath -[`process.send()`]: process.md#process_process_send_message_sendhandle_options_callback +[`process.disconnect()`]: process.html#process_process_disconnect +[`process.env`]: process.html#process_process_env +[`process.execPath`]: process.html#process_process_execpath +[`process.send()`]: process.html#process_process_send_message_sendhandle_options_callback [`stdio`]: #child_process_options_stdio [`subprocess.connected`]: #child_process_subprocess_connected [`subprocess.disconnect()`]: #child_process_subprocess_disconnect @@ -1617,6 +1611,9 @@ or [`child_process.fork()`][]. [`subprocess.stdin`]: #child_process_subprocess_stdin [`subprocess.stdio`]: #child_process_subprocess_stdio [`subprocess.stdout`]: #child_process_subprocess_stdout -[`util.promisify()`]: util.md#util_util_promisify_original +[`util.promisify()`]: util.html#util_util_promisify_original +[Default Windows shell]: #child_process_default_windows_shell +[HTML structured clone algorithm]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm +[Shell requirements]: #child_process_shell_requirements [synchronous counterparts]: #child_process_synchronous_process_creation -[v8.serdes]: v8.md#v8_serialization_api +[v8.serdes]: v8.html#v8_serialization_api diff --git a/doc/api/cli.md b/doc/api/cli.md index aeb15dbca62a76..899c28f6f76675 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1,4 +1,4 @@ -# Command-line options +# Command line options @@ -18,7 +18,7 @@ To view this documentation as a manual page in a terminal, run `man node`. Execute without arguments to start the [REPL][]. -For more info about `node inspect`, see the [debugger][] documentation. +_For more info about `node inspect`, please see the [debugger][] documentation._ ## Options All options, including V8 options, allow words to be separated by both -dashes (`-`) or underscores (`_`). For example, `--pending-deprecation` is -equivalent to `--pending_deprecation`. +dashes (`-`) or underscores (`_`). -If an option that takes a single value (such as `--max-http-header-size`) is -passed more than once, then the last passed value is used. Options from the -command line take precedence over options passed through the [`NODE_OPTIONS`][] -environment variable. +For example, `--pending-deprecation` is equivalent to `--pending_deprecation`. ### `-` -Alias for stdin. Analogous to the use of `-` in other command-line utilities, -meaning that the script is read from stdin, and the rest of the options +Alias for stdin. Analogous to the use of `-` in other command line utilities, +meaning that the script will be read from stdin, and the rest of the options are passed to that script. ### `--` @@ -54,7 +50,7 @@ added: v6.11.0 Indicate the end of node options. Pass the rest of the arguments to the script. If no script filename or eval/print script is supplied prior to this, then -the next argument is used as a script filename. +the next argument will be used as a script filename. ### `--abort-on-uncaught-exception` - -> Stability: 1 - Experimental - -Enable experimental support for custom conditional exports resolution -conditions. - -Any number of custom string condition names are permitted. - -The default Node.js conditions of `"node"`, `"default"`, `"import"`, and -`"require"` will always apply as defined. - ### `--cpu-prof` Disable the `Object.prototype.__proto__` property. If `mode` is `delete`, the -property is removed entirely. If `mode` is `throw`, accesses to the -property throw an exception with the code `ERR_PROTO_ACCESS`. +property will be removed entirely. If `mode` is `throw`, accesses to the +property will throw an exception with the code `ERR_PROTO_ACCESS`. ### `--disallow-code-generation-from-strings` Experimental `AbortController` and `AbortSignal` support is enabled by default. -Use of this command-line flag is no longer required. +Use of this command line flag is no longer required. ### `--experimental-import-meta-resolve` +By default all unhandled rejections trigger a warning plus a deprecation warning +for the very first unhandled rejection in case no [`unhandledRejection`][] hook +is used. + Using this flag allows to change what should happen when an unhandled rejection occurs. One of the following modes can be chosen: * `throw`: Emit [`unhandledRejection`][]. If this hook is not set, raise the - unhandled rejection as an uncaught exception. This is the default. + unhandled rejection as an uncaught exception. * `strict`: Raise the unhandled rejection as an uncaught exception. * `warn`: Always trigger a warning, no matter if the [`unhandledRejection`][] hook is set or not but do not print the deprecation warning. @@ -1062,7 +1047,7 @@ The following values are valid for `mode`: added: v0.1.3 --> -Print V8 command-line options. +Print V8 command line options. ### `--v8-pool-size=num` -Print node command-line options. +Print node command line options. The output of this option is less detailed than this document. ### `-i`, `--interactive` @@ -1214,19 +1199,20 @@ When set to `1`, process warnings are silenced. added: v8.0.0 --> -A space-separated list of command-line options. `options...` are interpreted -before command-line options, so command-line options will override or +A space-separated list of command line options. `options...` are interpreted +before command line options, so command line options will override or compound after anything in `options...`. Node.js will exit with an error if an option that is not allowed in the environment is used, such as `-p` or a script file. -If an option value contains a space, it can be escaped using double quotes: +In case an option value happens to contain a space (for example a path listed +in `--require`), it must be escaped using double quotes. For example: ```bash NODE_OPTIONS='--require "./my path/file.js"' ``` -A singleton flag passed as a command-line option will override the same flag +A singleton flag passed as a command line option will override the same flag passed into `NODE_OPTIONS`: ```bash @@ -1235,7 +1221,7 @@ NODE_OPTIONS='--inspect=localhost:4444' node --inspect=localhost:5555 ``` A flag that can be passed multiple times will be treated as if its -`NODE_OPTIONS` instances were passed first, and then its command-line +`NODE_OPTIONS` instances were passed first, and then its command line instances afterwards: ```bash @@ -1246,7 +1232,6 @@ node --require "./a.js" --require "./b.js" Node.js options that are allowed are: -* `--conditions` * `--diagnostic-dir` * `--disable-proto` * `--enable-fips` @@ -1361,7 +1346,7 @@ When set to `1`, emit pending deprecation warnings. Pending deprecations are generally identical to a runtime deprecation with the notable exception that they are turned *off* by default and will not be emitted -unless either the `--pending-deprecation` command-line flag, or the +unless either the `--pending-deprecation` command line flag, or the `NODE_PENDING_DEPRECATION=1` environment variable, is set. Pending deprecations are used to provide a kind of selective "early warning" mechanism that developers may leverage to detect deprecated API usage. @@ -1509,7 +1494,7 @@ Load an OpenSSL configuration file on startup. Among other uses, this can be used to enable FIPS-compliant crypto if Node.js is built with `./configure --openssl-fips`. -If the [`--openssl-config`][] command-line option is used, the environment +If the [`--openssl-config`][] command line option is used, the environment variable is ignored. ### `SSL_CERT_DIR=dir` @@ -1583,28 +1568,27 @@ On a machine with 2GB of memory, consider setting this to $ node --max-old-space-size=1536 index.js ``` +[`--openssl-config`]: #cli_openssl_config_file +[`Atomics.wait()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait +[`Buffer`]: buffer.html#buffer_class_buffer +[`SlowBuffer`]: buffer.html#buffer_class_slowbuffer +[`process.setUncaughtExceptionCaptureCallback()`]: process.html#process_process_setuncaughtexceptioncapturecallback_fn +[`tls.DEFAULT_MAX_VERSION`]: tls.html#tls_tls_default_max_version +[`tls.DEFAULT_MIN_VERSION`]: tls.html#tls_tls_default_min_version +[`unhandledRejection`]: process.html#process_event_unhandledrejection +[`worker_threads.threadId`]: worker_threads.html##worker_threads_worker_threadid [Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/ -[REPL]: repl.md +[REPL]: repl.html [ScriptCoverage]: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage [Source Map]: https://sourcemaps.info/spec.html [Subresource Integrity]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity [V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html -[`--openssl-config`]: #cli_openssl_config_file -[`Atomics.wait()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait -[`Buffer`]: buffer.md#buffer_class_buffer -[`NODE_OPTIONS`]: #cli_node_options_options -[`SlowBuffer`]: buffer.md#buffer_class_slowbuffer -[`process.setUncaughtExceptionCaptureCallback()`]: process.md#process_process_setuncaughtexceptioncapturecallback_fn -[`tls.DEFAULT_MAX_VERSION`]: tls.md#tls_tls_default_max_version -[`tls.DEFAULT_MIN_VERSION`]: tls.md#tls_tls_default_min_version -[`unhandledRejection`]: process.md#process_event_unhandledrejection -[`worker_threads.threadId`]: worker_threads.md#worker_threads_worker_threadid -[context-aware]: addons.md#addons_context_aware_addons -[customizing ESM specifier resolution]: esm.md#esm_customizing_esm_specifier_resolution_algorithm -[debugger]: debugger.md +[context-aware]: addons.html#addons_context_aware_addons +[customizing ESM specifier resolution]: esm.html#esm_customizing_esm_specifier_resolution_algorithm +[debugger]: debugger.html [debugging security implications]: https://nodejs.org/en/docs/guides/debugging-getting-started/#security-implications -[emit_warning]: process.md#process_process_emitwarning_warning_type_code_ctor -[experimental ECMAScript Module loader]: esm.md#esm_experimental_loaders +[emit_warning]: process.html#process_process_emitwarning_warning_type_code_ctor +[experimental ECMAScript Module loader]: esm.html#esm_experimental_loaders [jitless]: https://v8.dev/blog/jitless [libuv threadpool documentation]: https://docs.libuv.org/en/latest/threadpool.html [remote code execution]: https://www.owasp.org/index.php/Code_Injection diff --git a/doc/api/cluster.md b/doc/api/cluster.md index 0b3586d10cd439..1ed5e38670fb3c 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -436,7 +436,7 @@ If the graceful disconnect behavior is not needed, use `worker.process.kill()`. Causes `.exitedAfterDisconnect` to be set. -This method is aliased as `worker.destroy()` for backward compatibility. +This method is aliased as `worker.destroy()` for backwards compatibility. In a worker, `process.kill()` exists, but it is not this function; it is [`kill()`][]. @@ -873,17 +873,17 @@ socket.on('data', (id) => { }); ``` -[Advanced serialization for `child_process`]: child_process.md#child_process_advanced_serialization -[Child Process module]: child_process.md#child_process_child_process_fork_modulepath_args_options [`.fork()`]: #cluster_cluster_fork_env [`.setupMaster()`]: #cluster_cluster_setupmaster_settings -[`ChildProcess.send()`]: child_process.md#child_process_subprocess_send_message_sendhandle_options_callback -[`child_process.fork()`]: child_process.md#child_process_child_process_fork_modulepath_args_options -[`child_process` event: `'exit'`]: child_process.md#child_process_event_exit -[`child_process` event: `'message'`]: child_process.md#child_process_event_message +[`ChildProcess.send()`]: child_process.html#child_process_subprocess_send_message_sendhandle_options_callback +[`child_process.fork()`]: child_process.html#child_process_child_process_fork_modulepath_args_options +[`child_process` event: `'exit'`]: child_process.html#child_process_event_exit +[`child_process` event: `'message'`]: child_process.html#child_process_event_message [`cluster.settings`]: #cluster_cluster_settings -[`disconnect()`]: child_process.md#child_process_subprocess_disconnect -[`kill()`]: process.md#process_process_kill_pid_signal -[`process` event: `'message'`]: process.md#process_event_message -[`server.close()`]: net.md#net_event_close +[`disconnect()`]: child_process.html#child_process_subprocess_disconnect +[`kill()`]: process.html#process_process_kill_pid_signal +[`process` event: `'message'`]: process.html#process_event_message +[`server.close()`]: net.html#net_event_close [`worker.exitedAfterDisconnect`]: #cluster_worker_exitedafterdisconnect +[Advanced serialization for `child_process`]: child_process.html#child_process_advanced_serialization +[Child Process module]: child_process.html#child_process_child_process_fork_modulepath_args_options diff --git a/doc/api/console.md b/doc/api/console.md index e8bee883acc573..9e223e6ee9d2be 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -418,16 +418,12 @@ added: v0.1.104 Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`. Use the same `label` when calling [`console.timeEnd()`][] to stop the timer and output the elapsed time in -suitable time units to `stdout`. For example, if the elapsed -time is 3869ms, `console.timeEnd()` displays "3.869s". +milliseconds to `stdout`. Timer durations are accurate to the sub-millisecond. ### `console.timeEnd([label])` @@ -869,7 +868,7 @@ If `outputEncoding` is given a string will be returned; otherwise a `ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey` lies outside of the elliptic curve. Since `otherPublicKey` is usually supplied from a remote user over an insecure network, -be sure to handle this exception accordingly. +its recommended for developers to handle this exception accordingly. ### `ecdh.generateKeys([encoding[, format]])` -* `key` {Buffer | TypedArray | DataView} +* `key` {Buffer} * Returns: {KeyObject} Creates and returns a new key object containing a secret key for symmetric @@ -2801,44 +2800,6 @@ threadpool request. To minimize threadpool task length variation, partition large `randomFill` requests when doing so as part of fulfilling a client request. -### `crypto.randomInt([min, ]max[, callback])` - - -* `min` {integer} Start of random range (inclusive). **Default**: `0`. -* `max` {integer} End of random range (exclusive). -* `callback` {Function} `function(err, n) {}`. - -Return a random integer `n` such that `min <= n < max`. This -implementation avoids [modulo bias][]. - -The range (`max - min`) must be less than 248. `min` and `max` must -be [safe integers][]. - -If the `callback` function is not provided, the random integer is -generated synchronously. - -```js -// Asynchronous -crypto.randomInt(3, (err, n) => { - if (err) throw err; - console.log(`Random number chosen from (0, 1, 2): ${n}`); -}); -``` - -```js -// Synchronous -const n = crypto.randomInt(3); -console.log(`Random number chosen from (0, 1, 2): ${n}`); -``` - -```js -// With `min` argument -const n = crypto.randomInt(1, 7); -console.log(`The dice rolled: ${n}`); -``` - ### `crypto.scrypt(password, salt, keylen[, options], callback)` -Node.js APIs might be deprecated for any of the following reasons: +Node.js may deprecate APIs for any of the following reasons: * Use of the API is unsafe. * An improved alternative API is available. * Breaking changes to the API are expected in a future major release. -Node.js uses three kinds of Deprecations: +Node.js utilizes three kinds of Deprecations: * Documentation-only * Runtime @@ -34,12 +34,13 @@ from Node.js. ## Revoking deprecations -Occasionally, the deprecation of an API might be reversed. In such situations, +Occasionally, the deprecation of an API may be reversed. In such situations, this document will be updated with information relevant to the decision. However, the deprecation identifier will not be modified. ## List of deprecated APIs + ### DEP0001: `http.OutgoingMessage.prototype.flush` -Type: End-of-Life +Type: Runtime -Unhandled promise rejections are deprecated. By default, promise rejections -that are not handled terminate the Node.js process with a non-zero exit -code. To change the way Node.js treats unhandled rejections, use the -[`--unhandled-rejections`][] command-line option. +Unhandled promise rejections are deprecated. In the future, promise rejections +that are not handled will terminate the Node.js process with a non-zero exit +code. + ### DEP0019: `require('.')` resolved outside directory -Type: Documentation-only +Type: Runtime Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential security vulnerability. There is no safe, cross-platform alternative API. + ### DEP0140: Use `request.destroy()` instead of `request.abort()` - -Type: Documentation-only - -The [`crypto.Certificate()` constructor][] is deprecated. Use -[static methods of `crypto.Certificate()`][] instead. - -[Legacy URL API]: url.md#url_legacy_url_api +[`--pending-deprecation`]: cli.html#cli_pending_deprecation +[`--throw-deprecation`]: cli.html#cli_throw_deprecation +[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size +[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array +[`Buffer.from(buffer)`]: buffer.html#buffer_class_method_buffer_from_buffer +[`Buffer.isBuffer()`]: buffer.html#buffer_class_method_buffer_isbuffer_obj +[`Cipher`]: crypto.html#crypto_class_cipher +[`Decipher`]: crypto.html#crypto_class_decipher +[`EventEmitter.listenerCount(emitter, eventName)`]: events.html#events_eventemitter_listenercount_emitter_eventname +[`REPLServer.clearBufferedCommand()`]: repl.html#repl_replserver_clearbufferedcommand +[`ReadStream.open()`]: fs.html#fs_class_fs_readstream +[`Server.getConnections()`]: net.html#net_server_getconnections_callback +[`Server.listen({fd: })`]: net.html#net_server_listen_handle_backlog_callback +[`SlowBuffer`]: buffer.html#buffer_class_slowbuffer +[`WriteStream.open()`]: fs.html#fs_class_fs_writestream +[`assert`]: assert.html +[`asyncResource.runInAsyncScope()`]: async_hooks.html#async_hooks_asyncresource_runinasyncscope_fn_thisarg_args +[`child_process`]: child_process.html +[`clearInterval()`]: timers.html#timers_clearinterval_timeout +[`clearTimeout()`]: timers.html#timers_cleartimeout_timeout +[`console.error()`]: console.html#console_console_error_data_args +[`console.log()`]: console.html#console_console_log_data_args +[`crypto.DEFAULT_ENCODING`]: crypto.html#crypto_crypto_default_encoding +[`crypto.createCipher()`]: crypto.html#crypto_crypto_createcipher_algorithm_password_options +[`crypto.createCipheriv()`]: crypto.html#crypto_crypto_createcipheriv_algorithm_key_iv_options +[`crypto.createDecipher()`]: crypto.html#crypto_crypto_createdecipher_algorithm_password_options +[`crypto.createDecipheriv()`]: crypto.html#crypto_crypto_createdecipheriv_algorithm_key_iv_options +[`crypto.fips`]: crypto.html#crypto_crypto_fips +[`crypto.pbkdf2()`]: crypto.html#crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback +[`crypto.randomBytes()`]: crypto.html#crypto_crypto_randombytes_size_callback +[`crypto.scrypt()`]: crypto.html#crypto_crypto_scrypt_password_salt_keylen_options_callback +[`decipher.final()`]: crypto.html#crypto_decipher_final_outputencoding +[`decipher.setAuthTag()`]: crypto.html#crypto_decipher_setauthtag_buffer +[`domain`]: domain.html +[`ecdh.setPublicKey()`]: crypto.html#crypto_ecdh_setpublickey_publickey_encoding +[`emitter.listenerCount(eventName)`]: events.html#events_emitter_listenercount_eventname +[`fs.FileHandle`]: fs.html#fs_class_filehandle +[`fs.access()`]: fs.html#fs_fs_access_path_mode_callback +[`fs.createReadStream()`]: fs.html#fs_fs_createreadstream_path_options +[`fs.createWriteStream()`]: fs.html#fs_fs_createwritestream_path_options +[`fs.exists(path, callback)`]: fs.html#fs_fs_exists_path_callback +[`fs.lchmod(path, mode, callback)`]: fs.html#fs_fs_lchmod_path_mode_callback +[`fs.lchmodSync(path, mode)`]: fs.html#fs_fs_lchmodsync_path_mode +[`fs.lchown(path, uid, gid, callback)`]: fs.html#fs_fs_lchown_path_uid_gid_callback +[`fs.lchownSync(path, uid, gid)`]: fs.html#fs_fs_lchownsync_path_uid_gid +[`fs.read()`]: fs.html#fs_fs_read_fd_buffer_offset_length_position_callback +[`fs.readSync()`]: fs.html#fs_fs_readsync_fd_buffer_offset_length_position +[`fs.stat()`]: fs.html#fs_fs_stat_path_options_callback +[`http.get()`]: http.html#http_http_get_options_callback +[`http.request()`]: http.html#http_http_request_options_callback +[`https.get()`]: https.html#https_https_get_options_callback +[`https.request()`]: https.html#https_https_request_options_callback +[`module.createRequire()`]: modules.html#modules_module_createrequire_filename +[`os.networkInterfaces()`]: os.html#os_os_networkinterfaces +[`os.tmpdir()`]: os.html#os_os_tmpdir +[`process.env`]: process.html#process_process_env +[`process.mainModule`]: process.html#process_process_mainmodule +[`punycode`]: punycode.html +[`require.extensions`]: modules.html#modules_require_extensions +[`require.main`]: modules.html#modules_accessing_the_main_module +[`request.abort()`]: http.html#http_request_abort +[`request.socket`]: http.html#http_request_socket +[`request.connection`]: http.html#http_request_connection +[`request.destroy()`]: http.html#http_request_destroy_error +[`response.socket`]: http.html#http_response_socket +[`response.connection`]: http.html#http_response_connection +[`response.end()`]: http.html#http_response_end_data_encoding_callback +[`response.finished`]: #http_response_finished +[`response.writableFinished`]: #http_response_writablefinished +[`response.writableEnded`]: #http_response_writableended +[`script.createCachedData()`]: vm.html#vm_script_createcacheddata +[`setInterval()`]: timers.html#timers_setinterval_callback_delay_args +[`setTimeout()`]: timers.html#timers_settimeout_callback_delay_args +[`socket.bufferSize`]: net.html#net_socket_buffersize +[`timeout.ref()`]: timers.html#timers_timeout_ref +[`timeout.refresh()`]: timers.html#timers_timeout_refresh +[`timeout.unref()`]: timers.html#timers_timeout_unref +[`tls.CryptoStream`]: tls.html#tls_class_cryptostream +[`tls.SecureContext`]: tls.html#tls_tls_createsecurecontext_options +[`tls.SecurePair`]: tls.html#tls_class_securepair +[`tls.TLSSocket`]: tls.html#tls_class_tls_tlssocket +[`tls.checkServerIdentity()`]: tls.html#tls_tls_checkserveridentity_hostname_cert +[`tls.createSecureContext()`]: tls.html#tls_tls_createsecurecontext_options +[`url.format()`]: url.html#url_url_format_urlobject +[`url.parse()`]: url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost +[`url.resolve()`]: url.html#url_url_resolve_from_to +[`util._extend()`]: util.html#util_util_extend_target_source +[`util.getSystemErrorName()`]: util.html#util_util_getsystemerrorname_err +[`util.inspect()`]: util.html#util_util_inspect_object_options +[`util.inspect.custom`]: util.html#util_util_inspect_custom +[`util.isArray()`]: util.html#util_util_isarray_object +[`util.isBoolean()`]: util.html#util_util_isboolean_object +[`util.isBuffer()`]: util.html#util_util_isbuffer_object +[`util.isDate()`]: util.html#util_util_isdate_object +[`util.isError()`]: util.html#util_util_iserror_object +[`util.isFunction()`]: util.html#util_util_isfunction_object +[`util.isNull()`]: util.html#util_util_isnull_object +[`util.isNullOrUndefined()`]: util.html#util_util_isnullorundefined_object +[`util.isNumber()`]: util.html#util_util_isnumber_object +[`util.isObject()`]: util.html#util_util_isobject_object +[`util.isPrimitive()`]: util.html#util_util_isprimitive_object +[`util.isRegExp()`]: util.html#util_util_isregexp_object +[`util.isString()`]: util.html#util_util_isstring_object +[`util.isSymbol()`]: util.html#util_util_issymbol_object +[`util.isUndefined()`]: util.html#util_util_isundefined_object +[`util.log()`]: util.html#util_util_log_string +[`util.types`]: util.html#util_util_types +[`util`]: util.html +[`worker.exitedAfterDisconnect`]: cluster.html#cluster_worker_exitedafterdisconnect +[`worker.terminate()`]: worker_threads.html#worker_threads_worker_terminate +[`writable.writableLength`]: stream.html#stream_writable_writablelength +[`zlib.bytesWritten`]: zlib.html#zlib_zlib_byteswritten +[Legacy URL API]: url.html#url_legacy_url_api [NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf [RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3 -[WHATWG URL API]: url.md#url_the_whatwg_url_api -[`--pending-deprecation`]: cli.md#cli_pending_deprecation -[`--throw-deprecation`]: cli.md#cli_throw_deprecation -[`--unhandled-rejections`]: cli.md#cli_unhandled_rejections_mode -[`Buffer.allocUnsafeSlow(size)`]: buffer.md#buffer_static_method_buffer_allocunsafeslow_size -[`Buffer.from(array)`]: buffer.md#buffer_static_method_buffer_from_array -[`Buffer.from(buffer)`]: buffer.md#buffer_static_method_buffer_from_buffer -[`Buffer.isBuffer()`]: buffer.md#buffer_static_method_buffer_isbuffer_obj -[`Cipher`]: crypto.md#crypto_class_cipher -[`Decipher`]: crypto.md#crypto_class_decipher -[`EventEmitter.listenerCount(emitter, eventName)`]: events.md#events_eventemitter_listenercount_emitter_eventname -[`REPLServer.clearBufferedCommand()`]: repl.md#repl_replserver_clearbufferedcommand -[`ReadStream.open()`]: fs.md#fs_class_fs_readstream -[`Server.getConnections()`]: net.md#net_server_getconnections_callback -[`Server.listen({fd: })`]: net.md#net_server_listen_handle_backlog_callback -[`SlowBuffer`]: buffer.md#buffer_class_slowbuffer -[`WriteStream.open()`]: fs.md#fs_class_fs_writestream -[`assert`]: assert.md -[`asyncResource.runInAsyncScope()`]: async_hooks.md#async_hooks_asyncresource_runinasyncscope_fn_thisarg_args -[`child_process`]: child_process.md -[`clearInterval()`]: timers.md#timers_clearinterval_timeout -[`clearTimeout()`]: timers.md#timers_cleartimeout_timeout -[`console.error()`]: console.md#console_console_error_data_args -[`console.log()`]: console.md#console_console_log_data_args -[`crypto.Certificate()` constructor]: crypto.md#crypto_legacy_api -[`crypto.DEFAULT_ENCODING`]: crypto.md#crypto_crypto_default_encoding -[`crypto.createCipher()`]: crypto.md#crypto_crypto_createcipher_algorithm_password_options -[`crypto.createCipheriv()`]: crypto.md#crypto_crypto_createcipheriv_algorithm_key_iv_options -[`crypto.createDecipher()`]: crypto.md#crypto_crypto_createdecipher_algorithm_password_options -[`crypto.createDecipheriv()`]: crypto.md#crypto_crypto_createdecipheriv_algorithm_key_iv_options -[`crypto.fips`]: crypto.md#crypto_crypto_fips -[`crypto.pbkdf2()`]: crypto.md#crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback -[`crypto.randomBytes()`]: crypto.md#crypto_crypto_randombytes_size_callback -[`crypto.scrypt()`]: crypto.md#crypto_crypto_scrypt_password_salt_keylen_options_callback -[`decipher.final()`]: crypto.md#crypto_decipher_final_outputencoding -[`decipher.setAuthTag()`]: crypto.md#crypto_decipher_setauthtag_buffer -[`domain`]: domain.md -[`ecdh.setPublicKey()`]: crypto.md#crypto_ecdh_setpublickey_publickey_encoding -[`emitter.listenerCount(eventName)`]: events.md#events_emitter_listenercount_eventname -[`fs.FileHandle`]: fs.md#fs_class_filehandle -[`fs.access()`]: fs.md#fs_fs_access_path_mode_callback -[`fs.createReadStream()`]: fs.md#fs_fs_createreadstream_path_options -[`fs.createWriteStream()`]: fs.md#fs_fs_createwritestream_path_options -[`fs.exists(path, callback)`]: fs.md#fs_fs_exists_path_callback -[`fs.lchmod(path, mode, callback)`]: fs.md#fs_fs_lchmod_path_mode_callback -[`fs.lchmodSync(path, mode)`]: fs.md#fs_fs_lchmodsync_path_mode -[`fs.lchown(path, uid, gid, callback)`]: fs.md#fs_fs_lchown_path_uid_gid_callback -[`fs.lchownSync(path, uid, gid)`]: fs.md#fs_fs_lchownsync_path_uid_gid -[`fs.read()`]: fs.md#fs_fs_read_fd_buffer_offset_length_position_callback -[`fs.readSync()`]: fs.md#fs_fs_readsync_fd_buffer_offset_length_position -[`fs.stat()`]: fs.md#fs_fs_stat_path_options_callback -[`http.get()`]: http.md#http_http_get_options_callback -[`http.request()`]: http.md#http_http_request_options_callback -[`https.get()`]: https.md#https_https_get_options_callback -[`https.request()`]: https.md#https_https_request_options_callback -[`module.createRequire()`]: module.md#module_module_createrequire_filename -[`os.networkInterfaces()`]: os.md#os_os_networkinterfaces -[`os.tmpdir()`]: os.md#os_os_tmpdir -[`process.env`]: process.md#process_process_env -[`process.mainModule`]: process.md#process_process_mainmodule -[`punycode`]: punycode.md -[`request.abort()`]: http.md#http_request_abort -[`request.connection`]: http.md#http_request_connection -[`request.destroy()`]: http.md#http_request_destroy_error -[`request.socket`]: http.md#http_request_socket -[`require.extensions`]: modules.md#modules_require_extensions -[`require.main`]: modules.md#modules_accessing_the_main_module -[`response.connection`]: http.md#http_response_connection -[`response.end()`]: http.md#http_response_end_data_encoding_callback -[`response.finished`]: http.md#http_response_finished -[`response.socket`]: http.md#http_response_socket -[`response.writableEnded`]: http.md#http_response_writableended -[`response.writableFinished`]: http.md#http_response_writablefinished -[`script.createCachedData()`]: vm.md#vm_script_createcacheddata -[`setInterval()`]: timers.md#timers_setinterval_callback_delay_args -[`setTimeout()`]: timers.md#timers_settimeout_callback_delay_args -[`socket.bufferSize`]: net.md#net_socket_buffersize -[`timeout.ref()`]: timers.md#timers_timeout_ref -[`timeout.refresh()`]: timers.md#timers_timeout_refresh -[`timeout.unref()`]: timers.md#timers_timeout_unref -[`tls.CryptoStream`]: tls.md#tls_class_tls_cryptostream -[`tls.SecureContext`]: tls.md#tls_tls_createsecurecontext_options -[`tls.SecurePair`]: tls.md#tls_class_tls_securepair -[`tls.TLSSocket`]: tls.md#tls_class_tls_tlssocket -[`tls.checkServerIdentity()`]: tls.md#tls_tls_checkserveridentity_hostname_cert -[`tls.createSecureContext()`]: tls.md#tls_tls_createsecurecontext_options -[`url.format()`]: url.md#url_url_format_urlobject -[`url.parse()`]: url.md#url_url_parse_urlstring_parsequerystring_slashesdenotehost -[`url.resolve()`]: url.md#url_url_resolve_from_to -[`util._extend()`]: util.md#util_util_extend_target_source -[`util.getSystemErrorName()`]: util.md#util_util_getsystemerrorname_err -[`util.inspect()`]: util.md#util_util_inspect_object_options -[`util.inspect.custom`]: util.md#util_util_inspect_custom -[`util.isArray()`]: util.md#util_util_isarray_object -[`util.isBoolean()`]: util.md#util_util_isboolean_object -[`util.isBuffer()`]: util.md#util_util_isbuffer_object -[`util.isDate()`]: util.md#util_util_isdate_object -[`util.isError()`]: util.md#util_util_iserror_object -[`util.isFunction()`]: util.md#util_util_isfunction_object -[`util.isNull()`]: util.md#util_util_isnull_object -[`util.isNullOrUndefined()`]: util.md#util_util_isnullorundefined_object -[`util.isNumber()`]: util.md#util_util_isnumber_object -[`util.isObject()`]: util.md#util_util_isobject_object -[`util.isPrimitive()`]: util.md#util_util_isprimitive_object -[`util.isRegExp()`]: util.md#util_util_isregexp_object -[`util.isString()`]: util.md#util_util_isstring_object -[`util.isSymbol()`]: util.md#util_util_issymbol_object -[`util.isUndefined()`]: util.md#util_util_isundefined_object -[`util.log()`]: util.md#util_util_log_string -[`util.types`]: util.md#util_util_types -[`util`]: util.md -[`worker.exitedAfterDisconnect`]: cluster.md#cluster_worker_exitedafterdisconnect -[`worker.terminate()`]: worker_threads.md#worker_threads_worker_terminate -[`writable.writableLength`]: stream.md#stream_writable_writablelength -[`zlib.bytesWritten`]: zlib.md#zlib_zlib_byteswritten -[alloc]: buffer.md#buffer_static_method_buffer_alloc_size_fill_encoding -[alloc_unsafe_size]: buffer.md#buffer_static_method_buffer_allocunsafe_size -[from_arraybuffer]: buffer.md#buffer_static_method_buffer_from_arraybuffer_byteoffset_length -[from_string_encoding]: buffer.md#buffer_static_method_buffer_from_string_encoding -[legacy `urlObject`]: url.md#url_legacy_urlobject -[static methods of `crypto.Certificate()`]: crypto.md#crypto_class_certificate +[WHATWG URL API]: url.html#url_the_whatwg_url_api +[alloc]: buffer.html#buffer_class_method_buffer_alloc_size_fill_encoding +[alloc_unsafe_size]: buffer.html#buffer_class_method_buffer_allocunsafe_size +[from_arraybuffer]: buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length +[from_string_encoding]: buffer.html#buffer_class_method_buffer_from_string_encoding +[legacy `urlObject`]: url.html#url_legacy_urlobject diff --git a/doc/api/dgram.md b/doc/api/dgram.md index 9c289b3fb7cca8..3cc2ea78297228 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -96,11 +96,11 @@ The event handler function is passed two arguments: `msg` and `rinfo`. * `port` {number} The sender port. * `size` {number} The message size. -If the source address of the incoming packet is an IPv6 link-local -address, the interface name is added to the `address`. For +If the source address of the incoming packet is an IPv6 link local +address, the interface name is added to the `address`. For example, a packet received on the `en0` interface might have the address field set to `'fe80::2618:1234:ab11:3b9c%en0'`, where `'%en0'` -is the interface name as a zone ID suffix. +is the interface name as a zone id suffix. ### `socket.addMembership(multicastAddress[, multicastInterface])` **This module is pending deprecation**. Once a replacement API has been -finalized, this module will be fully deprecated. Most developers should +finalized, this module will be fully deprecated. Most end users should **not** have cause to use this module. Users who absolutely must have the functionality that domains provide may rely on it for the time being but should expect to have to migrate to a different solution @@ -478,10 +477,10 @@ Domains will not interfere with the error handling mechanisms for promises. In other words, no `'error'` event will be emitted for unhandled `Promise` rejections. -[`Error`]: errors.md#errors_class_error +[`Error`]: errors.html#errors_class_error [`domain.add(emitter)`]: #domain_domain_add_emitter [`domain.bind(callback)`]: #domain_domain_bind_callback [`domain.exit()`]: #domain_domain_exit -[`setInterval()`]: timers.md#timers_setinterval_callback_delay_args -[`setTimeout()`]: timers.md#timers_settimeout_callback_delay_args +[`setInterval()`]: timers.html#timers_setinterval_callback_delay_args +[`setTimeout()`]: timers.html#timers_settimeout_callback_delay_args [`throw`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw diff --git a/doc/api/embedding.md b/doc/api/embedding.md index f27b87821bd81c..1a416f52c600de 100644 --- a/doc/api/embedding.md +++ b/doc/api/embedding.md @@ -35,7 +35,6 @@ the `node` and `v8` C++ namespaces, respectively. ```cpp int main(int argc, char** argv) { - argv = uv_setup_args(argc, argv); std::vector args(argv, argv + argc); std::vector exec_args; std::vector errors; @@ -220,8 +219,8 @@ int RunNodeInstance(MultiIsolatePlatform* platform, } ``` -[CLI options]: cli.md -[`process.memoryUsage()`]: process.md#process_process_memoryusage -[deprecation policy]: deprecations.md +[`process.memoryUsage()`]: process.html#process_process_memoryusage +[CLI options]: cli.html +[deprecation policy]: deprecations.html [embedtest.cc]: https://github.com/nodejs/node/blob/master/test/embedding/embedtest.cc [src/node.h]: https://github.com/nodejs/node/blob/master/src/node.h diff --git a/doc/api/errors.md b/doc/api/errors.md index 814a6e5b16a8f2..db3ea5af4be9b1 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -224,7 +224,7 @@ above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation -details of error generation from the user. For instance: +details of error generation from an end user. For instance: ```js function MyError() { @@ -708,26 +708,26 @@ STDERR/STDOUT, and the data's length is longer than the `maxBuffer` option. `Console` was instantiated without `stdout` stream, or `Console` has a non-writable `stdout` or `stderr` stream. - -### `ERR_CONSTRUCT_CALL_INVALID` - + +### `ERR_CONTEXT_NOT_INITIALIZED` -A class constructor was called that is not callable. +The vm context passed into the API is not yet initialized. This could happen +when an error occurs (and is caught) during the creation of the +context, for example, when the allocation fails or the maximum call stack +size is reached when the context is created. ### `ERR_CONSTRUCT_CALL_REQUIRED` A constructor for a class was called without `new`. - -### `ERR_CONTEXT_NOT_INITIALIZED` + +### `ERR_CONSTRUCT_CALL_INVALID` + -The vm context passed into the API is not yet initialized. This could happen -when an error occurs (and is caught) during the creation of the -context, for example, when the allocation fails or the maximum call stack -size is reached when the context is created. +A class constructor was called that is not callable. ### `ERR_CPU_USAGE` @@ -920,7 +920,7 @@ A `Promise` that was callbackified via `util.callbackify()` was rejected with a falsy value. -### `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` +#### `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` @@ -955,11 +955,6 @@ An invalid HTTP header value was specified. Status code was outside the regular status code range (100-999). - -### `ERR_HTTP_REQUEST_TIMEOUT` - -The client has not sent the entire request within the allowed time. - ### `ERR_HTTP_SOCKET_ENCODING` @@ -1010,12 +1005,6 @@ A non-specific HTTP/2 error has occurred. New HTTP/2 Streams may not be opened after the `Http2Session` has received a `GOAWAY` frame from the connected peer. - -### `ERR_HTTP2_HEADER_SINGLE_VALUE` - -Multiple values were provided for an HTTP/2 header field that was required to -have only a single value. - ### `ERR_HTTP2_HEADERS_AFTER_RESPOND` @@ -1026,6 +1015,12 @@ An additional headers was specified after an HTTP/2 response was initiated. An attempt was made to send multiple response headers. + +### `ERR_HTTP2_HEADER_SINGLE_VALUE` + +Multiple values were provided for an HTTP/2 header field that was required to +have only a single value. + ### `ERR_HTTP2_INFO_STATUS_NOT_ALLOWED` @@ -1226,6 +1221,12 @@ is set for the `Http2Stream`. `http2.connect()` was passed a URL that uses any protocol other than `http:` or `https:`. + +### `ERR_INTERNAL_ASSERTION` + +There was a bug in Node.js or incorrect usage of Node.js internals. +To fix the error, open an issue at . + ### `ERR_INCOMPATIBLE_OPTION_PAIR` @@ -1286,12 +1287,6 @@ before it was connected. An API was called on the main thread that can only be used from the worker thread. - -### `ERR_INTERNAL_ASSERTION` - -There was a bug in Node.js or incorrect usage of Node.js internals. -To fix the error, open an issue at . - ### `ERR_INVALID_ADDRESS_FAMILY` @@ -1383,16 +1378,26 @@ An IP address is not valid. The imported module string is an invalid URL, package name, or package subpath specifier. + +### `ERR_INVALID_OPT_VALUE` + +An invalid or unexpected value was passed in an options object. + + +### `ERR_INVALID_OPT_VALUE_ENCODING` + +An invalid or unknown file encoding was passed. + ### `ERR_INVALID_PACKAGE_CONFIG` -An invalid [`package.json`][] file failed parsing. +An invalid `package.json` file was found which failed parsing. ### `ERR_INVALID_PACKAGE_TARGET` -The `package.json` [`"exports"`][] field contains an invalid target mapping -value for the attempted module resolution. +The `package.json` [exports][] field contains an invalid target mapping value +for the attempted module resolution. ### `ERR_INVALID_PERFORMANCE_MARK` @@ -1609,18 +1614,6 @@ strict compliance with the API specification (which in some cases may accept For APIs that accept options objects, some options might be mandatory. This code is thrown if a required option is missing. - -### `ERR_MISSING_PASSPHRASE` - -An attempt was made to read an encrypted key without specifying a passphrase. - - -### `ERR_MISSING_PLATFORM_FOR_WORKER` - -The V8 platform used by this instance of Node.js does not support creating -Workers. This is caused by lack of embedder support for Workers. In particular, -this error will not occur with standard builds of Node.js. - ### `ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST` An object that needs to be explicitly listed in the `transferList` argument -is in the object passed to a [`postMessage()`][] call, but is not provided +was found in the object passed to a [`postMessage()`][] call, but not provided in the `transferList` for that call. Usually, this is a `MessagePort`. In Node.js versions prior to REPLACEME, the error code being used here was @@ -1636,6 +1629,18 @@ In Node.js versions prior to REPLACEME, the error code being used here was transferable object types has been expanded to cover more types than `MessagePort`. + +### `ERR_MISSING_PASSPHRASE` + +An attempt was made to read an encrypted key without specifying a passphrase. + + +### `ERR_MISSING_PLATFORM_FOR_WORKER` + +The V8 platform used by this instance of Node.js does not support creating +Workers. This is caused by lack of embedder support for Workers. In particular, +this error will not occur with standard builds of Node.js. + ### `ERR_MODULE_NOT_FOUND` @@ -1725,13 +1730,13 @@ A given value is out of the accepted range. ### `ERR_PACKAGE_IMPORT_NOT_DEFINED` -The `package.json` [`"imports"`][] field does not define the given internal +The `package.json` ["imports" field][] does not define the given internal package specifier mapping. ### `ERR_PACKAGE_PATH_NOT_EXPORTED` -The `package.json` [`"exports"`][] field does not export the requested subpath. +The `package.json` [exports][] field does not export the requested subpath. Because exports are encapsulated, private internal modules that are not exported cannot be imported through the package resolution, unless using an absolute URL. @@ -1862,12 +1867,6 @@ A string was provided for a Subresource Integrity check, but was unable to be parsed. Check the format of integrity attributes by looking at the [Subresource Integrity specification][]. - -### `ERR_STREAM_ALREADY_FINISHED` - -A stream method was called that cannot complete because the stream was -finished. - ### `ERR_STREAM_CANNOT_PIPE` @@ -1879,6 +1878,12 @@ An attempt was made to call [`stream.pipe()`][] on a [`Writable`][] stream. A stream method was called that cannot complete because the stream was destroyed using `stream.destroy()`. + +### `ERR_STREAM_ALREADY_FINISHED` + +A stream method was called that cannot complete because the stream was +finished. + ### `ERR_STREAM_NULL_VALUES` @@ -1968,17 +1973,6 @@ added: v13.3.0 The context must be a `SecureContext`. - -### `ERR_TLS_INVALID_PROTOCOL_METHOD` - -The specified `secureProtocol` method is invalid. It is either unknown, or -disabled because it is insecure. - - -### `ERR_TLS_INVALID_PROTOCOL_VERSION` - -Valid TLS protocol versions are `'TLSv1'`, `'TLSv1.1'`, or `'TLSv1.2'`. - ### `ERR_TLS_INVALID_STATE` ```js @@ -2134,11 +2139,16 @@ import 'package-name'; // supported `import` with URL schemes other than `file` and `data` is unsupported. + +### `ERR_V8BREAKITERATOR` + +The V8 `BreakIterator` API was used but the full ICU data set is not installed. + ### `ERR_VALID_PERFORMANCE_ENTRY_TYPE` While using the Performance Timing API (`perf_hooks`), no valid performance -entry types are found. +entry types were found. ### `ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING` @@ -2261,17 +2271,6 @@ malconfigured clients, if more than 8KB of HTTP header data is received then HTTP parsing will abort without a request or response object being created, and an `Error` with this code will be emitted. - -### `HPE_UNEXPECTED_CONTENT_LENGTH` - -Server is sending both a `Content-Length` header and `Transfer-Encoding: chunked`. - -`Transfer-Encoding: chunked` allows the server to maintain an HTTP persistent -connection for dynamically generated content. -In this case, the `Content-Length` HTTP header cannot be used. - -Use `Content-Length` or `Transfer-Encoding: chunked`. - ### `MODULE_NOT_FOUND` A given index was out of the accepted range (e.g. negative offsets). - -### `ERR_INVALID_OPT_VALUE` - - -An invalid or unexpected value was passed in an options object. - - -### `ERR_INVALID_OPT_VALUE_ENCODING` - - -An invalid or unknown file encoding was passed. - ### `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` + +The `'ERR_UNKNOWN_BUILTIN_MODULE'` error code is used to identify a specific +kind of internal Node.js error that should not typically be triggered by user +code. Instances of this error point to an internal bug within the Node.js +binary itself. + ### `ERR_UNKNOWN_STDIN_TYPE` - > Stability: 1 - Experimental @@ -65,41 +44,801 @@ Node.js contains support for ES Modules based upon the Expect major changes in the implementation including interoperability support, specifier resolution, and default behavior. - - - - - ## Enabling -Node.js treats JavaScript code as CommonJS modules by default. -Authors can tell Node.js to treat JavaScript code as ECMAScript modules -via the `.mjs` file extension, the `package.json` [`"type"`][] field, or the -`--input-type` flag. See -[Modules: Packages](packages.md#packages_determining_module_system) for more -details. - - - - - - - - - - - - - - - - +Experimental support for ECMAScript modules is enabled by default. +Node.js will treat the following as ES modules when passed to `node` as the +initial input, or when referenced by `import` statements within ES module code: + +* Files ending in `.mjs`. + +* Files ending in `.js` when the nearest parent `package.json` file contains a + top-level field `"type"` with a value of `"module"`. + +* Strings passed in as an argument to `--eval`, or piped to `node` via `STDIN`, + with the flag `--input-type=module`. + +Node.js will treat as CommonJS all other forms of input, such as `.js` files +where the nearest parent `package.json` file contains no top-level `"type"` +field, or string input without the flag `--input-type`. This behavior is to +preserve backward compatibility. However, now that Node.js supports both +CommonJS and ES modules, it is best to be explicit whenever possible. Node.js +will treat the following as CommonJS when passed to `node` as the initial input, +or when referenced by `import` statements within ES module code: + +* Files ending in `.cjs`. + +* Files ending in `.js` when the nearest parent `package.json` file contains a + top-level field `"type"` with a value of `"commonjs"`. + +* Strings passed in as an argument to `--eval` or `--print`, or piped to `node` + via `STDIN`, with the flag `--input-type=commonjs`. + +### `package.json` `"type"` field + +Files ending with `.js` will be loaded as ES modules when the nearest parent +`package.json` file contains a top-level field `"type"` with a value of +`"module"`. + +The nearest parent `package.json` is defined as the first `package.json` found +when searching in the current folder, that folder’s parent, and so on up +until the root of the volume is reached. + + +```js +// package.json +{ + "type": "module" +} +``` + +```bash +# In same folder as above package.json +node my-app.js # Runs as ES module +``` + +If the nearest parent `package.json` lacks a `"type"` field, or contains +`"type": "commonjs"`, `.js` files are treated as CommonJS. If the volume root is +reached and no `package.json` is found, Node.js defers to the default, a +`package.json` with no `"type"` field. + +`import` statements of `.js` files are treated as ES modules if the nearest +parent `package.json` contains `"type": "module"`. + +```js +// my-app.js, part of the same example as above +import './startup.js'; // Loaded as ES module because of package.json +``` + +Package authors should include the `"type"` field, even in packages where all +sources are CommonJS. Being explicit about the `type` of the package will +future-proof the package in case the default type of Node.js ever changes, and +it will also make things easier for build tools and loaders to determine how the +files in the package should be interpreted. + +Regardless of the value of the `"type"` field, `.mjs` files are always treated +as ES modules and `.cjs` files are always treated as CommonJS. + +### Package scope and file extensions + +A folder containing a `package.json` file, and all subfolders below that folder +until the next folder containing another `package.json`, are a +_package scope_. The `"type"` field defines how to treat `.js` files +within the package scope. Every package in a +project’s `node_modules` folder contains its own `package.json` file, so each +project’s dependencies have their own package scopes. If a `package.json` file +does not have a `"type"` field, the default `"type"` is `"commonjs"`. + +The package scope applies not only to initial entry points (`node my-app.js`) +but also to files referenced by `import` statements and `import()` expressions. + +```js +// my-app.js, in an ES module package scope because there is a package.json +// file in the same folder with "type": "module". + +import './startup/init.js'; +// Loaded as ES module since ./startup contains no package.json file, +// and therefore inherits the ES module package scope from one level up. + +import 'commonjs-package'; +// Loaded as CommonJS since ./node_modules/commonjs-package/package.json +// lacks a "type" field or contains "type": "commonjs". + +import './node_modules/commonjs-package/index.js'; +// Loaded as CommonJS since ./node_modules/commonjs-package/package.json +// lacks a "type" field or contains "type": "commonjs". +``` + +Files ending with `.mjs` are always loaded as ES modules regardless of package +scope. + +Files ending with `.cjs` are always loaded as CommonJS regardless of package +scope. + +```js +import './legacy-file.cjs'; +// Loaded as CommonJS since .cjs is always loaded as CommonJS. + +import 'commonjs-package/src/index.mjs'; +// Loaded as ES module since .mjs is always loaded as ES module. +``` + +The `.mjs` and `.cjs` extensions may be used to mix types within the same +package scope: + +* Within a `"type": "module"` package scope, Node.js can be instructed to + interpret a particular file as CommonJS by naming it with a `.cjs` extension + (since both `.js` and `.mjs` files are treated as ES modules within a + `"module"` package scope). + +* Within a `"type": "commonjs"` package scope, Node.js can be instructed to + interpret a particular file as an ES module by naming it with an `.mjs` + extension (since both `.js` and `.cjs` files are treated as CommonJS within a + `"commonjs"` package scope). + +### `--input-type` flag + +Strings passed in as an argument to `--eval` (or `-e`), or piped to `node` via +`STDIN`, will be treated as ES modules when the `--input-type=module` flag is +set. + +```bash +node --input-type=module --eval "import { sep } from 'path'; console.log(sep);" + +echo "import { sep } from 'path'; console.log(sep);" | node --input-type=module +``` + +For completeness there is also `--input-type=commonjs`, for explicitly running +string input as CommonJS. This is the default behavior if `--input-type` is +unspecified. ## Packages -This section was moved to [Modules: Packages](packages.md). +### Package entry points + +In a package’s `package.json` file, two fields can define entry points for a +package: `"main"` and `"exports"`. The `"main"` field is supported in all +versions of Node.js, but its capabilities are limited: it only defines the main +entry point of the package. + +The `"exports"` field provides an alternative to `"main"` where the package +main entry point can be defined while also encapsulating the package, +**preventing any other entry points besides those defined in `"exports"`**. +This encapsulation allows module authors to define a public interface for +their package. + +If both `"exports"` and `"main"` are defined, the `"exports"` field takes +precedence over `"main"`. `"exports"` are not specific to ES modules or +CommonJS; `"main"` will be overridden by `"exports"` if it exists. As such +`"main"` cannot be used as a fallback for CommonJS but it can be used as a +fallback for legacy versions of Node.js that do not support the `"exports"` +field. + +[Conditional exports][] can be used within `"exports"` to define different +package entry points per environment, including whether the package is +referenced via `require` or via `import`. For more information about supporting +both CommonJS and ES Modules in a single package please consult +[the dual CommonJS/ES module packages section][]. + +**Warning**: Introducing the `"exports"` field prevents consumers of a package +from using any entry points that are not defined, including the `package.json` +(e.g. `require('your-package/package.json')`. **This will likely be a breaking +change.** + +To make the introduction of `"exports"` non-breaking, ensure that every +previously supported entry point is exported. It is best to explicitly specify +entry points so that the package’s public API is well-defined. For example, +a project that previous exported `main`, `lib`, +`feature`, and the `package.json` could use the following `package.exports`: + +```json +{ + "name": "my-mod", + "exports": { + ".": "./lib/index.js", + "./lib": "./lib/index.js", + "./lib/index": "./lib/index.js", + "./lib/index.js": "./lib/index.js", + "./feature": "./feature/index.js", + "./feature/index.js": "./feature/index.js", + "./package.json": "./package.json" + } +} +``` + +Alternatively a project could choose to export entire folders: + +```json +{ + "name": "my-mod", + "exports": { + ".": "./lib/index.js", + "./lib": "./lib/index.js", + "./lib/": "./lib/", + "./feature": "./feature/index.js", + "./feature/": "./feature/", + "./package.json": "./package.json" + } +} +``` + +As a last resort, package encapsulation can be disabled entirely by creating an +export for the root of the package `"./": "./"`. This will expose every file in +the package at the cost of disabling the encapsulation and potential tooling +benefits this provides. As the ES Module loader in Node.js enforces the use of +[the full specifier path][], exporting the root rather than being explicit +about entry is less expressive than either of the prior examples. Not only +will encapsulation be lost but module consumers will be unable to +`import feature from 'my-mod/feature'` as they will need to provide the full +path `import feature from 'my-mod/feature/index.js`. + +#### Main entry point export + +To set the main entry point for a package, it is advisable to define both +`"exports"` and `"main"` in the package’s `package.json` file: + + +```js +{ + "main": "./main.js", + "exports": "./main.js" +} +``` + +The benefit of doing this is that when using the `"exports"` field all +subpaths of the package will no longer be available to importers under +`require('pkg/subpath.js')`, and instead they will get a new error, +`ERR_PACKAGE_PATH_NOT_EXPORTED`. + +This encapsulation of exports provides more reliable guarantees +about package interfaces for tools and when handling semver upgrades for a +package. It is not a strong encapsulation since a direct require of any +absolute subpath of the package such as +`require('/path/to/node_modules/pkg/subpath.js')` will still load `subpath.js`. + +#### Subpath exports + +When using the `"exports"` field, custom subpaths can be defined along +with the main entry point by treating the main entry point as the +`"."` subpath: + + +```js +{ + "main": "./main.js", + "exports": { + ".": "./main.js", + "./submodule": "./src/submodule.js" + } +} +``` + +Now only the defined subpath in `"exports"` can be imported by a +consumer: + +```js +import submodule from 'es-module-package/submodule'; +// Loads ./node_modules/es-module-package/src/submodule.js +``` + +While other subpaths will error: + +```js +import submodule from 'es-module-package/private-module.js'; +// Throws ERR_PACKAGE_PATH_NOT_EXPORTED +``` + +Entire folders can also be mapped with package exports: + + +```js +// ./node_modules/es-module-package/package.json +{ + "exports": { + "./features/": "./src/features/" + } +} +``` + +With the above, all modules within the `./src/features/` folder +are exposed deeply to `import` and `require`: + +```js +import feature from 'es-module-package/features/x.js'; +// Loads ./node_modules/es-module-package/src/features/x.js +``` + +When using folder mappings, ensure that you do want to expose every +module inside the subfolder. Any modules which are not public +should be moved to another folder to retain the encapsulation +benefits of exports. + +#### Package exports fallbacks + +For possible new specifier support in future, array fallbacks are +supported for all invalid specifiers: + + +```js +{ + "exports": { + "./submodule": ["not:valid", "./submodule.js"] + } +} +``` + +Since `"not:valid"` is not a valid specifier, `"./submodule.js"` is used +instead as the fallback, as if it were the only target. + +#### Exports sugar + +If the `"."` export is the only export, the `"exports"` field provides sugar +for this case being the direct `"exports"` field value. + +If the `"."` export has a fallback array or string value, then the `"exports"` +field can be set to this value directly. + + +```js +{ + "exports": { + ".": "./main.js" + } +} +``` + +can be written: + + +```js +{ + "exports": "./main.js" +} +``` + +#### Conditional exports + +Conditional exports provide a way to map to different paths depending on +certain conditions. They are supported for both CommonJS and ES module imports. + +For example, a package that wants to provide different ES module exports for +`require()` and `import` can be written: + + +```js +// package.json +{ + "main": "./main-require.cjs", + "exports": { + "import": "./main-module.js", + "require": "./main-require.cjs" + }, + "type": "module" +} +``` + +Node.js supports the following conditions out of the box: + +* `"import"` - matched when the package is loaded via `import` or + `import()`. Can reference either an ES module or CommonJS file, as both + `import` and `import()` can load either ES module or CommonJS sources. + _Always matched when the `"require"` condition is not matched._ +* `"require"` - matched when the package is loaded via `require()`. + As `require()` only supports CommonJS, the referenced file must be CommonJS. + _Always matched when the `"import"` condition is not matched._ +* `"node"` - matched for any Node.js environment. Can be a CommonJS or ES + module file. _This condition should always come after `"import"` or + `"require"`._ +* `"default"` - the generic fallback that will always match. Can be a CommonJS + or ES module file. _This condition should always come last._ + +Within the `"exports"` object, key order is significant. During condition +matching, earlier entries have higher priority and take precedence over later +entries. _The general rule is that conditions should be from most specific to +least specific in object order_. + +Other conditions such as `"browser"`, `"electron"`, `"deno"`, `"react-native"`, +etc. are unknown to, and thus ignored by Node.js. Runtimes or tools other than +Node.js may use them at their discretion. Further restrictions, definitions, or +guidance on condition names may occur in the future. + +Using the `"import"` and `"require"` conditions can lead to some hazards, +which are further explained in [the dual CommonJS/ES module packages section][]. + +Conditional exports can also be extended to exports subpaths, for example: + + +```js +{ + "main": "./main.js", + "exports": { + ".": "./main.js", + "./feature": { + "node": "./feature-node.js", + "default": "./feature.js" + } + } +} +``` + +Defines a package where `require('pkg/feature')` and `import 'pkg/feature'` +could provide different implementations between Node.js and other JS +environments. + +When using environment branches, always include a `"default"` condition where +possible. Providing a `"default"` condition ensures that any unknown JS +environments are able to use this universal implementation, which helps avoid +these JS environments from having to pretend to be existing environments in +order to support packages with conditional exports. For this reason, using +`"node"` and `"default"` condition branches is usually preferable to using +`"node"` and `"browser"` condition branches. + +#### Nested conditions + +In addition to direct mappings, Node.js also supports nested condition objects. + +For example, to define a package that only has dual mode entry points for +use in Node.js but not the browser: + + +```js +{ + "main": "./main.js", + "exports": { + "node": { + "import": "./feature-node.mjs", + "require": "./feature-node.cjs" + }, + "default": "./feature.mjs", + } +} +``` + +Conditions continue to be matched in order as with flat conditions. If +a nested conditional does not have any mapping it will continue checking +the remaining conditions of the parent condition. In this way nested +conditions behave analogously to nested JavaScript `if` statements. + +#### Self-referencing a package using its name + +Within a package, the values defined in the package’s +`package.json` `"exports"` field can be referenced via the package’s name. +For example, assuming the `package.json` is: + +```json +// package.json +{ + "name": "a-package", + "exports": { + ".": "./main.mjs", + "./foo": "./foo.js" + } +} +``` + +Then any module _in that package_ can reference an export in the package itself: + +```js +// ./a-module.mjs +import { something } from 'a-package'; // Imports "something" from ./main.mjs. +``` + +Self-referencing is available only if `package.json` has `exports`, and will +allow importing only what that `exports` (in the `package.json`) allows. +So the code below, given the package above, will generate a runtime error: + +```js +// ./another-module.mjs + +// Imports "another" from ./m.mjs. Fails because +// the "package.json" "exports" field +// does not provide an export named "./m.mjs". +import { another } from 'a-package/m.mjs'; +``` + +Self-referencing is also available when using `require`, both in an ES module, +and in a CommonJS one. For example, this code will also work: + +```js +// ./a-module.js +const { something } = require('a-package/foo'); // Loads from ./foo.js. +``` + +### Internal package imports + +In addition to the `"exports"` field it is possible to define internal package +import maps that only apply to import specifiers from within the package itself. + +Entries in the imports field must always start with `#` to ensure they are +clearly disambiguated from package specifiers. + +For example, the imports field can be used to gain the benefits of conditional +exports for internal modules: + +```json +// package.json +{ + "imports": { + "#dep": { + "node": "dep-node-native", + "default": "./dep-polyfill.js" + } + }, + "dependencies": { + "dep-node-native": "^1.0.0" + } +} +``` + +where `import '#dep'` would now get the resolution of the external package +`dep-node-native` (including its exports in turn), and instead get the local +file `./dep-polyfill.js` relative to the package in other environments. + +Unlike the exports field, import maps permit mapping to external packages +because this provides an important use case for conditional loading and also can +be done without the risk of cycles, unlike for exports. + +Apart from the above, the resolution rules for the imports field are otherwise +analogous to the exports field. + +### Dual CommonJS/ES module packages + +Prior to the introduction of support for ES modules in Node.js, it was a common +pattern for package authors to include both CommonJS and ES module JavaScript +sources in their package, with `package.json` `"main"` specifying the CommonJS +entry point and `package.json` `"module"` specifying the ES module entry point. +This enabled Node.js to run the CommonJS entry point while build tools such as +bundlers used the ES module entry point, since Node.js ignored (and still +ignores) the top-level `"module"` field. + +Node.js can now run ES module entry points, and a package can contain both +CommonJS and ES module entry points (either via separate specifiers such as +`'pkg'` and `'pkg/es-module'`, or both at the same specifier via [Conditional +exports][]). Unlike in the scenario where `"module"` is only used by bundlers, +or ES module files are transpiled into CommonJS on the fly before evaluation by +Node.js, the files referenced by the ES module entry point are evaluated as ES +modules. + +#### Dual package hazard + +When an application is using a package that provides both CommonJS and ES module +sources, there is a risk of certain bugs if both versions of the package get +loaded. This potential comes from the fact that the `pkgInstance` created by +`const pkgInstance = require('pkg')` is not the same as the `pkgInstance` +created by `import pkgInstance from 'pkg'` (or an alternative main path like +`'pkg/module'`). This is the “dual package hazard,” where two versions of the +same package can be loaded within the same runtime environment. While it is +unlikely that an application or package would intentionally load both versions +directly, it is common for an application to load one version while a dependency +of the application loads the other version. This hazard can happen because +Node.js supports intermixing CommonJS and ES modules, and can lead to unexpected +behavior. + +If the package main export is a constructor, an `instanceof` comparison of +instances created by the two versions returns `false`, and if the export is an +object, properties added to one (like `pkgInstance.foo = 3`) are not present on +the other. This differs from how `import` and `require` statements work in +all-CommonJS or all-ES module environments, respectively, and therefore is +surprising to users. It also differs from the behavior users are familiar with +when using transpilation via tools like [Babel][] or [`esm`][]. + +#### Writing dual packages while avoiding or minimizing hazards + +First, the hazard described in the previous section occurs when a package +contains both CommonJS and ES module sources and both sources are provided for +use in Node.js, either via separate main entry points or exported paths. A +package could instead be written where any version of Node.js receives only +CommonJS sources, and any separate ES module sources the package may contain +could be intended only for other environments such as browsers. Such a package +would be usable by any version of Node.js, since `import` can refer to CommonJS +files; but it would not provide any of the advantages of using ES module syntax. + +A package could also switch from CommonJS to ES module syntax in a breaking +change version bump. This has the disadvantage that the newest version +of the package would only be usable in ES module-supporting versions of Node.js. + +Every pattern has tradeoffs, but there are two broad approaches that satisfy the +following conditions: + +1. The package is usable via both `require` and `import`. +1. The package is usable in both current Node.js and older versions of Node.js + that lack support for ES modules. +1. The package main entry point, e.g. `'pkg'` can be used by both `require` to + resolve to a CommonJS file and by `import` to resolve to an ES module file. + (And likewise for exported paths, e.g. `'pkg/feature'`.) +1. The package provides named exports, e.g. `import { name } from 'pkg'` rather + than `import pkg from 'pkg'; pkg.name`. +1. The package is potentially usable in other ES module environments such as + browsers. +1. The hazards described in the previous section are avoided or minimized. + +##### Approach #1: Use an ES module wrapper + +Write the package in CommonJS or transpile ES module sources into CommonJS, and +create an ES module wrapper file that defines the named exports. Using +[Conditional exports][], the ES module wrapper is used for `import` and the +CommonJS entry point for `require`. + + +```js +// ./node_modules/pkg/package.json +{ + "type": "module", + "main": "./index.cjs", + "exports": { + "import": "./wrapper.mjs", + "require": "./index.cjs" + } +} +``` + +```js +// ./node_modules/pkg/index.cjs +exports.name = 'value'; +``` + +```js +// ./node_modules/pkg/wrapper.mjs +import cjsModule from './index.cjs'; +export const name = cjsModule.name; +``` + +In this example, the `name` from `import { name } from 'pkg'` is the same +singleton as the `name` from `const { name } = require('pkg')`. Therefore `===` +returns `true` when comparing the two `name`s and the divergent specifier hazard +is avoided. + +If the module is not simply a list of named exports, but rather contains a +unique function or object export like `module.exports = function () { ... }`, +or if support in the wrapper for the `import pkg from 'pkg'` pattern is desired, +then the wrapper would instead be written to export the default optionally +along with any named exports as well: + +```js +import cjsModule from './index.cjs'; +export const name = cjsModule.name; +export default cjsModule; +``` + +This approach is appropriate for any of the following use cases: +* The package is currently written in CommonJS and the author would prefer not + to refactor it into ES module syntax, but wishes to provide named exports for + ES module consumers. +* The package has other packages that depend on it, and the end user might + install both this package and those other packages. For example a `utilities` + package is used directly in an application, and a `utilities-plus` package + adds a few more functions to `utilities`. Because the wrapper exports + underlying CommonJS files, it doesn’t matter if `utilities-plus` is written in + CommonJS or ES module syntax; it will work either way. +* The package stores internal state, and the package author would prefer not to + refactor the package to isolate its state management. See the next section. + +A variant of this approach not requiring conditional exports for consumers could +be to add an export, e.g. `"./module"`, to point to an all-ES module-syntax +version of the package. This could be used via `import 'pkg/module'` by users +who are certain that the CommonJS version will not be loaded anywhere in the +application, such as by dependencies; or if the CommonJS version can be loaded +but doesn’t affect the ES module version (for example, because the package is +stateless): + + +```js +// ./node_modules/pkg/package.json +{ + "type": "module", + "main": "./index.cjs", + "exports": { + ".": "./index.cjs", + "./module": "./wrapper.mjs" + } +} +``` + +##### Approach #2: Isolate state + +A `package.json` file can define the separate CommonJS and ES module entry +points directly: + + +```js +// ./node_modules/pkg/package.json +{ + "type": "module", + "main": "./index.cjs", + "exports": { + "import": "./index.mjs", + "require": "./index.cjs" + } +} +``` + +This can be done if both the CommonJS and ES module versions of the package are +equivalent, for example because one is the transpiled output of the other; and +the package’s management of state is carefully isolated (or the package is +stateless). + +The reason that state is an issue is because both the CommonJS and ES module +versions of the package may get used within an application; for example, the +user’s application code could `import` the ES module version while a dependency +`require`s the CommonJS version. If that were to occur, two copies of the +package would be loaded in memory and therefore two separate states would be +present. This would likely cause hard-to-troubleshoot bugs. + +Aside from writing a stateless package (if JavaScript’s `Math` were a package, +for example, it would be stateless as all of its methods are static), there are +some ways to isolate state so that it’s shared between the potentially loaded +CommonJS and ES module instances of the package: + +1. If possible, contain all state within an instantiated object. JavaScript’s + `Date`, for example, needs to be instantiated to contain state; if it were a + package, it would be used like this: + + ```js + import Date from 'date'; + const someDate = new Date(); + // someDate contains state; Date does not + ``` + + The `new` keyword isn’t required; a package’s function can return a new + object, or modify a passed-in object, to keep the state external to the + package. + +1. Isolate the state in one or more CommonJS files that are shared between the + CommonJS and ES module versions of the package. For example, if the CommonJS + and ES module entry points are `index.cjs` and `index.mjs`, respectively: + + ```js + // ./node_modules/pkg/index.cjs + const state = require('./state.cjs'); + module.exports.state = state; + ``` + + ```js + // ./node_modules/pkg/index.mjs + import state from './state.cjs'; + export { + state + }; + ``` + + Even if `pkg` is used via both `require` and `import` in an application (for + example, via `import` in application code and via `require` by a dependency) + each reference of `pkg` will contain the same state; and modifying that + state from either module system will apply to both. + +Any plugins that attach to the package’s singleton would need to separately +attach to both the CommonJS and ES module singletons. + +This approach is appropriate for any of the following use cases: +* The package is currently written in ES module syntax and the package author + wants that version to be used wherever such syntax is supported. +* The package is stateless or its state can be isolated without too much + difficulty. +* The package is unlikely to have other public packages that depend on it, or if + it does, the package is stateless or has state that need not be shared between + dependencies or with the overall application. + +Even with isolated state, there is still the cost of possible extra code +execution between the CommonJS and ES module versions of a package. + +As with the previous approach, a variant of this approach not requiring +conditional exports for consumers could be to add an export, e.g. +`"./module"`, to point to an all-ES module-syntax version of the package: + + +```js +// ./node_modules/pkg/package.json +{ + "type": "module", + "main": "./index.cjs", + "exports": { + ".": "./index.cjs", + "./module": "./index.mjs" + } +} +``` ## `import` Specifiers @@ -126,27 +865,13 @@ There are four types of specifiers: Bare specifiers, and the bare specifier portion of deep import specifiers, are strings; but everything else in a specifier is a URL. -`file:`, `node:`, and `data:` URLs are supported. A specifier like +Only `file:` and `data:` URLs are supported. A specifier like `'https://example.com/app.js'` may be supported by browsers but it is not supported in Node.js. Specifiers may not begin with `/` or `//`. These are reserved for potential future use. The root of the current volume may be referenced via `file:///`. -#### `node:` Imports - - - -`node:` URLs are supported as a means to load Node.js builtin modules. This -URL scheme allows for builtin modules to be referenced by valid absolute URL -strings. - -```js -import fs from 'node:fs/promises'; -``` - #### `data:` Imports ```js -import { default as cjs } from 'cjs'; +import packageMain from 'commonjs-package'; // Works -// The following import statement is "syntax sugar" (equivalent but sweeter) -// for `{ default as cjsSugar }` in the above import statement: -import cjsSugar from 'cjs'; - -console.log(cjs); -console.log(cjs === cjsSugar); -// Prints: -// -// true +import { method } from 'commonjs-package'; // Errors ``` -The ECMAScript Module Namespace representation of a CommonJS module is always -a namespace with a `default` export key pointing to the CommonJS -`module.exports` value. +It is also possible to +[import an ES or CommonJS module for its side effects only][]. -This Module Namespace Exotic Object can be directly observed either when using -`import * as m from 'cjs'` or a dynamic import: +### `import()` expressions - -```js -import * as m from 'cjs'; -console.log(m); -console.log(m === await import('cjs')); -// Prints: -// [Module] { default: } -// true -``` +[Dynamic `import()`][] is supported in both CommonJS and ES modules. It can be +used to include ES module files from CommonJS code. -For better compatibility with existing usage in the JS ecosystem, Node.js -in addition attempts to determine the CommonJS named exports of every imported -CommonJS module to provide them as separate ES module exports using a static -analysis process. +## CommonJS, JSON, and native modules -For example, consider a CommonJS module written: +CommonJS, JSON, and native modules can be used with +[`module.createRequire()`][]. ```js // cjs.cjs -exports.name = 'exported'; -``` - -The preceding module supports named imports in ES modules: +module.exports = 'cjs'; - -```js -import { name } from './cjs.cjs'; -console.log(name); -// Prints: 'exported' +// esm.mjs +import { createRequire } from 'module'; -import cjs from './cjs.cjs'; -console.log(cjs); -// Prints: { name: 'exported' } +const require = createRequire(import.meta.url); -import * as m from './cjs.cjs'; -console.log(m); -// Prints: [Module] { default: { name: 'exported' }, name: 'exported' } +const cjs = require('./cjs.cjs'); +cjs === 'cjs'; // true ``` -As can be seen from the last example of the Module Namespace Exotic Object being -logged, the `name` export is copied off of the `module.exports` object and set -directly on the ES module namespace when the module is imported. - -Live binding updates or new exports added to `module.exports` are not detected -for these named exports. - -The detection of named exports is based on common syntax patterns but does not -always correctly detect named exports. In these cases, using the default -import form described above can be a better option. - -Named exports detection covers many common export patterns, reexport patterns -and build tool and transpiler outputs. See [cjs-module-lexer][] for the exact -semantics implemented. - ## Builtin modules -[Core modules][] provide named exports of their public API. A +Builtin modules will provide named exports of their public API. A default export is also provided which is the value of the CommonJS exports. The default export can be used for, among other things, modifying the named exports. Named exports of builtin modules are updated only by calling @@ -425,24 +1090,6 @@ syncBuiltinESMExports(); fs.readFileSync === readFileSync; ``` -## CommonJS, JSON, and native modules - -CommonJS, JSON, and native modules can be used with -[`module.createRequire()`][]. - -```js -// cjs.cjs -module.exports = 'cjs'; - -// esm.mjs -import { createRequire } from 'module'; - -const require = createRequire(import.meta.url); - -const cjs = require('./cjs.cjs'); -cjs === 'cjs'; // true -``` - ## Experimental JSON modules Currently importing JSON modules are only supported in the `commonjs` mode @@ -450,11 +1097,11 @@ and are loaded using the CJS loader. [WHATWG JSON modules specification][] are still being standardized, and are experimentally supported by including the additional flag `--experimental-json-modules` when running Node.js. -When the `--experimental-json-modules` flag is included, both the -`commonjs` and `module` mode use the new experimental JSON -loader. The imported JSON only exposes a `default`. There is no +When the `--experimental-json-modules` flag is included both the +`commonjs` and `module` mode will use the new experimental JSON +loader. The imported JSON only exposes a `default`, there is no support for named exports. A cache entry is created in the CommonJS -cache to avoid duplication. The same object is returned in +cache, to avoid duplication. The same object will be returned in CommonJS if the JSON module has already been imported from the same path. @@ -558,7 +1205,7 @@ The `conditions` property on the `context` is an array of conditions for for looking up conditional mappings elsewhere or to modify the list when calling the default resolution logic. -The current [package exports conditions][Conditional Exports] are always in +The current [package exports conditions][Conditional Exports] will always be in the `context.conditions` array passed into the hook. To guarantee _default Node.js module specifier resolution behavior_ when calling `defaultResolve`, the `context.conditions` array passed to it _must_ include _all_ elements of the @@ -628,7 +1275,7 @@ Note: These types all correspond to classes defined in ECMAScript. * The specific [`TypedArray`][] object is a [`Uint8Array`][]. Note: If the source value of a text-based format (i.e., `'json'`, `'module'`) is -not a string, it is converted to a string using [`util.TextDecoder`][]. +not a string, it will be converted to a string using [`util.TextDecoder`][]. ```js /** @@ -641,7 +1288,7 @@ export async function getFormat(url, context, defaultGetFormat) { if (Math.random() > 0.5) { // Some condition. // For some or all URLs, do some custom logic for determining format. // Always return an object of the form {format: }, where the - // format is one of the strings in the preceding table. + // format is one of the strings in the table above. return { format: 'module', }; @@ -739,15 +1386,15 @@ export async function transformSource(source, context, defaultTransformSource) { * Returns: {string} -Sometimes it might be necessary to run some code inside of the same global scope -that the application runs in. This hook allows the return of a string that is -run as sloppy-mode script on startup. +Sometimes it can be necessary to run some code inside of the same global scope +that the application will run in. This hook allows to return a string that will +be ran as sloppy-mode script on startup. Similar to how CommonJS wrappers work, the code runs in an implicit function scope. The only argument is a `require`-like function that can be used to load builtins like "fs": `getBuiltin(request: string)`. -If the code needs more advanced `require` features, it has to construct +If the code needs more advanced `require` features, it will have to construct its own `require` using `module.createRequire()`. ```js @@ -842,9 +1489,13 @@ import { VERSION } from 'https://coffeescript.org/browser-compiler-modern/coffee console.log(VERSION); ``` -With the preceding loader, running -`node --experimental-loader ./https-loader.mjs ./main.mjs` -prints the current version of CoffeeScript per the module at the URL in +With this loader, running: + +```console +node --experimental-loader ./https-loader.mjs ./main.js +``` + +Will print the current version of CoffeeScript per the module at the URL in `main.mjs`. #### Transpiler loader @@ -925,9 +1576,13 @@ console.log "Brought to you by Node.js version #{version}" export scream = (str) -> str.toUpperCase() ``` -With the preceding loader, running -`node --experimental-loader ./coffeescript-loader.mjs main.coffee` -causes `main.coffee` to be turned into JavaScript after its source code is +With this loader, running: + +```console +node --experimental-loader ./coffeescript-loader.mjs main.coffee +``` + +Will cause `main.coffee` to be turned into JavaScript after its source code is loaded from disk but before Node.js executes it; and so on for any `.coffee`, `.litcoffee` or `.coffee.md` files referenced via `import` statements of any loaded file. @@ -961,7 +1616,7 @@ future updates. In the following algorithms, all subroutine errors are propagated as errors of these top-level routines unless stated otherwise. -_defaultConditions_ is the conditional environment name array, +_defaultEnv_ is the conditional environment name priority array, `["node", "import"]`. The resolver can throw the following errors: @@ -976,45 +1631,45 @@ The resolver can throw the following errors: * _Package Import Not Defined_: Package imports do not define the specifier. * _Module Not Found_: The package or module requested does not exist. -### Resolver Algorithm Specification +
+Resolver algorithm specification **ESM_RESOLVE**(_specifier_, _parentURL_) -> 1. Let _resolved_ be **undefined**. +> 1. Let _resolvedURL_ be **undefined**. > 1. If _specifier_ is a valid URL, then -> 1. Set _resolved_ to the result of parsing and reserializing +> 1. Set _resolvedURL_ to the result of parsing and reserializing > _specifier_ as a URL. > 1. Otherwise, if _specifier_ starts with _"/"_, _"./"_ or _"../"_, then -> 1. Set _resolved_ to the URL resolution of _specifier_ relative to +> 1. Set _resolvedURL_ to the URL resolution of _specifier_ relative to > _parentURL_. > 1. Otherwise, if _specifier_ starts with _"#"_, then -> 1. Set _resolved_ to the destructured value of the result of -> **PACKAGE_IMPORTS_RESOLVE**(_specifier_, _parentURL_, -> _defaultConditions_). +> 1. Set _resolvedURL_ to the result of +> **PACKAGE_INTERNAL_RESOLVE**(_specifier_, _parentURL_). +> 1. If _resolvedURL_ is **null** or **undefined**, throw a +> _Package Import Not Defined_ error. > 1. Otherwise, > 1. Note: _specifier_ is now a bare specifier. -> 1. Set _resolved_ the result of +> 1. Set _resolvedURL_ the result of > **PACKAGE_RESOLVE**(_specifier_, _parentURL_). -> 1. If _resolved_ contains any percent encodings of _"/"_ or _"\\"_ (_"%2f"_ +> 1. If _resolvedURL_ contains any percent encodings of _"/"_ or _"\\"_ (_"%2f"_ > and _"%5C"_ respectively), then > 1. Throw an _Invalid Module Specifier_ error. -> 1. If the file at _resolved_ is a directory, then +> 1. If the file at _resolvedURL_ is a directory, then > 1. Throw an _Unsupported Directory Import_ error. -> 1. If the file at _resolved_ does not exist, then +> 1. If the file at _resolvedURL_ does not exist, then > 1. Throw a _Module Not Found_ error. -> 1. Set _resolved_ to the real path of _resolved_. -> 1. Let _format_ be the result of **ESM_FORMAT**(_resolved_). -> 1. Load _resolved_ as module format, _format_. -> 1. Return _resolved_. +> 1. Set _resolvedURL_ to the real path of _resolvedURL_. +> 1. Let _format_ be the result of **ESM_FORMAT**(_resolvedURL_). +> 1. Load _resolvedURL_ as module format, _format_. +> 1. Return _resolvedURL_. **PACKAGE_RESOLVE**(_packageSpecifier_, _parentURL_) -> 1. Let _packageName_ be **undefined**. +> 1. Let _packageName_ be *undefined*. +> 1. Let _packageSubpath_ be *undefined*. > 1. If _packageSpecifier_ is an empty string, then > 1. Throw an _Invalid Module Specifier_ error. -> 1. If _packageSpecifier_ does not start with _"@"_, then -> 1. Set _packageName_ to the substring of _packageSpecifier_ until the first -> _"/"_ separator or the end of the string. > 1. Otherwise, > 1. If _packageSpecifier_ does not contain a _"/"_ separator, then > 1. Throw an _Invalid Module Specifier_ error. @@ -1022,14 +1677,20 @@ The resolver can throw the following errors: > until the second _"/"_ separator or the end of the string. > 1. If _packageName_ starts with _"."_ or contains _"\\"_ or _"%"_, then > 1. Throw an _Invalid Module Specifier_ error. -> 1. Let _packageSubpath_ be _"."_ concatenated with the substring of +> 1. Let _packageSubpath_ be _undefined_. +> 1. If the length of _packageSpecifier_ is greater than the length of +> _packageName_, then +> 1. Set _packageSubpath_ to _"."_ concatenated with the substring of > _packageSpecifier_ from the position at the length of _packageName_. +> 1. If _packageSubpath_ contains any _"."_ or _".."_ segments or percent +> encoded strings for _"/"_ or _"\\"_, then +> 1. Throw an _Invalid Module Specifier_ error. > 1. Let _selfUrl_ be the result of -> **PACKAGE_SELF_RESOLVE**(_packageName_, _packageSubpath_, _parentURL_). -> 1. If _selfUrl_ is not **undefined**, return _selfUrl_. -> 1. If _packageSubpath_ is _"."_ and _packageName_ is a Node.js builtin +> **SELF_REFERENCE_RESOLVE**(_packageName_, _packageSubpath_, _parentURL_). +> 1. If _selfUrl_ isn't empty, return _selfUrl_. +> 1. If _packageSubpath_ is _undefined_ and _packageName_ is a Node.js builtin > module, then -> 1. Return the string _"node:"_ concatenated with _packageSpecifier_. +> 1. Return the string _"nodejs:"_ concatenated with _packageSpecifier_. > 1. While _parentURL_ is not the file system root, > 1. Let _packageURL_ be the URL resolution of _"node_modules/"_ > concatenated with _packageSpecifier_, relative to _parentURL_. @@ -1038,147 +1699,126 @@ The resolver can throw the following errors: > 1. Set _parentURL_ to the parent URL path of _parentURL_. > 1. Continue the next loop iteration. > 1. Let _pjson_ be the result of **READ_PACKAGE_JSON**(_packageURL_). -> 1. If _pjson_ is not **null** and _pjson_._exports_ is not **null** or -> **undefined**, then -> 1. Let _exports_ be _pjson.exports_. -> 1. Return the _resolved_ destructured value of the result of -> **PACKAGE_EXPORTS_RESOLVE**(_packageURL_, _packageSubpath_, -> _pjson.exports_, _defaultConditions_). -> 1. Otherwise, if _packageSubpath_ is equal to _"."_, then -> 1. Return the result applying the legacy **LOAD_AS_DIRECTORY** -> CommonJS resolver to _packageURL_, throwing a _Module Not Found_ -> error for no resolution. +> 1. If _packageSubpath_ is equal to _"./"_, then +> 1. Return _packageURL_ + _"/"_. +> 1. If _packageSubpath_ is _undefined__, then +> 1. Return the result of **PACKAGE_MAIN_RESOLVE**(_packageURL_, +> _pjson_). > 1. Otherwise, +> 1. If _pjson_ is not **null** and _pjson_ has an _"exports"_ key, then +> 1. Let _exports_ be _pjson.exports_. +> 1. If _exports_ is not **null** or **undefined**, then +> 1. Let _resolved_ be the result of **PACKAGE_EXPORTS_RESOLVE**( +> _packageURL_, _packageSubpath_, _pjson.exports_). +> 1. If _resolved_ is **null** or **undefined**, throw a +> _Package Path Not Exported_ error. +> 1. Return _resolved_. > 1. Return the URL resolution of _packageSubpath_ in _packageURL_. > 1. Throw a _Module Not Found_ error. -**PACKAGE_SELF_RESOLVE**(_packageName_, _packageSubpath_, _parentURL_) +**SELF_REFERENCE_RESOLVE**(_packageName_, _packageSubpath_, _parentURL_) > 1. Let _packageURL_ be the result of **READ_PACKAGE_SCOPE**(_parentURL_). > 1. If _packageURL_ is **null**, then > 1. Return **undefined**. > 1. Let _pjson_ be the result of **READ_PACKAGE_JSON**(_packageURL_). -> 1. If _pjson_ is **null** or if _pjson_._exports_ is **null** or -> **undefined**, then +> 1. If _pjson_ does not include an _"exports"_ property, then > 1. Return **undefined**. > 1. If _pjson.name_ is equal to _packageName_, then -> 1. Return the _resolved_ destructured value of the result of -> **PACKAGE_EXPORTS_RESOLVE**(_packageURL_, _subpath_, _pjson.exports_, -> _defaultConditions_). +> 1. If _packageSubpath_ is equal to _"./"_, then +> 1. Return _packageURL_ + _"/"_. +> 1. If _packageSubpath_ is _undefined_, then +> 1. Return the result of **PACKAGE_MAIN_RESOLVE**(_packageURL_, _pjson_). +> 1. Otherwise, +> 1. If _pjson_ is not **null** and _pjson_ has an _"exports"_ key, then +> 1. Let _exports_ be _pjson.exports_. +> 1. If _exports_ is not **null** or **undefined**, then +> 1. Let _resolved_ be the result of **PACKAGE_EXPORTS_RESOLVE**( +> _packageURL_, _subpath_, _pjson.exports_). +> 1. If _resolved_ is **null** or **undefined**, throw a +> _Package Path Not Exported_ error. +> 1. Return _resolved_. +> 1. Return the URL resolution of _subpath_ in _packageURL_. > 1. Otherwise, return **undefined**. -**PACKAGE_EXPORTS_RESOLVE**(_packageURL_, _subpath_, _exports_, _conditions_) +**PACKAGE_MAIN_RESOLVE**(_packageURL_, _pjson_) -> 1. If _exports_ is an Object with both a key starting with _"."_ and a key not -> starting with _"."_, throw an _Invalid Package Configuration_ error. -> 1. If _subpath_ is equal to _"."_, then -> 1. Let _mainExport_ be **undefined**. -> 1. If _exports_ is a String or Array, or an Object containing no keys -> starting with _"."_, then -> 1. Set _mainExport_ to _exports_. -> 1. Otherwise if _exports_ is an Object containing a _"."_ property, then -> 1. Set _mainExport_ to _exports_\[_"."_\]. -> 1. If _mainExport_ is not **undefined**, then +> 1. If _pjson_ is **null**, then +> 1. Throw a _Module Not Found_ error. +> 1. If _pjson.exports_ is not **null** or **undefined**, then +> 1. If _exports_ is an Object with both a key starting with _"."_ and a key +> not starting with _"."_, throw an _Invalid Package Configuration_ error. +> 1. If _pjson.exports_ is a String or Array, or an Object containing no +> keys starting with _"."_, then +> 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**( +> _packageURL_, _pjson.exports_, _""_, **false**, _defaultEnv_). +> 1. If _resolved_ is **null** or **undefined**, throw a +> _Package Path Not Exported_ error. +> 1. Return _resolved_. +> 1. If _pjson.exports_ is an Object containing a _"."_ property, then +> 1. Let _mainExport_ be the _"."_ property in _pjson.exports_. > 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**( -> _packageURL_, _mainExport_, _""_, **false**, **false**, -> _conditions_). -> 1. If _resolved_ is not **null** or **undefined**, then -> 1. Return _resolved_. -> 1. Otherwise, if _exports_ is an Object and all keys of _exports_ start with -> _"."_, then -> 1. Let _matchKey_ be the string _"./"_ concatenated with _subpath_. -> 1. Let _resolvedMatch_ be result of **PACKAGE_IMPORTS_EXPORTS_RESOLVE**( -> _matchKey_, _exports_, _packageURL_, **false**, _conditions_). -> 1. If _resolvedMatch_._resolve_ is not **null** or **undefined**, then -> 1. Return _resolvedMatch_. -> 1. Throw a _Package Path Not Exported_ error. - -**PACKAGE_IMPORTS_RESOLVE**(_specifier_, _parentURL_, _conditions_) +> _packageURL_, _mainExport_, _""_, **false**, _defaultEnv_). +> 1. If _resolved_ is **null** or **undefined**, throw a +> _Package Path Not Exported_ error. +> 1. Return _resolved_. +> 1. Throw a _Package Path Not Exported_ error. +> 1. Let _legacyMainURL_ be the result applying the legacy +> **LOAD_AS_DIRECTORY** CommonJS resolver to _packageURL_, throwing a +> _Module Not Found_ error for no resolution. +> 1. Return _legacyMainURL_. -> 1. Assert: _specifier_ begins with _"#"_. -> 1. If _specifier_ is exactly equal to _"#"_ or starts with _"#/"_, then -> 1. Throw an _Invalid Module Specifier_ error. -> 1. Let _packageURL_ be the result of **READ_PACKAGE_SCOPE**(_parentURL_). -> 1. If _packageURL_ is not **null**, then -> 1. Let _pjson_ be the result of **READ_PACKAGE_JSON**(_packageURL_). -> 1. If _pjson.imports_ is a non-null Object, then -> 1. Let _resolvedMatch_ be the result of -> **PACKAGE_IMPORTS_EXPORTS_RESOLVE**(_specifier_, _pjson.imports_, -> _packageURL_, **true**, _conditions_). -> 1. If _resolvedMatch_._resolve_ is not **null** or **undefined**, then -> 1. Return _resolvedMatch_. -> 1. Throw a _Package Import Not Defined_ error. - -**PACKAGE_IMPORTS_EXPORTS_RESOLVE**(_matchKey_, _matchObj_, _packageURL_, -_isImports_, _conditions_) - -> 1. If _matchKey_ is a key of _matchObj_, and does not end in _"*"_, then -> 1. Let _target_ be the value of _matchObj_\[_matchKey_\]. -> 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**( -> _packageURL_, _target_, _""_, **false**, _isImports_, _conditions_). -> 1. Return the object _{ resolved, exact: **true** }_. -> 1. Let _expansionKeys_ be the list of keys of _matchObj_ ending in _"/"_ -> or _"*"_, sorted by length descending. -> 1. For each key _expansionKey_ in _expansionKeys_, do -> 1. If _expansionKey_ ends in _"*"_ and _matchKey_ starts with but is -> not equal to the substring of _expansionKey_ excluding the last _"*"_ -> character, then -> 1. Let _target_ be the value of _matchObj_\[_expansionKey_\]. -> 1. Let _subpath_ be the substring of _matchKey_ starting at the -> index of the length of _expansionKey_ minus one. -> 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**( -> _packageURL_, _target_, _subpath_, **true**, _isImports_, -> _conditions_). -> 1. Return the object _{ resolved, exact: **true** }_. -> 1. If _matchKey_ starts with _expansionKey_, then -> 1. Let _target_ be the value of _matchObj_\[_expansionKey_\]. -> 1. Let _subpath_ be the substring of _matchKey_ starting at the -> index of the length of _expansionKey_. -> 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**( -> _packageURL_, _target_, _subpath_, **false**, _isImports_, -> _conditions_). -> 1. Return the object _{ resolved, exact: **false** }_. -> 1. Return the object _{ resolved: **null**, exact: **true** }_. +**PACKAGE_EXPORTS_RESOLVE**(_packageURL_, _packagePath_, _exports_) +> 1. If _exports_ is an Object with both a key starting with _"."_ and a key not +> starting with _"."_, throw an _Invalid Package Configuration_ error. +> 1. If _exports_ is an Object and all keys of _exports_ start with _"."_, then +> 1. Set _packagePath_ to _"./"_ concatenated with _packagePath_. +> 1. If _packagePath_ is a key of _exports_, then +> 1. Let _target_ be the value of _exports\[packagePath\]_. +> 1. Return **PACKAGE_TARGET_RESOLVE**(_packageURL_, _target_, +> _""_, **false**, _defaultEnv_). +> 1. Let _directoryKeys_ be the list of keys of _exports_ ending in +> _"/"_, sorted by length descending. +> 1. For each key _directory_ in _directoryKeys_, do +> 1. If _packagePath_ starts with _directory_, then +> 1. Let _target_ be the value of _exports\[directory\]_. +> 1. Let _subpath_ be the substring of _target_ starting at the index +> of the length of _directory_. +> 1. Return **PACKAGE_TARGET_RESOLVE**(_packageURL_, _target_, +> _subpath_, **false**, _defaultEnv_). +> 1. Return **null**. -**PACKAGE_TARGET_RESOLVE**(_packageURL_, _target_, _subpath_, _pattern_, -_internal_, _conditions_) +**PACKAGE_TARGET_RESOLVE**(_packageURL_, _target_, _subpath_, _internal_, _env_) > 1. If _target_ is a String, then -> 1. If _pattern_ is **false**, _subpath_ has non-zero length and _target_ -> does not end with _"/"_, throw an _Invalid Module Specifier_ error. +> 1. If _target_ contains any _"node_modules"_ segments including +> _"node_modules"_ percent-encoding, throw an _Invalid Package Target_ +> error. +> 1. If _subpath_ has non-zero length and _target_ does not end with _"/"_, +> throw an _Invalid Module Specifier_ error. > 1. If _target_ does not start with _"./"_, then -> 1. If _internal_ is **true** and _target_ does not start with _"../"_ or -> _"/"_ and is not a valid URL, then -> 1. If _pattern_ is **true**, then -> 1. Return **PACKAGE_RESOLVE**(_target_ with every instance of -> _"*"_ replaced by _subpath_, _packageURL_ + _"/"_)_. -> 1. Return **PACKAGE_RESOLVE**(_target_ + _subpath_, -> _packageURL_ + _"/"_)_. -> 1. Otherwise, throw an _Invalid Package Target_ error. -> 1. If _target_ split on _"/"_ or _"\\"_ contains any _"."_, _".."_ or -> _"node_modules"_ segments after the first segment, throw an -> _Invalid Package Target_ error. +> 1. If _target_ does not start with _"../"_ or _"/"_ and is not a valid +> URL, then +> 1. If _internal_ is **true**, return **PACKAGE_RESOLVE**( +> _target_ + _subpath_, _packageURL_ + _"/"_)_. +> 1. Otherwise throw an _Invalid Package Target_ error. > 1. Let _resolvedTarget_ be the URL resolution of the concatenation of > _packageURL_ and _target_. -> 1. Assert: _resolvedTarget_ is contained in _packageURL_. -> 1. If _subpath_ split on _"/"_ or _"\\"_ contains any _"."_, _".."_ or -> _"node_modules"_ segments, throw an _Invalid Module Specifier_ error. -> 1. If _pattern_ is **true**, then -> 1. Return the URL resolution of _resolvedTarget_ with every instance of -> _"*"_ replaced with _subpath_. -> 1. Otherwise, -> 1. Return the URL resolution of the concatenation of _subpath_ and -> _resolvedTarget_. +> 1. If _resolvedTarget_ is not contained in _packageURL_, throw an +> _Invalid Package Target_ error. +> 1. Let _resolved_ be the URL resolution of the concatenation of +> _subpath_ and _resolvedTarget_. +> 1. If _resolved_ is not contained in _resolvedTarget_, throw an +> _Invalid Module Specifier_ error. +> 1. Return _resolved_. > 1. Otherwise, if _target_ is a non-null Object, then > 1. If _exports_ contains any index property keys, as defined in ECMA-262 > [6.1.7 Array Index][], throw an _Invalid Package Configuration_ error. > 1. For each property _p_ of _target_, in object insertion order as, -> 1. If _p_ equals _"default"_ or _conditions_ contains an entry for _p_, -> then +> 1. If _p_ equals _"default"_ or _env_ contains an entry for _p_, then > 1. Let _targetValue_ be the value of the _p_ property in _target_. > 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**( -> _packageURL_, _targetValue_, _subpath_, _pattern_, _internal_, -> _conditions_). +> _packageURL_, _targetValue_, _subpath_, _internal_, _env_) > 1. If _resolved_ is equal to **undefined**, continue the loop. > 1. Return _resolved_. > 1. Return **undefined**. @@ -1186,15 +1826,39 @@ _internal_, _conditions_) > 1. If _target.length is zero, return **null**. > 1. For each item _targetValue_ in _target_, do > 1. Let _resolved_ be the result of **PACKAGE_TARGET_RESOLVE**( -> _packageURL_, _targetValue_, _subpath_, _pattern_, _internal_, -> _conditions_), continuing the loop on any _Invalid Package Target_ -> error. +> _packageURL_, _targetValue_, _subpath_, _internal_, _env_), +> continuing the loop on any _Invalid Package Target_ error. > 1. If _resolved_ is **undefined**, continue the loop. > 1. Return _resolved_. > 1. Return or throw the last fallback resolution **null** return or error. > 1. Otherwise, if _target_ is _null_, return **null**. > 1. Otherwise throw an _Invalid Package Target_ error. +**PACKAGE_INTERNAL_RESOLVE**(_specifier_, _parentURL_) + +> 1. Assert: _specifier_ begins with _"#"_. +> 1. If _specifier_ is exactly equal to _"#"_ or starts with _"#/"_, then +> 1. Throw an _Invalid Module Specifier_ error. +> 1. Let _packageURL_ be the result of **READ_PACKAGE_SCOPE**(_parentURL_). +> 1. If _packageURL_ is not **null**, then +> 1. Let _pjson_ be the result of **READ_PACKAGE_JSON**(_packageURL_). +> 1. If _pjson.imports is a non-null Object, then +> 1. Let _imports_ be _pjson.imports_. +> 1. If _specifier_ is a key of _imports_, then +> 1. Let _target_ be the value of _imports\[specifier\]_. +> 1. Return **PACKAGE_TARGET_RESOLVE**(_packageURL_, _target_, +> _""_, **true**, _defaultEnv_). +> 1. Let _directoryKeys_ be the list of keys of _imports_ ending in +> _"/"_, sorted by length descending. +> 1. For each key _directory_ in _directoryKeys_, do +> 1. If _specifier_ starts with _directory_, then +> 1. Let _target_ be the value of _imports\[directory\]_. +> 1. Let _subpath_ be the substring of _target_ starting at the +> index of the length of _directory_. +> 1. Return **PACKAGE_TARGET_RESOLVE**(_packageURL_, _target_, +> _subpath_, **true**, _defaultEnv_). +> 1. Return **null**. + **ESM_FORMAT**(_url_) > 1. Assert: _url_ corresponds to an existing file. @@ -1214,11 +1878,11 @@ _internal_, _conditions_) > 1. Let _scopeURL_ be _url_. > 1. While _scopeURL_ is not the file system root, -> 1. Set _scopeURL_ to the parent URL of _scopeURL_. > 1. If _scopeURL_ ends in a _"node_modules"_ path segment, return **null**. > 1. Let _pjson_ be the result of **READ_PACKAGE_JSON**(_scopeURL_). > 1. If _pjson_ is not **null**, then > 1. Return _pjson_. +> 1. Set _scopeURL_ to the parent URL of _scopeURL_. > 1. Return **null**. **READ_PACKAGE_JSON**(_packageURL_) @@ -1230,6 +1894,8 @@ _internal_, _conditions_) > 1. Throw an _Invalid Package Configuration_ error. > 1. Return the parsed JSON source of the file at _pjsonURL_. +
+ ### Customizing ESM specifier resolution algorithm The current specifier resolution does not support all default behavior of @@ -1243,7 +1909,7 @@ requires the full path to a module be provided to the loader. To enable the automatic extension resolution and importing from directories that include an index file use the `node` mode. -```console +```bash $ node index.mjs success! $ node index # Failure! @@ -1252,37 +1918,36 @@ $ node --experimental-specifier-resolution=node index success! ``` - -[6.1.7 Array Index]: https://tc39.es/ecma262/#integer-index -[CommonJS]: modules.md -[Conditional exports]: packages.md#packages_conditional_exports -[Core modules]: modules.md#modules_core_modules +[Babel]: https://babeljs.io/ +[CommonJS]: modules.html +[Conditional exports]: #esm_conditional_exports [Dynamic `import()`]: https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports -[ECMAScript Top-Level `await` proposal]: https://github.com/tc39/proposal-top-level-await/ [ECMAScript-modules implementation]: https://github.com/nodejs/modules/blob/master/doc/plan-for-new-modules-implementation.md +[ECMAScript Top-Level `await` proposal]: https://github.com/tc39/proposal-top-level-await/ [ES Module Integration Proposal for Web Assembly]: https://github.com/webassembly/esm-integration [Node.js EP for ES Modules]: https://github.com/nodejs/node-eps/blob/master/002-es-modules.md [Terminology]: #esm_terminology -[Top-Level Await]: https://github.com/tc39/proposal-top-level-await [WHATWG JSON modules specification]: https://html.spec.whatwg.org/#creating-a-json-module-script -[`"exports"`]: packages.md#packages_exports -[`"type"`]: packages.md#packages_type -[`ArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer -[`SharedArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer -[`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray -[`Uint8Array`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array [`data:` URLs]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs +[`esm`]: https://github.com/standard-things/esm#readme [`export`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export [`import()`]: #esm_import_expressions [`import.meta.url`]: #esm_import_meta [`import`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import -[`module.createRequire()`]: module.md#module_module_createrequire_filename -[`module.syncBuiltinESMExports()`]: module.md#module_module_syncbuiltinesmexports -[`package.json`]: packages.md#packages_node_js_package_json_field_definitions +[`module.createRequire()`]: modules.html#modules_module_createrequire_filename +[`module.syncBuiltinESMExports()`]: modules.html#modules_module_syncbuiltinesmexports [`transformSource` hook]: #esm_transformsource_source_context_defaulttransformsource +[`ArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer +[`SharedArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer [`string`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String -[`util.TextDecoder`]: util.md#util_class_util_textdecoder -[cjs-module-lexer]: https://github.com/guybedford/cjs-module-lexer/tree/0.4.0 +[`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray +[`Uint8Array`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array +[`util.TextDecoder`]: util.html#util_class_util_textdecoder +[import an ES or CommonJS module for its side effects only]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Import_a_module_for_its_side_effects_only [special scheme]: https://url.spec.whatwg.org/#special-scheme +[the full specifier path]: #esm_mandatory_file_extensions [the official standard format]: https://tc39.github.io/ecma262/#sec-modules +[the dual CommonJS/ES module packages section]: #esm_dual_commonjs_es_module_packages [transpiler loader example]: #esm_transpiler_loader +[6.1.7 Array Index]: https://tc39.es/ecma262/#integer-index +[Top-Level Await]: https://github.com/tc39/proposal-top-level-await diff --git a/doc/api/events.md b/doc/api/events.md index 7ace75fa65ddbe..3004d5bbb3c9fc 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -24,7 +24,7 @@ can be used. When the `EventEmitter` object emits an event, all of the functions attached to that specific event are called _synchronously_. Any values returned by the -called listeners are _ignored_ and discarded. +called listeners are _ignored_ and will be discarded. The following example shows a simple `EventEmitter` instance with a single listener. The `eventEmitter.on()` method is used to register listeners, while @@ -97,7 +97,7 @@ myEmitter.emit('event', 'a', 'b'); ## Handling events only once When a listener is registered using the `eventEmitter.on()` method, that -listener is invoked _every time_ the named event is emitted. +listener will be invoked _every time_ the named event is emitted. ```js const myEmitter = new MyEmitter(); @@ -259,12 +259,12 @@ added: v0.1.26 The `EventEmitter` instance will emit its own `'newListener'` event *before* a listener is added to its internal array of listeners. -Listeners registered for the `'newListener'` event are passed the event +Listeners registered for the `'newListener'` event will be passed the event name and a reference to the listener being added. The fact that the event is triggered before adding the listener has a subtle but important side effect: any *additional* listeners registered to the same -`name` *within* the `'newListener'` callback are inserted *before* the +`name` *within* the `'newListener'` callback will be inserted *before* the listener that is in the process of being added. ```js @@ -305,7 +305,7 @@ The `'removeListener'` event is emitted *after* the `listener` is removed. ### `EventEmitter.listenerCount(emitter, eventName)` > Stability: 0 - Deprecated: Use [`emitter.listenerCount()`][] instead. @@ -333,8 +333,8 @@ By default, a maximum of `10` listeners can be registered for any single event. This limit can be changed for individual `EventEmitter` instances using the [`emitter.setMaxListeners(n)`][] method. To change the default for *all* `EventEmitter` instances, the `EventEmitter.defaultMaxListeners` -property can be used. If this value is not a positive number, a `RangeError` -is thrown. +property can be used. If this value is not a positive number, a `TypeError` +will be thrown. Take caution when setting the `EventEmitter.defaultMaxListeners` because the change affects *all* `EventEmitter` instances, including those created before @@ -355,7 +355,7 @@ emitter.once('event', () => { }); ``` -The [`--trace-warnings`][] command-line flag can be used to display the +The [`--trace-warnings`][] command line flag can be used to display the stack trace for such warnings. The emitted warning can be inspected with [`process.on('warning')`][] and will @@ -445,7 +445,7 @@ added: v6.0.0 * Returns: {Array} Returns an array listing the events for which the emitter has registered -listeners. The values in the array are strings or `Symbol`s. +listeners. The values in the array will be strings or `Symbol`s. ```js const EventEmitter = require('events'); @@ -672,11 +672,11 @@ listener array. If any single listener has been added multiple times to the listener array for the specified `eventName`, then `removeListener()` must be called multiple times to remove each instance. -Once an event is emitted, all listeners attached to it at the -time of emitting are called in order. This implies that any +Once an event has been emitted, all listeners attached to it at the +time of emitting will be called in order. This implies that any `removeListener()` or `removeAllListeners()` calls *after* emitting and *before* the last listener finishes execution will not remove them from -`emit()` in progress. Subsequent events behave as expected. +`emit()` in progress. Subsequent events will behave as expected. ```js const myEmitter = new MyEmitter(); @@ -825,7 +825,7 @@ class MyClass extends EventEmitter { } ``` -## `events.once(emitter, name[, options])` +## `events.once(emitter, name)` -The `fs` module enables interacting with the file system in a -way modeled on standard POSIX functions. +The `fs` module provides an API for interacting with the file system in a +manner closely modeled around standard POSIX functions. To use this module: @@ -17,33 +17,12 @@ To use this module: const fs = require('fs'); ``` -All file system operations have synchronous, callback, and promise-based -forms. +All file system operations have synchronous and asynchronous forms. -## Synchronous example - -The synchronous form blocks the Node.js event loop and further JavaScript -execution until the operation is complete. Exceptions are thrown immediately -and can be handled using `try…catch`, or can be allowed to bubble up. - -```js -const fs = require('fs'); - -try { - fs.unlinkSync('/tmp/hello'); - console.log('successfully deleted /tmp/hello'); -} catch (err) { - // handle the error -} -``` - -## Callback example - -The callback form takes a completion callback function as its last -argument and invokes the operation asynchronously. The arguments passed to -the completion callback depend on the method, but the first argument is always -reserved for an exception. If the operation is completed successfully, then -the first argument is `null` or `undefined`. +The asynchronous form always takes a completion callback as its last argument. +The arguments passed to the completion callback depend on the method, but the +first argument is always reserved for an exception. If the operation was +completed successfully, then the first argument will be `null` or `undefined`. ```js const fs = require('fs'); @@ -54,30 +33,23 @@ fs.unlink('/tmp/hello', (err) => { }); ``` -## Promise example - -Promise-based operations return a `Promise` that is resolved when the -asynchronous operation is complete. +Exceptions that occur using synchronous operations are thrown immediately and +may be handled using `try…catch`, or may be allowed to bubble up. ```js -const fs = require('fs/promises'); +const fs = require('fs'); -(async function(path) { - try { - await fs.unlink(path); - console.log(`successfully deleted ${path}`); - } catch (error) { - console.error('there was an error:', error.message); - } -})('/tmp/hello'); +try { + fs.unlinkSync('/tmp/hello'); + console.log('successfully deleted /tmp/hello'); +} catch (err) { + // handle the error +} ``` -## Ordering of callback and promise-based operations - -There is no guaranteed ordering when using either the callback or -promise-based methods. For example, the following is prone to error -because the `fs.stat()` operation might complete before the `fs.rename()` -operation: +There is no guaranteed ordering when using asynchronous methods. So the +following is prone to error because the `fs.stat()` operation may complete +before the `fs.rename()` operation: ```js fs.rename('/tmp/hello', '/tmp/world', (err) => { @@ -103,20 +75,28 @@ fs.rename('/tmp/hello', '/tmp/world', (err) => { }); ``` -Or, use the promise-based API: +In busy processes, use the asynchronous versions of these calls. The synchronous +versions will block the entire process until they complete, halting all +connections. -```js -const fs = require('fs/promises'); +Most asynchronous `fs` functions allow the callback argument to be omitted. +However, this usage is deprecated. When the callback is omitted, a default +callback is used that rethrows errors. To get a trace to the original call site, +set the `NODE_DEBUG` environment variable: -(async function(from, to) { - try { - await fs.rename(from, to); - const stats = await fs.stat(to); - console.log(`stats: ${JSON.stringify(stats)}`); - } catch (error) { - console.error('there was an error:', error.message); - } -})('/tmp/hello', '/tmp/world'); +```console +$ cat script.js +function bad() { + require('fs').readFile('/'); +} +bad(); + +$ env NODE_DEBUG=fs node script.js +fs.js:88 + throw backtrace; + ^ +Error: EISDIR: illegal operation on a directory, read + ``` ## File paths @@ -126,7 +106,7 @@ a string, a [`Buffer`][], or a [`URL`][] object using the `file:` protocol. String form paths are interpreted as UTF-8 character sequences identifying the absolute or relative filename. Relative paths will be resolved relative -to the current working directory as determined by calling `process.cwd()`. +to the current working directory as specified by `process.cwd()`. Example using an absolute path on POSIX: @@ -1650,11 +1630,6 @@ operations. The specific constants currently defined are described in ## `fs.copyFile(src, dest[, mode], callback)` * `src` {string|Buffer|URL} source filename to copy @@ -1701,11 +1676,6 @@ fs.copyFile('source.txt', 'destination.txt', COPYFILE_EXCL, callback); ## `fs.copyFileSync(src, dest[, mode])` * `src` {string|Buffer|URL} source filename to copy @@ -2403,8 +2373,6 @@ changes: pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013. - - version: v0.4.7 - description: Documentation-only deprecation. --> * `path` {string|Buffer|URL} @@ -2422,8 +2390,6 @@ changes: - version: v10.6.0 pr-url: https://github.com/nodejs/node/pull/21498 description: This API is no longer deprecated. - - version: v0.4.7 - description: Documentation-only deprecation. --> * `path` {string|Buffer|URL} @@ -2434,7 +2400,7 @@ Synchronous lchown(2). Returns `undefined`. ## `fs.lutimes(path, atime, mtime, callback)` * `path` {string|Buffer|URL} @@ -2917,9 +2883,6 @@ If `position` is an integer, the file position will remain unchanged. The callback is given the three arguments, `(err, bytesRead, buffer)`. -If the file is not modified concurrently, the end-of-file is reached when the -number of bytes read is zero. - If this method is invoked as its [`util.promisify()`][]ed version, it returns a `Promise` for an `Object` with `bytesRead` and `buffer` properties. @@ -3525,6 +3488,8 @@ changes: it will emit a deprecation warning with id DEP0013. --> +> Stability: 1 - Recursive removal is experimental. + * `path` {string|Buffer|URL} * `options` {Object} * `maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or @@ -3547,12 +3512,6 @@ to the completion callback. Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. -Setting `recursive` to `true` results in behavior similar to the Unix command -`rm -rf`: an error will not be raised for paths that do not exist, and paths -that represent files will be deleted. The permissive behavior of the -`recursive` option is deprecated, `ENOTDIR` and `ENOENT` will be thrown in -the future. - ## `fs.rmdirSync(path[, options])` +> Stability: 1 - Recursive removal is experimental. + * `path` {string|Buffer|URL} * `options` {Object} * `maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or @@ -3595,12 +3556,6 @@ Synchronous rmdir(2). Returns `undefined`. Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. -Setting `recursive` to `true` results in behavior similar to the Unix command -`rm -rf`: an error will not be raised for paths that do not exist, and paths -that represent files will be deleted. The permissive behavior of the -`recursive` option is deprecated, `ENOTDIR` and `ENOENT` will be thrown in -the future. - ## `fs.stat(path[, options], callback)` * `fd` {integer} -* `buffer` {Buffer|TypedArray|DataView|string|Object} +* `buffer` {Buffer|TypedArray|DataView} * `offset` {integer} * `length` {integer} * `position` {integer} @@ -4216,8 +4166,7 @@ changes: * `bytesWritten` {integer} * `buffer` {Buffer|TypedArray|DataView} -Write `buffer` to the file specified by `fd`. If `buffer` is a normal object, it -must have an own `toString` function property. +Write `buffer` to the file specified by `fd`. `offset` determines the part of the buffer to be written, and `length` is an integer specifying the number of bytes to write. @@ -4244,10 +4193,6 @@ the end of the file. * `fd` {integer} -* `string` {string|Object} +* `string` {string} * `position` {integer} * `encoding` {string} **Default:** `'utf8'` * `callback` {Function} @@ -4274,8 +4219,8 @@ changes: * `written` {integer} * `string` {string} -Write `string` to the file specified by `fd`. If `string` is not a string, or an -object with an own `toString` function property, then an exception is thrown. +Write `string` to the file specified by `fd`. If `string` is not a string, then +an exception will be thrown. `position` refers to the offset from the beginning of the file where this data should be written. If `typeof position !== 'number'` the data will be written at @@ -4307,10 +4252,6 @@ details. * `file` {string|Buffer|URL|integer} filename or file descriptor -* `data` {string|Buffer|TypedArray|DataView|Object} +* `data` {string|Buffer|TypedArray|DataView} * `options` {Object|string} * `encoding` {string|null} **Default:** `'utf8'` * `mode` {integer} **Default:** `0o666` @@ -4352,7 +4293,6 @@ When `file` is a file descriptor, the behavior is similar to calling a file descriptor. The `encoding` option is ignored if `data` is a buffer. -If `data` is a normal object, it must have an own `toString` function property. ```js const data = new Uint8Array(Buffer.from('Hello Node.js')); @@ -4402,10 +4342,6 @@ to contain only `', World'`. * `file` {string|Buffer|URL|integer} filename or file descriptor -* `data` {string|Buffer|TypedArray|DataView|Object} +* `data` {string|Buffer|TypedArray|DataView} * `options` {Object|string} * `encoding` {string|null} **Default:** `'utf8'` * `mode` {integer} **Default:** `0o666` @@ -4438,10 +4374,6 @@ this API: [`fs.writeFile()`][]. * `fd` {integer} -* `buffer` {Buffer|TypedArray|DataView|string|Object} +* `buffer` {Buffer|TypedArray|DataView} * `offset` {integer} * `length` {integer} * `position` {integer} @@ -4472,10 +4404,6 @@ this API: [`fs.write(fd, buffer...)`][]. * `fd` {integer} -* `string` {string|Object} +* `string` {string} * `position` {integer} * `encoding` {string} * Returns: {number} The number of bytes written. @@ -4619,8 +4547,7 @@ added: v10.0.0 file descriptor is closed, or will be rejected if an error occurs while closing. -Closes the file handle after waiting for any pending operation on the handle to -complete. +Closes the file descriptor. ```js const fsPromises = require('fs').promises; @@ -4680,9 +4607,6 @@ Following successful read, the `Promise` is resolved with an object with a `bytesRead` property specifying the number of bytes read, and a `buffer` property that is a reference to the passed in `buffer` argument. -If the file is not modified concurrently, the end-of-file is reached when the -number of bytes read is zero. - #### `filehandle.read(options)` -* `buffer` {Buffer|Uint8Array|string|Object} +* `buffer` {Buffer|Uint8Array} * `offset` {integer} * `length` {integer} * `position` {integer} @@ -4897,23 +4817,19 @@ the end of the file. -* `string` {string|Object} +* `string` {string} * `position` {integer} * `encoding` {string} **Default:** `'utf8'` * Returns: {Promise} -Write `string` to the file. If `string` is not a string, or an -object with an own `toString` function property, then an exception is thrown. +Write `string` to the file. If `string` is not a string, then +an exception will be thrown. The `Promise` is resolved with an object containing a `bytesWritten` property identifying the number of bytes written, and a `buffer` property containing @@ -4937,24 +4853,20 @@ the end of the file. -* `data` {string|Buffer|Uint8Array|Object} +* `data` {string|Buffer|Uint8Array} * `options` {Object|string} * `encoding` {string|null} **Default:** `'utf8'` * Returns: {Promise} Asynchronously writes data to a file, replacing the file if it already exists. -`data` can be a string, a buffer, or an object with an own `toString` function -property. The `Promise` is resolved with no arguments upon success. +`data` can be a string or a buffer. The `Promise` will be resolved with no +arguments upon success. The `encoding` option is ignored if `data` is a buffer. @@ -5081,11 +4993,6 @@ upon success. ### `fsPromises.copyFile(src, dest[, mode])` * `src` {string|Buffer|URL} source filename to copy @@ -5489,12 +5396,6 @@ Using `fsPromises.rmdir()` on a file (not a directory) results in the `Promise` being rejected with an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. -Setting `recursive` to `true` results in behavior similar to the Unix command -`rm -rf`: an error will not be raised for paths that do not exist, and paths -that represent files will be deleted. The permissive behavior of the -`recursive` option is deprecated, `ENOTDIR` and `ENOENT` will be thrown in -the future. - ### `fsPromises.stat(path[, options])` * `file` {string|Buffer|URL|FileHandle} filename or `FileHandle` -* `data` {string|Buffer|Uint8Array|Object} +* `data` {string|Buffer|Uint8Array} * `options` {Object|string} * `encoding` {string|null} **Default:** `'utf8'` * `mode` {integer} **Default:** `0o666` @@ -5597,8 +5494,8 @@ changes: * Returns: {Promise} Asynchronously writes data to a file, replacing the file if it already exists. -`data` can be a string, a buffer, or an object with an own `toString` function -property. The `Promise` is resolved with no arguments upon success. +`data` can be a string or a buffer. The `Promise` will be resolved with no +arguments upon success. The `encoding` option is ignored if `data` is a buffer. @@ -5980,26 +5877,16 @@ through `fs.open()` or `fs.writeFile()` or `fsPromises.open()`) will fail with A call to `fs.ftruncate()` or `filehandle.truncate()` can be used to reset the file contents. -[Caveats]: #fs_caveats -[Common System Errors]: errors.md#errors_common_system_errors -[FS constants]: #fs_fs_constants_1 -[File access constants]: #fs_file_access_constants -[MDN-Date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date -[MDN-Number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type -[MSDN-Rel-Path]: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#fully-qualified-vs-relative-paths -[MSDN-Using-Streams]: https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams -[Naming Files, Paths, and Namespaces]: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file -[Readable Stream]: stream.md#stream_class_stream_readable -[Writable Stream]: stream.md#stream_class_stream_writable [`AHAFS`]: https://www.ibm.com/developerworks/aix/library/au-aix_event_infrastructure/ -[`Buffer.byteLength`]: buffer.md#buffer_static_method_buffer_bytelength_string_encoding -[`Buffer`]: buffer.md#buffer_buffer +[`Buffer.byteLength`]: buffer.html#buffer_class_method_buffer_bytelength_string_encoding +[`Buffer`]: buffer.html#buffer_buffer [`FSEvents`]: https://developer.apple.com/documentation/coreservices/file_system_events [`Number.MAX_SAFE_INTEGER`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER [`ReadDirectoryChangesW`]: https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-readdirectorychangesw [`ReadStream`]: #fs_class_fs_readstream -[`URL`]: url.md#url_the_whatwg_url_api -[`UV_THREADPOOL_SIZE`]: cli.md#cli_uv_threadpool_size_size +[Readable Stream]: #stream_class_stream_readable +[`URL`]: url.html#url_the_whatwg_url_api +[`UV_THREADPOOL_SIZE`]: cli.html#cli_uv_threadpool_size_size [`WriteStream`]: #fs_class_fs_writestream [`event ports`]: https://illumos.org/man/port_create [`filehandle.writeFile()`]: #fs_filehandle_writefile_data_options @@ -6013,7 +5900,7 @@ the file contents. [`fs.copyFile()`]: #fs_fs_copyfile_src_dest_mode_callback [`fs.createReadStream()`]: #fs_fs_createreadstream_path_options [`fs.createWriteStream()`]: #fs_fs_createwritestream_path_options -[`fs.exists()`]: fs.md#fs_fs_exists_path_callback +[`fs.exists()`]: fs.html#fs_fs_exists_path_callback [`fs.fstat()`]: #fs_fs_fstat_fd_options_callback [`fs.ftruncate()`]: #fs_fs_ftruncate_fd_len_callback [`fs.futimes()`]: #fs_fs_futimes_fd_atime_mtime_callback @@ -6045,10 +5932,20 @@ the file contents. [`fsPromises.utimes()`]: #fs_fspromises_utimes_path_atime_mtime [`inotify(7)`]: https://man7.org/linux/man-pages/man7/inotify.7.html [`kqueue(2)`]: https://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2 -[`net.Socket`]: net.md#net_class_net_socket -[`stat()`]: fs.md#fs_fs_stat_path_options_callback -[`util.promisify()`]: util.md#util_util_promisify_original +[`net.Socket`]: net.html#net_class_net_socket +[`stat()`]: fs.html#fs_fs_stat_path_options_callback +[`util.promisify()`]: util.html#util_util_promisify_original +[Caveats]: #fs_caveats +[Common System Errors]: errors.html#errors_common_system_errors +[FS constants]: #fs_fs_constants_1 +[File access constants]: #fs_file_access_constants +[MDN-Date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date +[MDN-Number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type +[MSDN-Rel-Path]: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#fully-qualified-vs-relative-paths +[MSDN-Using-Streams]: https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams +[Naming Files, Paths, and Namespaces]: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file [bigints]: https://tc39.github.io/proposal-bigint [chcp]: https://ss64.com/nt/chcp.html [inode]: https://en.wikipedia.org/wiki/Inode [support of file system `flags`]: #fs_file_system_flags +[Writable Stream]: stream.html#stream_class_stream_writable diff --git a/doc/api/globals.md b/doc/api/globals.md index 8b279a21715e6b..4844c86134e39c 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -322,27 +322,27 @@ The object that acts as the namespace for all W3C [Mozilla Developer Network][webassembly-mdn] for usage and compatibility. [`AbortController`]: https://developer.mozilla.org/en-US/docs/Web/API/AbortController -[`TextDecoder`]: util.md#util_class_util_textdecoder -[`TextEncoder`]: util.md#util_class_util_textencoder -[`URLSearchParams`]: url.md#url_class_urlsearchparams -[`URL`]: url.md#url_class_url -[`__dirname`]: modules.md#modules_dirname -[`__filename`]: modules.md#modules_filename -[`clearImmediate`]: timers.md#timers_clearimmediate_immediate -[`clearInterval`]: timers.md#timers_clearinterval_timeout -[`clearTimeout`]: timers.md#timers_cleartimeout_timeout -[`console`]: console.md -[`exports`]: modules.md#modules_exports -[`module`]: modules.md#modules_module -[`process.nextTick()`]: process.md#process_process_nexttick_callback_args -[`process` object]: process.md#process_process -[`require()`]: modules.md#modules_require_id -[`setImmediate`]: timers.md#timers_setimmediate_callback_args -[`setInterval`]: timers.md#timers_setinterval_callback_delay_args -[`setTimeout`]: timers.md#timers_settimeout_callback_delay_args -[buffer section]: buffer.md +[`TextDecoder`]: util.html#util_class_util_textdecoder +[`TextEncoder`]: util.html#util_class_util_textencoder +[`URLSearchParams`]: url.html#url_class_urlsearchparams +[`URL`]: url.html#url_class_url +[`__dirname`]: modules.html#modules_dirname +[`__filename`]: modules.html#modules_filename +[`clearImmediate`]: timers.html#timers_clearimmediate_immediate +[`clearInterval`]: timers.html#timers_clearinterval_timeout +[`clearTimeout`]: timers.html#timers_cleartimeout_timeout +[`console`]: console.html +[`exports`]: modules.html#modules_exports +[`module`]: modules.html#modules_module +[`process.nextTick()`]: process.html#process_process_nexttick_callback_args +[`process` object]: process.html#process_process +[`require()`]: modules.html#modules_require_id +[`setImmediate`]: timers.html#timers_setimmediate_callback_args +[`setInterval`]: timers.html#timers_setinterval_callback_delay_args +[`setTimeout`]: timers.html#timers_settimeout_callback_delay_args +[buffer section]: buffer.html [built-in objects]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects -[module system documentation]: modules.md -[timers]: timers.md +[module system documentation]: modules.html +[timers]: timers.html [webassembly-mdn]: https://developer.mozilla.org/en-US/docs/WebAssembly [webassembly-org]: https://webassembly.org diff --git a/doc/api/http.md b/doc/api/http.md index 640fb041dd0de3..98bb57b69dd8d3 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -133,7 +133,7 @@ changes: options are respectively set to `false` and `Infinity`, in which case `Connection: close` will be used. **Default:** `false`. * `keepAliveMsecs` {number} When using the `keepAlive` option, specifies - the [initial delay](net.md#net_socket_setkeepalive_enable_initialdelay) + the [initial delay](net.html#net_socket_setkeepalive_enable_initialdelay) for TCP Keep-Alive packets. Ignored when the `keepAlive` option is `false` or `undefined`. **Default:** `1000`. * `maxSockets` {number} Maximum number of sockets to allow per @@ -926,7 +926,8 @@ added: v0.3.0 Reference to the underlying socket. Usually users will not want to access this property. In particular, the socket will not emit `'readable'` events -because of how the protocol parser attaches to the socket. +because of how the protocol parser attaches to the socket. The `socket` +may also be accessed via `request.connection`. ```js const http = require('http'); @@ -1156,7 +1157,7 @@ This event is emitted when a new TCP stream is established. `socket` is typically an object of type [`net.Socket`][]. Usually users will not want to access this event. In particular, the socket will not emit `'readable'` events because of how the protocol parser attaches to the socket. The `socket` can -also be accessed at `request.socket`. +also be accessed at `request.connection`. This event can also be explicitly emitted by users to inject connections into the HTTP server. In that case, any [`Duplex`][] stream can be passed. @@ -1258,23 +1259,6 @@ added: v0.7.0 Limits maximum incoming headers count. If set to 0, no limit will be applied. -### `server.requestTimeout` - - -* {number} **Default:** `0` - -Sets the timeout value in milliseconds for receiving the entire request from -the client. - -If the timeout expires, the server responds with status 408 without -forwarding the request to the request listener and then closes the connection. - -It must be set to a non-zero value (e.g. 120 seconds) to proctect against -potential Denial-of-Service attacks in case the server is deployed without a -reverse proxy in front. - ### `server.setTimeout([msecs][, callback])` -Indicates that the the response is completed, or its underlying connection was -terminated prematurely (before the response completion). +Indicates that the underlying connection was terminated. ### Event: `'finish'` #### Error codes for `RST_STREAM` and `GOAWAY` + | Value | Name | Constant | |--------|---------------------|-----------------------------------------------| @@ -2533,7 +2530,7 @@ For incoming headers: `access-control-max-age`, `access-control-request-method`, `content-encoding`, `content-language`, `content-length`, `content-location`, `content-md5`, `content-range`, `content-type`, `date`, `dnt`, `etag`, `expires`, `from`, - `host`, `if-match`, `if-modified-since`, `if-none-match`, `if-range`, + `if-match`, `if-modified-since`, `if-none-match`, `if-range`, `if-unmodified-since`, `last-modified`, `location`, `max-forwards`, `proxy-authorization`, `range`, `referer`,`retry-after`, `tk`, `upgrade-insecure-requests`, `user-agent` or `x-content-type-options` are @@ -2551,6 +2548,7 @@ server.on('stream', (stream, headers) => { }); ``` + #### Sensitive headers HTTP2 headers can be marked as sensitive, which means that the HTTP/2 @@ -2616,7 +2614,6 @@ properties. * `maxHeaderListSize` {number} Specifies the maximum size (uncompressed octets) of header list that will be accepted. The minimum allowed value is 0. The maximum allowed value is 232-1. **Default:** `65535`. -* `maxHeaderSize` {number} Alias for `maxHeaderListSize`. * `enableConnectProtocol`{boolean} Specifies `true` if the "Extended Connect Protocol" defined by [RFC 8441][] is to be enabled. This setting is only meaningful if sent by the server. Once the `enableConnectProtocol` setting @@ -2911,10 +2908,8 @@ added: v8.4.0 * {string} -The request authority pseudo header field. Because HTTP/2 allows requests -to set either `:authority` or `host`, this value is derived from -`req.headers[':authority']` if present. Otherwise, it is derived from -`req.headers['host']`. +The request authority pseudo header field. It can also be accessed via +`req.headers[':authority']`. #### `request.complete` - -* {number} **Default:** `0` - -See [`http.Server#requestTimeout`][]. - ### `server.setTimeout([msecs][, callback])` -* [About this documentation](documentation.md) -* [Usage and example](synopsis.md) +* [About this documentation](documentation.html) +* [Usage and example](synopsis.html) -
+
-* [Assertion testing](assert.md) -* [Async hooks](async_hooks.md) -* [Buffer](buffer.md) -* [C++ addons](addons.md) -* [C/C++ addons with N-API](n-api.md) -* [C++ embedder API](embedding.md) -* [Child processes](child_process.md) -* [Cluster](cluster.md) -* [Command-line options](cli.md) -* [Console](console.md) -* [Crypto](crypto.md) -* [Debugger](debugger.md) -* [Deprecated APIs](deprecations.md) -* [DNS](dns.md) -* [Domain](domain.md) -* [Errors](errors.md) -* [Events](events.md) -* [File system](fs.md) -* [Globals](globals.md) -* [HTTP](http.md) -* [HTTP/2](http2.md) -* [HTTPS](https.md) -* [Inspector](inspector.md) -* [Internationalization](intl.md) -* [Modules: CommonJS modules](modules.md) -* [Modules: ECMAScript modules](esm.md) -* [Modules: `module` API](module.md) -* [Modules: Packages](packages.md) -* [Net](net.md) -* [OS](os.md) -* [Path](path.md) -* [Performance hooks](perf_hooks.md) -* [Policies](policy.md) -* [Process](process.md) -* [Punycode](punycode.md) -* [Query strings](querystring.md) -* [QUIC](quic.md) -* [Readline](readline.md) -* [REPL](repl.md) -* [Report](report.md) -* [Stream](stream.md) -* [String decoder](string_decoder.md) -* [Timers](timers.md) -* [TLS/SSL](tls.md) -* [Trace events](tracing.md) -* [TTY](tty.md) -* [UDP/datagram](dgram.md) -* [URL](url.md) -* [Utilities](util.md) -* [V8](v8.md) -* [VM](vm.md) -* [WASI](wasi.md) -* [Worker threads](worker_threads.md) -* [Zlib](zlib.md) +* [Assertion testing](assert.html) +* [Async hooks](async_hooks.html) +* [Buffer](buffer.html) +* [C++ addons](addons.html) +* [C/C++ addons with N-API](n-api.html) +* [C++ embedder API](embedding.html) +* [Child processes](child_process.html) +* [Cluster](cluster.html) +* [Command line options](cli.html) +* [Console](console.html) +* [Crypto](crypto.html) +* [Debugger](debugger.html) +* [Deprecated APIs](deprecations.html) +* [DNS](dns.html) +* [Domain](domain.html) +* [ECMAScript modules](esm.html) +* [Errors](errors.html) +* [Events](events.html) +* [File system](fs.html) +* [Globals](globals.html) +* [HTTP](http.html) +* [HTTP/2](http2.html) +* [HTTPS](https.html) +* [Inspector](inspector.html) +* [Internationalization](intl.html) +* [Modules](modules.html) +* [Net](net.html) +* [OS](os.html) +* [Path](path.html) +* [Performance hooks](perf_hooks.html) +* [Policies](policy.html) +* [Process](process.html) +* [Punycode](punycode.html) +* [Query strings](querystring.html) +* [QUIC](quic.html) +* [Readline](readline.html) +* [REPL](repl.html) +* [Report](report.html) +* [Stream](stream.html) +* [String decoder](string_decoder.html) +* [Timers](timers.html) +* [TLS/SSL](tls.html) +* [Trace events](tracing.html) +* [TTY](tty.html) +* [UDP/datagram](dgram.html) +* [URL](url.html) +* [Utilities](util.html) +* [V8](v8.html) +* [VM](vm.html) +* [WASI](wasi.html) +* [Worker threads](worker_threads.html) +* [Zlib](zlib.html) -
+
* [Code repository and issue tracker](https://github.com/nodejs/node) diff --git a/doc/api/inspector.md b/doc/api/inspector.md index c22dbca03bcbf1..f541b9eb99fb68 100644 --- a/doc/api/inspector.md +++ b/doc/api/inspector.md @@ -45,7 +45,7 @@ started. If wait is `true`, will block until a client has connected to the inspect port and flow control has been passed to the debugger client. -See the [security warning](cli.md#inspector_security) regarding the `host` +See the [security warning](cli.html#inspector_security) regarding the `host` parameter usage. ## `inspector.url()` @@ -239,8 +239,8 @@ session.post('HeapProfiler.takeHeapSnapshot', null, (err, r) => { }); ``` +[`'Debugger.paused'`]: https://chromedevtools.github.io/devtools-protocol/v8/Debugger#event-paused +[`session.connect()`]: #inspector_session_connect [CPU Profiler]: https://chromedevtools.github.io/devtools-protocol/v8/Profiler [Chrome DevTools Protocol Viewer]: https://chromedevtools.github.io/devtools-protocol/v8/ [Heap Profiler]: https://chromedevtools.github.io/devtools-protocol/v8/HeapProfiler -[`'Debugger.paused'`]: https://chromedevtools.github.io/devtools-protocol/v8/Debugger#event-paused -[`session.connect()`]: #inspector_session_connect diff --git a/doc/api/intl.md b/doc/api/intl.md index 3d6132f9dc5c9b..8b7dee489b4e9b 100644 --- a/doc/api/intl.md +++ b/doc/api/intl.md @@ -189,26 +189,26 @@ to be helpful: dedicated to ECMA-402. ["ICU Data"]: http://userguide.icu-project.org/icudata -[BUILDING.md]: https://github.com/nodejs/node/blob/master/BUILDING.md -[ECMA-262]: https://tc39.github.io/ecma262/ -[ECMA-402]: https://tc39.github.io/ecma402/ -[ICU]: http://site.icu-project.org/ -[REPL]: repl.md#repl_repl -[Test262]: https://github.com/tc39/test262/tree/master/test/intl402 -[WHATWG URL parser]: url.md#url_the_whatwg_url_api -[`--icu-data-dir`]: cli.md#cli_icu_data_dir_file +[`--icu-data-dir`]: cli.html#cli_icu_data_dir_file [`Date.prototype.toLocaleString()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString [`Intl.DateTimeFormat`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat [`Intl`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl -[`NODE_ICU_DATA`]: cli.md#cli_node_icu_data_file +[`NODE_ICU_DATA`]: cli.html#cli_node_icu_data_file [`Number.prototype.toLocaleString()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString [`RegExp` Unicode Property Escapes]: https://github.com/tc39/proposal-regexp-unicode-property-escapes [`String.prototype.localeCompare()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare [`String.prototype.normalize()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize [`String.prototype.toLowerCase()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase [`String.prototype.toUpperCase()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase -[`require('buffer').transcode()`]: buffer.md#buffer_buffer_transcode_source_fromenc_toenc -[`require('util').TextDecoder`]: util.md#util_class_util_textdecoder +[`require('buffer').transcode()`]: buffer.html#buffer_buffer_transcode_source_fromenc_toenc +[`require('util').TextDecoder`]: util.html#util_class_util_textdecoder +[BUILDING.md]: https://github.com/nodejs/node/blob/master/BUILDING.md +[ECMA-262]: https://tc39.github.io/ecma262/ +[ECMA-402]: https://tc39.github.io/ecma402/ +[ICU]: http://site.icu-project.org/ +[REPL]: repl.html#repl_repl +[Test262]: https://github.com/tc39/test262/tree/master/test/intl402 +[WHATWG URL parser]: url.html#url_the_whatwg_url_api [btest402]: https://github.com/srl295/btest402 [full-icu]: https://www.npmjs.com/package/full-icu [internationalized domain names]: https://en.wikipedia.org/wiki/Internationalized_domain_name diff --git a/doc/api/module.md b/doc/api/module.md deleted file mode 100644 index 2fb6ca884b4443..00000000000000 --- a/doc/api/module.md +++ /dev/null @@ -1,213 +0,0 @@ -# Modules: `module` API - - - -## The `Module` object - -* {Object} - -Provides general utility methods when interacting with instances of -`Module`, the [`module`][] variable often seen in [CommonJS][] modules. Accessed -via `import 'module'` or `require('module')`. - -### `module.builtinModules` - - -* {string[]} - -A list of the names of all modules provided by Node.js. Can be used to verify -if a module is maintained by a third party or not. - -`module` in this context isn't the same object that's provided -by the [module wrapper][]. To access it, require the `Module` module: - -```js -// module.mjs -// In an ECMAScript module -import { builtinModules as builtin } from 'module'; -``` - -```js -// module.cjs -// In a CommonJS module -const builtin = require('module').builtinModules; -``` - -### `module.createRequire(filename)` - - -* `filename` {string|URL} Filename to be used to construct the require - function. Must be a file URL object, file URL string, or absolute path - string. -* Returns: {require} Require function - -```js -import { createRequire } from 'module'; -const require = createRequire(import.meta.url); - -// sibling-module.js is a CommonJS module. -const siblingModule = require('./sibling-module'); -``` - -### `module.createRequireFromPath(filename)` - - -> Stability: 0 - Deprecated: Please use [`createRequire()`][] instead. - -* `filename` {string} Filename to be used to construct the relative require - function. -* Returns: {require} Require function - -```js -const { createRequireFromPath } = require('module'); -const requireUtil = createRequireFromPath('../src/utils/'); - -// Require `../src/utils/some-tool` -requireUtil('./some-tool'); -``` - -### `module.syncBuiltinESMExports()` - - -The `module.syncBuiltinESMExports()` method updates all the live bindings for -builtin [ES Modules][] to match the properties of the [CommonJS][] exports. It -does not add or remove exported names from the [ES Modules][]. - -```js -const fs = require('fs'); -const { syncBuiltinESMExports } = require('module'); - -fs.readFile = null; - -delete fs.readFileSync; - -fs.newAPI = function newAPI() { - // ... -}; - -syncBuiltinESMExports(); - -import('fs').then((esmFS) => { - assert.strictEqual(esmFS.readFile, null); - assert.strictEqual('readFileSync' in fs, true); - assert.strictEqual(esmFS.newAPI, undefined); -}); -``` - -## Source map v3 support - - -> Stability: 1 - Experimental - -Helpers for interacting with the source map cache. This cache is -populated when source map parsing is enabled and -[source map include directives][] are found in a modules' footer. - -To enable source map parsing, Node.js must be run with the flag -[`--enable-source-maps`][], or with code coverage enabled by setting -[`NODE_V8_COVERAGE=dir`][]. - -```js -// module.mjs -// In an ECMAScript module -import { findSourceMap, SourceMap } from 'module'; -``` - -```js -// module.cjs -// In a CommonJS module -const { findSourceMap, SourceMap } = require('module'); -``` - -### `module.findSourceMap(path[, error])` - - -* `path` {string} -* `error` {Error} -* Returns: {module.SourceMap} - -`path` is the resolved path for the file for which a corresponding source map -should be fetched. - -The `error` instance should be passed as the second parameter to `findSourceMap` -in exceptional flows, such as when an overridden -[`Error.prepareStackTrace(error, trace)`][] is invoked. Modules are not added to -the module cache until they are successfully loaded. In these cases, source maps -are associated with the `error` instance along with the `path`. - -### Class: `module.SourceMap` - - -#### `new SourceMap(payload)` - -* `payload` {Object} - -Creates a new `sourceMap` instance. - -`payload` is an object with keys matching the [Source map v3 format][]: - -* `file`: {string} -* `version`: {number} -* `sources`: {string[]} -* `sourcesContent`: {string[]} -* `names`: {string[]} -* `mappings`: {string} -* `sourceRoot`: {string} - -#### `sourceMap.payload` - -* Returns: {Object} - -Getter for the payload used to construct the [`SourceMap`][] instance. - -#### `sourceMap.findEntry(lineNumber, columnNumber)` - -* `lineNumber` {number} -* `columnNumber` {number} -* Returns: {Object} - -Given a line number and column number in the generated source file, returns -an object representing the position in the original file. The object returned -consists of the following keys: - -* generatedLine: {number} -* generatedColumn: {number} -* originalSource: {string} -* originalLine: {number} -* originalColumn: {number} - -[CommonJS]: modules.md -[ES Modules]: esm.md -[Source map v3 format]: https://sourcemaps.info/spec.html#h.mofvlxcwqzej -[`--enable-source-maps`]: cli.md#cli_enable_source_maps -[`Error.prepareStackTrace(error, trace)`]: https://v8.dev/docs/stack-trace-api#customizing-stack-traces -[`NODE_V8_COVERAGE=dir`]: cli.md#cli_node_v8_coverage_dir -[`SourceMap`]: #module_class_module_sourcemap -[`createRequire()`]: #module_module_createrequire_filename -[`module`]: modules.md#modules_the_module_object -[module wrapper]: modules.md#modules_the_module_wrapper -[source map include directives]: https://sourcemaps.info/spec.html#h.lmz475t4mvbx diff --git a/doc/api/modules.md b/doc/api/modules.md index 196b6240d71546..7dda283112bdd8 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -1,4 +1,4 @@ -# Modules: CommonJS modules +# Modules @@ -98,9 +98,10 @@ may be necessary to install a specific version of package `bar`. The `bar` package may itself have dependencies, and in some cases, these may even collide or form cyclic dependencies. -Because Node.js looks up the `realpath` of any modules it loads (that is, it -resolves symlinks) and then [looks for their dependencies in `node_modules` folders](#modules_loading_from_node_modules_folders), -this situation can be resolved with the following architecture: +Since Node.js looks up the `realpath` of any modules it loads (that is, +resolves symlinks), and then looks for their dependencies in the `node_modules` +folders as described [here](#modules_loading_from_node_modules_folders), this +situation is very simple to resolve with the following architecture: * `/usr/lib/node/foo/1.2.3/`: Contents of the `foo` package, version 1.2.3. * `/usr/lib/node/bar/4.3.2/`: Contents of the `bar` package that `foo` depends @@ -160,10 +161,10 @@ require(X) from module at path Y b. LOAD_AS_DIRECTORY(Y + X) c. THROW "not found" 4. If X begins with '#' - a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) -5. LOAD_PACKAGE_SELF(X, dirname(Y)) -6. LOAD_NODE_MODULES(X, dirname(Y)) -7. THROW "not found" + a. LOAD_INTERAL_IMPORT(X, Y) +4. LOAD_SELF_REFERENCE(X, Y) +5. LOAD_NODE_MODULES(X, dirname(Y)) +6. THROW "not found" LOAD_AS_FILE(X) 1. If X is a file, load X as its file extension format. STOP @@ -190,7 +191,7 @@ LOAD_AS_DIRECTORY(X) LOAD_NODE_MODULES(X, START) 1. let DIRS = NODE_MODULES_PATHS(START) 2. for each DIR in DIRS: - a. LOAD_PACKAGE_EXPORTS(X, DIR) + a. LOAD_PACKAGE_EXPORTS(DIR, X) b. LOAD_AS_FILE(DIR/X) c. LOAD_AS_DIRECTORY(DIR/X) @@ -205,45 +206,47 @@ NODE_MODULES_PATHS(START) d. let I = I - 1 5. return DIRS -LOAD_PACKAGE_IMPORTS(X, DIR) -1. Find the closest package scope SCOPE to DIR. +LOAD_SELF_REFERENCE(X, START) +1. Find the closest package scope to START. 2. If no scope was found, return. -3. If the SCOPE/package.json "imports" is null or undefined, return. -4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), - ["node", "require"]) defined in the ESM resolver. -5. RESOLVE_ESM_MATCH(MATCH). +3. If the `package.json` has no "exports", return. +4. If the name in `package.json` is a prefix of X, then + a. Load the remainder of X relative to this package as if it was + loaded via `LOAD_NODE_MODULES` with a name in `package.json`. -LOAD_PACKAGE_EXPORTS(X, DIR) -1. Try to interpret X as a combination of NAME and SUBPATH where the name +LOAD_PACKAGE_EXPORTS(DIR, X) +1. Try to interpret X as a combination of name and subpath where the name may have a @scope/ prefix and the subpath begins with a slash (`/`). -2. If X does not match this pattern or DIR/NAME/package.json is not a file, +2. If X does not match this pattern or DIR/name/package.json is not a file, return. -3. Parse DIR/NAME/package.json, and look for "exports" field. +3. Parse DIR/name/package.json, and look for "exports" field. 4. If "exports" is null or undefined, return. -5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - `package.json` "exports", ["node", "require"]) defined in the ESM resolver. -6. RESOLVE_ESM_MATCH(MATCH) - -LOAD_PACKAGE_SELF(X, DIR) -1. Find the closest package scope SCOPE to DIR. -2. If no scope was found, return. -3. If the SCOPE/package.json "exports" is null or undefined, return. -4. If the SCOPE/package.json "name" is not the first segment of X, return. -5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - defined in the ESM resolver. -6. RESOLVE_ESM_MATCH(MATCH) - -RESOLVE_ESM_MATCH(MATCH) -1. let { RESOLVED, EXACT } = MATCH -2. let RESOLVED_PATH = fileURLToPath(RESOLVED) -3. If EXACT is true, - a. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension - format. STOP -4. Otherwise, if EXACT is false, - a. LOAD_AS_FILE(RESOLVED_PATH) - b. LOAD_AS_DIRECTORY(RESOLVED_PATH) -5. THROW "not found" +5. If "exports" is an object with some keys starting with "." and some keys + not starting with ".", throw "invalid config". +6. If "exports" is a string, or object with no keys starting with ".", treat + it as having that value as its "." object property. +7. If subpath is "." and "exports" does not have a "." entry, return. +8. Find the longest key in "exports" that the subpath starts with. +9. If no such key can be found, throw "not found". +10. let RESOLVED = + fileURLToPath(PACKAGE_EXPORTS_TARGET_RESOLVE(pathToFileURL(DIR/name), + exports[key], subpath.slice(key.length), ["node", "require"])), as defined + in the ESM resolver. +11. If key ends with "/": + a. LOAD_AS_FILE(RESOLVED) + b. LOAD_AS_DIRECTORY(RESOLVED) +12. Otherwise + a. If RESOLVED is a file, load it as its file extension format. STOP +13. Throw "not found" + +LOAD_INTERNAL_IMPORT(X, START) +1. Find the closest package scope to START. +2. If no scope was found or the `package.json` has no "imports", return. +3. let RESOLVED = + fileURLToPath(PACKAGE_INTERNAL_RESOLVE(X, pathToFileURL(START)), as defined + in the ESM resolver. +4. If RESOLVED is not a valid file, throw "not found" +5. Load RESOLVED as its file extension format. STOP ``` ## Caching @@ -390,8 +393,8 @@ directories, and then provide a single entry point to those directories. There are three ways in which a folder may be passed to `require()` as an argument. -The first is to create a [`package.json`][] file in the root of the folder, -which specifies a `main` module. An example [`package.json`][] file might +The first is to create a `package.json` file in the root of the folder, +which specifies a `main` module. An example `package.json` file might look like this: ```json @@ -405,10 +408,10 @@ If this was in a folder at `./some-library`, then This is the extent of the awareness of `package.json` files within Node.js. -If there is no [`package.json`][] file present in the directory, or if the -[`"main"`][] entry is missing or cannot be resolved, then Node.js +If there is no `package.json` file present in the directory, or if the +`'main'` entry is missing or cannot be resolved, then Node.js will attempt to load an `index.js` or `index.node` file out of that -directory. For example, if there was no [`package.json`][] file in the previous +directory. For example, if there was no `package.json` file in the above example, then `require('./some-library')` would attempt to load: * `./some-library/index.js` @@ -950,40 +953,209 @@ in order to be used. ## The `Module` object -This section was moved to -[Modules: `module` core module](module.md#module_the_module_object). + + +* {Object} + +Provides general utility methods when interacting with instances of +`Module`, the `module` variable often seen in file modules. Accessed +via `require('module')`. + +### `module.builtinModules` + + +* {string[]} + +A list of the names of all modules provided by Node.js. Can be used to verify +if a module is maintained by a third party or not. + +`module` in this context isn't the same object that's provided +by the [module wrapper][]. To access it, require the `Module` module: + +```js +const builtin = require('module').builtinModules; +``` + +### `module.createRequire(filename)` + + +* `filename` {string|URL} Filename to be used to construct the require + function. Must be a file URL object, file URL string, or absolute path + string. +* Returns: {require} Require function + +```js +import { createRequire } from 'module'; +const require = createRequire(import.meta.url); + +// sibling-module.js is a CommonJS module. +const siblingModule = require('./sibling-module'); +``` + +### `module.createRequireFromPath(filename)` + + +> Stability: 0 - Deprecated: Please use [`createRequire()`][] instead. + +* `filename` {string} Filename to be used to construct the relative require + function. +* Returns: {require} Require function + +```js +const { createRequireFromPath } = require('module'); +const requireUtil = createRequireFromPath('../src/utils/'); + +// Require `../src/utils/some-tool` +requireUtil('./some-tool'); +``` + +### `module.syncBuiltinESMExports()` + + +The `module.syncBuiltinESMExports()` method updates all the live bindings for +builtin ES Modules to match the properties of the CommonJS exports. It does +not add or remove exported names from the ES Modules. - -* `module.builtinModules` -* `module.createRequire(filename)` -* `module.createRequireFromPath(filename)` -* `module.syncBuiltinESMExports()` +```js +const fs = require('fs'); +const { syncBuiltinESMExports } = require('module'); + +fs.readFile = null; + +delete fs.readFileSync; + +fs.newAPI = function newAPI() { + // ... +}; + +syncBuiltinESMExports(); + +import('fs').then((esmFS) => { + assert.strictEqual(esmFS.readFile, null); + assert.strictEqual('readFileSync' in fs, true); + assert.strictEqual(esmFS.newAPI, undefined); +}); +``` ## Source map v3 support + + +> Stability: 1 - Experimental + +Helpers for interacting with the source map cache. This cache is +populated when source map parsing is enabled and +[source map include directives][] are found in a modules' footer. + +To enable source map parsing, Node.js must be run with the flag +[`--enable-source-maps`][], or with code coverage enabled by setting +[`NODE_V8_COVERAGE=dir`][]. + +```js +const { findSourceMap, SourceMap } = require('module'); +``` + +### `module.findSourceMap(path[, error])` + + +* `path` {string} +* `error` {Error} +* Returns: {module.SourceMap} + +`path` is the resolved path for the file for which a corresponding source map +should be fetched. + +The `error` instance should be passed as the second parameter to `findSourceMap` +in exceptional flows, e.g., when an overridden +[`Error.prepareStackTrace(error, trace)`][] is invoked. Modules are not added to +the module cache until they are successfully loaded, in these cases source maps +will be associated with the `error` instance along with the `path`. + +### Class: `module.SourceMap` + + +#### `new SourceMap(payload)` + +* `payload` {Object} + +Creates a new `sourceMap` instance. -This section was moved to -[Modules: `module` core module](module.md#module_source_map_v3_support). +`payload` is an object with keys matching the [Source map v3 format][]: - -* `module.findSourceMap(path[, error])` -* Class: `module.SourceMap` - * `new SourceMap(payload)` - * `sourceMap.payload` - * `sourceMap.findEntry(lineNumber, columnNumber)` +* `file`: {string} +* `version`: {number} +* `sources`: {string[]} +* `sourcesContent`: {string[]} +* `names`: {string[]} +* `mappings`: {string} +* `sourceRoot`: {string} + +#### `sourceMap.payload` + +* Returns: {Object} + +Getter for the payload used to construct the [`SourceMap`][] instance. + +#### `sourceMap.findEntry(lineNumber, columnNumber)` + +* `lineNumber` {number} +* `columnNumber` {number} +* Returns: {Object} + +Given a line number and column number in the generated source file, returns +an object representing the position in the original file. The object returned +consists of the following keys: + +* generatedLine: {number} +* generatedColumn: {number} +* originalSource: {string} +* originalLine: {number} +* originalColumn: {number} -[ECMAScript Modules]: esm.md [GLOBAL_FOLDERS]: #modules_loading_from_the_global_folders -[`"main"`]: packages.md#packages_main -[`Error`]: errors.md#errors_class_error +[`Error`]: errors.html#errors_class_error [`__dirname`]: #modules_dirname [`__filename`]: #modules_filename +[`createRequire()`]: #modules_module_createrequire_filename [`module` object]: #modules_the_module_object [`module.id`]: #modules_module_id [`module.children`]: #modules_module_children -[`package.json`]: packages.md#packages_node_js_package_json_field_definitions -[`path.dirname()`]: path.md#path_path_dirname_path -[`require.main`]: #modules_require_main -[an error]: errors.md#errors_err_require_esm +[`path.dirname()`]: path.html#path_path_dirname_path +[ECMAScript Modules]: esm.html +[an error]: errors.html#errors_err_require_esm [exports shortcut]: #modules_exports_shortcut [module resolution]: #modules_all_together -[native addons]: addons.md +[module wrapper]: #modules_the_module_wrapper +[native addons]: addons.html +[`require.main`]: #modules_require_main +[source map include directives]: https://sourcemaps.info/spec.html#h.lmz475t4mvbx +[`--enable-source-maps`]: cli.html#cli_enable_source_maps +[`NODE_V8_COVERAGE=dir`]: cli.html#cli_node_v8_coverage_dir +[`Error.prepareStackTrace(error, trace)`]: https://v8.dev/docs/stack-trace-api#customizing-stack-traces +[`SourceMap`]: modules.html#modules_class_module_sourcemap +[Source map v3 format]: https://sourcemaps.info/spec.html#h.mofvlxcwqzej diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 1836e3821d8ff4..5a90f4c81fcdae 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -36,7 +36,7 @@ properties: The N-API is a C API that ensures ABI stability across Node.js versions and different compiler levels. A C++ API can be easier to use. To support using C++, the project maintains a -C++ wrapper module called [`node-addon-api`][]. +C++ wrapper module called [node-addon-api][]. This wrapper provides an inlineable C++ API. Binaries built with `node-addon-api` will depend on the symbols for the N-API C-based functions exported by Node.js. `node-addon-api` is a more @@ -78,10 +78,6 @@ it still gets the benefits of the ABI stability provided by the C API. When using `node-addon-api` instead of the C APIs, start with the API [docs][] for `node-addon-api`. -The [N-API Resource](https://nodejs.github.io/node-addon-examples/) offers an -excellent orientation and tips for developers just getting started with N-API -and `node-addon-api`. - ## Implications of ABI stability Although N-API provides an ABI stability guarantee, other parts of Node.js do @@ -111,7 +107,7 @@ versions: ``` Thus, for an addon to remain ABI-compatible across Node.js major versions, it -must use N-API exclusively by restricting itself to using +must make use exclusively of N-API by restricting itself to using ```c #include @@ -147,7 +143,7 @@ tools. However, it is not necessary to install the entire Visual Studio IDE. The following command installs the necessary toolchain: ```bash -npm install --global windows-build-tools +npm install --global --production windows-build-tools ``` The sections below describe the additional tools available for developing @@ -244,101 +240,16 @@ from version 3 with some additions. This means that it is not necessary to recompile for new versions of Node.js which are listed as supporting a later version. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1234567
v6.xv6.14.2*
v8.xv8.6.0**v8.10.0*v8.11.2v8.16.0
v9.xv9.0.0*v9.3.0*v9.11.0*
v10.xv10.0.0v10.0.0v10.0.0v10.16.0v10.17.0v10.20.0
v11.xv11.0.0v11.0.0v11.0.0v11.8.0
v12.xv12.0.0v12.0.0v12.0.0v12.0.0v12.11.0v12.17.0
v13.xv13.0.0v13.0.0v13.0.0v13.0.0v13.0.0
v14.xv14.0.0v14.0.0v14.0.0v14.0.0v14.0.0v14.0.0v14.12.0
+| | 1 | 2 | 3 | 4 | 5 | 6 | +|-------|----------|----------|----------|----------|-----------|-----------| +| v6.x | | | v6.14.2* | | | | +| v8.x | v8.6.0** | v8.10.0* | v8.11.2 | v8.16.0 | | | +| v9.x | v9.0.0* | v9.3.0* | v9.11.0* | | | | +| v10.x | v10.0.0 | v10.0.0 | v10.0.0 | v10.16.0 | v10.17.0 | v10.20.0 | +| v11.x | v11.0.0 | v11.0.0 | v11.0.0 | v11.8.0 | | | +| v12.x | v12.0.0 | v12.0.0 | v12.0.0 | v12.0.0 | v12.11.0 | v12.17.0 | +| v13.x | v13.0.0 | v13.0.0 | v13.0.0 | v13.0.0 | v13.0.0 | | +| v14.x | v14.0.0 | v14.0.0 | v14.0.0 | v14.0.0 | v14.0.0 | v14.0.0 | \* N-API was experimental. @@ -346,18 +257,6 @@ listed as supporting a later version. version 1 but continued to evolve until Node.js 8.6.0. The API is different in versions prior to Node.js 8.6.0. We recommend N-API version 3 or later. -Each API documented for N-API will have a header named `added in:`, and APIs -which are stable will have the additional header `N-API version:`. -APIs are directly usable when using a Node.js version which supports -the N-API version shown in `N-API version:` or higher. -When using a Node.js version that does not support the -`N-API version:` listed or if there is no `N-API version:` listed, -then the API will only be available if -`#define NAPI_EXPERIMENTAL` precedes the inclusion of `node_api.h` -or `js_native_api.h`. If an API appears not to be available on -a version of Node.js which is later than the one shown in `added in:` then -this is most likely the reason for the apparent absence. - The N-APIs associated strictly with accessing ECMAScript features from native code can be found separately in `js_native_api.h` and `js_native_api_types.h`. The APIs defined in these headers are included in `node_api.h` and @@ -449,6 +348,8 @@ NAPI_MODULE_INIT() { ## Environment life cycle APIs +> Stability: 1 - Experimental + [Section 8.7][] of the [ECMAScript Language Specification][] defines the concept of an "Agent" as a self-contained environment in which JavaScript code runs. Multiple such Agents may be started and terminated either concurrently or in @@ -467,7 +368,7 @@ From the perspective of a native addon this means that the bindings it provides may be called multiple times, from multiple contexts, and even concurrently from multiple threads. -Native addons may need to allocate global state which they use during +Native addons may need to allocate global state of which they make use during their entire life cycle such that the state must be unique to each instance of the addon. @@ -701,7 +602,7 @@ For more details, review the [Object lifetime management][]. #### napi_type_tag A 128-bit value stored as two unsigned 64-bit integers. It serves as a UUID @@ -720,15 +621,6 @@ typedef struct { } napi_type_tag; ``` -#### napi_async_cleanup_hook_handle - - -An opaque value returned by [`napi_add_async_cleanup_hook`][]. It must be passed -to [`napi_remove_async_cleanup_hook`][] when the chain of asynchronous cleanup -events completes. - ### N-API callback types #### napi_callback_info @@ -857,30 +749,6 @@ typedef void (*napi_threadsafe_function_call_js)(napi_env env, Unless for reasons discussed in [Object Lifetime Management][], creating a handle and/or callback scope inside the function body is not necessary. -#### napi_async_cleanup_hook - - -Function pointer used with [`napi_add_async_cleanup_hook`][]. It will be called -when the environment is being torn down. - -Callback functions must satisfy the following signature: - -```c -typedef void (*napi_async_cleanup_hook)(napi_async_cleanup_hook_handle handle, - void* data); -``` - -* `[in] handle`: The handle that must be passed to -[`napi_remove_async_cleanup_hook`][] after completion of the asynchronous -cleanup. -* `[in] data`: The data that was passed to [`napi_add_async_cleanup_hook`][]. - -The body of the function should initiate the asynchronous cleanup actions at the -end of which `handle` must be passed in a call to -[`napi_remove_async_cleanup_hook`][]. - ## Error handling N-API uses both return values and JavaScript exceptions for error handling. @@ -1526,11 +1394,11 @@ for a reference is 0, all subsequent calls to get the object associated with the reference [`napi_get_reference_value`][] will return `NULL` for the returned `napi_value`. An attempt to call [`napi_reference_ref`][] for a reference whose object has been collected -results in an error. +will result in an error. References must be deleted once they are no longer required by the addon. When -a reference is deleted, it will no longer prevent the corresponding object from -being collected. Failure to delete a persistent reference results in +a reference is deleted it will no longer prevent the corresponding object from +being collected. Failure to delete a persistent reference will result in a 'memory leak' with both the native memory for the persistent reference and the corresponding object on the heap being retained forever. @@ -1682,12 +1550,10 @@ and will lead the process to abort. The hooks will be called in reverse order, i.e. the most recently added one will be called first. -Removing this hook can be done by using [`napi_remove_env_cleanup_hook`][]. +Removing this hook can be done by using `napi_remove_env_cleanup_hook`. Typically, that happens when the resource for which this hook was added is being torn down anyway. -For asynchronous cleanup, [`napi_add_async_cleanup_hook`][] is available. - #### napi_remove_env_cleanup_hook - -> Stability: 1 - Experimental - -```c -NAPI_EXTERN napi_status napi_add_async_cleanup_hook( - napi_env env, - napi_async_cleanup_hook hook, - void* arg, - napi_async_cleanup_hook_handle* remove_handle); -``` - -* `[in] env`: The environment that the API is invoked under. -* `[in] hook`: The function pointer to call at environment teardown. -* `[in] arg`: The pointer to pass to `hook` when it gets called. -* `[out] remove_handle`: Optional handle that refers to the asynchronous cleanup -hook. - -Registers `hook`, which is a function of type [`napi_async_cleanup_hook`][], as -a function to be run with the `remove_handle` and `arg` parameters once the -current Node.js environment exits. - -Unlike [`napi_add_env_cleanup_hook`][], the hook is allowed to be asynchronous. - -Otherwise, behavior generally matches that of [`napi_add_env_cleanup_hook`][]. - -If `remove_handle` is not `NULL`, an opaque value will be stored in it -that must later be passed to [`napi_remove_async_cleanup_hook`][], -regardless of whether the hook has already been invoked. -Typically, that happens when the resource for which this hook was added -is being torn down anyway. - -#### napi_remove_async_cleanup_hook - - -> Stability: 1 - Experimental - -```c -NAPI_EXTERN napi_status napi_remove_async_cleanup_hook( - napi_async_cleanup_hook_handle remove_handle); -``` - -* `[in] remove_handle`: The handle to an asynchronous cleanup hook that was -created with [`napi_add_async_cleanup_hook`][]. - -Unregisters the cleanup hook corresponding to `remove_handle`. This will prevent -the hook from being executed, unless it has already started executing. -This must be called on any `napi_async_cleanup_hook_handle` value obtained -from [`napi_add_async_cleanup_hook`][]. - ## Module registration N-API modules are registered in a manner similar to other modules except that instead of using the `NODE_MODULE` macro the following @@ -1798,16 +1601,8 @@ provided by the addon: ```c napi_value Init(napi_env env, napi_value exports) { napi_status status; - napi_property_descriptor desc = { - "hello", - NULL, - Method, - NULL, - NULL, - NULL, - napi_writable | napi_enumerable | napi_configurable, - NULL - }; + napi_property_descriptor desc = + {"hello", NULL, Method, NULL, NULL, NULL, napi_default, NULL}; status = napi_define_properties(env, exports, 1, &desc); if (status != napi_ok) return NULL; return exports; @@ -1834,7 +1629,7 @@ To define a class so that new instances can be created (often used with napi_value Init(napi_env env, napi_value exports) { napi_status status; napi_property_descriptor properties[] = { - { "value", NULL, NULL, GetValue, SetValue, NULL, napi_writable | napi_configurable, NULL }, + { "value", NULL, NULL, GetValue, SetValue, NULL, napi_default, NULL }, DECLARE_NAPI_METHOD("plusOne", PlusOne), DECLARE_NAPI_METHOD("multiply", Multiply), }; @@ -2490,8 +2285,8 @@ This API is used to convert from the C `int64_t` type to the JavaScript The JavaScript `Number` type is described in [Section 6.1.6][] of the ECMAScript Language Specification. Note the complete range of `int64_t` cannot be represented with full precision in JavaScript. Integer values -outside the range of [`Number.MIN_SAFE_INTEGER`][] `-(2**53 - 1)` - -[`Number.MAX_SAFE_INTEGER`][] `(2**53 - 1)` will lose precision. +outside the range of [`Number.MIN_SAFE_INTEGER`][] `-(2^53 - 1)` - +[`Number.MAX_SAFE_INTEGER`][] `(2^53 - 1)` will lose precision. #### napi_create_double +> Stability: 1 - Experimental + ```c napi_status napi_detach_arraybuffer(napi_env env, napi_value arraybuffer) @@ -3598,9 +3390,10 @@ added: - v13.3.0 - v12.16.0 - v10.22.0 -napiVersion: 7 --> +> Stability: 1 - Experimental + ```c napi_status napi_is_detached_arraybuffer(napi_env env, napi_value arraybuffer, @@ -3749,8 +3542,8 @@ if (status != napi_ok) return status; // Set the properties napi_property_descriptor descriptors[] = { - { "foo", NULL, NULL, NULL, NULL, fooValue, napi_writable | napi_configurable, NULL }, - { "bar", NULL, NULL, NULL, NULL, barValue, napi_writable | napi_configurable, NULL } + { "foo", NULL, NULL, NULL, NULL, fooValue, napi_default, NULL }, + { "bar", NULL, NULL, NULL, NULL, barValue, napi_default, NULL } } status = napi_define_properties(env, obj, @@ -3761,12 +3554,6 @@ if (status != napi_ok) return status; ### Structures #### napi_property_attributes - ```c typedef enum { @@ -3778,14 +3565,6 @@ typedef enum { // Used with napi_define_class to distinguish static properties // from instance properties. Ignored by napi_define_properties. napi_static = 1 << 10, - - // Default for class methods. - napi_default_method = napi_writable | napi_configurable, - - // Default for object properties, like in JS obj[prop]. - napi_default_property = napi_writable | - napi_enumerable | - napi_configurable, } napi_property_attributes; ``` @@ -3804,10 +3583,6 @@ They can be one or more of the following bitflags: * `napi_static`: The property will be defined as a static property on a class as opposed to an instance property, which is the default. This is used only by [`napi_define_class`][]. It is ignored by `napi_define_properties`. -* `napi_default_method`: Like a method in a JS class, the property is - configurable and writeable, but not enumerable. -* `napi_default_property`: Like a property set via assignment in JavaScript, the - property is writable, enumerable, and configurable. #### napi_property_descriptor @@ -4404,8 +4179,8 @@ napi_status napi_get_cb_info(napi_env env, * `[in] env`: The environment that the API is invoked under. * `[in] cbinfo`: The callback info passed into the callback function. -* `[in-out] argc`: Specifies the length of the provided `argv` array and - receives the actual count of arguments. +* `[in-out] argc`: Specifies the size of the provided `argv` array and receives + the actual count of arguments. * `[out] argv`: Buffer to which the `napi_value` representing the arguments are copied. If there are more arguments than the provided count, only the requested number of arguments are copied. If there are fewer arguments @@ -4849,7 +4624,7 @@ JavaScript object becomes garbage-collected. ### napi_type_tag_object > Stability: 1 - Experimental @@ -4876,7 +4651,7 @@ If the object already has an associated type tag, this API will return ### napi_check_object_type_tag > Stability: 1 - Experimental @@ -5141,8 +4916,8 @@ napi_status napi_async_init(napi_env env, * `[in] async_resource`: Object associated with the async work that will be passed to possible `async_hooks` [`init` hooks][]. In order to retain ABI compatibility with previous versions, - passing `NULL` for `async_resource` does not result in an error. However, - this results in incorrect operation of async hooks for the + passing `NULL` for `async_resource` will not result in an error, however, + this will result incorrect operation of async hooks for the napi_async_context created. Potential issues include loss of async context when using the AsyncLocalStorage API. * `[in] async_resource_name`: Identifier for the kind of resource @@ -5192,11 +4967,9 @@ NAPI_EXTERN napi_status napi_make_callback(napi_env env, * `[in] env`: The environment that the API is invoked under. * `[in] async_context`: Context for the async operation that is invoking the callback. This should normally be a value previously - obtained from [`napi_async_init`][]. - In order to retain ABI compatibility with previous versions, passing `NULL` - for `async_context` does not result in an error. However, this results - in incorrect operation of async hooks. Potential issues include loss of - async context when using the `AsyncLocalStorage` API. + obtained from [`napi_async_init`][]. However `NULL` is also allowed, + which indicates the current async context (if any) is to be used + for the callback. * `[in] recv`: The `this` object passed to the called function. * `[in] func`: `napi_value` representing the JavaScript function to be invoked. * `[in] argc`: The count of elements in the `argv` array. @@ -5637,7 +5410,7 @@ return status of `napi_closing` in response to a call to should be the last API call made in conjunction with a given `napi_threadsafe_function`, because after the call completes, there is no guarantee that the `napi_threadsafe_function` is still allocated. For the same -reason, do not use a thread-safe function +reason, do not make use of a thread-safe function after receiving a return value of `napi_closing` in response to a call to `napi_call_threadsafe_function`. Data associated with the `napi_threadsafe_function` can be freed in its `napi_finalize` callback which @@ -5660,8 +5433,8 @@ reference count reaches zero. In particular, `napi_call_threadsafe_function()` will return `napi_closing`, thus informing the threads that it is no longer possible to make asynchronous calls to the thread-safe function. This can be used as a criterion for terminating the thread. **Upon receiving a return value -of `napi_closing` from `napi_call_threadsafe_function()` a thread must not use -the thread-safe function anymore because it is no longer guaranteed to +of `napi_closing` from `napi_call_threadsafe_function()` a thread must make no +further use of the thread-safe function because it is no longer guaranteed to be allocated.** ### Deciding whether to keep the process running @@ -5889,9 +5662,9 @@ This API may only be called from the main thread. [ABI Stability]: https://nodejs.org/en/docs/guides/abi-stability/ [AppVeyor]: https://www.appveyor.com -[C++ Addons]: addons.md -[CMake]: https://cmake.org +[C++ Addons]: addons.html [CMake.js]: https://github.com/cmake-js/cmake-js +[CMake]: https://cmake.org [ECMAScript Language Specification]: https://tc39.github.io/ecma262/ [Error handling]: #n_api_error_handling [GCC]: https://gcc.gnu.org @@ -5906,41 +5679,39 @@ This API may only be called from the main thread. [Section 19.2]: https://tc39.github.io/ecma262/#sec-function-objects [Section 19.4]: https://tc39.github.io/ecma262/#sec-symbol-objects [Section 20.3]: https://tc39.github.io/ecma262/#sec-date-objects -[Section 22.1]: https://tc39.github.io/ecma262/#sec-array-objects [Section 22.1.4.1]: https://tc39.github.io/ecma262/#sec-properties-of-array-instances-length +[Section 22.1]: https://tc39.github.io/ecma262/#sec-array-objects [Section 22.2]: https://tc39.github.io/ecma262/#sec-typedarray-objects -[Section 24.1]: https://tc39.github.io/ecma262/#sec-arraybuffer-objects -[Section 24.1.1.2]: https://tc39.es/ecma262/#sec-isdetachedbuffer [Section 24.1.1.3]: https://tc39.es/ecma262/#sec-detacharraybuffer +[Section 24.1]: https://tc39.github.io/ecma262/#sec-arraybuffer-objects [Section 24.3]: https://tc39.github.io/ecma262/#sec-dataview-objects [Section 25.4]: https://tc39.github.io/ecma262/#sec-promise-objects -[Section 6]: https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values -[Section 6.1]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types [Section 6.1.4]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-string-type [Section 6.1.6]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-number-type -[Section 6.1.7]: https://tc39.github.io/ecma262/#sec-object-type [Section 6.1.7.1]: https://tc39.github.io/ecma262/#table-2 -[Section 7]: https://tc39.github.io/ecma262/#sec-abstract-operations +[Section 6.1.7]: https://tc39.github.io/ecma262/#sec-object-type +[Section 6.1]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types +[Section 6]: https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values [Section 7.1.13]: https://tc39.github.io/ecma262/#sec-toobject [Section 7.1.2]: https://tc39.github.io/ecma262/#sec-toboolean [Section 7.1.3]: https://tc39.github.io/ecma262/#sec-tonumber [Section 7.2.14]: https://tc39.github.io/ecma262/#sec-strict-equality-comparison [Section 7.2.2]: https://tc39.github.io/ecma262/#sec-isarray +[Section 7]: https://tc39.github.io/ecma262/#sec-abstract-operations [Section 8.7]: https://tc39.es/ecma262/#sec-agents [Section 9.1.6]: https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc +[Section 24.1.1.2]: https://tc39.es/ecma262/#sec-isdetachedbuffer [Travis CI]: https://travis-ci.org [Visual Studio]: https://visualstudio.microsoft.com [Working with JavaScript properties]: #n_api_working_with_javascript_properties [Xcode]: https://developer.apple.com/xcode/ [`Number.MAX_SAFE_INTEGER`]: https://tc39.github.io/ecma262/#sec-number.max_safe_integer [`Number.MIN_SAFE_INTEGER`]: https://tc39.github.io/ecma262/#sec-number.min_safe_integer -[`Worker`]: worker_threads.md#worker_threads_class_worker -[`global`]: globals.md#globals_global -[`init` hooks]: async_hooks.md#async_hooks_init_asyncid_type_triggerasyncid_resource -[`napi_add_async_cleanup_hook`]: #n_api_napi_add_async_cleanup_hook +[`Worker`]: worker_threads.html#worker_threads_class_worker +[`global`]: globals.html#globals_global +[`init` hooks]: async_hooks.html#async_hooks_init_asyncid_type_triggerasyncid_resource [`napi_add_env_cleanup_hook`]: #n_api_napi_add_env_cleanup_hook [`napi_add_finalizer`]: #n_api_napi_add_finalizer -[`napi_async_cleanup_hook`]: #n_api_napi_async_cleanup_hook [`napi_async_complete_callback`]: #n_api_napi_async_complete_callback [`napi_async_init`]: #n_api_napi_async_init [`napi_callback`]: #n_api_napi_callback @@ -5979,8 +5750,6 @@ This API may only be called from the main thread. [`napi_queue_async_work`]: #n_api_napi_queue_async_work [`napi_reference_ref`]: #n_api_napi_reference_ref [`napi_reference_unref`]: #n_api_napi_reference_unref -[`napi_remove_async_cleanup_hook`]: #n_api_napi_remove_async_cleanup_hook -[`napi_remove_env_cleanup_hook`]: #n_api_napi_remove_env_cleanup_hook [`napi_set_instance_data`]: #n_api_napi_set_instance_data [`napi_set_property`]: #n_api_napi_set_property [`napi_threadsafe_function_call_js`]: #n_api_napi_threadsafe_function_call_js @@ -5990,16 +5759,16 @@ This API may only be called from the main thread. [`napi_throw`]: #n_api_napi_throw [`napi_unwrap`]: #n_api_napi_unwrap [`napi_wrap`]: #n_api_napi_wrap -[`node-addon-api`]: https://github.com/nodejs/node-addon-api [`node_api.h`]: https://github.com/nodejs/node/blob/master/src/node_api.h -[`process.release`]: process.md#process_process_release +[`process.release`]: process.html#process_process_release [`uv_ref`]: https://docs.libuv.org/en/v1.x/handle.html#c.uv_ref [`uv_unref`]: https://docs.libuv.org/en/v1.x/handle.html#c.uv_unref -[async_hooks `type`]: async_hooks.md#async_hooks_type -[context-aware addons]: addons.md#addons_context_aware_addons +[async_hooks `type`]: async_hooks.html#async_hooks_type +[context-aware addons]: addons.html#addons_context_aware_addons [docs]: https://github.com/nodejs/node-addon-api#api-documentation -[global scope]: globals.md -[module scope]: modules.md#modules_the_module_scope +[global scope]: globals.html +[module scope]: modules.html#modules_the_module_scope +[node-addon-api]: https://github.com/nodejs/node-addon-api [node-gyp]: https://github.com/nodejs/node-gyp [node-pre-gyp]: https://github.com/mapbox/node-pre-gyp [prebuild]: https://github.com/prebuild/prebuild diff --git a/doc/api/net.md b/doc/api/net.md index d23b8c0c91c6a0..3bf9a68a8abf09 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -55,86 +55,6 @@ net.createServer().listen( path.join('\\\\?\\pipe', process.cwd(), 'myctl')); ``` -## Class: `net.BlockList` - - -The `BlockList` object can be used with some network APIs to specify rules for -disabling inbound or outbound access to specific IP addresses, IP ranges, or -IP subnets. - -### `blockList.addAddress(address[, type])` - - -* `address` {string} An IPv4 or IPv6 address. -* `type` {string} Either `'ipv4'` or `'ipv6'`. **Default**: `'ipv4'`. - -Adds a rule to block the given IP address. - -### `blockList.addRange(start, end[, type])` - - -* `start` {string} The starting IPv4 or IPv6 address in the range. -* `end` {string} The ending IPv4 or IPv6 address in the range. -* `type` {string} Either `'ipv4'` or `'ipv6'`. **Default**: `'ipv4'`. - -Adds a rule to block a range of IP addresses from `start` (inclusive) to -`end` (inclusive). - -### `blockList.addSubnet(net, prefix[, type])` - - -* `net` {string} The network IPv4 or IPv6 address. -* `prefix` {number} The number of CIDR prefix bits. For IPv4, this - must be a value between `0` and `32`. For IPv6, this must be between - `0` and `128`. -* `type` {string} Either `'ipv4'` or `'ipv6'`. **Default**: `'ipv4'`. - -Adds a rule to block a range of IP addresses specified as a subnet mask. - -### `blockList.check(address[, type])` - - -* `address` {string} The IP address to check -* `type` {string} Either `'ipv4'` or `'ipv6'`. **Default**: `'ipv4'`. -* Returns: {boolean} - -Returns `true` if the given IP address matches any of the rules added to the -`BlockList`. - -```js -const blockList = new net.BlockList(); -blockList.addAddress('123.123.123.123'); -blockList.addRange('10.0.0.1', '10.0.0.10'); -blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); - -console.log(blockList.check('123.123.123.123')); // Prints: true -console.log(blockList.check('10.0.0.3')); // Prints: true -console.log(blockList.check('222.111.111.222')); // Prints: false - -// IPv6 notation for IPv4 addresses works: -console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true -console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true -``` - -### `blockList.rules` - - -* Type: {string[]} - -The list of rules added to the blocklist. - ## Class: `net.Server` - -* {string} - -This property represents the state of the connection as a string. - -* If the stream is connecting `socket.readyState` is `opening`. -* If the stream is readable and writable, it is `open`. -* If the stream is readable and not writable, it is `readOnly`. -* If the stream is not readable and writable, it is `writeOnly`. - ## `net.connect()` Aliases to @@ -1320,8 +1226,8 @@ Returns `true` if input is a version 6 IP address, otherwise returns `false`. [IPC]: #net_ipc_support [Identifying paths for IPC connections]: #net_identifying_paths_for_ipc_connections -[QUIC documentation]: quic.md -[Readable Stream]: stream.md#stream_class_stream_readable +[Readable Stream]: stream.html#stream_class_stream_readable +[QUIC documentation]: quic.html [`'close'`]: #net_event_close [`'connect'`]: #net_event_connect [`'connection'`]: #net_event_connection @@ -1331,10 +1237,10 @@ Returns `true` if input is a version 6 IP address, otherwise returns `false`. [`'error'`]: #net_event_error_1 [`'listening'`]: #net_event_listening [`'timeout'`]: #net_event_timeout -[`EventEmitter`]: events.md#events_class_eventemitter -[`child_process.fork()`]: child_process.md#child_process_child_process_fork_modulepath_args_options -[`dns.lookup()`]: dns.md#dns_dns_lookup_hostname_options_callback -[`dns.lookup()` hints]: dns.md#dns_supported_getaddrinfo_flags +[`EventEmitter`]: events.html#events_class_eventemitter +[`child_process.fork()`]: child_process.html#child_process_child_process_fork_modulepath_args_options +[`dns.lookup()` hints]: dns.html#dns_supported_getaddrinfo_flags +[`dns.lookup()`]: dns.html#dns_dns_lookup_hostname_options_callback [`net.Server`]: #net_class_net_server [`net.Socket`]: #net_class_net_socket [`net.connect()`]: #net_net_connect @@ -1347,7 +1253,7 @@ Returns `true` if input is a version 6 IP address, otherwise returns `false`. [`net.createConnection(port, host)`]: #net_net_createconnection_port_host_connectlistener [`net.createServer()`]: #net_net_createserver_options_connectionlistener [`new net.Socket(options)`]: #net_new_net_socket_options -[`readable.setEncoding()`]: stream.md#stream_readable_setencoding_encoding +[`readable.setEncoding()`]: stream.html#stream_readable_setencoding_encoding [`server.close()`]: #net_server_close_callback [`server.listen()`]: #net_server_listen [`server.listen(handle)`]: #net_server_listen_handle_backlog_callback @@ -1366,11 +1272,11 @@ Returns `true` if input is a version 6 IP address, otherwise returns `false`. [`socket.setEncoding()`]: #net_socket_setencoding_encoding [`socket.setTimeout()`]: #net_socket_settimeout_timeout_callback [`socket.setTimeout(timeout)`]: #net_socket_settimeout_timeout_callback -[`writable.destroy()`]: stream.md#stream_writable_destroy_error -[`writable.destroyed`]: stream.md#stream_writable_destroyed -[`writable.end()`]: stream.md#stream_writable_end_chunk_encoding_callback -[`writable.writableLength`]: stream.md#stream_writable_writablelength +[`writable.writableLength`]: stream.html#stream_writable_writablelength +[`writable.destroyed`]: stream.html#stream_writable_destroyed +[`writable.destroy()`]: stream.html#stream_writable_destroy_error +[`writable.end()`]: stream.html#stream_writable_end_chunk_encoding_callback [half-closed]: https://tools.ietf.org/html/rfc1122 -[stream_writable_write]: stream.md#stream_writable_write_chunk_encoding_callback +[stream_writable_write]: stream.html#stream_writable_write_chunk_encoding_callback [unspecified IPv4 address]: https://en.wikipedia.org/wiki/0.0.0.0 [unspecified IPv6 address]: https://en.wikipedia.org/wiki/IPv6_address#Unspecified_address diff --git a/doc/api/os.md b/doc/api/os.md index 08a566a27b6e29..8dd8a63fcfaa3e 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -291,7 +291,7 @@ added: v0.3.3 Returns the operating system as a string. On POSIX systems, the operating system release is determined by calling -[`uname(3)`][]. On Windows, `GetVersionExW()` is used. See +[uname(3)][]. On Windows, `GetVersionExW()` is used. See for more information. ## `os.setPriority([pid, ]priority)` @@ -348,11 +348,11 @@ added: v0.3.3 * Returns: {string} -Returns the operating system name as returned by [`uname(3)`][]. For example, it +Returns the operating system name as returned by [uname(3)][]. For example, it returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. See for additional information -about the output of running [`uname(3)`][] on various operating systems. +about the output of running [uname(3)][] on various operating systems. ## `os.uptime()` - - -## Introduction - -A package is a folder tree described by a `package.json` file. The package -consists of the folder containing the `package.json` file and all subfolders -until the next folder containing another `package.json` file, or a folder -named `node_modules`. - -This page provides guidance for package authors writing `package.json` files -along with a reference for the [`package.json`][] fields defined by Node.js. - -## Determining module system - -Node.js will treat the following as [ES modules][] when passed to `node` as the -initial input, or when referenced by `import` statements within ES module code: - -* Files ending in `.mjs`. - -* Files ending in `.js` when the nearest parent `package.json` file contains a - top-level [`"type"`][] field with a value of `"module"`. - -* Strings passed in as an argument to `--eval`, or piped to `node` via `STDIN`, - with the flag `--input-type=module`. - -Node.js will treat as [CommonJS][] all other forms of input, such as `.js` files -where the nearest parent `package.json` file contains no top-level `"type"` -field, or string input without the flag `--input-type`. This behavior is to -preserve backward compatibility. However, now that Node.js supports both -CommonJS and ES modules, it is best to be explicit whenever possible. Node.js -will treat the following as CommonJS when passed to `node` as the initial input, -or when referenced by `import` statements within ES module code: - -* Files ending in `.cjs`. - -* Files ending in `.js` when the nearest parent `package.json` file contains a - top-level field [`"type"`][] with a value of `"commonjs"`. - -* Strings passed in as an argument to `--eval` or `--print`, or piped to `node` - via `STDIN`, with the flag `--input-type=commonjs`. - -Package authors should include the [`"type"`][] field, even in packages where -all sources are CommonJS. Being explicit about the `type` of the package will -future-proof the package in case the default type of Node.js ever changes, and -it will also make things easier for build tools and loaders to determine how the -files in the package should be interpreted. - -### `package.json` and file extensions - -Within a package, the [`package.json`][] [`"type"`][] field defines how -Node.js should interpret `.js` files. If a `package.json` file does not have a -`"type"` field, `.js` files are treated as [CommonJS][]. - -A `package.json` `"type"` value of `"module"` tells Node.js to interpret `.js` -files within that package as using [ES module][] syntax. - -The `"type"` field applies not only to initial entry points (`node my-app.js`) -but also to files referenced by `import` statements and `import()` expressions. - -```js -// my-app.js, treated as an ES module because there is a package.json -// file in the same folder with "type": "module". - -import './startup/init.js'; -// Loaded as ES module since ./startup contains no package.json file, -// and therefore inherits the "type" value from one level up. - -import 'commonjs-package'; -// Loaded as CommonJS since ./node_modules/commonjs-package/package.json -// lacks a "type" field or contains "type": "commonjs". - -import './node_modules/commonjs-package/index.js'; -// Loaded as CommonJS since ./node_modules/commonjs-package/package.json -// lacks a "type" field or contains "type": "commonjs". -``` - -Files ending with `.mjs` are always loaded as [ES modules][] regardless of -the nearest parent `package.json`. - -Files ending with `.cjs` are always loaded as [CommonJS][] regardless of the -nearest parent `package.json`. - -```js -import './legacy-file.cjs'; -// Loaded as CommonJS since .cjs is always loaded as CommonJS. - -import 'commonjs-package/src/index.mjs'; -// Loaded as ES module since .mjs is always loaded as ES module. -``` - -The `.mjs` and `.cjs` extensions can be used to mix types within the same -package: - -* Within a `"type": "module"` package, Node.js can be instructed to - interpret a particular file as [CommonJS][] by naming it with a `.cjs` - extension (since both `.js` and `.mjs` files are treated as ES modules within - a `"module"` package). - -* Within a `"type": "commonjs"` package, Node.js can be instructed to - interpret a particular file as an [ES module][] by naming it with an `.mjs` - extension (since both `.js` and `.cjs` files are treated as CommonJS within a - `"commonjs"` package). - -### `--input-type` flag - -Strings passed in as an argument to `--eval` (or `-e`), or piped to `node` via -`STDIN`, are treated as [ES modules][] when the `--input-type=module` flag -is set. - -```bash -node --input-type=module --eval "import { sep } from 'path'; console.log(sep);" - -echo "import { sep } from 'path'; console.log(sep);" | node --input-type=module -``` - -For completeness there is also `--input-type=commonjs`, for explicitly running -string input as CommonJS. This is the default behavior if `--input-type` is -unspecified. - -## Package entry points - -In a package’s `package.json` file, two fields can define entry points for a -package: [`"main"`][] and [`"exports"`][]. The [`"main"`][] field is supported -in all versions of Node.js, but its capabilities are limited: it only defines -the main entry point of the package. - -The [`"exports"`][] field provides an alternative to [`"main"`][] where the -package main entry point can be defined while also encapsulating the package, -**preventing any other entry points besides those defined in [`"exports"`][]**. -This encapsulation allows module authors to define a public interface for -their package. - -If both [`"exports"`][] and [`"main"`][] are defined, the [`"exports"`][] field -takes precedence over [`"main"`][]. [`"exports"`][] are not specific to ES -modules or CommonJS; [`"main"`][] is overridden by [`"exports"`][] if it -exists. As such [`"main"`][] cannot be used as a fallback for CommonJS but it -can be used as a fallback for legacy versions of Node.js that do not support the -[`"exports"`][] field. - -[Conditional exports][] can be used within [`"exports"`][] to define different -package entry points per environment, including whether the package is -referenced via `require` or via `import`. For more information about supporting -both CommonJS and ES Modules in a single package please consult -[the dual CommonJS/ES module packages section][]. - -**Warning**: Introducing the [`"exports"`][] field prevents consumers of a -package from using any entry points that are not defined, including the -[`package.json`][] (e.g. `require('your-package/package.json')`. **This will -likely be a breaking change.** - -To make the introduction of [`"exports"`][] non-breaking, ensure that every -previously supported entry point is exported. It is best to explicitly specify -entry points so that the package’s public API is well-defined. For example, -a project that previous exported `main`, `lib`, -`feature`, and the `package.json` could use the following `package.exports`: - -```json -{ - "name": "my-mod", - "exports": { - ".": "./lib/index.js", - "./lib": "./lib/index.js", - "./lib/index": "./lib/index.js", - "./lib/index.js": "./lib/index.js", - "./feature": "./feature/index.js", - "./feature/index.js": "./feature/index.js", - "./package.json": "./package.json" - } -} -``` - -Alternatively a project could choose to export entire folders: - -```json -{ - "name": "my-mod", - "exports": { - ".": "./lib/index.js", - "./lib": "./lib/index.js", - "./lib/*": "./lib/*.js", - "./feature": "./feature/index.js", - "./feature/*": "./feature/*.js", - "./package.json": "./package.json" - } -} -``` - -As a last resort, package encapsulation can be disabled entirely by creating an -export for the root of the package `"./*": "./*"`. This exposes every file -in the package at the cost of disabling the encapsulation and potential tooling -benefits this provides. As the ES Module loader in Node.js enforces the use of -[the full specifier path][], exporting the root rather than being explicit -about entry is less expressive than either of the prior examples. Not only -is encapsulation lost but module consumers are unable to -`import feature from 'my-mod/feature'` as they need to provide the full -path `import feature from 'my-mod/feature/index.js`. - -### Main entry point export - -To set the main entry point for a package, it is advisable to define both -[`"exports"`][] and [`"main"`][] in the package’s [`package.json`][] file: - -```json -{ - "main": "./main.js", - "exports": "./main.js" -} -``` - -When the [`"exports"`][] field is defined, all subpaths of the package are -encapsulated and no longer available to importers. For example, -`require('pkg/subpath.js')` throws an [`ERR_PACKAGE_PATH_NOT_EXPORTED`][] -error. - -This encapsulation of exports provides more reliable guarantees -about package interfaces for tools and when handling semver upgrades for a -package. It is not a strong encapsulation since a direct require of any -absolute subpath of the package such as -`require('/path/to/node_modules/pkg/subpath.js')` will still load `subpath.js`. - -### Subpath exports - -> Stability: 1 - Experimental - -When using the [`"exports"`][] field, custom subpaths can be defined along -with the main entry point by treating the main entry point as the -`"."` subpath: - -```json -{ - "main": "./main.js", - "exports": { - ".": "./main.js", - "./submodule": "./src/submodule.js" - } -} -``` - -Now only the defined subpath in [`"exports"`][] can be imported by a consumer: - -```js -import submodule from 'es-module-package/submodule'; -// Loads ./node_modules/es-module-package/src/submodule.js -``` - -While other subpaths will error: - -```js -import submodule from 'es-module-package/private-module.js'; -// Throws ERR_PACKAGE_PATH_NOT_EXPORTED -``` - -### Subpath export patterns - -> Stability: 1 - Experimental - -For packages with a small number of exports, we recommend explicitly listing -each exports subpath entry. But for packages that have large numbers of -subpaths, this might cause `package.json` bloat and maintenance issues. - -For these use cases, subpath export patterns can be used instead: - -```json -// ./node_modules/es-module-package/package.json -{ - "exports": { - "./features/*": "./src/features/*.js" - } -} -``` - -The left hand matching pattern must always end in `*`. All instances of `*` on -the right hand side will then be replaced with this value, including if it -contains any `/` separators. - -```js -import featureX from 'es-module-package/features/x'; -// Loads ./node_modules/es-module-package/src/features/x.js - -import featureY from 'es-module-package/features/y/y'; -// Loads ./node_modules/es-module-package/src/features/y/y.js -``` - -This is a direct static replacement without any special handling for file -extensions. In the previous example, `pkg/features/x.json` would be resolved to -`./src/features/x.json.js` in the mapping. - -The property of exports being statically enumerable is maintained with exports -patterns since the individual exports for a package can be determined by -treating the right hand side target pattern as a `**` glob against the list of -files within the package. Because `node_modules` paths are forbidden in exports -targets, this expansion is dependent on only the files of the package itself. - -### Exports sugar - -> Stability: 1 - Experimental - -If the `"."` export is the only export, the [`"exports"`][] field provides sugar -for this case being the direct [`"exports"`][] field value. - -If the `"."` export has a fallback array or string value, then the -[`"exports"`][] field can be set to this value directly. - -```json -{ - "exports": { - ".": "./main.js" - } -} -``` - -can be written: - -```json -{ - "exports": "./main.js" -} -``` - -### Conditional exports - -> Stability: 1 - Experimental - -Conditional exports provide a way to map to different paths depending on -certain conditions. They are supported for both CommonJS and ES module imports. - -For example, a package that wants to provide different ES module exports for -`require()` and `import` can be written: - -```json -// package.json -{ - "main": "./main-require.cjs", - "exports": { - "import": "./main-module.js", - "require": "./main-require.cjs" - }, - "type": "module" -} -``` - -Node.js supports the following conditions out of the box: - -* `"import"` - matches when the package is loaded via `import` or - `import()`, or via any top-level import or resolve operation by the - ECMAScript module loader. Applies regardless of the module format of the - target file. _Always mutually exclusive with `"require"`._ -* `"require"` - matches when the package is loaded via `require()`. The - referenced file should be loadable with `require()` although the condition - matches regardless of the module format of the target file. Expected - formats include CommonJS, JSON, and native addons but not ES modules as - `require()` doesn't support them. _Always mutually exclusive with - `"import"`._ -* `"node"` - matches for any Node.js environment. Can be a CommonJS or ES - module file. _This condition should always come after `"import"` or - `"require"`._ -* `"default"` - the generic fallback that always matches. Can be a CommonJS - or ES module file. _This condition should always come last._ - -Within the [`"exports"`][] object, key order is significant. During condition -matching, earlier entries have higher priority and take precedence over later -entries. _The general rule is that conditions should be from most specific to -least specific in object order_. - -Other conditions such as `"browser"`, `"electron"`, `"deno"`, `"react-native"`, -etc., are unknown to Node.js, and thus ignored. Runtimes or tools other than -Node.js can use them at their discretion. Further restrictions, definitions, or -guidance on condition names might occur in the future. - -Using the `"import"` and `"require"` conditions can lead to some hazards, -which are further explained in [the dual CommonJS/ES module packages section][]. - -Conditional exports can also be extended to exports subpaths, for example: - -```json -{ - "main": "./main.js", - "exports": { - ".": "./main.js", - "./feature": { - "node": "./feature-node.js", - "default": "./feature.js" - } - } -} -``` - -Defines a package where `require('pkg/feature')` and `import 'pkg/feature'` -could provide different implementations between Node.js and other JS -environments. - -When using environment branches, always include a `"default"` condition where -possible. Providing a `"default"` condition ensures that any unknown JS -environments are able to use this universal implementation, which helps avoid -these JS environments from having to pretend to be existing environments in -order to support packages with conditional exports. For this reason, using -`"node"` and `"default"` condition branches is usually preferable to using -`"node"` and `"browser"` condition branches. - -### Nested conditions - -> Stability: 1 - Experimental - -In addition to direct mappings, Node.js also supports nested condition objects. - -For example, to define a package that only has dual mode entry points for -use in Node.js but not the browser: - -```json -{ - "main": "./main.js", - "exports": { - "node": { - "import": "./feature-node.mjs", - "require": "./feature-node.cjs" - }, - "default": "./feature.mjs", - } -} -``` - -Conditions continue to be matched in order as with flat conditions. If -a nested conditional does not have any mapping it will continue checking -the remaining conditions of the parent condition. In this way nested -conditions behave analogously to nested JavaScript `if` statements. - -### Resolving user conditions - -When running Node.js, custom user conditions can be added with the -`--conditions` flag: - -```bash -node --conditions=development main.js -``` - -which would then resolve the `"development"` condition in package imports and -exports, while resolving the existing `"node"`, `"default"`, `"import"`, and -`"require"` conditions as appropriate. - -Any number of custom conditions can be set with repeat flags. - -### Self-referencing a package using its name - -Within a package, the values defined in the package’s -`package.json` [`"exports"`][] field can be referenced via the package’s name. -For example, assuming the `package.json` is: - -```json -// package.json -{ - "name": "a-package", - "exports": { - ".": "./main.mjs", - "./foo": "./foo.js" - } -} -``` - -Then any module _in that package_ can reference an export in the package itself: - -```js -// ./a-module.mjs -import { something } from 'a-package'; // Imports "something" from ./main.mjs. -``` - -Self-referencing is available only if `package.json` has [`"exports"`][], and -will allow importing only what that [`"exports"`][] (in the `package.json`) -allows. So the code below, given the previous package, will generate a runtime -error: - -```js -// ./another-module.mjs - -// Imports "another" from ./m.mjs. Fails because -// the "package.json" "exports" field -// does not provide an export named "./m.mjs". -import { another } from 'a-package/m.mjs'; -``` - -Self-referencing is also available when using `require`, both in an ES module, -and in a CommonJS one. For example, this code will also work: - -```js -// ./a-module.js -const { something } = require('a-package/foo'); // Loads from ./foo.js. -``` - -## Dual CommonJS/ES module packages - -Prior to the introduction of support for ES modules in Node.js, it was a common -pattern for package authors to include both CommonJS and ES module JavaScript -sources in their package, with `package.json` [`"main"`][] specifying the -CommonJS entry point and `package.json` `"module"` specifying the ES module -entry point. -This enabled Node.js to run the CommonJS entry point while build tools such as -bundlers used the ES module entry point, since Node.js ignored (and still -ignores) the top-level `"module"` field. - -Node.js can now run ES module entry points, and a package can contain both -CommonJS and ES module entry points (either via separate specifiers such as -`'pkg'` and `'pkg/es-module'`, or both at the same specifier via [Conditional -exports][]). Unlike in the scenario where `"module"` is only used by bundlers, -or ES module files are transpiled into CommonJS on the fly before evaluation by -Node.js, the files referenced by the ES module entry point are evaluated as ES -modules. - -### Dual package hazard - -When an application is using a package that provides both CommonJS and ES module -sources, there is a risk of certain bugs if both versions of the package get -loaded. This potential comes from the fact that the `pkgInstance` created by -`const pkgInstance = require('pkg')` is not the same as the `pkgInstance` -created by `import pkgInstance from 'pkg'` (or an alternative main path like -`'pkg/module'`). This is the “dual package hazard,” where two versions of the -same package can be loaded within the same runtime environment. While it is -unlikely that an application or package would intentionally load both versions -directly, it is common for an application to load one version while a dependency -of the application loads the other version. This hazard can happen because -Node.js supports intermixing CommonJS and ES modules, and can lead to unexpected -behavior. - -If the package main export is a constructor, an `instanceof` comparison of -instances created by the two versions returns `false`, and if the export is an -object, properties added to one (like `pkgInstance.foo = 3`) are not present on -the other. This differs from how `import` and `require` statements work in -all-CommonJS or all-ES module environments, respectively, and therefore is -surprising to users. It also differs from the behavior users are familiar with -when using transpilation via tools like [Babel][] or [`esm`][]. - -### Writing dual packages while avoiding or minimizing hazards - -First, the hazard described in the previous section occurs when a package -contains both CommonJS and ES module sources and both sources are provided for -use in Node.js, either via separate main entry points or exported paths. A -package might instead be written where any version of Node.js receives only -CommonJS sources, and any separate ES module sources the package might contain -are intended only for other environments such as browsers. Such a package -would be usable by any version of Node.js, since `import` can refer to CommonJS -files; but it would not provide any of the advantages of using ES module syntax. - -A package might also switch from CommonJS to ES module syntax in a [breaking -change](https://semver.org/) version bump. This has the disadvantage that the -newest version of the package would only be usable in ES module-supporting -versions of Node.js. - -Every pattern has tradeoffs, but there are two broad approaches that satisfy the -following conditions: - -1. The package is usable via both `require` and `import`. -1. The package is usable in both current Node.js and older versions of Node.js - that lack support for ES modules. -1. The package main entry point, e.g. `'pkg'` can be used by both `require` to - resolve to a CommonJS file and by `import` to resolve to an ES module file. - (And likewise for exported paths, e.g. `'pkg/feature'`.) -1. The package provides named exports, e.g. `import { name } from 'pkg'` rather - than `import pkg from 'pkg'; pkg.name`. -1. The package is potentially usable in other ES module environments such as - browsers. -1. The hazards described in the previous section are avoided or minimized. - -#### Approach #1: Use an ES module wrapper - -Write the package in CommonJS or transpile ES module sources into CommonJS, and -create an ES module wrapper file that defines the named exports. Using -[Conditional exports][], the ES module wrapper is used for `import` and the -CommonJS entry point for `require`. - -```json -// ./node_modules/pkg/package.json -{ - "type": "module", - "main": "./index.cjs", - "exports": { - "import": "./wrapper.mjs", - "require": "./index.cjs" - } -} -``` - -The preceding example uses explicit extensions `.mjs` and `.cjs`. -If your files use the `.js` extension, `"type": "module"` will cause such files -to be treated as ES modules, just as `"type": "commonjs"` would cause them -to be treated as CommonJS. -See [Enabling](#esm_enabling). - -```js -// ./node_modules/pkg/index.cjs -exports.name = 'value'; -``` - -```js -// ./node_modules/pkg/wrapper.mjs -import cjsModule from './index.cjs'; -export const name = cjsModule.name; -``` - -In this example, the `name` from `import { name } from 'pkg'` is the same -singleton as the `name` from `const { name } = require('pkg')`. Therefore `===` -returns `true` when comparing the two `name`s and the divergent specifier hazard -is avoided. - -If the module is not simply a list of named exports, but rather contains a -unique function or object export like `module.exports = function () { ... }`, -or if support in the wrapper for the `import pkg from 'pkg'` pattern is desired, -then the wrapper would instead be written to export the default optionally -along with any named exports as well: - -```js -import cjsModule from './index.cjs'; -export const name = cjsModule.name; -export default cjsModule; -``` - -This approach is appropriate for any of the following use cases: -* The package is currently written in CommonJS and the author would prefer not - to refactor it into ES module syntax, but wishes to provide named exports for - ES module consumers. -* The package has other packages that depend on it, and the end user might - install both this package and those other packages. For example a `utilities` - package is used directly in an application, and a `utilities-plus` package - adds a few more functions to `utilities`. Because the wrapper exports - underlying CommonJS files, it doesn’t matter if `utilities-plus` is written in - CommonJS or ES module syntax; it will work either way. -* The package stores internal state, and the package author would prefer not to - refactor the package to isolate its state management. See the next section. - -A variant of this approach not requiring conditional exports for consumers could -be to add an export, e.g. `"./module"`, to point to an all-ES module-syntax -version of the package. This could be used via `import 'pkg/module'` by users -who are certain that the CommonJS version will not be loaded anywhere in the -application, such as by dependencies; or if the CommonJS version can be loaded -but doesn’t affect the ES module version (for example, because the package is -stateless): - -```json -// ./node_modules/pkg/package.json -{ - "type": "module", - "main": "./index.cjs", - "exports": { - ".": "./index.cjs", - "./module": "./wrapper.mjs" - } -} -``` - -#### Approach #2: Isolate state - -A [`package.json`][] file can define the separate CommonJS and ES module entry -points directly: - -```json -// ./node_modules/pkg/package.json -{ - "type": "module", - "main": "./index.cjs", - "exports": { - "import": "./index.mjs", - "require": "./index.cjs" - } -} -``` - -This can be done if both the CommonJS and ES module versions of the package are -equivalent, for example because one is the transpiled output of the other; and -the package’s management of state is carefully isolated (or the package is -stateless). - -The reason that state is an issue is because both the CommonJS and ES module -versions of the package might get used within an application; for example, the -user’s application code could `import` the ES module version while a dependency -`require`s the CommonJS version. If that were to occur, two copies of the -package would be loaded in memory and therefore two separate states would be -present. This would likely cause hard-to-troubleshoot bugs. - -Aside from writing a stateless package (if JavaScript’s `Math` were a package, -for example, it would be stateless as all of its methods are static), there are -some ways to isolate state so that it’s shared between the potentially loaded -CommonJS and ES module instances of the package: - -1. If possible, contain all state within an instantiated object. JavaScript’s - `Date`, for example, needs to be instantiated to contain state; if it were a - package, it would be used like this: - - ```js - import Date from 'date'; - const someDate = new Date(); - // someDate contains state; Date does not - ``` - - The `new` keyword isn’t required; a package’s function can return a new - object, or modify a passed-in object, to keep the state external to the - package. - -1. Isolate the state in one or more CommonJS files that are shared between the - CommonJS and ES module versions of the package. For example, if the CommonJS - and ES module entry points are `index.cjs` and `index.mjs`, respectively: - - ```js - // ./node_modules/pkg/index.cjs - const state = require('./state.cjs'); - module.exports.state = state; - ``` - - ```js - // ./node_modules/pkg/index.mjs - import state from './state.cjs'; - export { - state - }; - ``` - - Even if `pkg` is used via both `require` and `import` in an application (for - example, via `import` in application code and via `require` by a dependency) - each reference of `pkg` will contain the same state; and modifying that - state from either module system will apply to both. - -Any plugins that attach to the package’s singleton would need to separately -attach to both the CommonJS and ES module singletons. - -This approach is appropriate for any of the following use cases: -* The package is currently written in ES module syntax and the package author - wants that version to be used wherever such syntax is supported. -* The package is stateless or its state can be isolated without too much - difficulty. -* The package is unlikely to have other public packages that depend on it, or if - it does, the package is stateless or has state that need not be shared between - dependencies or with the overall application. - -Even with isolated state, there is still the cost of possible extra code -execution between the CommonJS and ES module versions of a package. - -As with the previous approach, a variant of this approach not requiring -conditional exports for consumers could be to add an export, e.g. -`"./module"`, to point to an all-ES module-syntax version of the package: - -```json -// ./node_modules/pkg/package.json -{ - "type": "module", - "main": "./index.cjs", - "exports": { - ".": "./index.cjs", - "./module": "./index.mjs" - } -} -``` - -## Node.js `package.json` field definitions - -This section describes the fields used by the Node.js runtime. Other tools (such -as [npm](https://docs.npmjs.com/creating-a-package-json-file)) use -additional fields which are ignored by Node.js and not documented here. - -The following fields in `package.json` files are used in Node.js: - -* [`"name"`][] - Relevant when using named imports within a package. Also used - by package managers as the name of the package. -* [`"type"`][] - The package type determining whether to load `.js` files as - CommonJS or ES modules. -* [`"exports"`][] - Package exports and conditional exports. When present, - limits which submodules can be loaded from within the package. -* [`"main"`][] - The default module when loading the package, if exports is not - specified, and in versions of Node.js prior to the introduction of exports. -* [`"imports"`][] - Package imports, for use by modules within the package - itself. - -### `"name"` - - -* Type: {string} - -```json -{ - "name": "package-name" -} -``` - -The `"name"` field defines your package’s name. Publishing to the -_npm_ registry requires a name that satisfies -[certain requirements](https://docs.npmjs.com/files/package.json#name). - -The `"name"` field can be used in addition to the [`"exports"`][] field to -[self-reference][] a package using its name. - -### `"type"` - - -* Type: {string} - -The `"type"` field defines the module format that Node.js uses for all -`.js` files that have that `package.json` file as their nearest parent. - -Files ending with `.js` are loaded as ES modules when the nearest parent -`package.json` file contains a top-level field `"type"` with a value of -`"module"`. - -The nearest parent `package.json` is defined as the first `package.json` found -when searching in the current folder, that folder’s parent, and so on up -until a node_modules folder or the volume root is reached. - -```json -// package.json -{ - "type": "module" -} -``` - -```bash -# In same folder as preceding package.json -node my-app.js # Runs as ES module -``` - -If the nearest parent `package.json` lacks a `"type"` field, or contains -`"type": "commonjs"`, `.js` files are treated as [CommonJS][]. If the volume -root is reached and no `package.json` is found, `.js` files are treated as -[CommonJS][]. - -`import` statements of `.js` files are treated as ES modules if the nearest -parent `package.json` contains `"type": "module"`. - -```js -// my-app.js, part of the same example as above -import './startup.js'; // Loaded as ES module because of package.json -``` - -Regardless of the value of the `"type"` field, `.mjs` files are always treated -as ES modules and `.cjs` files are always treated as CommonJS. - -### `"exports"` - - -* Type: {Object} | {string} | {string[]} - -```json -{ - "exports": "./index.js" -} -``` - -The `"exports"` field allows defining the [entry points][] of a package when -imported by name loaded either via a `node_modules` lookup or a -[self-reference][] to its own name. It is supported in Node.js 12+ as an -alternative to the [`"main"`][] that can support defining [subpath exports][] -and [conditional exports][] while encapsulating internal unexported modules. - -[Conditional Exports][] can also be used within `"exports"` to define different -package entry points per environment, including whether the package is -referenced via `require` or via `import`. - -All paths defined in the `"exports"` must be relative file URLs starting with -`./`. - -### `"main"` - - -* Type: {string} - -```json -{ - "main": "./main.js" -} -``` - -The `"main"` field defines the script that is used when the [package directory -is loaded via `require()`](modules.md#modules_folders_as_modules). Its value -is interpreted as a path. - -```js -require('./path/to/directory'); // This resolves to ./path/to/directory/main.js. -``` - -When a package has an [`"exports"`][] field, this will take precedence over the -`"main"` field when importing the package by name. - -### `"imports"` - - -> Stability: 1 - Experimental - -* Type: {Object} - -In addition to the [`"exports"`][] field it is possible to define internal -package import maps that only apply to import specifiers from within the package -itself. - -Entries in the imports field must always start with `#` to ensure they are -clearly disambiguated from package specifiers. - -For example, the imports field can be used to gain the benefits of conditional -exports for internal modules: - -```json -// package.json -{ - "imports": { - "#dep": { - "node": "dep-node-native", - "default": "./dep-polyfill.js" - } - }, - "dependencies": { - "dep-node-native": "^1.0.0" - } -} -``` - -where `import '#dep'` would now get the resolution of the external package -`dep-node-native` (including its exports in turn), and instead get the local -file `./dep-polyfill.js` relative to the package in other environments. - -Unlike the `"exports"` field, import maps permit mapping to external packages, -providing an important use case for conditional loading scenarios. - -Apart from the above, the resolution rules for the imports field are otherwise -analogous to the exports field. - -[Babel]: https://babeljs.io/ -[Conditional exports]: #packages_conditional_exports -[CommonJS]: modules.md -[ES module]: esm.md -[ES modules]: esm.md -[`ERR_PACKAGE_PATH_NOT_EXPORTED`]: errors.md#errors_err_package_path_not_exported -[`esm`]: https://github.com/standard-things/esm#readme -[`"exports"`]: #packages_exports -[`"main"`]: #packages_main -[`"name"`]: #packages_name -[`"imports"`]: #packages_imports -[`"type"`]: #packages_type -[`package.json`]: #packages_node_js_package_json_field_definitions -[entry points]: #packages_package_entry_points -[self-reference]: #packages_self_referencing_a_package_using_its_name -[subpath exports]: #packages_subpath_exports -[the full specifier path]: esm.md#esm_mandatory_file_extensions -[the dual CommonJS/ES module packages section]: #packages_dual_commonjs_es_module_packages diff --git a/doc/api/path.md b/doc/api/path.md index c26a98e59c9d6d..14acbb1eb5f99d 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -87,19 +87,6 @@ path.basename('/foo/bar/baz/asdf/quux.html', '.html'); // Returns: 'quux' ``` -Although Windows usually treats file names, including file extensions, in a -case-insensitive manner, this function does not. For example, `C:\\foo.html` and -`C:\\foo.HTML` refer to the same file, but `basename` treats the extension as a -case-sensitive string: - -```js -path.win32.basename('C:\\foo.html', '.html'); -// Returns: 'foo' - -path.win32.basename('C:\\foo.HTML', '.html'); -// Returns: 'foo.HTML' -``` - A [`TypeError`][] is thrown if `path` is not a string or if `ext` is given and is not a string. @@ -495,7 +482,7 @@ For instance, given the sequence of path segments: `/foo`, `/bar`, `baz`, calling `path.resolve('/foo', '/bar', 'baz')` would return `/bar/baz` because `'baz'` is not an absolute path but `'/bar' + '/' + 'baz'` is. -If, after processing all given `path` segments, an absolute path has not yet +If after processing all given `path` segments an absolute path has not yet been generated, the current working directory is used. The resulting path is normalized and trailing slashes are removed unless the @@ -562,7 +549,7 @@ On Windows systems only, returns an equivalent [namespace-prefixed path][] for the given `path`. If `path` is not a string, `path` will be returned without modifications. -This method is meaningful only on Windows systems. On POSIX systems, the +This method is meaningful only on Windows system. On POSIX systems, the method is non-operational and always returns `path` without modifications. ## `path.win32` @@ -575,10 +562,10 @@ added: v0.11.15 The `path.win32` property provides access to Windows-specific implementations of the `path` methods. -[MSDN-Rel-Path]: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#fully-qualified-vs-relative-paths -[`TypeError`]: errors.md#errors_class_typeerror +[`TypeError`]: errors.html#errors_class_typeerror [`path.parse()`]: #path_path_parse_path [`path.posix`]: #path_path_posix [`path.sep`]: #path_path_sep [`path.win32`]: #path_path_win32 +[MSDN-Rel-Path]: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#fully-qualified-vs-relative-paths [namespace-prefixed path]: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#namespaces diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index a6d9dfa9e95edc..392dc2a5245104 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -53,63 +53,6 @@ added: v8.5.0 If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline. If `name` is provided, removes only the named mark. -### `performance.eventLoopUtilization([utilization1[, utilization2]])` - - -* `utilization1` {Object} The result of a previous call to - `eventLoopUtilization()`. -* `utilization2` {Object} The result of a previous call to - `eventLoopUtilization()` prior to `utilization1`. -* Returns {Object} - * `idle` {number} - * `active` {number} - * `utilization` {number} - -The `eventLoopUtilization()` method returns an object that contains the -cumulative duration of time the event loop has been both idle and active as a -high resolution milliseconds timer. The `utilization` value is the calculated -Event Loop Utilization (ELU). If bootstrapping has not yet finished, the -properties have the value of `0`. - -Both `utilization1` and `utilization2` are optional parameters. - -If `utilization1` is passed, then the delta between the current call's `active` -and `idle` times, as well as the corresponding `utilization` value are -calculated and returned (similar to [`process.hrtime()`][]). - -If `utilization1` and `utilization2` are both passed, then the delta is -calculated between the two arguments. This is a convenience option because, -unlike [`process.hrtime()`][], calculating the ELU is more complex than a -single subtraction. - -ELU is similar to CPU utilization, except that it only measures event loop -statistics and not CPU usage. It represents the percentage of time the event -loop has spent outside the event loop's event provider (e.g. `epoll_wait`). -No other CPU idle time is taken into consideration. The following is an example -of how a mostly idle process will have a high ELU. - -```js -'use strict'; -const { eventLoopUtilization } = require('perf_hooks').performance; -const { spawnSync } = require('child_process'); - -setImmediate(() => { - const elu = eventLoopUtilization(); - spawnSync('sleep', ['5']); - console.log(eventLoopUtilization(elu).utilization); -}); -``` - -Although the CPU is mostly idle while running this script, the value of -`utilization` is `1`. This is because the call to -[`child_process.spawnSync()`][] blocks the event loop from proceeding. - -Passing in a user-defined object instead of the result of a previous call to -`eventLoopUtilization()` will lead to undefined behavior. The return values -are not guaranteed to reflect any correct state of the event loop. - ### `performance.mark([name])` * {string} -The type of the performance entry. It may be one of: - -* `'node'` (Node.js only) -* `'mark'` (available on the Web) -* `'measure'` (available on the Web) -* `'gc'` (Node.js only) -* `'function'` (Node.js only) -* `'http2'` (Node.js only) -* `'http'` (Node.js only) +The name of the performance entry. -### performanceEntry.flags +### `performanceEntry.startTime` * {number} -_This property is an extension by Node.js. It is not available in Web browsers._ - -When `performanceEntry.entryType` is equal to `'gc'`, the `performance.flags` -property contains additional information about garbage collection operation. -The value may be one of: - -* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_NO` -* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED` -* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_FORCED` -* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING` -* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE` -* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY` -* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE` +The high resolution millisecond timestamp marking the starting time of the +Performance Entry. -### `performanceEntry.name` +### `performanceEntry.entryType` * {string} -The name of the performance entry. +The type of the performance entry. It may be one of: + +* `'node'` (Node.js only) +* `'mark'` (available on the Web) +* `'measure'` (available on the Web) +* `'gc'` (Node.js only) +* `'function'` (Node.js only) +* `'http2'` (Node.js only) +* `'http'` (Node.js only) ### `performanceEntry.kind` * {number} -The high resolution millisecond timestamp marking the starting time of the -Performance Entry. +_This property is an extension by Node.js. It is not available in Web browsers._ + +When `performanceEntry.entryType` is equal to `'gc'`, the `performance.flags` +property contains additional information about garbage collection operation. +The value may be one of: + +* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_NO` +* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED` +* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_FORCED` +* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING` +* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE` +* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY` +* `perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE` ## Class: `PerformanceNodeTiming` - -* {number} - -The high resolution millisecond timestamp of the amount of time the event loop -has been idle within the event loop's event provider (e.g. `epoll_wait`). This -does not take CPU usage into consideration. If the event loop has not yet -started (e.g., in the first tick of the main script), the property has the -value of 0. - ### `performanceNodeTiming.loopExit` ```js { name: 'node', - lts: 'Erbium', - sourceUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1.tar.gz', - headersUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1-headers.tar.gz', - libUrl: 'https://nodejs.org/download/release/v12.18.1/win-x64/node.lib' + lts: 'Argon', + sourceUrl: 'https://nodejs.org/download/release/v4.4.5/node-v4.4.5.tar.gz', + headersUrl: 'https://nodejs.org/download/release/v4.4.5/node-v4.4.5-headers.tar.gz', + libUrl: 'https://nodejs.org/download/release/v4.4.5/win-x64/node.lib' } ``` @@ -2345,7 +2339,7 @@ important ways: * Pipes (and sockets): *synchronous* on Windows, *asynchronous* on POSIX These behaviors are partly for historical reasons, as changing them would -create backward incompatibility, but they are also expected by some users. +create backwards incompatibility, but they are also expected by some users. Synchronous writes avoid problems such as output written with `console.log()` or `console.error()` being unexpectedly interleaved, or not written at all if @@ -2423,15 +2417,17 @@ the current value of `ps`. When a new value is assigned, different platforms will impose different maximum length restrictions on the title. Usually such restrictions are quite limited. For instance, on Linux and macOS, `process.title` is limited to the size of the -binary name plus the length of the command-line arguments because setting the +binary name plus the length of the command line arguments because setting the `process.title` overwrites the `argv` memory of the process. Node.js v0.8 allowed for longer process title strings by also overwriting the `environ` memory but that was potentially insecure and confusing in some (rather obscure) cases. -Assigning a value to `process.title` might not result in an accurate label -within process manager applications such as macOS Activity Monitor or Windows -Services Manager. +Assigning a value to `process.title` _may_ not reflect an accurate +(or any) label within the process manager application of the underlying +operating system (i.e. macOS Activity Monitor, Windows Services Manager, etc). +Inconsistencies and breaking changes within the _operating systems process +interface_ make synchronization with these applications unreliable. ## `process.traceDeprecation` @@ -148,5 +151,5 @@ added: v0.6.1 Returns a string identifying the current [Punycode.js][] version number. -[Punycode]: https://tools.ietf.org/html/rfc3492 [Punycode.js]: https://github.com/bestiejs/punycode.js +[Punycode]: https://tools.ietf.org/html/rfc3492 diff --git a/doc/api/quic.md b/doc/api/quic.md index 1cd72dd41b9190..6969a43ec9f716 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -94,7 +94,7 @@ At any given time, a `QuicSession` exists is one of four possible states: * `Ready` - Entered as soon as the TLS 1.3 handshake completes. Once the `QuicSession` enters the `Ready` state, it may be used to exchange application data using `QuicStream` instances. -* `Closed` - Entered as soon as the `QuicSession` connection has been +* `Closed` - Entere as soon as the `QuicSession` connection has been terminated. New instances of `QuicClientSession` are created using the `connect()` @@ -152,7 +152,7 @@ socket.on('session', (session) => { ``` As with client `QuicSession` instances, the `QuicServerSession` cannot be -used to exchange application data until the `'secure'` event has been emitted. +used to exhange application data until the `'secure'` event has been emitted. ### QuicSession and ALPN @@ -197,7 +197,7 @@ peer opened the stream. A unidirectional stream can be written to only by the QuicSession that opened it. The `'stream'` event is emitted by the `QuicSession` when a new `QuicStream` -has been initiated by the connected peer: +has been initated by the connected peer: ```js session.on('stream', (stream) => { @@ -212,7 +212,7 @@ session.on('stream', (stream) => { #### QuicStream headers -Some QUIC application protocols (like HTTP/3) use headers. +Some QUIC application protocols (like HTTP/3) make use of headers. There are four kinds of headers that the Node.js QUIC implementation is capable of handling dependent entirely on known application protocol @@ -249,7 +249,7 @@ TBD ## QUIC JavaScript API -### `net.createQuicSocket([options])` +### `net.createQuicSocket(\[options\])` @@ -288,6 +288,11 @@ added: REPLACEME * `validateAddress` {boolean} When `true`, the `QuicSocket` will use explicit address validation using a QUIC `RETRY` frame when listening for new server sessions. Default: `false`. + * `validateAddressLRU` {boolean} When `true`, validation will be skipped if + the address has been recently validated. Currently, only the 10 most + recently validated addresses are remembered. Setting `validateAddressLRU` + to `true`, will enable the `validateAddress` option as well. Default: + `false`. The `net.createQuicSocket()` function is used to create new `QuicSocket` instances associated with a local UDP address. @@ -336,7 +341,7 @@ The object will contain the properties: If the `QuicEndpoint` is not bound, `quicendpoint.address` is an empty object. -#### `quicendpoint.bind([options])` +#### `quicendpoint.bind(\[options\])` @@ -396,14 +401,14 @@ added: REPLACEME Set to `true` if the `QuicEndpoint` is in the process of closing. -#### `quicendpoint.destroy([error])` +#### `quicendpoint.destroy(\[error\])` * `error` {Object} An `Error` object. -Closes and destroys the `QuicEndpoint` instance making it unusable. +Closes and destroys the `QuicEndpoint` instance making it usuable. #### `quicendpoint.destroyed` -#### `quicendpoint.setBroadcast([on])` +#### `quicendpoint.setBroadcast(\[on\])` @@ -552,7 +557,7 @@ A socket's address family's ANY address (IPv4 `'0.0.0.0'` or IPv6 `'::'`) can be used to return control of the sockets default outgoing interface to the system for future multicast packets. -#### `quicendpoint.setMulticastLoopback([on])` +#### `quicendpoint.setMulticastLoopback(\[on\])` @@ -645,7 +650,7 @@ decrypted. It may be emitted multiple times per `QuicSession` instance. The callback will be invoked with a single argument: -* `line` {Buffer} Line of ASCII text, in NSS SSLKEYLOGFILE format. +* `line` Line of ASCII text, in NSS SSLKEYLOGFILE format. A typical use case is to append received lines to a common text file, which is later used by software (such as Wireshark) to decrypt the traffic: @@ -712,7 +717,7 @@ added: REPLACEME * Type: {number} -The number of retransmissions caused by delayed acknowledgments. +The number of retransmissions caused by delayed acknowledgements. #### `quicsession.address` @@ -888,7 +893,7 @@ some properties corresponding to the fields of the certificate. If there is no local certificate, or if the `QuicSession` has been destroyed, an empty object will be returned. -#### `quicsession.getPeerCertificate([detailed])` +#### `quicsession.getPeerCertificate(\[detailed\])` @@ -962,7 +967,7 @@ added: REPLACEME * Type: {number} -The number of key update operations that have occurred. +The number of key update operations that have occured. #### `quicsession.latestRTT` @@ -1078,7 +1083,7 @@ added: REPLACEME If `qlog` support is enabled for `QuicSession`, the `quicsession.qlog` property provides a [`stream.Readable`][] that may be used to access the `qlog` event data according to the [qlog standard][]. For client `QuicSessions`, the -`quicsession.qlog` property will be `undefined` until the `'qlog'` event +`quicsession.qlog` property will be `undefined` untilt the `'qlog'` event is emitted. #### `quicsession.remoteAddress` @@ -1246,16 +1251,12 @@ empty object when the key exchange is not ephemeral. The supported types are For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. -#### `quicclientsession.setSocket(socket[, natRebinding])` +#### `quicclientsession.setSocket(socket])` * `socket` {QuicSocket} A `QuicSocket` instance to move this session to. -* `natRebinding` {boolean} When `true`, indicates that the local address is to - be changed without triggering address validation. This will be rare and will - typically be used only to test resiliency in NAT rebind scenarios. - **Default**: `false`. * Returns: {Promise} Migrates the `QuicClientSession` to the given `QuicSocket` instance. If the new @@ -1441,28 +1442,10 @@ added: REPLACEME * Returns: {QuicEndpoint} Creates and adds a new `QuicEndpoint` to the `QuicSocket` instance. An -error will be thrown if `quicsocket.addEndpoint()` is called either after +error will be thrown if `quicsock.addEndpoint()` is called either after the `QuicSocket` has already started binding to the local ports, or after the `QuicSocket` has been destroyed. -#### `quicsocket.blockList` - - -* Type: {net.BlockList} - -A {net.BlockList} instance used to define rules for remote IPv4 or IPv6 -addresses that this `QuicSocket` is not permitted to interact with. The -rules can be specified as either specific individual addresses, ranges -of addresses, or CIDR subnet ranges. - -When listening as a server, if a packet is received from a blocked address, -the packet will be ignored. - -When connecting as a client, if the remote IP address is blocked, the -connection attempt will be rejected. - #### `quicsocket.bound` @@ -1669,7 +1652,7 @@ added: REPLACEME Returns a `Promise` that resolves a new `QuicClientSession`. -#### `quicsocket.destroy([error])` +#### `quicsocket.destroy(\[error\])` @@ -1712,7 +1695,7 @@ An array of `QuicEndpoint` instances associated with the `QuicSocket`. Read-only. -#### `quicsocket.listen([options])` +#### `quicsocket.listen(\[options\])` @@ -2146,7 +2129,7 @@ Read-only. added: REPLACEME --> -* Returns: {Promise} +* Returns: {Promise`} Closes the `QuicStream` by ending both sides of the `QuicStream` `Duplex`. Returns a `Promise` that is resolved once the `QuicStream` has been destroyed. @@ -2237,7 +2220,7 @@ The maximum received offset for this `QuicStream`. Read-only. -#### `quicstream.pushStream(headers[, options])` +#### `quicstream.pushStream(headers\[, options\])` @@ -2287,7 +2270,7 @@ The `QuicServerSession` or `QuicClientSession` to which the Read-only. -#### `quicstream.sendFD(fd[, options])` +#### `quicstream.sendFD(fd\[, options\])` @@ -2299,7 +2282,7 @@ added: REPLACEME * `length` {number} The amount of data from the fd to send. Default: `-1`. -Instead of using a `QuicStream` as a writable stream, send data from a given +Instead of using a `Quicstream` as a writable stream, send data from a given file descriptor. If `offset` is set to a non-negative number, reading starts from that position @@ -2313,7 +2296,7 @@ Using the same file descriptor concurrently for multiple streams is not supported and may result in data loss. Re-using a file descriptor after a stream has finished is supported. -#### `quicstream.sendFile(path[, options])` +#### `quicstream.sendFile(path\[, options\])` @@ -2366,7 +2349,7 @@ added: REPLACEME * Type: {boolean} -Will be `true` if the `QuicStream` is unidirectional. Whether the `QuicStream` +Will be `true` if the `QuicStream` is undirectional. Whether the `QuicStream` will be readable or writable depends on whether the `quicstream.session` is a `QuicClientSession` or `QuicServerSession`, and whether the `QuicStream` was initiated locally or remotely. @@ -2499,20 +2482,20 @@ server.listen({ }); ``` +[`crypto.getCurves()`]: crypto.html#crypto_crypto_getcurves +[`stream.Readable`]: #stream_class_stream_readable +[`tls.DEFAULT_ECDH_CURVE`]: #tls_tls_default_ecdh_curve +[`tls.getCiphers()`]: tls.html#tls_tls_getciphers [ALPN]: https://tools.ietf.org/html/rfc7301 +[RFC 4007]: https://tools.ietf.org/html/rfc4007 [Certificate Object]: https://nodejs.org/dist/latest-v12.x/docs/api/tls.html#tls_certificate_object +[custom DNS lookup function]: #quic_custom_dns_lookup_functions [Handling client hello]: #quic_handling_client_hello +[modifying the default cipher suite]: tls.html#tls_modifying_the_default_tls_cipher_suite [OCSP requests]: #quic_online_certificate_status_protocol_ocsp [OCSP responses]: #quic_online_certificate_status_protocol_ocsp -[OpenSSL Options]: crypto.md#crypto_openssl_options +[OpenSSL Options]: crypto.html#crypto_openssl_options [Perfect Forward Secrecy]: #tls_perfect_forward_secrecy -[RFC 4007]: https://tools.ietf.org/html/rfc4007 -[`crypto.getCurves()`]: crypto.md#crypto_crypto_getcurves -[`stream.Readable`]: #stream_class_stream_readable -[`tls.DEFAULT_ECDH_CURVE`]: #tls_tls_default_ecdh_curve -[`tls.getCiphers()`]: tls.md#tls_tls_getciphers -[custom DNS lookup function]: #quic_custom_dns_lookup_functions -[modifying the default cipher suite]: tls.md#tls_modifying_the_default_tls_cipher_suite -[promisified version of `lookup()`]: dns.md#dns_dnspromises_lookup_hostname_options +[promisified version of `lookup()`]: dns.html#dns_dnspromises_lookup_hostname_options ['qlog']: #quic_quicsession_qlog [qlog standard]: https://tools.ietf.org/id/draft-marx-qlog-event-definitions-quic-h3-00.html diff --git a/doc/api/readline.md b/doc/api/readline.md index 2e82fdf91a1f10..d34ca6e91e7f61 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -356,10 +356,6 @@ async function processLineByLine() { } ``` -`readline.createInterface()` will start to consume the input stream once -invoked. Having asynchronous operations between interface creation and -asynchronous iteration may result in missed lines. - ### `rl.line` The REPL supports bi-directional reverse-i-search similar to [ZSH][]. It is -triggered with Ctrl+R to search backward and -Ctrl+S to search +triggered with ` + R` to search backwards and ` + S` to search forwards. Duplicated history entires will be skipped. Entries are accepted as soon as any button is pressed that doesn't correspond -with the reverse search. Cancelling is possible by pressing Esc or -Ctrl+C. +with the reverse search. Cancelling is possible by pressing `escape` or +` + C`. Changing the direction immediately searches for the next entry in the expected direction from the current position on. @@ -287,7 +284,7 @@ repl.start({ prompt: '> ', eval: myEval }); #### Recoverable errors -As a user is typing input into the REPL prompt, pressing **Enter** will +As a user is typing input into the REPL prompt, pressing the `` key will send the current line of input to the `eval` function. In order to support multi-line input, the eval function can return an instance of `repl.Recoverable` to the provided callback function: @@ -384,10 +381,8 @@ added: v0.7.7 --> The `'exit'` event is emitted when the REPL is exited either by receiving the -`.exit` command as input, the user pressing Ctrl+C twice -to signal `SIGINT`, -or by pressing Ctrl+D to signal `'end'` on the input -stream. The listener +`.exit` command as input, the user pressing `-C` twice to signal `SIGINT`, +or by pressing `-D` to signal `'end'` on the input stream. The listener callback is invoked without any arguments. ```js @@ -544,7 +539,7 @@ added: v11.10.0 * `repl` {repl.REPLServer} Initializes a history log file for the REPL instance. When executing the -Node.js binary and using the command-line REPL, a history file is initialized +Node.js binary and using the command line REPL, a history file is initialized by default. However, this is not the case when creating a REPL programmatically. Use this method to initialize a history log file when working with REPL instances programmatically. @@ -574,9 +569,6 @@ changes: - version: v10.0.0 pr-url: https://github.com/nodejs/node/pull/19187 description: The `REPL_MAGIC_MODE` `replMode` was removed. - - version: v6.3.0 - pr-url: https://github.com/nodejs/node/pull/6635 - description: The `breakEvalOnSigint` option is supported now. - version: v5.8.0 pr-url: https://github.com/nodejs/node/pull/5388 description: The `options` parameter is optional now. @@ -620,8 +612,7 @@ changes: * `repl.REPL_MODE_STRICT` to evaluate expressions in strict mode. This is equivalent to prefacing every repl statement with `'use strict'`. * `breakEvalOnSigint` {boolean} Stop evaluating the current piece of code when - `SIGINT` is received, such as when Ctrl+C is pressed. - This cannot be used + `SIGINT` is received, such as when `Ctrl+C` is pressed. This cannot be used together with a custom `eval` function. **Default:** `false`. * `preview` {boolean} Defines if the repl prints autocomplete and output previews or not. **Default:** `true` with the default eval function and @@ -751,21 +742,21 @@ For an example of running a "full-featured" (`terminal`) REPL over a `net.Server` and `net.Socket` instance, see: . -For an example of running a REPL instance over [`curl(1)`][], see: +For an example of running a REPL instance over [curl(1)][], see: . -[TTY keybindings]: readline.md#readline_tty_keybindings [ZSH]: https://en.wikipedia.org/wiki/Z_shell -[`'uncaughtException'`]: process.md#process_event_uncaughtexception -[`--experimental-repl-await`]: cli.md#cli_experimental_repl_await -[`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE`]: errors.md#errors_err_domain_cannot_set_uncaught_exception_capture -[`ERR_INVALID_REPL_INPUT`]: errors.md#errors_err_invalid_repl_input -[`curl(1)`]: https://curl.haxx.se/docs/manpage.html -[`domain`]: domain.md -[`process.setUncaughtExceptionCaptureCallback()`]: process.md#process_process_setuncaughtexceptioncapturecallback_fn -[`readline.InterfaceCompleter`]: readline.md#readline_use_of_the_completer_function +[`'uncaughtException'`]: process.html#process_event_uncaughtexception +[`--experimental-repl-await`]: cli.html#cli_experimental_repl_await +[`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE`]: errors.html#errors_err_domain_cannot_set_uncaught_exception_capture +[`ERR_INVALID_REPL_INPUT`]: errors.html#errors_err_invalid_repl_input +[`domain`]: domain.html +[`process.setUncaughtExceptionCaptureCallback()`]: process.html#process_process_setuncaughtexceptioncapturecallback_fn +[`readline.InterfaceCompleter`]: readline.html#readline_use_of_the_completer_function [`repl.ReplServer`]: #repl_class_replserver [`repl.start()`]: #repl_repl_start_options +[`util.inspect()`]: util.html#util_util_inspect_object_options [`reverse-i-search`]: #repl_reverse_i_search -[`util.inspect()`]: util.md#util_util_inspect_object_options -[stream]: stream.md +[TTY keybindings]: readline.html#readline_tty_keybindings +[curl(1)]: https://curl.haxx.se/docs/manpage.html +[stream]: stream.html diff --git a/doc/api/report.md b/doc/api/report.md index b62de913be2b29..95d53697f0df4b 100644 --- a/doc/api/report.md +++ b/doc/api/report.md @@ -598,5 +598,5 @@ The thread which is generating the report will wait for the reports from Worker threads to finish. However, the latency for this will usually be low, as both running JavaScript and the event loop are interrupted to generate the report. -[`Worker`]: worker_threads.md -[`process API documentation`]: process.md +[`process API documentation`]: process.html +[`Worker`]: worker_threads.html diff --git a/doc/api/stream.md b/doc/api/stream.md index ff92207c07e3ef..361958a11a6c33 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -386,10 +386,6 @@ See also: [`writable.uncork()`][], [`writable._writev()`][stream-_writev]. ##### `writable.destroy([error])` * `error` {Error} Optional, an error to emit with `'error'` event. @@ -404,8 +400,8 @@ This is a destructive and immediate way to destroy a stream. Previous calls to Use `end()` instead of destroy if data should flush before close, or wait for the `'drain'` event before destroying the stream. -Once `destroy()` has been called any further calls will be a no-op and no -further errors except from `_destroy()` may be emitted as `'error'`. +Once `destroy()` has been called any further calls will be a noop and no +further errors except from `_destroy` may be emitted as `'error'`. Implementors should not override this method, but instead implement [`writable._destroy()`][writable-_destroy]. @@ -972,10 +968,6 @@ called and `readableFlowing` is not `true`. ##### `readable.destroy([error])` * `error` {Error} Error which will be passed as payload in `'error'` event @@ -986,8 +978,8 @@ event (unless `emitClose` is set to `false`). After this call, the readable stream will release any internal resources and subsequent calls to `push()` will be ignored. -Once `destroy()` has been called any further calls will be a no-op and no -further errors except from `_destroy()` may be emitted as `'error'`. +Once `destroy()` has been called any further calls will be a noop and no +further errors except from `_destroy` may be emitted as `'error'`. Implementors should not override this method, but instead implement [`readable._destroy()`][readable-_destroy]. @@ -1539,10 +1531,6 @@ Examples of `Transform` streams include: ##### `transform.destroy([error])` * `error` {Error} @@ -1555,8 +1543,8 @@ Implementors should not override this method, but instead implement The default implementation of `_destroy()` for `Transform` also emit `'close'` unless `emitClose` is set in false. -Once `destroy()` has been called, any further calls will be a no-op and no -further errors except from `_destroy()` may be emitted as `'error'`. +Once `destroy()` has been called any further calls will be a noop and no +further errors except from `_destroy` may be emitted as `'error'`. ### `stream.finished(stream[, options], callback)` -* Returns: {integer} a number that can be used to reference this `timeout` +* Returns: {integer} number that can be used to reference this `timeout` -Coerce a `Timeout` to a primitive. The primitive can be used to -clear the `Timeout`. The primitive can only be used in the -same thread where the timeout was created. Therefore, to use it -across [`worker_threads`][] it must first be passed to the correct -thread. This allows enhanced compatibility with browser -`setTimeout()` and `setInterval()` implementations. +Coerce a `Timeout` to a primitive, a primitive will be generated that +can be used to clear the `Timeout`. +The generated number can only be used in the same thread where timeout +was created. Therefore to use it cross [`worker_threads`][] it has +to first be passed to a correct thread. +This allows enhanced compatibility with browser's `setTimeout()`, and +`setInterval()` implementations. ## Scheduling timers @@ -353,13 +354,13 @@ const timersPromises = require('timers/promises'); cancel the scheduled `Immediate`. [Event Loop]: https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout -[`AbortController`]: globals.md#globals_class_abortcontroller -[`TypeError`]: errors.md#errors_class_typeerror -[`clearImmediate()`]: timers.md#timers_clearimmediate_immediate -[`clearInterval()`]: timers.md#timers_clearinterval_timeout -[`clearTimeout()`]: timers.md#timers_cleartimeout_timeout -[`setImmediate()`]: timers.md#timers_setimmediate_callback_args -[`setInterval()`]: timers.md#timers_setinterval_callback_delay_args -[`setTimeout()`]: timers.md#timers_settimeout_callback_delay_args -[`util.promisify()`]: util.md#util_util_promisify_original -[`worker_threads`]: worker_threads.md +[`AbortController`]: globals.html#globals_class_abortcontroller +[`TypeError`]: errors.html#errors_class_typeerror +[`clearImmediate()`]: timers.html#timers_clearimmediate_immediate +[`clearInterval()`]: timers.html#timers_clearinterval_timeout +[`clearTimeout()`]: timers.html#timers_cleartimeout_timeout +[`setImmediate()`]: timers.html#timers_setimmediate_callback_args +[`setInterval()`]: timers.html#timers_setinterval_callback_delay_args +[`setTimeout()`]: timers.html#timers_settimeout_callback_delay_args +[`util.promisify()`]: util.html#util_util_promisify_original +[`worker_threads`]: worker_threads.html diff --git a/doc/api/tls.md b/doc/api/tls.md index a8d44e9aacbab2..8e442b0400e36d 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -308,10 +308,10 @@ HIGH !CAMELLIA ``` -This default can be replaced entirely using the [`--tls-cipher-list`][] -command-line switch (directly, or via the [`NODE_OPTIONS`][] environment -variable). For instance, the following makes `ECDHE-RSA-AES128-GCM-SHA256:!RC4` -the default TLS cipher suite: +This default can be replaced entirely using the [`--tls-cipher-list`][] command +line switch (directly, or via the [`NODE_OPTIONS`][] environment variable). For +instance, the following makes `ECDHE-RSA-AES128-GCM-SHA256:!RC4` the default TLS +cipher suite: ```bash node --tls-cipher-list='ECDHE-RSA-AES128-GCM-SHA256:!RC4' server.js @@ -370,51 +370,6 @@ The first 3 are enabled by default. The last 2 `CCM`-based suites are supported by TLSv1.3 because they may be more performant on constrained systems, but they are not enabled by default since they offer less security. -## Class: `tls.CryptoStream` - - -> Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead. - -The `tls.CryptoStream` class represents a stream of encrypted data. This class -is deprecated and should no longer be used. - -### `cryptoStream.bytesWritten` - - -The `cryptoStream.bytesWritten` property returns the total number of bytes -written to the underlying socket *including* the bytes required for the -implementation of the TLS protocol. - -## Class: `tls.SecurePair` - - -> Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead. - -Returned by [`tls.createSecurePair()`][]. - -### Event: `'secure'` - - -The `'secure'` event is emitted by the `SecurePair` object once a secure -connection has been established. - -As with checking for the server -[`'secureConnection'`](#tls_event_secureconnection) -event, `pair.cleartext.authorized` should be inspected to confirm whether the -certificate used is properly authorized. - ## Class: `tls.Server` -```js +```text { subject: { OU: [ 'Domain Control Validated', 'PositiveSSL Wildcard' ], CN: '*.nodejs.org' }, @@ -1711,75 +1668,12 @@ The `tls.createSecureContext()` method creates a `SecureContext` object. It is usable as an argument to several `tls` APIs, such as [`tls.createServer()`][] and [`server.addContext()`][], but has no public methods. -A key is *required* for ciphers that use certificates. Either `key` or +A key is *required* for ciphers that make use of certificates. Either `key` or `pfx` can be used to provide it. If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of CAs][]. -## `tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options])` - - -> Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead. - -* `context` {Object} A secure context object as returned by - `tls.createSecureContext()` -* `isServer` {boolean} `true` to specify that this TLS connection should be - opened as a server. -* `requestCert` {boolean} `true` to specify whether a server should request a - certificate from a connecting client. Only applies when `isServer` is `true`. -* `rejectUnauthorized` {boolean} If not `false` a server automatically reject - clients with invalid certificates. Only applies when `isServer` is `true`. -* `options` - * `enableTrace`: See [`tls.createServer()`][] - * `secureContext`: A TLS context object from [`tls.createSecureContext()`][] - * `isServer`: If `true` the TLS socket will be instantiated in server-mode. - **Default:** `false`. - * `server` {net.Server} A [`net.Server`][] instance - * `requestCert`: See [`tls.createServer()`][] - * `rejectUnauthorized`: See [`tls.createServer()`][] - * `ALPNProtocols`: See [`tls.createServer()`][] - * `SNICallback`: See [`tls.createServer()`][] - * `session` {Buffer} A `Buffer` instance containing a TLS session. - * `requestOCSP` {boolean} If `true`, specifies that the OCSP status request - extension will be added to the client hello and an `'OCSPResponse'` event - will be emitted on the socket before establishing a secure communication. - -Creates a new secure pair object with two streams, one of which reads and writes -the encrypted data and the other of which reads and writes the cleartext data. -Generally, the encrypted stream is piped to/from an incoming encrypted data -stream and the cleartext one is used as a replacement for the initial encrypted -stream. - -`tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and -`encrypted` stream properties. - -Using `cleartext` has the same API as [`tls.TLSSocket`][]. - -The `tls.createSecurePair()` method is now deprecated in favor of -`tls.TLSSocket()`. For example, the code: - -```js -pair = tls.createSecurePair(/* ... */); -pair.encrypted.pipe(socket); -socket.pipe(pair.encrypted); -``` - -can be replaced by: - -```js -secureSocket = tls.TLSSocket(socket, options); -``` - -where `secureSocket` has the same API as `pair.cleartext`. - ## `tls.createServer([options][, secureConnectionListener])` + +> Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead. + +The `tls.CryptoStream` class represents a stream of encrypted data. This class +is deprecated and should no longer be used. + +#### `cryptoStream.bytesWritten` + + +The `cryptoStream.bytesWritten` property returns the total number of bytes +written to the underlying socket *including* the bytes required for the +implementation of the TLS protocol. + +### Class: `SecurePair` + + +> Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead. + +Returned by [`tls.createSecurePair()`][]. + +#### Event: `'secure'` + + +The `'secure'` event is emitted by the `SecurePair` object once a secure +connection has been established. + +As with checking for the server +[`'secureConnection'`](#tls_event_secureconnection) +event, `pair.cleartext.authorized` should be inspected to confirm whether the +certificate used is properly authorized. + +### `tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options])` + + +> Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead. + +* `context` {Object} A secure context object as returned by + `tls.createSecureContext()` +* `isServer` {boolean} `true` to specify that this TLS connection should be + opened as a server. +* `requestCert` {boolean} `true` to specify whether a server should request a + certificate from a connecting client. Only applies when `isServer` is `true`. +* `rejectUnauthorized` {boolean} If not `false` a server automatically reject + clients with invalid certificates. Only applies when `isServer` is `true`. +* `options` + * `enableTrace`: See [`tls.createServer()`][] + * `secureContext`: A TLS context object from [`tls.createSecureContext()`][] + * `isServer`: If `true` the TLS socket will be instantiated in server-mode. + **Default:** `false`. + * `server` {net.Server} A [`net.Server`][] instance + * `requestCert`: See [`tls.createServer()`][] + * `rejectUnauthorized`: See [`tls.createServer()`][] + * `ALPNProtocols`: See [`tls.createServer()`][] + * `SNICallback`: See [`tls.createServer()`][] + * `session` {Buffer} A `Buffer` instance containing a TLS session. + * `requestOCSP` {boolean} If `true`, specifies that the OCSP status request + extension will be added to the client hello and an `'OCSPResponse'` event + will be emitted on the socket before establishing a secure communication. + +Creates a new secure pair object with two streams, one of which reads and writes +the encrypted data and the other of which reads and writes the cleartext data. +Generally, the encrypted stream is piped to/from an incoming encrypted data +stream and the cleartext one is used as a replacement for the initial encrypted +stream. + +`tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and +`encrypted` stream properties. + +Using `cleartext` has the same API as [`tls.TLSSocket`][]. + +The `tls.createSecurePair()` method is now deprecated in favor of +`tls.TLSSocket()`. For example, the code: + +```js +pair = tls.createSecurePair(/* ... */); +pair.encrypted.pipe(socket); +socket.pipe(pair.encrypted); +``` + +can be replaced by: + +```js +secureSocket = tls.TLSSocket(socket, options); +``` + +where `secureSocket` has the same API as `pair.cleartext`. + [`'newSession'`]: #tls_event_newsession [`'resumeSession'`]: #tls_event_resumesession [`'secureConnect'`]: #tls_event_secureconnect [`'secureConnection'`]: #tls_event_secureconnection [`'session'`]: #tls_event_session +[`--tls-cipher-list`]: cli.html#cli_tls_cipher_list_list +[`NODE_OPTIONS`]: cli.html#cli_node_options_options [`SSL_export_keying_material`]: https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html [`SSL_get_version`]: https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html -[`crypto.getCurves()`]: crypto.md#crypto_crypto_getcurves -[`net.Server.address()`]: net.md#net_server_address -[`net.Server`]: net.md#net_class_net_server -[`net.Socket`]: net.md#net_class_net_socket -[`net.createServer()`]: net.md#net_net_createserver_options_connectionlistener +[`crypto.getCurves()`]: crypto.html#crypto_crypto_getcurves +[`Duplex`]: stream.html#stream_class_stream_duplex +[`net.createServer()`]: net.html#net_net_createserver_options_connectionlistener +[`net.Server.address()`]: net.html#net_server_address +[`net.Server`]: net.html#net_class_net_server +[`net.Socket`]: net.html#net_class_net_socket [`server.addContext()`]: #tls_server_addcontext_hostname_context [`server.getTicketKeys()`]: #tls_server_getticketkeys -[`server.listen()`]: net.md#net_server_listen +[`server.listen()`]: net.html#net_server_listen [`server.setTicketKeys()`]: #tls_server_setticketkeys_keys -[`socket.connect()`]: net.md#net_socket_connect_options_connectlistener +[`socket.connect()`]: net.html#net_socket_connect_options_connectlistener [`tls.DEFAULT_ECDH_CURVE`]: #tls_tls_default_ecdh_curve [`tls.DEFAULT_MAX_VERSION`]: #tls_tls_default_max_version [`tls.DEFAULT_MIN_VERSION`]: #tls_tls_default_min_version @@ -2026,10 +2015,25 @@ added: v11.4.0 [`tls.createServer()`]: #tls_tls_createserver_options_secureconnectionlistener [`tls.getCiphers()`]: #tls_tls_getciphers [`tls.rootCertificates`]: #tls_tls_rootcertificates +[Chrome's 'modern cryptography' setting]: https://www.chromium.org/Home/chromium-security/education/tls#TOC-Cipher-Suites +[DHE]: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange +[ECDHE]: https://en.wikipedia.org/wiki/Elliptic_curve_Diffie%E2%80%93Hellman +[forward secrecy]: https://en.wikipedia.org/wiki/Perfect_forward_secrecy +[Mozilla's publicly trusted list of CAs]: https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt +[OCSP request]: https://en.wikipedia.org/wiki/OCSP_stapling +[OpenSSL Options]: crypto.html#crypto_openssl_options +[perfect forward secrecy]: #tls_perfect_forward_secrecy +[RFC 2246]: https://www.ietf.org/rfc/rfc2246.txt +[RFC 5077]: https://tools.ietf.org/html/rfc5077 +[RFC 5929]: https://tools.ietf.org/html/rfc5929 +[SSL_METHODS]: https://www.openssl.org/docs/man1.1.1/man7/ssl.html#Dealing-with-Protocol-Methods +[Session Resumption]: #tls_session_resumption +[Stream]: stream.html#stream_stream +[TLS recommendations]: https://wiki.mozilla.org/Security/Server_Side_TLS [asn1.js]: https://www.npmjs.com/package/asn1.js [certificate object]: #tls_certificate_object [cipher list format]: https://www.openssl.org/docs/man1.1.1/man1/ciphers.html#CIPHER-LIST-FORMAT -[forward secrecy]: https://en.wikipedia.org/wiki/Perfect_forward_secrecy [modifying the default cipher suite]: #tls_modifying_the_default_tls_cipher_suite [specific attacks affecting larger AES key sizes]: https://www.schneier.com/blog/archives/2009/07/another_new_aes.html -[perfect forward secrecy]: #tls_perfect_forward_secrecy +[RFC 4279]: https://tools.ietf.org/html/rfc4279 +[RFC 4086]: https://tools.ietf.org/html/rfc4086 diff --git a/doc/api/tracing.md b/doc/api/tracing.md index 9d1c873a3e883b..9350e0b9ca97da 100644 --- a/doc/api/tracing.md +++ b/doc/api/tracing.md @@ -207,7 +207,7 @@ t2.enable(); console.log(trace_events.getEnabledCategories()); ``` -[Performance API]: perf_hooks.md -[V8]: v8.md -[`Worker`]: worker_threads.md#worker_threads_class_worker -[`async_hooks`]: async_hooks.md +[Performance API]: perf_hooks.html +[V8]: v8.html +[`Worker`]: worker_threads.html#worker_threads_class_worker +[`async_hooks`]: async_hooks.html diff --git a/doc/api/tty.md b/doc/api/tty.md index a757b5b37030bd..f4a83c290a3854 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -211,10 +211,10 @@ added: v0.7.7 * Returns: {number[]} -`writeStream.getWindowSize()` returns the size of the [TTY](tty.md) +`writeStream.getWindowSize()` returns the size of the [TTY](tty.html) corresponding to this `WriteStream`. The array is of the type `[numColumns, numRows]` where `numColumns` and `numRows` represent the number -of columns and rows in the corresponding [TTY](tty.md). +of columns and rows in the corresponding [TTY](tty.html). ### `writeStream.hasColors([count][, env])` + +> Stability: 0 - Deprecated: Use the WHATWG URL API instead. ### Legacy `urlObject` -> Stability: 0 - Deprecated: Use the WHATWG URL API instead. - The legacy `urlObject` (`require('url').Url`) is created and returned by the `url.parse()` function. @@ -1153,8 +1150,6 @@ changes: times. --> -> Stability: 0 - Deprecated: Use the WHATWG URL API instead. - * `urlObject` {Object|string} A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. @@ -1249,8 +1244,6 @@ changes: when no query string is present. --> -> Stability: 0 - Deprecated: Use the WHATWG URL API instead. - * `urlString` {string} The URL string to parse. * `parseQueryString` {boolean} If `true`, the `query` property will always be set to an object returned by the [`querystring`][] module's `parse()` @@ -1295,8 +1288,6 @@ changes: contains a hostname. --> -> Stability: 0 - Deprecated: Use the WHATWG URL API instead. - * `from` {string} The Base URL being resolved against. * `to` {string} The HREF URL being resolved. @@ -1370,18 +1361,14 @@ console.log(myURL.origin); // Prints https://xn--1xa.example.com ``` -[ICU]: intl.md#intl_options_for_building_node_js -[Punycode]: https://tools.ietf.org/html/rfc5891#section-4.4 -[WHATWG URL Standard]: https://url.spec.whatwg.org/ -[WHATWG URL]: #url_the_whatwg_url_api -[`Error`]: errors.md#errors_class_error +[`Error`]: errors.html#errors_class_error [`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify [`Map`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map -[`TypeError`]: errors.md#errors_class_typeerror +[`TypeError`]: errors.html#errors_class_typeerror [`URLSearchParams`]: #url_class_urlsearchparams [`array.toString()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString [`new URL()`]: #url_new_url_input_base -[`querystring`]: querystring.md +[`querystring`]: querystring.html [`require('url').format()`]: #url_url_format_url_options [`url.domainToASCII()`]: #url_url_domaintoascii_domain [`url.domainToUnicode()`]: #url_url_domaintounicode_domain @@ -1393,6 +1380,10 @@ console.log(myURL.origin); [`url.toString()`]: #url_url_tostring [`urlSearchParams.entries()`]: #url_urlsearchparams_entries [`urlSearchParams@@iterator()`]: #url_urlsearchparams_symbol_iterator +[ICU]: intl.html#intl_options_for_building_node_js +[Punycode]: https://tools.ietf.org/html/rfc5891#section-4.4 +[WHATWG URL Standard]: https://url.spec.whatwg.org/ +[WHATWG URL]: #url_the_whatwg_url_api [examples of parsed URLs]: https://url.spec.whatwg.org/#example-url-parsing [host name spoofing]: https://hackerone.com/reports/678487 [legacy `urlObject`]: #url_legacy_urlobject diff --git a/doc/api/util.md b/doc/api/util.md index ecdfc837b06db4..b15dacbfa0b475 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -136,42 +136,6 @@ let debuglog = util.debuglog('internals', (debug) => { }); ``` -### `debuglog().enabled` - - -* {boolean} - -The `util.debuglog().enabled` getter is used to create a test that can be used -in conditionals based on the existence of the `NODE_DEBUG` environment variable. -If the `section` name appears within the value of that environment variable, -then the returned value will be `true`. If not, then the returned value will be -`false`. - -```js -const util = require('util'); -const enabled = util.debuglog('foo').enabled; -if (enabled) { - console.log('hello from foo [%d]', 123); -} -``` - -If this program is run with `NODE_DEBUG=foo` in the environment, then it will -output something like: - -```console -hello from foo [123] -``` - -## `util.debug(section)` - - -Alias for `util.debuglog`. Usage allows for readability of that doesn't imply -logging when only using `util.debuglog().enabled`. - ## `util.deprecate(fn, msg[, code])` - -* {string} The request method. -``` +use `REPLACEME` for the version number in the documentation YAML. For contributing C++ code, you may want to look at the [C++ Style Guide](../cpp-style-guide.md), as well as the @@ -603,15 +584,15 @@ widely used, so don't be discouraged! If you want to know more about the code review and the landing process, see the [Collaborator Guide][]. +[approved]: #getting-approvals-for-your-pull-request +[benchmark results]: ../writing-and-running-benchmarks.md [Building guide]: ../../../BUILDING.md [CI (Continuous Integration) test run]: #ci-testing [Code of Conduct]: https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md [Collaborator Guide]: ../collaborator-guide.md -[IRC in the #node-dev channel]: https://webchat.freenode.net?channels=node-dev&uio=d4 -[Onboarding guide]: ../../../onboarding.md -[approved]: #getting-approvals-for-your-pull-request -[benchmark results]: ../writing-and-running-benchmarks.md [guide for writing tests in Node.js]: ../writing-tests.md [hiding-a-comment]: https://help.github.com/articles/managing-disruptive-comments/#hiding-a-comment [https://ci.nodejs.org/]: https://ci.nodejs.org/ +[IRC in the #node-dev channel]: https://webchat.freenode.net?channels=node-dev&uio=d4 +[Onboarding guide]: ../../../onboarding.md [running tests]: ../../../BUILDING.md#running-tests diff --git a/doc/guides/cpp-style-guide.md b/doc/guides/cpp-style-guide.md index 56f3f5b4c84094..adf8f0481697f8 100644 --- a/doc/guides/cpp-style-guide.md +++ b/doc/guides/cpp-style-guide.md @@ -392,15 +392,15 @@ Node.js is built [without C++ exception handling][], so code using `throw` or even `try` and `catch` **will** break. [C++ Core Guidelines]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines +[Google C++ Style Guide]: https://google.github.io/styleguide/cppguide.html +[Google’s `cpplint`]: https://github.com/google/styleguide +[errors]: https://github.com/nodejs/node/blob/master/doc/guides/using-internal-errors.md [ES.47]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-nullptr [ES.48]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-casts [ES.49]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-casts-named -[Google C++ Style Guide]: https://google.github.io/styleguide/cppguide.html -[Google’s `cpplint`]: https://github.com/google/styleguide [R.20]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-owner [R.21]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-unique [Run Time Type Information]: https://en.wikipedia.org/wiki/Run-time_type_information -[aliased_buffer.h]: https://github.com/nodejs/node/blob/master/src/aliased_buffer.h#L12 [cppref_auto_ptr]: https://en.cppreference.com/w/cpp/memory/auto_ptr -[errors]: https://github.com/nodejs/node/blob/master/doc/guides/using-internal-errors.md [without C++ exception handling]: https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_exceptions.html#intro.using.exception.no +[aliased_buffer.h]: https://github.com/nodejs/node/blob/master/src/aliased_buffer.h#L12 diff --git a/doc/guides/doc-style-guide.md b/doc/guides/doc-style-guide.md index b44206ff9e2791..4813c4a1fbd282 100644 --- a/doc/guides/doc-style-guide.md +++ b/doc/guides/doc-style-guide.md @@ -17,13 +17,15 @@ this guide. * `.editorconfig` describes the preferred formatting. * A [plugin][] is available for some editors to apply these rules. * Check changes to documentation with `make lint-md`. -* [Use US spelling][]. -* [Use serial commas][]. -* Avoid first-person pronouns (_I_, _we_). - * Exception: _we recommend foo_ is preferable to _foo is recommended_. -* Use gender-neutral pronouns and gender-neutral plural nouns. - * OK: _they_, _their_, _them_, _folks_, _people_, _developers_ - * NOT OK: _his_, _hers_, _him_, _her_, _guys_, _dudes_ +* Use American English spelling. + * OK: _capitalize_, _color_ + * NOT OK: _capitalise_, _colour_ +* Use [serial commas][]. +* Avoid personal pronouns (_I_, _you_, _we_) in reference documentation. + * Personal pronouns are acceptable in colloquial documentation such as guides. + * Use gender-neutral pronouns and gender-neutral plural nouns. + * OK: _they_, _their_, _them_, _folks_, _people_, _developers_ + * NOT OK: _his_, _hers_, _him_, _her_, _guys_, _dudes_ * When combining wrapping elements (parentheses and quotes), place terminal punctuation: * Inside the wrapping element if the wrapping element contains a complete @@ -84,8 +86,11 @@ this guide. * Use _Node.js_ and not _Node_, _NodeJS_, or similar variants. * When referring to the executable, _`node`_ is acceptable. -* [Be direct][]. - +* Be direct. + * OK: The return value is a string. + + * NOT OK: It is important to note that, in all cases, the return value will be + a string regardless. * When referring to a version of Node.js in prose, use _Node.js_ and the version number. Do not prefix the version number with _v_ in prose. This is to avoid confusion about whether _v8_ refers to Node.js 8.x or the V8 JavaScript @@ -93,20 +98,16 @@ this guide. * OK: _Node.js 14.x_, _Node.js 14.3.1_ * NOT OK: _Node.js v14_ -* [Use sentence-style capitalization for headings][]. +* For headings, use sentence case, not title case. + * OK: _## Everybody to the limit_ + * NOT OK: _## Everybody To The Limit_ See also API documentation structure overview in [doctools README][]. -For topics not covered here, refer to the [Microsoft Writing Style Guide][]. - -[Be direct]: https://docs.microsoft.com/en-us/style-guide/word-choice/use-simple-words-concise-sentences -[Javascript type]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Data_structures_and_types -[Microsoft Writing Style Guide]: https://docs.microsoft.com/en-us/style-guide/welcome/ -[Use US spelling]: https://docs.microsoft.com/en-us/style-guide/word-choice/use-us-spelling-avoid-non-english-words -[Use sentence-style capitalization for headings]: https://docs.microsoft.com/en-us/style-guide/scannable-content/headings#formatting-headings -[Use serial commas]: https://docs.microsoft.com/en-us/style-guide/punctuation/commas -[`remark-preset-lint-node`]: https://github.com/nodejs/remark-preset-lint-node -[doctools README]: ../../tools/doc/README.md [info string]: https://github.github.com/gfm/#info-string [language]: https://github.com/highlightjs/highlight.js/blob/master/SUPPORTED_LANGUAGES.md +[Javascript type]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Data_structures_and_types +[serial commas]: https://en.wikipedia.org/wiki/Serial_comma [plugin]: https://editorconfig.org/#download +[doctools README]: ../../tools/doc/README.md +[`remark-preset-lint-node`]: https://github.com/nodejs/remark-preset-lint-node diff --git a/doc/guides/maintaining-V8.md b/doc/guides/maintaining-V8.md index 291c7eb0d9aadd..f57b6f38840707 100644 --- a/doc/guides/maintaining-V8.md +++ b/doc/guides/maintaining-V8.md @@ -415,8 +415,8 @@ This would require some tooling to: as their support has ended. [ChromiumReleaseCalendar]: https://www.chromium.org/developers/calendar -[Node.js CI]: https://ci.nodejs.org/job/node-test-pull-request/ [Node.js `canary` branch]: https://github.com/nodejs/node-v8/tree/canary +[Node.js CI]: https://ci.nodejs.org/job/node-test-pull-request/ [NodeJS-Backport-Approved-Chromium]: https://bugs.chromium.org/p/chromium/issues/list?can=1&q=label%3ANodeJS-Backport-Approved [NodeJS-Backport-Approved-V8]: https://bugs.chromium.org/p/v8/issues/list?can=1&q=label%3ANodeJS-Backport-Approved [NodeJS-Backport-Done-Chromium]: https://bugs.chromium.org/p/chromium/issues/list?can=1&q=label%3ANodeJS-Backport-Done @@ -425,10 +425,10 @@ as their support has ended. [NodeJS-Backport-Rejected-V8]: https://bugs.chromium.org/p/v8/issues/list?can=1&q=label%3ANodeJS-Backport-Rejected [NodeJS-Backport-Review-Chromium]: https://bugs.chromium.org/p/chromium/issues/list?can=1&q=label%3ANodeJS-Backport-Review [NodeJS-Backport-Review-V8]: https://bugs.chromium.org/p/v8/issues/list?can=1&q=label%3ANodeJS-Backport-Review +[`git-node`]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md#git-node-v8 [V8 CI]: https://ci.nodejs.org/job/node-test-commit-v8-linux/ [V8ActiveBranches]: https://build.chromium.org/p/client.v8.branches/console [V8Contributing]: https://github.com/v8/v8/wiki/Contributing [V8MergingPatching]: https://github.com/v8/v8/wiki/Merging%20&%20Patching [V8TemplateMergeRequest]: https://bugs.chromium.org/p/v8/issues/entry?template=Node.js%20merge%20request [V8TemplateUpstreamBug]: https://bugs.chromium.org/p/v8/issues/entry?template=Node.js%20upstream%20bug -[`git-node`]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md#git-node-v8 diff --git a/doc/guides/maintaining-icu.md b/doc/guides/maintaining-icu.md index 4b0c413c3f9fcb..bf5727d4e865c3 100644 --- a/doc/guides/maintaining-icu.md +++ b/doc/guides/maintaining-icu.md @@ -83,7 +83,7 @@ V8 will not compile. ```c // deps/v8/src/objects/intl-objects.h -#define V8_MINIMUM_ICU_VERSION 65 +#define V8_MINIMUM_ICU_VERSION 64 ``` V8 in Node.js depends on the ICU version supplied by Node.js. @@ -104,7 +104,7 @@ should be sufficient). ```bash ./configure \ --with-intl=full-icu \ - --with-icu-source=https://github.com/unicode-org/icu/releases/download/release-67-1/icu4c-67_1-src.tgz + --with-icu-source=http://download.icu-project.org/files/icu4c/58.1/icu4c-58_1-src.tgz make ``` @@ -261,8 +261,8 @@ Node.js (see the top level README.md). Only modifying `icu-small` would cause the patch not to be landed in case the user specifies the ICU source code another way. -[CLDR]: https://unicode.org/cldr -[Ecma402]: https://github.com/tc39/ecma402 [ICU]: http://icu-project.org [Unicode]: https://unicode.org [tz]: https://www.iana.org/time-zones +[CLDR]: https://unicode.org/cldr +[Ecma402]: https://github.com/tc39/ecma402 diff --git a/doc/guides/maintaining-openssl.md b/doc/guides/maintaining-openssl.md index b1477e3c67780a..603d82a0ae23ea 100644 --- a/doc/guides/maintaining-openssl.md +++ b/doc/guides/maintaining-openssl.md @@ -37,7 +37,7 @@ them. % mv openssl-1.1.0h openssl % git add --all openssl % git commit openssl -``` +```` The commit message can be written as (with the openssl version set to the relevant value): @@ -61,8 +61,8 @@ separately after updating the openssl source as described above. The current patch implementation can be found in the `deps/openssl/patches` directory in the file `0001-deps-add-support-for-BoringSSL-QUIC-APIs.patch`. -```console -% git am deps/openssl/patches 0001-deps-add-support-for-BoringSSL-QUIC-APIs.patch +```text + $ git am deps/openssl/patches 0001-deps-add-support-for-BoringSSL-QUIC-APIs.patch ``` The patch file itself is generated by squashing commits from the @@ -80,10 +80,6 @@ The patch is currently supported only for openssl-1.1.1e. Use `make` to regenerate all platform dependent files in `deps/openssl/config/archs/`: ```console -# On non-Linux machines -% make gen-openssl - -# On Linux machines % make -C deps/openssl/config ``` diff --git a/doc/guides/releases.md b/doc/guides/releases.md index fbbb43b4e3e7a4..d4f2a2ac962771 100644 --- a/doc/guides/releases.md +++ b/doc/guides/releases.md @@ -92,14 +92,8 @@ signed by someone who has been authorized to create a release. The GPG keys should be fetchable from a known third-party keyserver. The SKS Keyservers at are recommended. Use the -[submission](https://pgp.mit.edu/) form to submit a new GPG key. You'll need to -do an ASCII-armored export of your key first: - -```console -$ gpg --armor --export email@server.com > ~/nodekey.asc -``` - -Keys should be fetchable via: +[submission](https://pgp.mit.edu/) form to submit a new GPG key. Keys should be +fetchable via: ```console $ gpg --keyserver pool.sks-keyservers.net --recv-keys @@ -604,8 +598,6 @@ $ ./tools/release.sh -i ~/.ssh/node_id_rsa `tools/release.sh` will perform the following actions when run: -
- **a.** Select a GPG key from your private keys. It will use a command similar to: `gpg --list-secret-keys` to list your keys. If you don't have any keys, it will bail. If you have only one key, it will use that. If you have more than @@ -639,7 +631,6 @@ SHASUMS256.txt.sig. **g.** Upload the `SHASUMS256.txt` files back to the server into the release directory. -
If you didn't wait for ARM builds in the previous step before promoting the release, you should re-run `tools/release.sh` after the ARM builds have @@ -756,14 +747,6 @@ For example: The changes must be made as part of a new semver-minor release. -### Update release labels - -The `lts-watch-vN.x` issue label must be created, with the same color as other -existing labels for that release line, such as `vN.x`. - -If the release is transitioning from Active LTS to Maintenance, the -`backport-requested-vN.x` label must be deleted. - ## Major Releases The process for cutting a new Node.js major release has a number of differences @@ -800,21 +783,6 @@ One month or less before the release date, commits must be cherry-picked into the two branches. To land `SEMVER-MAJOR` at this time requires no objections from the TSC. -### Create release labels - -The following issue labels must be created: - -* `vN.x` -* `backport-blocked-vN.x` -* `backport-open-vN.x` -* `backport-requested-vN.x` -* `backported-to-vN.x` -* `dont-land-on-vN.x` - -The label description can be copied from existing labels of previous releases. -The label color must be the same for all new labels, but different from the -labels of previous releases. - ### Release Proposal A draft release proposal should be created two months before the release. A @@ -875,9 +843,9 @@ test, or doc-related are to be listed as notable changes. Some SEMVER-MINOR commits may be listed as notable changes on a case-by-case basis. Use your judgment there. -[Build issue tracker]: https://github.com/nodejs/build/issues/new [CI lockdown procedure]: https://github.com/nodejs/build/blob/master/doc/jenkins-guide.md#restricting-access-for-security-releases -[Partner Communities]: https://github.com/nodejs/community-committee/blob/master/governance/PARTNER_COMMUNITIES.md +[Build issue tracker]: https://github.com/nodejs/build/issues/new [nodejs.org release-post.js script]: https://github.com/nodejs/nodejs.org/blob/master/scripts/release-post.js [nodejs.org repository]: https://github.com/nodejs/nodejs.org +[Partner Communities]: https://github.com/nodejs/community-committee/blob/master/governance/PARTNER_COMMUNITIES.md [webchat.freenode.net]: https://webchat.freenode.net/ diff --git a/doc/guides/security-release-process.md b/doc/guides/security-release-process.md index 0ada9b63742615..acf6b56558e3ae 100644 --- a/doc/guides/security-release-process.md +++ b/doc/guides/security-release-process.md @@ -1,8 +1,8 @@ -# Security release process +# Security Release Process The security release process covers the steps required to plan/implement a security release. This document is copied into the description of the Next -Security Release and used to track progress on the release. It contains ***TEXT +Security Release, and used to track progress on the release. It contains ***TEXT LIKE THIS*** which will be replaced during the release process with the information described. @@ -17,7 +17,7 @@ information described. * ... * [ ] PR release announcements in [private](https://github.com/nodejs-private/nodejs.org-private): - * (Use previous PRs as templates. Don't forget to update the site banner and + * (Use previous PRs as templates, don't forget to update the site banner, and the date in the slug so that it will move to the top of the blog list.) * [ ] pre-release: ***LINK TO PR*** * [ ] post-release: ***LINK TO PR*** @@ -44,10 +44,6 @@ information described. (Re-PR the pre-approved branch from nodejs-private/nodejs.org-private to nodejs/nodejs.org) -* [ ] Post in the #nodejs-social channel in the OpenJS Foundation Slack - asking that the social team tweet/retweet the pre-announcement. - If you are on Twitter, you can just direct message the `@nodejs` handle. - * [ ] Request releaser(s) to start integrating the PRs to be released. * [ ] Notify [docker-node][] of upcoming security release date: ***LINK*** @@ -69,9 +65,9 @@ information described. * (Re-PR the pre-approved branch from nodejs-private/nodejs.org-private to nodejs/nodejs.org) -* [ ] Post in the #nodejs-social channel in the OpenJS Foundation Slack - asking that the social team tweet/retweet the announcement. - If you are on Twitter, you can just direct message the `@nodejs` handle. +* [ ] Email `"Rachel Romoff" ` to tweet an + announcement, or if you are on twitter you can just direct message the + `@nodejs` handle. * [ ] Comment in [docker-node][] issue that release is ready for integration. The docker-node team will build and release docker image updates. @@ -93,5 +89,5 @@ information described. [H1 CVE requests]: https://hackerone.com/nodejs/cve_requests [docker-node]: https://github.com/nodejs/docker-node/issues -[email]: https://groups.google.com/forum/#!forum/nodejs-sec [nodejs/build]: https://github.com/nodejs/build/issues +[email]: https://groups.google.com/forum/#!forum/nodejs-sec diff --git a/doc/guides/technical-values.md b/doc/guides/technical-values.md deleted file mode 100644 index d79fde6a461021..00000000000000 --- a/doc/guides/technical-values.md +++ /dev/null @@ -1,61 +0,0 @@ -# Technical values and priorities - -The project uses these technical values to establish priorities and guide -collaboration. - -## Values and priority level - -* Priority 1 - Developer experience -* Priority 2 - Stability -* Priority 3 - Operational qualities -* Priority 4 - Node.js maintainer experience -* Priority 5 - Up to date Technology and APIs - -## Value descriptions - -### 1 - Developer experience -We value ensuring that developers are productive and enjoy developing -with Node.js. Some key elements of this include: -* Approachability (both technical and community) -* Great documentation -* Bundling friction-reducing APIs and components, even though - they could be provided externally -* Enabling/supporting external packages to ensure overall developer experience - -### 2 - Stability -Whenever possible, we seek to ensure that working code continues to work. To -keep the trust of developers and users, we value stability. -Some key elements of this include: -* Backward compatibility -* Stable releases on a predictable schedule -* A strong safety net, including testing how changes - in Node.js affect popular packages -* Careful consideration of what goes into long term support (LTS) releases - -### 3 - Operational qualities -We value keeping Node.js safe, performant, and lightweight. -We value enabling the ability to investigate and debug problems in -development and production. Some key elements of this include: -* High throughput (speed) -* Fast startup -* Small binary size -* Small memory footprint -* High-quality debugging tools -* Robust diagnostic tools (profilers, etc.) -* Responsible security practices - -### 4 - Node.js maintainer experience -We value the productivity and happiness of the Node.js maintainers. -Some key elements of this include: -* Approachability of the codebase -* Good internal documentation and guides -* Low-friction policies and processes -* Good CI and tooling to make maintainers productive - -### 5 - Up to date Technology and APIs -We value providing developers with modern APIs and technologies -following existing standards whenever possible. -Some key elements of this include: -* Participating in standards work and organizations -* Web API compatibility -* Supporting and exposing new technologies and standards through early adoption diff --git a/doc/guides/writing-and-running-benchmarks.md b/doc/guides/writing-and-running-benchmarks.md index b6b22d75c17e2c..5f630ccc1f805d 100644 --- a/doc/guides/writing-and-running-benchmarks.md +++ b/doc/guides/writing-and-running-benchmarks.md @@ -551,8 +551,8 @@ Supported options keys are: benchmarker [autocannon]: https://github.com/mcollina/autocannon -[benchmark-ci]: https://github.com/nodejs/benchmarking/blob/master/docs/core_benchmarks.md +[wrk]: https://github.com/wg/wrk +[t-test]: https://en.wikipedia.org/wiki/Student%27s_t-test#Equal_or_unequal_sample_sizes.2C_unequal_variances [git-for-windows]: https://git-scm.com/download/win [nghttp2.org]: https://nghttp2.org -[t-test]: https://en.wikipedia.org/wiki/Student%27s_t-test#Equal_or_unequal_sample_sizes.2C_unequal_variances -[wrk]: https://github.com/wg/wrk +[benchmark-ci]: https://github.com/nodejs/benchmarking/blob/master/docs/core_benchmarks.md diff --git a/doc/guides/writing-tests.md b/doc/guides/writing-tests.md index b7d92709444678..0aa4cb8221f278 100644 --- a/doc/guides/writing-tests.md +++ b/doc/guides/writing-tests.md @@ -434,9 +434,9 @@ Nightly coverage reports for the Node.js master branch are available at [ASCII]: https://man7.org/linux/man-pages/man7/ascii.7.html [Google Test]: https://github.com/google/googletest -[Test Coverage section of the Building guide]: https://github.com/nodejs/node/blob/master/BUILDING.md#running-coverage [`common` module]: https://github.com/nodejs/node/blob/master/test/common/README.md [all maintained branches]: https://github.com/nodejs/lts -[directory structure overview]: https://github.com/nodejs/node/blob/master/test/README.md#test-directories [node.green]: https://node.green/ [test fixture]: https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#test-fixtures-using-the-same-data-configuration-for-multiple-tests +[Test Coverage section of the Building guide]: https://github.com/nodejs/node/blob/master/BUILDING.md#running-coverage +[directory structure overview]: https://github.com/nodejs/node/blob/master/test/README.md#test-directories diff --git a/doc/node.1 b/doc/node.1 index f52014dbdcb9dc..3da44752bd38eb 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -78,10 +78,6 @@ Aborting instead of exiting causes a core file to be generated for analysis. .It Fl -completion-bash Print source-able bash completion script for Node.js. . -.It Fl -conditions Ar string -Use custom conditional exports conditions. -.Ar string -. .It Fl -cpu-prof Start the V8 CPU profiler on start up, and write the CPU profile to disk before exit. If @@ -95,7 +91,7 @@ The directory where the CPU profiles generated by will be placed. The default value is controlled by the .Fl -diagnostic-dir . -command-line option. +command line option. . .It Fl -cpu-prof-interval The sampling interval in microseconds for the CPU profiles generated by @@ -105,7 +101,7 @@ The default is . .It Fl -cpu-prof-name File name of the V8 CPU profile generated with -.Fl -cpu-prof . +.Fl -cpu-prof . .It Fl -diagnostic-dir Set the directory for all diagnostic output files. @@ -159,7 +155,7 @@ Enable experimental top-level keyword support in REPL. . .It Fl -experimental-specifier-resolution -Select extension resolution algorithm for ES Modules; either 'explicit' (default) or 'node'. +Select extension resolution algorithm for ES Modules; either 'explicit' (default) or 'node' . .It Fl -experimental-vm-modules Enable experimental ES module support in VM module. @@ -198,7 +194,7 @@ The directory where the heap profiles generated by will be placed. The default value is controlled by the .Fl -diagnostic-dir . -command-line option. +command line option. . .It Fl -heap-prof-interval The average sampling interval in bytes for the heap profiles generated by @@ -208,7 +204,7 @@ The default is . .It Fl -heap-prof-name File name of the V8 heap profile generated with -.Fl -heap-prof . +.Fl -heap-prof . .It Fl -icu-data-dir Ns = Ns Ar file Specify ICU data load path. @@ -319,7 +315,7 @@ will be generated. The `file` name may be an absolute path. If it is not, the default directory it will be written to is controlled by the .Fl -diagnostic-dir . -command-line option. +command line option. . .It Fl -report-filename Name of the file to which the @@ -554,7 +550,7 @@ process warnings are silenced. .It Ev NODE_OPTIONS Ar options... A space-separated list of command-line .Ar options , -which are interpreted as if they had been specified on the command line before the actual command (so they can be overridden). +which are interpreted as if they had been specified on the command-line before the actual command (so they can be overridden). Node.js will exit with an error if an option that is not allowed in the environment is used, such as .Fl -print or a script file. @@ -580,7 +576,7 @@ Write process warnings to the given instead of printing to stderr. Equivalent to passing .Fl -redirect-warnings Ar file -on the command line. +on command-line. .It Ev NODE_REPL_HISTORY Ar file Path to the .Ar file diff --git a/doc/template.html b/doc/template.html index 9e07b55c44e5e1..6caf5a82bc31a7 100644 --- a/doc/template.html +++ b/doc/template.html @@ -27,7 +27,7 @@

Node.js __VERSION__ Documentation