1. 19 Apr, 2016 1 commit
    • adamk's avatar
      Remove all non-function-name uses of CONST_LEGACY · 59546149
      adamk authored
      Now that all 'const' declarations are of the ES2015 variety, the only
      use of CONST_LEGACY is for function name bindings in sloppy mode
      named function expressions.
      
      This patch aims to delete all code meant to handle other cases, which
      mostly had to do with hole initialization/hole checks. Since function
      name bindings are initialized at entry to a function, it's impossible
      to ever observe one in an uninitialized state.
      
      To simplify the patch further, it removes the `IMPORT` VariableMode,
      as it's not likely to be needed (IMPORT is identical to CONST for
      the purpose of VariableMode).
      
      Review URL: https://codereview.chromium.org/1895973002
      
      Cr-Commit-Position: refs/heads/master@{#35632}
      59546149
  2. 14 Apr, 2016 1 commit
  3. 06 Apr, 2016 1 commit
    • verwaest's avatar
      Use a dictionary-mode code cache on the map rather than a dual system. · d2eb555e
      verwaest authored
      The previous code cache system required stubs to be marked with a StubType, causing them to be inserted either into a fixed array or into a dictionary-mode code cache. This could cause names to be in both cases, and lookup would just find the "fast" one first. Given that we clear out the caches on each GC, the memory overhead shouldn't be too bad. Additionally, the dictionary itself should just stay linear for small arrays; that's faster anyway.
      
      This CL additionally deletes some dead IC code.
      
      BUG=
      
      Review URL: https://codereview.chromium.org/1846963002
      
      Cr-Commit-Position: refs/heads/master@{#35291}
      d2eb555e
  4. 30 Mar, 2016 1 commit
  5. 21 Mar, 2016 1 commit
    • oth's avatar
      [interpreter] Add support for scalable operands. · 48d082af
      oth authored
      This change introduces wide prefix bytecodes to support wide (16-bit)
      and extra-wide (32-bit) operands. It retires the previous
      wide-bytecodes and reduces the number of operand types.
      
      Operands are now either scalable or fixed size. Scalable operands
      increase in width when a bytecode is prefixed with wide or extra-wide.
      
      The bytecode handler table is extended to 256*3 entries. The
      first 256 entries are used for bytecodes with 8-bit operands,
      the second 256 entries are used for bytecodes with operands that
      scale to 16-bits, and the third group of 256 entries are used for
      bytecodes with operands that scale to 32-bits.
      
      LOG=N
      BUG=v8:4747,v8:4280
      
      Review URL: https://codereview.chromium.org/1783483002
      
      Cr-Commit-Position: refs/heads/master@{#34955}
      48d082af
  6. 17 Mar, 2016 2 commits
  7. 10 Mar, 2016 2 commits
  8. 07 Mar, 2016 1 commit
  9. 01 Mar, 2016 1 commit
  10. 19 Feb, 2016 1 commit
    • adamk's avatar
      Don't reflect ES2015 Function name inference in Function.prototype.toString · cc2ea257
      adamk authored
      Various syntactic forms now cause functions to have names where they
      didn't before. Per the upcoming changes to the toString spec, only
      a name that was literally part of a function's expression or declaration
      is meant to be reflected in toString. This also happens to be the same
      set of names that V8 currently outputs (without the --harmony-function-name
      flag).
      
      This required distinguishing anonymous FunctionExpressions from other sorts
      of function definitions (like methods and getters/setters) in the AST, parser,
      and at runtime.
      
      The patch also takes the opportunity to remove one more argument (and enum)
      from FunctionLiteral, as well as adding a special factory method for the
      case of a FunctionLiteral representing toplevel or eval'd code.
      
      BUG=v8:4760
      LOG=n
      
      Review URL: https://codereview.chromium.org/1712833002
      
      Cr-Commit-Position: refs/heads/master@{#34132}
      cc2ea257
  11. 18 Feb, 2016 1 commit
  12. 08 Feb, 2016 1 commit
    • bmeurer's avatar
      [runtime] Optimize and unify rest parameters. · 3ef573e9
      bmeurer authored
      Replace the somewhat awkward RestParamAccessStub, which would always
      call into the runtime anyway with a proper FastNewRestParameterStub,
      which is basically based on the code that was already there for strict
      arguments object materialization. But for rest parameters we could
      optimize even further (leading to 8-10x improvements for functions with
      rest parameters), by fixing the internal formal parameter count:
      
      Every SharedFunctionInfo has a formal_parameter_count field, which
      specifies the number of formal parameters, and is used to decide whether
      we need to create an arguments adaptor frame when calling a function
      (i.e. if there's a mismatch between the actual and expected parameters).
      Previously the formal_parameter_count included the rest parameter, which
      was sort of unfortunate, as that meant that calling a function with only
      the non-rest parameters still required an arguments adaptor (plus some
      other oddities). Now with this CL we fix, so that we do no longer
      include the rest parameter in that count. Thereby checking for rest
      parameters is very efficient, as we only need to check whether there is
      an arguments adaptor frame, and if not create an empty array, otherwise
      check whether the arguments adaptor frame has more parameters than
      specified by the formal_parameter_count.
      
      The FastNewRestParameterStub is written in a way that it can be directly
      used by Ignition as well, and with some tweaks to the TurboFan backends
      and the CodeStubAssembler, we should be able to rewrite it as
      TurboFanCodeStub in the near future.
      
      Drive-by-fix: Refactor and unify the CreateArgumentsType which was
      different in TurboFan and Ignition; now we have a single enum class
      which is used in both TurboFan and Ignition.
      
      R=jarin@chromium.org, rmcilroy@chromium.org
      TBR=rossberg@chromium.org
      BUG=v8:2159
      LOG=n
      
      Review URL: https://codereview.chromium.org/1676883002
      
      Cr-Commit-Position: refs/heads/master@{#33809}
      3ef573e9
  13. 05 Feb, 2016 1 commit
  14. 27 Jan, 2016 2 commits
    • mlippautz's avatar
      Reland of "[heap] Parallel newspace evacuation, semispace copy, and compaction \o/" · 004ce08d
      mlippautz authored
      This reverts commit 85ba94f2.
      
      All parallelism can be turned off using --predictable, or --noparallel-compaction.
      
      This patch completely parallelizes
       - semispace copy: from space -> to space (within newspace)
       - newspace evacuation: newspace -> oldspace
       - oldspace compaction: oldspace -> oldspace
      
      Previously newspace has been handled sequentially (semispace copy, newspace
      evacuation) before compacting oldspace in parallel. However, on a high level
      there are no dependencies between those two actions, hence we parallelize them
      altogether. We base the number of evacuation tasks on the overall set of
      to-be-processed pages (newspace + oldspace compaction pages).
      
      Some low-level details:
       - The hard cap on number of tasks has been lifted
       - We cache store buffer entries locally before merging them back into the global
         StoreBuffer in a finalization phase.
       - We cache AllocationSite operations locally before merging them back into the
         global pretenuring storage in a finalization phase.
       - AllocationSite might be compacted while they would be needed for newspace
         evacuation. To mitigate any problems we defer checking allocation sites for
         newspace till merging locally buffered data.
      
      CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_asan_rel,v8_linux64_tsan_rel,v8_mac64_asan_rel
      BUG=chromium:524425
      LOG=N
      R=hpayer@chromium.org, ulan@chromium.org
      
      Review URL: https://codereview.chromium.org/1640563004
      
      Cr-Commit-Position: refs/heads/master@{#33552}
      004ce08d
    • machenbach's avatar
      Revert of [heap] Parallel newspace evacuation, semispace copy, and compaction... · 85ba94f2
      machenbach authored
      Revert of [heap] Parallel newspace evacuation, semispace copy, and compaction \o/ (patchset #16 id:620001 of https://codereview.chromium.org/1577853007/ )
      
      Reason for revert:
      [Sheriff] Leads to crashes on all webrtc chromium testers, e.g.:
      https://build.chromium.org/p/chromium.webrtc/builders/Mac%20Tester/builds/49664
      
      Original issue's description:
      > [heap] Parallel newspace evacuation, semispace copy, and compaction \o/
      >
      > All parallelism can be turned off using --predictable, or --noparallel-compaction.
      >
      > This patch completely parallelizes
      >  - semispace copy: from space -> to space (within newspace)
      >  - newspace evacuation: newspace -> oldspace
      >  - oldspace compaction: oldspace -> oldspace
      >
      > Previously newspace has been handled sequentially (semispace copy, newspace
      > evacuation) before compacting oldspace in parallel. However, on a high level
      > there are no dependencies between those two actions, hence we parallelize them
      > altogether. We base the number of evacuation tasks on the overall set of
      > to-be-processed pages (newspace + oldspace compaction pages).
      >
      > Some low-level details:
      >  - The hard cap on number of tasks has been lifted
      >  - We cache store buffer entries locally before merging them back into the global
      >    StoreBuffer in a finalization phase.
      >  - We cache AllocationSite operations locally before merging them back into the
      >    global pretenuring storage in a finalization phase.
      >  - AllocationSite might be compacted while they would be needed for newspace
      >    evacuation. To mitigate any problems we defer checking allocation sites for
      >    newspace till merging locally buffered data.
      >
      > CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_asan_rel,v8_linux64_tsan_rel,v8_mac64_asan_rel
      > BUG=chromium:524425
      > LOG=N
      > R=hpayer@chromium.org, ulan@chromium.org
      >
      > Committed: https://crrev.com/8f0fd8c0370ae8c5aab56491b879d7e30c329062
      > Cr-Commit-Position: refs/heads/master@{#33523}
      
      TBR=hpayer@chromium.org,ulan@chromium.org,mlippautz@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=chromium:524425
      
      Review URL: https://codereview.chromium.org/1643473002
      
      Cr-Commit-Position: refs/heads/master@{#33539}
      85ba94f2
  15. 26 Jan, 2016 2 commits
    • mlippautz's avatar
      [heap] Parallel newspace evacuation, semispace copy, and compaction \o/ · 8f0fd8c0
      mlippautz authored
      All parallelism can be turned off using --predictable, or --noparallel-compaction.
      
      This patch completely parallelizes
       - semispace copy: from space -> to space (within newspace)
       - newspace evacuation: newspace -> oldspace
       - oldspace compaction: oldspace -> oldspace
      
      Previously newspace has been handled sequentially (semispace copy, newspace
      evacuation) before compacting oldspace in parallel. However, on a high level
      there are no dependencies between those two actions, hence we parallelize them
      altogether. We base the number of evacuation tasks on the overall set of
      to-be-processed pages (newspace + oldspace compaction pages).
      
      Some low-level details:
       - The hard cap on number of tasks has been lifted
       - We cache store buffer entries locally before merging them back into the global
         StoreBuffer in a finalization phase.
       - We cache AllocationSite operations locally before merging them back into the
         global pretenuring storage in a finalization phase.
       - AllocationSite might be compacted while they would be needed for newspace
         evacuation. To mitigate any problems we defer checking allocation sites for
         newspace till merging locally buffered data.
      
      CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_asan_rel,v8_linux64_tsan_rel,v8_mac64_asan_rel
      BUG=chromium:524425
      LOG=N
      R=hpayer@chromium.org, ulan@chromium.org
      
      Review URL: https://codereview.chromium.org/1577853007
      
      Cr-Commit-Position: refs/heads/master@{#33523}
      8f0fd8c0
    • ishell's avatar
      [es6] Tail calls support. · 6131ab1e
      ishell authored
      This CL implements PrepareForTailCall() mentioned in ES6 spec for full codegen, Crankshaft and Turbofan.
      When debugger is active tail calls are disabled.
      
      Tail calling can be enabled by --harmony-tailcalls flag.
      
      BUG=v8:4698
      LOG=Y
      TBR=rossberg@chromium.org
      
      Review URL: https://codereview.chromium.org/1609893003
      
      Cr-Commit-Position: refs/heads/master@{#33509}
      6131ab1e
  16. 18 Jan, 2016 1 commit
  17. 24 Nov, 2015 1 commit
  18. 23 Nov, 2015 1 commit
    • bmeurer's avatar
      [builtins] Sanitize the machinery around Construct calls. · 374b6ea2
      bmeurer authored
      There's no point in collecting feedback for super constructor calls,
      because in all (interesting) cases we can gather (better) feedback from
      other sources (i.e. via inlining or via using a LOAD_IC to get to the
      [[Prototype]] of the target).  So CallConstructStub is now only used
      for new Foo(...args) sites where we want to collect feedback in the
      baseline compiler.  The optimizing compilers, Reflect.construct and
      super constructor calls use the Construct builtin directly, which allows
      us to remove some weird code from the CallConstructStub (and opens the
      possibility for more code sharing with the CallICStub, maybe even going
      for a ConstructICStub).
      
      Also remove the 100% redundant HCallNew instruction, which is just a
      wrapper for the Construct builtin anyway (indirectly via the
      CallConstructStub).
      
      Drive-by-fix: Drop unused has_function_cache bit on Code objects.
      
      R=mstarzinger@chromium.org, yangguo@chromium.org
      BUG=v8:4413, v8:4430
      LOG=n
      
      Review URL: https://codereview.chromium.org/1469793002
      
      Cr-Commit-Position: refs/heads/master@{#32172}
      374b6ea2
  19. 09 Nov, 2015 1 commit
    • bmeurer's avatar
      [builtins] Introduce specialized Call/CallFunction builtins. · 7c3396d0
      bmeurer authored
      Introduce receiver conversion mode specialization for the Call and
      CallFunction builtins, so we can specialize the builtin functionality
      (actually an optimization only) based on static information from the
      callsite (this is basically a superset of the optimizations that were
      available with the CallFunctionStub and CallICStub, except that these
      optimizations are correct now).
      
      This fixes a regression introduced by the removal of CallFunctionStub,
      for programs that call a lot.
      
      R=yangguo@chromium.org
      BUG=chromium:552244
      LOG=n
      
      Review URL: https://codereview.chromium.org/1436493002
      
      Cr-Commit-Position: refs/heads/master@{#31871}
      7c3396d0
  20. 05 Nov, 2015 1 commit
  21. 04 Nov, 2015 3 commits
  22. 29 Oct, 2015 1 commit
    • mvstanton's avatar
      Vector ICs: Allow for more IC kinds. · 25d48ec3
      mvstanton authored
      We have plans to create more ICs, and we are out of bits to represent the Kind
      in the flags field of the code object. The InlineCacheState can lose a bit
      because it no longer needs the DEFAULT state. That state existed as a way to
      detect errors where code incorrectly looked at a vector IC stub's
      InlineCacheState instead of correctly determining said state from a glance at
      the vector. This really isn't a danger anymore.
      
      So, with the horse trading, we could now represent up to 32 code kinds.
      
      BUG=
      
      Review URL: https://codereview.chromium.org/1427803003
      
      Cr-Commit-Position: refs/heads/master@{#31666}
      25d48ec3
  23. 28 Oct, 2015 1 commit
    • mbrandy's avatar
      Fix external callback logging in profiler. · 2bd5914b
      mbrandy authored
      For platforms that use function descriptors (currently AIX and
      PPC64BE), log an external callback's entrypoint address rather than
      its function descriptor address.  This allows proper lookup in the
      tick processor's symbol table.
      
      R=jkummerow@chromium.org, michael_dawson@ca.ibm.com
      BUG=
      
      Review URL: https://codereview.chromium.org/1409993006
      
      Cr-Commit-Position: refs/heads/master@{#31633}
      2bd5914b
  24. 07 Oct, 2015 1 commit
    • adamk's avatar
      Use Scope::function_kind_ to distinguish arrow function scopes · 24565b85
      adamk authored
      Previously, arrow function scopes had a separate ScopeType. However,
      Scope::DeserializeScopeChain() erroneously deserialized ARROW_SCOPE
      ScopeInfos as FUNCTION_SCOPE. This could lead to bugs such as the
      attached one, where "super" was disallowed where it should have
      been allowed.
      
      This patch utilizes the Scope's FunctionKind to distinguish arrow
      functions from others. Besides fixing the above bug, this also
      simplifies code in various places that had to deal with two different
      ScopeTypes both of which meant "function".
      
      BUG=v8:4466
      LOG=n
      
      Review URL: https://codereview.chromium.org/1386253002
      
      Cr-Commit-Position: refs/heads/master@{#31154}
      24565b85
  25. 01 Oct, 2015 1 commit
  26. 30 Sep, 2015 1 commit
  27. 29 Sep, 2015 1 commit
    • bmeurer's avatar
      [es6] Introduce %ToInteger and %ToLength. · 93b2b262
      bmeurer authored
      This adds ES6 compliant Object::ToInteger, Object::ToInt32,
      Object::ToUint32 and Object::ToLength, and replaces the old
      Execution wrappers of those abstract operations (which were
      not using the correct ToPrimitive).
      
      This also introduces proper %ToInteger and %ToLength runtime
      entries, with a fast path %_ToInteger supported in fullcodegen
      and Crankshaft (for now). Internal JavaScript code should use
      TO_INTEGER and TO_LENGTH respectively.
      
      CQ_INCLUDE_TRYBOTS=tryserver.v8:v8_linux_layout_dbg,v8_linux_nosnap_dbg
      BUG=v8:4307
      LOG=n
      
      Review URL: https://codereview.chromium.org/1378533002
      
      Cr-Commit-Position: refs/heads/master@{#30993}
      93b2b262
  28. 24 Sep, 2015 3 commits
    • bmeurer's avatar
      [es6] Introduce spec compliant IsConstructor. · 8fe3ac07
      bmeurer authored
      There was already a bit on the Map named "function with prototype",
      which basically meant that the Map was a map for a JSFunction that could
      be used as a constructor. Now this CL generalizes that bit to
      IsConstructor, which says that whatever (Heap)Object you are looking at
      can be used as a constructor (i.e. the bit is also set for bound
      functions that can be used as constructors and proxies that have a
      [[Construct]] internal method).
      
      This way we have a single chokepoint for IsConstructor checking, which
      allows us to get rid of the various ways in which we tried to guess
      whether something could be used as a constructor or not.
      
      Drive-by-fix: Renamed IsConstructor on FunctionKind to
      IsClassConstructor to resolve the weird name clash, and the
      IsClassConstructor name also matches the spec.
      
      CQ_INCLUDE_TRYBOTS=tryserver.v8:v8_linux_layout_dbg,v8_linux_nosnap_dbg
      R=jarin@chromium.org, rossberg@chromium.org
      BUG=v8:4413, v8:4430
      LOG=n
      
      Committed: https://crrev.com/8de4d9351df4cf66c8a128d561a6e331d196be54
      Cr-Commit-Position: refs/heads/master@{#30900}
      
      Review URL: https://codereview.chromium.org/1358423002
      
      Cr-Commit-Position: refs/heads/master@{#30902}
      8fe3ac07
    • bmeurer's avatar
      Revert of [es6] Introduce spec compliant IsConstructor. (patchset #2 id:20001... · 656ebdce
      bmeurer authored
      Revert of [es6] Introduce spec compliant IsConstructor. (patchset #2 id:20001 of https://codereview.chromium.org/1358423002/ )
      
      Reason for revert:
      Failed on Fuzzer and MIPS bot.
      
      Original issue's description:
      > [es6] Introduce spec compliant IsConstructor.
      >
      > There was already a bit on the Map named "function with prototype",
      > which basically meant that the Map was a map for a JSFunction that could
      > be used as a constructor. Now this CL generalizes that bit to
      > IsConstructor, which says that whatever (Heap)Object you are looking at
      > can be used as a constructor (i.e. the bit is also set for bound
      > functions that can be used as constructors and proxies that have a
      > [[Construct]] internal method).
      >
      > This way we have a single chokepoint for IsConstructor checking, which
      > allows us to get rid of the various ways in which we tried to guess
      > whether something could be used as a constructor or not.
      >
      > Drive-by-fix: Renamed IsConstructor on FunctionKind to
      > IsClassConstructor to resolve the weird name clash, and the
      > IsClassConstructor name also matches the spec.
      >
      > R=jarin@chromium.org, rossberg@chromium.org
      > BUG=v8:4430
      > LOG=n
      >
      > Committed: https://crrev.com/8de4d9351df4cf66c8a128d561a6e331d196be54
      > Cr-Commit-Position: refs/heads/master@{#30900}
      
      TBR=jarin@chromium.org,rossberg@chromium.org
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=v8:4430
      
      Review URL: https://codereview.chromium.org/1360403002
      
      Cr-Commit-Position: refs/heads/master@{#30901}
      656ebdce
    • bmeurer's avatar
      [es6] Introduce spec compliant IsConstructor. · 8de4d935
      bmeurer authored
      There was already a bit on the Map named "function with prototype",
      which basically meant that the Map was a map for a JSFunction that could
      be used as a constructor. Now this CL generalizes that bit to
      IsConstructor, which says that whatever (Heap)Object you are looking at
      can be used as a constructor (i.e. the bit is also set for bound
      functions that can be used as constructors and proxies that have a
      [[Construct]] internal method).
      
      This way we have a single chokepoint for IsConstructor checking, which
      allows us to get rid of the various ways in which we tried to guess
      whether something could be used as a constructor or not.
      
      Drive-by-fix: Renamed IsConstructor on FunctionKind to
      IsClassConstructor to resolve the weird name clash, and the
      IsClassConstructor name also matches the spec.
      
      R=jarin@chromium.org, rossberg@chromium.org
      BUG=v8:4430
      LOG=n
      
      Review URL: https://codereview.chromium.org/1358423002
      
      Cr-Commit-Position: refs/heads/master@{#30900}
      8de4d935
  29. 22 Sep, 2015 1 commit
    • bmeurer's avatar
      [builtins] Add support for NewTarget to Execution::New. · 1dfac69f
      bmeurer authored
      Introduce new builtins Construct and ConstructFunction (in line
      with the Call and CallFunction builtins that we already have) as
      proper bottleneck for Construct and [[Construct]] on JSFunctions.
      Use these builtins to support passing NewTarget from C++ to
      JavaScript land.
      
      Long-term we want the CallConstructStub to be used for
      gathering feedback on entry to construction chain (i.e. the
      initial new Foo), and use the Construct builtins to do the
      actual work inside the construction chain (i.e. calling into
      super and stuff).
      
      MIPS and MIPS64 ports contributed by akos.palfi@imgtec.com.
      
      R=jarin@chromium.org
      BUG=v8:4430
      LOG=n
      
      Review URL: https://codereview.chromium.org/1359583002
      
      Cr-Commit-Position: refs/heads/master@{#30857}
      1dfac69f
  30. 01 Sep, 2015 1 commit
  31. 21 Aug, 2015 1 commit
  32. 11 Aug, 2015 1 commit
    • mstarzinger's avatar
      Remove several grab-bag includes from the v8.h header. · 58109a2c
      mstarzinger authored
      This is the first step of turning the v8.h file into a normal header
      instead of an include-the-world header. The new rule is that no other
      header files are allowed to include v8.h, which is enforced by DEPS.
      
      Also the number of includes inside the v8.h file has been drastically
      reduced. Basically the last missing piece is the inclusion of the big
      objects-inl.h file.
      
      This in turn makes many headers follow the IWYU principle.
      
      R=bmeurer@chromium.org,hpayer@chromium.org,titzer@chromium.org
      
      Review URL: https://codereview.chromium.org/1282503003
      
      Cr-Commit-Position: refs/heads/master@{#30102}
      58109a2c