1. 30 Nov, 2017 1 commit
  2. 27 Nov, 2017 2 commits
    • Adam Klein's avatar
      Move function name var initialization to BytecodeGenerator · bfa90f7e
      Adam Klein authored
      Besides avoiding the weird hack of inserting a statement at the 0th
      index of the function body, we also avoid allocating (and initializing)
      the variable if it's unreferenced (which I'd wager is the common case).
      
      Bug: v8:6092
      Change-Id: If917d422bb4818cf21e8272aa786ca84d4472802
      Reviewed-on: https://chromium-review.googlesource.com/784092Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Commit-Queue: Adam Klein <adamk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49646}
      bfa90f7e
    • Sathya Gunasekaran's avatar
      [class] Store class fields initializer on the constructor · 4ca9d843
      Sathya Gunasekaran authored
      Previously, the class fields initializer function was stored on a
      synthetic context allocated variable. This approach had sevaral
      problems:
      
      - We didn't know that class literal had fields until after we had
      completely parsed the class literal. This meant that we had to go back
      and fix up the scope of the constructor to have this synthetic
      variable. This resulted in mismatch between parser and preparsed scope
      data.
      
      - This synthetic variable could potentially resolve to an initializer
      of an outer class.
      
      For ex:
      class X extends Object {
        c = 1;
        constructor() {
          var t = () => {
            class P extends Object {
              constructor() {
                var t = () => { super(); };
                t();
              }
            }
            super();
          }
          t();
        }
      }
      
      In this the inner class P could access the outer class X's initiliazer
      function. We would have to maintain extra metadata to make sure this
      doesn't happen.
      
      Instead this new approach uses a private symbol to store the
      initializer function on the class constructor itself.
      
      For the base constructor case, we can simply check for a bit on the
      constructor function literal to see if we need to emit code that loads
      and calls this initializer function. Therefore, we don't pay the cost
      of loading this function in case there are no class fields.
      
      For the derived constructor case, there are two possiblities:
      (a) We are in a super() call directly in the derived constructor:
      
      In this case we can do a check similar to the base constructor check,
      we can check for a bit on the derived constructor and emit code for
      loading and calling the initializer function.
      
      This is usually the common case and we don't pay any cost for not using
      class fields.
      
      (b) We are in a super() call inside an arrow function in the derived
      constructor:
      
      In this case, we /always/ emit code to load and call the initializer
      function. If the function doesn't exist then we have undefined and we
      don't call anything. Otherwise we call the function.
      
      super() can't be called twice so even if we emit code to load and call
      the initializer function multiple times, it doesn't matter because it
      would have already been an error.
      
      Bug: v8:5367
      Change-Id: I7f77cd6493ff84cf0e430a8c1039bc9ac6941a88
      Reviewed-on: https://chromium-review.googlesource.com/781660
      Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
      Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49628}
      4ca9d843
  3. 24 Nov, 2017 1 commit
  4. 23 Nov, 2017 1 commit
  5. 17 Nov, 2017 2 commits
  6. 16 Nov, 2017 2 commits
  7. 14 Nov, 2017 1 commit
    • Adam Klein's avatar
      [parser] RewritableExpressions should keep track of their Scope directly · 082009fc
      Adam Klein authored
      Previously, the Parser stored a Scope alongside a RewritableExpression
      for each potential destructuring assignment. This Scope was later used
      during rewriting to set the correct context for the rewriting. But this
      approach failed if a new Scope was inserted into the Scope chain between
      the time the assignment was parsed and when it was rewritten.
      
      By storing the Scope directly in RewritableExpression,
      ReparentExpressionScopes() is able to appropriately re-scope such
      expressions prior to their rewriting.
      
      Bug: chromium:779457
      Change-Id: Ieb429a3da841f76d5798610af59da4fccb000652
      Reviewed-on: https://chromium-review.googlesource.com/767666
      Commit-Queue: Adam Klein <adamk@chromium.org>
      Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49368}
      082009fc
  8. 13 Nov, 2017 1 commit
    • Adam Klein's avatar
      [parser] Greatly simplify Array spread rewriting code · 18cac20c
      Adam Klein authored
      Since each Array literal containing a spread is individually queued for
      rewriting, there's no need for an AstVisitor here: a simple linear
      pass through the queue is sufficient.
      
      This patch deletes AstExpressionRewriter and all the machinery supporting
      it in the AST. This code was built with the idea of using it as
      a general expression rewriting mechanism in the parser, but those use
      cases never materialized, and Array spread remains the only thing
      that used this code.
      
      Bug: v8:6092
      Change-Id: I754c4883099e840881b005f20216f86e57721d5a
      Reviewed-on: https://chromium-review.googlesource.com/765051Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Commit-Queue: Adam Klein <adamk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49337}
      18cac20c
  9. 10 Nov, 2017 3 commits
  10. 09 Nov, 2017 1 commit
    • Ross McIlroy's avatar
      [Ast] Teach Ast Printer to print raw literal values. · ff4e4ab4
      Ross McIlroy authored
      Converts the ast prettyprinter to printing literals from the raw values
      rather than internalized on-heap strings. This enables ast printing before
      internalizing, and means we can avoid use of the isolate in the interpreter's
      off-thread phase.
      
      Also removes --print-builtin-ast and relies on just --print-ast to print
      everything.
      
      Finally, converts FunctionLiteral's debug_name function to return a
      char[] which is created from the raw name literal where it exists, rather
      than relying on the value having been internalized.
      
      BUG=v8:5203
      
      Change-Id: Ib69f754e254736f415db38713e6209465817e6f1
      Reviewed-on: https://chromium-review.googlesource.com/758681Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49276}
      ff4e4ab4
  11. 08 Nov, 2017 2 commits
  12. 07 Nov, 2017 1 commit
  13. 06 Nov, 2017 1 commit
  14. 03 Nov, 2017 3 commits
    • Ross McIlroy's avatar
      Revert "[Ast] Teach Ast Printer to print raw literal values." · 5dc02ef2
      Ross McIlroy authored
      This reverts commit c60934e9.
      
      Reason for revert: breaks nosnap build
      
      
      Original change's description:
      > [Ast] Teach Ast Printer to print raw literal values.
      > 
      > Converts the ast prettyprinter to printing literals from the raw values
      > rather than internalized on-heap strings. This enables ast printing before
      > internalizing, and means we can avoid use of the isolate in the interpreter's
      > off-thread phase.
      > 
      > Also removes --print-builtin-ast and relies on just --print-ast to print
      > everything.
      > 
      > Finally, converts FunctionLiteral's debug_name function to return a
      > char[] which is created from the raw name literal where it exists, rather
      > than relying on the value having been internalized.
      > 
      > BUG=v8:5203
      > 
      > Change-Id: I0e358d6acc9ae4516ed49e7a763e208fea5fcf66
      > Reviewed-on: https://chromium-review.googlesource.com/749261
      > Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
      > Reviewed-by: Adam Klein <adamk@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#49119}
      
      TBR=rmcilroy@chromium.org,adamk@chromium.org
      
      Change-Id: Ic9d511f5107666a2f6a2bf59d8e93643c32d4d2b
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:5203
      Reviewed-on: https://chromium-review.googlesource.com/753627Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49120}
      5dc02ef2
    • Ross McIlroy's avatar
      [Ast] Teach Ast Printer to print raw literal values. · c60934e9
      Ross McIlroy authored
      Converts the ast prettyprinter to printing literals from the raw values
      rather than internalized on-heap strings. This enables ast printing before
      internalizing, and means we can avoid use of the isolate in the interpreter's
      off-thread phase.
      
      Also removes --print-builtin-ast and relies on just --print-ast to print
      everything.
      
      Finally, converts FunctionLiteral's debug_name function to return a
      char[] which is created from the raw name literal where it exists, rather
      than relying on the value having been internalized.
      
      BUG=v8:5203
      
      Change-Id: I0e358d6acc9ae4516ed49e7a763e208fea5fcf66
      Reviewed-on: https://chromium-review.googlesource.com/749261
      Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
      Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49119}
      c60934e9
    • Sathya Gunasekaran's avatar
      [class] Evaluate static computed props during class definition · 4f781eca
      Sathya Gunasekaran authored
      This patch evaluates computed properties in the order of declaration
      during class definition time.
      
      This patch creates a synthetic variable to store the result of
      evaluating a computed property and then looks this up in the
      initializer function.
      
      Bug: v8:5367
      Change-Id: I4182c6a01196d2538991818142890f6afb0e532b
      Reviewed-on: https://chromium-review.googlesource.com/752567Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
      Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49115}
      4f781eca
  15. 31 Oct, 2017 5 commits
  16. 27 Oct, 2017 2 commits
  17. 25 Oct, 2017 3 commits
  18. 24 Oct, 2017 1 commit
  19. 23 Oct, 2017 2 commits
  20. 22 Oct, 2017 1 commit
  21. 20 Oct, 2017 1 commit
  22. 19 Oct, 2017 3 commits