1. 11 Dec, 2020 2 commits
    • Clemens Backes's avatar
      [include][cleanup] Replace typedef by using · e677c91f
      Clemens Backes authored
      The rest of the code base was already migrated last year in
      https://crrev.com/c/1631409. In the API we have to be more careful to
      not break embedders. According to the standard there is no semantic
      difference between typedef and using ([decl.typedef#2]):
        A typedef-name can also be introduced by an alias-declaration. The
        identifier following the using keyword becomes a typedef-name and the
        optional attribute-specifier-seq following the identifier appertains
        to that typedef-name. Such a typedef-name has the same semantics as if
        it were introduced by the typedef specifier.
      
      Thus this CL replaces all typedefs in include/v8.h by the equivalent
      using declaration. This improves readability, especially for function
      pointer types.
      
      R=ulan@chromium.org
      CC=leszeks@chromium.org
      
      Bug: v8:11074
      Change-Id: Id917b6aa5c8cd289c60bda5da1e3667e747936e7
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2563880
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#71719}
      e677c91f
    • Anna Henningsen's avatar
      [api] Add Context::GetMicrotaskQueue method · 4bf051d5
      Anna Henningsen authored
      Add a method that returns the microtask queue that is being used
      by the `v8::Context`.
      
      This is helpful in non-monolithic embedders like Node.js, which
      accept Contexts created by its own embedders like Electron, or
      for native Node.js addons. In particular, it enables:
      
      1. Making sure that “nested” `Context`s use the correct microtask
         queue, i.e. the one from the outer Context.
      2. Enqueueing microtasks into the correct microtask queue.
      
      Previously, these things only worked when the microtask queue for
      a given Context was the Isolate’s default queue.
      
      As an alternative, I considered adding a way to make new `Context`s
      inherit the queue from the `Context` that was entered at the time
      of their creation, but that seemed a bit more “magic”, less flexible,
      and didn’t take care of concern 2 listed above.
      
      Change-Id: I15ed796df90f23c97a545a8e1b30a3bf4a5c4320
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2579914Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Commit-Queue: Toon Verwaest <verwaest@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#71710}
      4bf051d5
  2. 10 Dec, 2020 2 commits
  3. 07 Dec, 2020 2 commits
    • Daniel Clark's avatar
      Allow casting to Primitive types from Data · a8f6c061
      Daniel Clark authored
      Although every Primitive is a Data, the Cast operations for the
      subclasses of Primitive do not allow casting directly from Data to the
      subclasses without first going through Value.  Because of this,
      Primitives extracted from a V8::FixedArray require two casts to get to
      the "real" type.
      
      Thus, as a convenience to embedders, this change makes it possible to
      cast directly from Data to all the subtypes of Primitive.
      
      Also, this change makes the parameter names in the declarations match
      those in the definitions, though there does not seem to be a universally
      followed convention regarding these.
      
      Bug: v8:10958
      Change-Id: I18dc3fbb9a9bccb2cb3b75efd829af64d46d8eb9
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2573816Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Commit-Queue: Dan Clark <daniec@microsoft.com>
      Cr-Commit-Position: refs/heads/master@{#71649}
      a8f6c061
    • Benedikt Meurer's avatar
      [wasm] Use WebAssembly.Memory objects in the scope chain. · 058299a8
      Benedikt Meurer authored
      Previously V8 would wrap the WebAssembly.Memory backing stores into
      Uint8Arrays and report that as memories, but that's confusing to the
      developer, since that's not what's really being used. The way that
      DevTools presents the backing stores of memories, it's still perfectly
      possible to get hold of an Uint8Array if that's what the developer is
      looking for.
      
      To make it possible to easily identify the WebAssembly.Memory objects
      in the DevTools front-end (in particular for the memory inspector) we
      add a 'webassemblymemory' subtype to the Chrome DevTools Protocol. We
      also improve the description for the memories to include the number
      of active pages.
      
      Fixed: chromium:1155566
      Screenshot: https://imgur.com/8enx57u.png
      Change-Id: I63dbabe0e372e9ad6dcc8e6642cdb743147a620c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2574699Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#71641}
      058299a8
  4. 01 Dec, 2020 2 commits
  5. 30 Nov, 2020 1 commit
  6. 27 Nov, 2020 1 commit
  7. 26 Nov, 2020 1 commit
    • Omer Katz's avatar
      cppgc: Fix and merge cppgc samples · f8fa0edf
      Omer Katz authored
      Both sample are essentially the same up to string constants since
      cppgc's default platform started using libplatform.
      The only diff between the sample is whether we call
      v8::V8::IntializePlatform or cppgc::InitializeProcess.
      
      Drive-by: replace CPPGC_BUILD_IN_V8 with CPPGC_IS_STANDALONE which is
                more descriptive.
      
      Bug: chromium:1056170
      Change-Id: I8fdeb59c3345af77f1bccd8b93255ab39b4d3181
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2557516
      Commit-Queue: Omer Katz <omerkatz@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#71421}
      f8fa0edf
  8. 25 Nov, 2020 2 commits
  9. 24 Nov, 2020 4 commits
  10. 23 Nov, 2020 1 commit
  11. 20 Nov, 2020 1 commit
  12. 19 Nov, 2020 1 commit
    • Omer Katz's avatar
      cppgc: Add tracing scopes · 6a1a3a10
      Omer Katz authored
      This CL adds tracing scopes for the various cppgc classes.
      Scopes use TRACE_EVENT_BEGIN and TRACE_EVENT_END macros to report trace
      events. To do so they need to include trace-event.h. For unified heap
      builds, trace-event.h forwards to v8's src/tracing/trace-event.h. For
      other builds, trace-event.h provides a subset of
      src/tracing/trace-event.h that covers just the parts used by cppgc.
      
      This CL covers what we need for traces and blink gc metrics (up to
      renaming events from BlinkGC.* to CppGC.*). UMA and UKM are not yet
      handled.
      
      Bug: chromium:1056170
      Change-Id: Id92e84b27259ff0aadae7692f3d79d30896fb8e7
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2540548
      Commit-Queue: Omer Katz <omerkatz@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#71284}
      6a1a3a10
  13. 18 Nov, 2020 2 commits
  14. 17 Nov, 2020 1 commit
  15. 16 Nov, 2020 1 commit
  16. 13 Nov, 2020 2 commits
  17. 12 Nov, 2020 1 commit
  18. 11 Nov, 2020 3 commits
  19. 09 Nov, 2020 1 commit
  20. 05 Nov, 2020 1 commit
    • Devlin Cronin's avatar
      Introduce Function::FunctionProtoToString() · 2ccd4dc5
      Devlin Cronin authored
      Add a new function on the public API to allow serializing a function to
      a string using the built-in toString() implementation, allowing
      serialization without worrying about untrusted author script overriding
      the toString() implementation. This is similar in nature to
      Object::ObjectProtoToString() (but that only returns "[object Function]"
      for any passed function).
      
      Add tests for the same.
      
      Bug: chromium:1144841
      Change-Id: Ie4c29b870034c0817c23bf91f9424f956098823d
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2514768Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70976}
      2ccd4dc5
  21. 04 Nov, 2020 2 commits
  22. 02 Nov, 2020 1 commit
    • Ulan Degenbaev's avatar
      Fix alloc/dealloc size mismatch for v8::BackingStore · 9a49b229
      Ulan Degenbaev authored
      On newer compilers the {operator delete} with explicit {size_t}
      argument would be instantiated for {v8::BackingStore} and used
      in the destructor of {std::unique_ptr<v8::BackingStore>}. The {size_t}
      argument is wrong though, since the pointer actually points
      to a {v8::internal::BackingStore} object.
      The solution is to explicitly provide a {operator delete}, preventing
      an implicitly generated {size_t} operator.
      
      Bug:v8:11081
      
      Change-Id: Iee0aa47a67f0e41000bea628942f7e3d70198b83
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2506712
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70916}
      9a49b229
  23. 30 Oct, 2020 2 commits
  24. 29 Oct, 2020 3 commits