Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report: add support for Workers #31386

Closed
wants to merge 7 commits into from
Closed

Commits on Jan 21, 2020

  1. src: better encapsulate native immediate list

    Refactor for clarity and reusability. Make it more obvious that the
    list is a FIFO queue.
    addaleax committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    cf9939f View commit details
    Browse the repository at this point in the history
  2. src: exclude C++ SetImmediate() from count

    There is no real reason to manage a count manually, given that
    checking whether there are C++ callbacks is a single pointer
    comparison.
    
    This makes it easier to add other kinds of native C++ callbacks
    that are managed in a similar way.
    addaleax committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    c7ef27b View commit details
    Browse the repository at this point in the history
  3. src: add a threadsafe variant of SetImmediate()

    Add a variant of `SetImmediate()` that can be called from any thread.
    This allows removing the `AsyncRequest` abstraction and replaces it
    with a more generic mechanism.
    addaleax committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    ed57a14 View commit details
    Browse the repository at this point in the history
  4. src: remove AsyncRequest

    Remove `AsyncRequest` from the source code, and replace its
    usage with threadsafe `SetImmediate()` calls. This has the
    advantage of being able to pass in any function, rather than
    one that is defined when the `AsyncRequest` is “installed”.
    
    This necessitates two changes:
    
    - The stopping flag (which was only used in one case and ignored
      in the other) is now a direct member of the `Environment` class.
    - Workers no longer have their own libuv handles, requiring
      manual management of their libuv ref count.
    
    As a drive-by fix, the `can_call_into_js` variable was turned
    into an atomic variable. While there have been no bug reports,
    the flag is set from `Stop(env)` calls, which are supposed to
    be possible from any thread.
    addaleax committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    026aa74 View commit details
    Browse the repository at this point in the history
  5. src: add interrupts to Environments/Workers

    Allow doing what V8’s `v8::Isolate::RequestInterrupt()` does for V8.
    This also works when there is no JS code currently executing.
    addaleax committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    c01410a View commit details
    Browse the repository at this point in the history
  6. src: move MemoryInfo() for worker code to .cc files

    This is a) the right thing to do anyway because these functions
    can not be inlined by the compiler and b) avoids compilation warnings
    in the following commit.
    addaleax committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    1b3e183 View commit details
    Browse the repository at this point in the history
  7. report: add support for Workers

    Include a report for each sub-Worker of the current Node.js instance.
    
    This adds a feature that is necessary for eventually making the report
    feature stable, as was discussed during the last collaborator summit.
    
    Refs: openjs-foundation/summit#240
    addaleax committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    9de09f3 View commit details
    Browse the repository at this point in the history