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

internal: separate VM profiler data from ConfigRef #899

Merged

Conversation

zerbina
Copy link
Collaborator

@zerbina zerbina commented Sep 13, 2023

Summary

Store the data collected by the VM profiler with the profiler itself,
instead of storing it with the global configuration state (ConfigRef).

This allows for moving the profiler-related data types closer to the
vmprofiler module, and it also shrinks the surface of ConfigRef and
the options module.

Details

  • move all profiler-related data types to vmdef; they should ideally
    be placed in the vmprofiler module, but that would currently
    introduce cyclic dependencies
  • vmprofiler.dump now accepts a Profiler instance; for rendering the
    data associated with a VM context, the new
    compilerbridge.dumpVmProfilerData procedure is now used

Summary
=======

Store the data collected by the VM profiler with the profiler itself,
instead of storing it with the global configuration state (`ConfigRef`).

This allows for moving the profiler-related data types closer to the
`vmprofiler` module, and it also shrinks the surface of `ConfigRef` and
the `options` module.

Details
=======

* move all profiler-related data types to `vmdef`; they should ideally
  be placed in the `vmprofiler` module, but that would currently
  introduce cyclic dependencies
* `vmprofiler.dump` now accepts a `Profiler` instance; for rendering the
  data associated with a VM context, the new
  `compilerbridge.dumpVmProfilerData` procedure is now used
@zerbina zerbina added refactor Implementation refactor compiler General compiler tag labels Sep 13, 2023
Copy link
Collaborator

@saem saem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heck yeah, more modular compiler, all that much easier to understand. 🎉

@saem
Copy link
Collaborator

saem commented Sep 14, 2023

/merge

@github-actions
Copy link

Merge requested by: @saem

Contents after the first section break of the PR description has been removed and preserved below:


Notes for Reviewers

This is the first step towards making the VM profiler functional again.
It broke a long time ago, when the stack-frame handling moved away from
refs.

@chore-runner chore-runner bot added this pull request to the merge queue Sep 14, 2023
Merged via the queue into nim-works:devel with commit ce91535 Sep 14, 2023
18 checks passed
@zerbina zerbina deleted the vmprofiler-decouple-from-config branch September 14, 2023 22:07
bung87 pushed a commit to bung87/nimskull that referenced this pull request Sep 16, 2023
## Summary

Store the data collected by the VM profiler with the profiler itself,
instead of storing it with the global configuration state (`ConfigRef`).

This allows for moving the profiler-related data types closer to the
`vmprofiler` module, and it also shrinks the surface of `ConfigRef` and
the `options` module.

## Details

* move all profiler-related data types to `vmdef`; they should ideally
  be placed in the `vmprofiler` module, but that would currently
  introduce cyclic dependencies
* `vmprofiler.dump` now accepts a `Profiler` instance; for rendering the
  data associated with a VM context, the new
  `compilerbridge.dumpVmProfilerData` procedure is now used
bung87 pushed a commit to bung87/nimskull that referenced this pull request Sep 23, 2023
## Summary

Store the data collected by the VM profiler with the profiler itself,
instead of storing it with the global configuration state (`ConfigRef`).

This allows for moving the profiler-related data types closer to the
`vmprofiler` module, and it also shrinks the surface of `ConfigRef` and
the `options` module.

## Details

* move all profiler-related data types to `vmdef`; they should ideally
  be placed in the `vmprofiler` module, but that would currently
  introduce cyclic dependencies
* `vmprofiler.dump` now accepts a `Profiler` instance; for rendering the
  data associated with a VM context, the new
  `compilerbridge.dumpVmProfilerData` procedure is now used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler General compiler tag refactor Implementation refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants