1. 10 Oct, 2019 1 commit
    • Joyee Cheung's avatar
      [class] implement static private methods · 4e8c6281
      Joyee Cheung authored
      This patch refactors the declaration and allocation of the class variable, and
      implements static private methods:
      
      
      - The class variable is declared in the class scope with an explicit
        reference through class_scope->class_variable(). Anonymous classes
        whose class variable may be accessed transitively through static
        private method access use the dot string as the class name. Whether
        the class variable is allocated depending on whether it is used.
        Other references of the class variable in the ClassLiteral AST node
        and the ClassInfo structure are removed in favor of the reference
        through the class scope.
      - Previously the class variable was always (stack- or context-)
        allocated if the class is named. Now if the class variable is only
        referenced by name, it's stack allocated. If it's used transitively
        by access to static private methods, or may be used through eval,
        it's context allocated. Therefore we now use 1 less context slots
        in the class context if it's a named class without anyone referencing
        it by name in inner scopes.
      - Explicit access to static private methods or potential access to
        static private methods through eval results in forced context
        allocation of the class variables. In those cases, we save its index
        in context locals in the ScopeInfo and deserialize it later, so that
        we can check that the receiver of static private methods is the class
        constructor at run time. This flag is recorded as
        HasSavedClassVariableIndexField in the scope info.
      - Classes that need the class variable to be saved due to
        access to static private methods now save a
        ShouldSaveClassVariableIndexField in the preparse data so that the
        bits on the variables can be updated during a reparse. In the case
        of anonymous classes that need the class variables to be saved,
        we also re-declare the class variable after the reparse since
        the inner functions are skipped and we need to rely on the preparse
        data flags to remember declaring it.
      
      Design doc: https://docs.google.com/document/d/1rgGRw5RdzaRrM-GrIMhsn-DLULtADV2dmIdh_iIZxlc/edit
      
      Bug: v8:8330
      Change-Id: Idd07803f47614e97ad202de3b7faa9f71105eac5
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1781011
      Commit-Queue: Joyee Cheung <joyee@igalia.com>
      Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#64219}
      4e8c6281
  2. 13 Sep, 2019 1 commit
  3. 24 May, 2019 1 commit
  4. 23 May, 2019 2 commits
  5. 11 Apr, 2019 1 commit
  6. 03 Apr, 2019 1 commit
  7. 26 Feb, 2019 1 commit
  8. 31 Jan, 2019 1 commit
  9. 23 Jan, 2019 3 commits
  10. 21 Jan, 2019 1 commit
  11. 18 Jan, 2019 1 commit
  12. 10 Jan, 2019 1 commit
  13. 09 Jan, 2019 1 commit
  14. 08 Jan, 2019 1 commit
  15. 07 Jan, 2019 1 commit
  16. 21 Dec, 2018 1 commit
  17. 18 Dec, 2018 1 commit
  18. 14 Nov, 2018 1 commit
  19. 14 Sep, 2018 1 commit
  20. 07 Sep, 2018 2 commits
    • Ross McIlroy's avatar
      [Parser] Split building logic out of ProducedPreParserScopeData. · 83dee31e
      Ross McIlroy authored
      Splits PreParsedScopeDataBuilder out of ProducedPreParserScopeData to make the split between
      building PreParsedScopeData and using already build PreParserScopeData more explicit.
      
      BUG=v8:8041
      
      Change-Id: Iab42cab84c247152c14ac39f3136f985753160ec
      Reviewed-on: https://chromium-review.googlesource.com/1202104
      Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
      Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55718}
      83dee31e
    • Ross McIlroy's avatar
      [Parser] Add support for Zone allocated ConsumedPreParsingScopeData. · 8da9dbbb
      Ross McIlroy authored
      Adds support for zone allocated (off-heap) ConsumedPreParsingScopeData to
      enable worker-thread access to PreParsingScopeData during parallel IIFE
      compile tasks.
      
      In order to avoid code-duplication, a templated
      BaseConsumedPreParsingScopeData is added which implements the logic for
      decoding the bytestream into scope data. Two implementations of this
      base class are instantiated for each of the underlying serialized scope date:
        - ZoneConsumedPreParsedScopeData for exposing ZonePreParsedScopeData
        - OnHeapConsumedPreParsedScopeData for exposing on-heap PreParsedScopeData
      The interface for each of these classes is the ConsumedPreParsingScopeData,
      which exposes the methods required by the parser to deserialize the required
      data.
      
      As a side-cleanup, moved Ucs2CharLength and Utf8LengthHelper implementations
      to cc file so that we don't get a linker error if one of them are unused by
      the cc file including the header.
      
      
      BUG=v8:8041
      
      Change-Id: Id502312d32fe4a9ddb6f5d2d9d3e3a9d30b9b27d
      Reviewed-on: https://chromium-review.googlesource.com/1199462
      Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
      Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55711}
      8da9dbbb
  21. 22 Aug, 2018 1 commit
  22. 30 Jul, 2018 1 commit
  23. 11 Jul, 2018 1 commit
  24. 06 Jul, 2018 1 commit
    • Sigurd Schneider's avatar
      Revert "[parser] Move some PPSD sanity checks to debug" · b672210f
      Sigurd Schneider authored
      This reverts commit f45045cc.
      
      Reason for revert: <INSERT REASONING HERE>
      
      Original change's description:
      > [parser] Move some PPSD sanity checks to debug
      > 
      > Move some of PreParsedScopeData's santity checks, such as the magic
      > value separating skippable function data from scope data, to be debug
      > only, to save memory.
      > 
      > Start position of inner skippable functions is still kept, because it's
      > too good at catching bugs, but we may want to remove it in the future
      > as well.
      > 
      > Bug: chromium:818642
      > Change-Id: If86ff1b9845e8dd3b015b4e554d0033328b145bf
      > Reviewed-on: https://chromium-review.googlesource.com/1127046
      > Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      > Reviewed-by: Marja Hölttä <marja@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#54263}
      
      TBR=marja@chromium.org,leszeks@chromium.org
      
      Change-Id: I15ceedd66d9ecb66cf65f5834d09975b41d3ed27
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: chromium:818642
      Reviewed-on: https://chromium-review.googlesource.com/1127859Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
      Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54290}
      b672210f
  25. 05 Jul, 2018 1 commit
    • Leszek Swirski's avatar
      [parser] Move some PPSD sanity checks to debug · f45045cc
      Leszek Swirski authored
      Move some of PreParsedScopeData's santity checks, such as the magic
      value separating skippable function data from scope data, to be debug
      only, to save memory.
      
      Start position of inner skippable functions is still kept, because it's
      too good at catching bugs, but we may want to remove it in the future
      as well.
      
      Bug: chromium:818642
      Change-Id: If86ff1b9845e8dd3b015b4e554d0033328b145bf
      Reviewed-on: https://chromium-review.googlesource.com/1127046
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54263}
      f45045cc
  26. 02 Jul, 2018 1 commit
  27. 07 Nov, 2017 1 commit
  28. 25 Oct, 2017 1 commit
  29. 23 Oct, 2017 2 commits
    • Marja Hölttä's avatar
      Revert "[parser] Skipping inner funcs: Use less memory for variables." · 271e3b10
      Marja Hölttä authored
      This reverts commit 97ead433.
      
      Reason for revert: makes the PreParserScopeAnalysis test much slower.
      
      Original change's description:
      > [parser] Skipping inner funcs: Use less memory for variables.
      > 
      > - Make it possible to store quarter-bytes instead of full bytes.
      > 
      > - Don't store is_used; it can be recovered correctly based on the actual full
      >   parse (when a lazy function is eventually called) and
      >   has_forced_scope_allocation.
      > 
      > - With the is_used change, the old testing approach (which compared a scope for
      >   which we didn't do scope allocation to the baseline) no longer made
      >   sense. Replaced it with a new testing approach, which is also closer to the
      >   actual usage.
      > 
      > BUG=v8:5516
      > 
      > Change-Id: I02bac24e482126689dcdbabe8b3a04977be29b0c
      > Reviewed-on: https://chromium-review.googlesource.com/725422
      > Commit-Queue: Marja Hölttä <marja@chromium.org>
      > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#48828}
      
      TBR=marja@chromium.org,verwaest@chromium.org
      
      Change-Id: I8cb87bcd55462b1cef4444dabb5cbfa2ecb24c7c
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:5516
      Reviewed-on: https://chromium-review.googlesource.com/732878Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Commit-Queue: Marja Hölttä <marja@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#48829}
      271e3b10
    • Marja Hölttä's avatar
      [parser] Skipping inner funcs: Use less memory for variables. · 97ead433
      Marja Hölttä authored
      - Make it possible to store quarter-bytes instead of full bytes.
      
      - Don't store is_used; it can be recovered correctly based on the actual full
        parse (when a lazy function is eventually called) and
        has_forced_scope_allocation.
      
      - With the is_used change, the old testing approach (which compared a scope for
        which we didn't do scope allocation to the baseline) no longer made
        sense. Replaced it with a new testing approach, which is also closer to the
        actual usage.
      
      BUG=v8:5516
      
      Change-Id: I02bac24e482126689dcdbabe8b3a04977be29b0c
      Reviewed-on: https://chromium-review.googlesource.com/725422
      Commit-Queue: Marja Hölttä <marja@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#48828}
      97ead433
  30. 19 Oct, 2017 1 commit
  31. 29 Sep, 2017 1 commit
    • Marja Hölttä's avatar
      [parser] Skipping inner funcs: Make the data on heap smaller. · a0258063
      Marja Hölttä authored
      We were unnecessarily storing everything as uint32_t, even though many items in
      the preparsed scope data can be stored as uint8_t. This CL also adds an
      (internal) API which abstracts away the actual data storing, so the backing
      store can be made even more efficient (e.g., use only 1-3 bytes for some
      uint32_t values, if they fit) without affecting other parts of the code.
      
      BUG=v8:5516,chromium:762492
      
      Change-Id: I7cd4d91dc11f87f8aec9c7584044a6f2a59b73ba
      Reviewed-on: https://chromium-review.googlesource.com/684182
      Commit-Queue: Marja Hölttä <marja@chromium.org>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#48231}
      a0258063
  32. 04 Aug, 2017 1 commit
    • Marja Hölttä's avatar
      [parser] Skipping inner funcs: implement a bailout. · e7a46253
      Marja Hölttä authored
      In some cases, PreParser cannot replicate the Scope structure created by
      Parser. It happens esp. with arrow function parameters, since the relevant
      information is already lost by the time we figure out it's an arrow function.
      
      In these cases, PreParser should bail out of trying to create data for skipping
      inner functions.
      
      Implementation notes:
      
      - The arrow function case is more fundamental; the non-arrow case could be
        hacked together somehow if we implemented tracking is_simple for each param
        separately; but now that it's possible to bail out consistently from both
        cases, I don't think the is_simple complication is worth it.
      
      - The added mjsunit test cases are based on the test262 test cases which exposed
        the problem.
      
      - cctest/preparser/PreParserScopeAnalysis was exercising similar cases, but the
        problem didn't show up because the function parameters didn't contain
        skippable functions. Those test cases have been repurposed for testing the
        bailout.
      
      - Extra precaution: the bailout tests are in a separate file, to guard from the
        bug that a bailout case results in bailing out of *all* data creation, which
        would make all skipping tests in the same file useless.
      
      BUG=v8:5516
      
      Change-Id: I4324749a5ec602fa5d7dc27647ade0284a6842fe
      Reviewed-on: https://chromium-review.googlesource.com/599849Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Commit-Queue: Marja Hölttä <marja@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47170}
      e7a46253
  33. 30 Jun, 2017 1 commit
  34. 25 Apr, 2017 2 commits