1. 16 Jul, 2015 1 commit
    • littledan's avatar
      Array.prototype.reverse should call [[HasProperty]] on elements before [[Get]] · f76dfee9
      littledan authored
      This is a change from ES5 to ES6: When reversing an array, first it is checked
      whether the element exists, before the element is looked up. The order in ES6
      is
      
      [[HasElement]] lower
      [[Get]] lower (if present)
      [[HasElement]] upper
      [[Get]] upper (if present)
      
      In ES5, on the other hand, the order was
      
      [[Get]] lower
      [[Get]] upper
      [[HasElement]] lower
      [[HasElement]] upper
      
      To mitigate the performance impact, this patch implements a new, third copy
      of reversing arrays if %_HasPackedElements. This allows us to skip all
      membership tests, and a quick and dirty benchmark shows that the new version
      is faster:
      
      Over 4 runs, the slowest for the new version:
      d8> var start = Date.now(); for (var i = 0; i < 100000000; i++) [1, 2, 3, 4, 5].reverse(); Date.now() - start
      4658
      
      Over 3 runs, the fastest for the old version:
      d8> var start = Date.now(); for (var i = 0; i < 100000000; i++) [1, 2, 3, 4, 5].reverse(); Date.now() - start
      5176
      
      BUG=v8:4223
      R=adamk
      LOG=Y
      
      Review URL: https://codereview.chromium.org/1238593003
      
      Cr-Commit-Position: refs/heads/master@{#29716}
      f76dfee9
  2. 17 Jun, 2015 1 commit
  3. 16 Jun, 2015 1 commit
    • littledan's avatar
      Add %TypedArray% to proto chain · a1059015
      littledan authored
      According to the ES6 spec, the main methods and getters shouldn't
      be properties of the individual TypedArray objects and prototypes
      but instead on %TypedArray% and %TypedArray%.prototype. This
      difference is observable through introspection. This patch moves
      some methods and getters to the proper place, with the exception
      of %TypedArray%.prototype.subarray and harmony methods. These will
      be moved in follow-on patches.
      
      BUG=v8:4085
      LOG=Y
      R=adamk
      
      Review URL: https://codereview.chromium.org/1186733002
      
      Cr-Commit-Position: refs/heads/master@{#29057}
      a1059015
  4. 15 Jun, 2015 1 commit
  5. 09 Jun, 2015 1 commit
    • dehrenberg's avatar
      Implement %TypedArray%.prototype.slice · 51df8df9
      dehrenberg authored
      The initial implementation of this method takes a couple shortcuts:
      - At some points in the spec, we should be making a reference to
        "Table 49" and instead do property lookup on the constructor.
        This is an issue with some other TypedArray methods too.
      - The spec indicates that, if constructor and @@species haven't been
        messed with in particular ways, then there should be a memcpy
        from the old to the new. That fast path is not implemented here
        in this patch, but because V8 doesn't canonicalize NaN, the result
        isn't observably different.
      
      BUG=v8:3578
      LOG=Y
      R=arv
      
      Review URL: https://codereview.chromium.org/1170023002
      
      Cr-Commit-Position: refs/heads/master@{#28882}
      51df8df9
  6. 04 Jun, 2015 1 commit
  7. 03 Jun, 2015 2 commits
  8. 02 Jun, 2015 1 commit
  9. 26 May, 2015 1 commit
  10. 22 May, 2015 4 commits
  11. 21 May, 2015 2 commits
  12. 20 May, 2015 5 commits
  13. 19 May, 2015 2 commits
  14. 18 May, 2015 1 commit
    • dehrenberg's avatar
      Add TypedArray.from method · cc3f59db
      dehrenberg authored
      This function creates a new way to make TypedArrays based on existing
      iterable or Array-like objects, analogous to Array.from. The patch
      implements the function and adds tests.
      
      R=arv@chromium.org
      BUG=v8:3578
      LOG=Y
      
      Review URL: https://codereview.chromium.org/1132163011
      
      Cr-Commit-Position: refs/heads/master@{#28456}
      cc3f59db
  15. 13 May, 2015 1 commit
  16. 12 May, 2015 5 commits
  17. 11 May, 2015 1 commit
  18. 09 May, 2015 1 commit
    • dehrenberg's avatar
      Make one copy for all TypedArray methods · ca9d499f
      dehrenberg authored
      This is the first step of converting TypedArrays to the proper
      proto chain. There is one copy for each of the Harmony TypedArray
      methods, rather than a version for each TypedArray type. This
      form prevents accidentally baking in knowledge about a particular
      array type into the method definition.
      
      R=adamk@chromium.org, arv@chromium.org, caitpotter88@gmail.com, dslomov@chromium.org, jochen@chromium.org
      BUG=v8:4085
      LOG=Y
      
      Review URL: https://codereview.chromium.org/1126313003
      
      Cr-Commit-Position: refs/heads/master@{#28325}
      ca9d499f
  19. 07 May, 2015 2 commits
  20. 06 May, 2015 3 commits
  21. 05 May, 2015 2 commits
  22. 04 May, 2015 1 commit