-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[cDAC] GC Contract #118050
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
Merged
Merged
[cDAC] GC Contract #118050
Changes from all commits
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
09a7e0a
init
max-charlamb 4da67a4
Merge remote-tracking branch 'origin/main' into cdac-multi-contract
max-charlamb 8fe911d
wip 2 adding gc contract descriptor
max-charlamb 4363c0f
add datadescriptor function
max-charlamb d308a7f
Merge remote-tracking branch 'origin/main' into cdac-multi-contract
max-charlamb 9365a4b
fix merge issue
max-charlamb 47c23f3
rename configure file
max-charlamb 1a9c57a
update
max-charlamb 780cda3
wip
max-charlamb 9ad4256
verify in-proc gc contract
max-charlamb 452db7d
fix typo
max-charlamb 7d67771
rename ContractDescriptor type
max-charlamb 0477d96
use gcDacVars to initialize descriptor pointer
max-charlamb 462c06c
initial work on managed side
max-charlamb c1ba596
gc_descriptors -> gc_descriptor
max-charlamb a6e4366
add option to export contract
max-charlamb 29c3f73
support having zero of a type of descriptor
max-charlamb 58422b8
fix bug in ContractDescriptorTarget change
max-charlamb de5ef0d
try modify contract machinery to support subdescriptors
max-charlamb 192a5b1
update to use interface target
max-charlamb 5ceeacf
fix linking in datadescriptors
max-charlamb c74a18a
working version
max-charlamb c5f8064
working
max-charlamb 632dead
remove test var
max-charlamb ec7539f
fix building datadescriptor
max-charlamb 18a22eb
implement GetGCHeapData
max-charlamb 3f6690c
fix infra
max-charlamb 41550b8
remove debug tool
max-charlamb d77c3fb
renames
max-charlamb d63be19
fix
max-charlamb d9820c5
rename
max-charlamb f29e7a7
Merge remote-tracking branch 'origin/main' into cdac-multi-contract
max-charlamb 39c531c
add docs
max-charlamb 9b77c90
fix merge issue
max-charlamb 50f2431
refactor
max-charlamb 0216767
change name
max-charlamb e00088c
remove docs
max-charlamb 823379a
clean-up
max-charlamb 5f77536
clean up
max-charlamb bec16e6
trim docs
max-charlamb 61698e1
fix
max-charlamb 9728139
doc
max-charlamb ea63649
address comment
max-charlamb cad5e9e
fix targettests
max-charlamb 4698361
rename DLLEXPORT -> EXPORT_VISIBLE
max-charlamb 378a71f
fix license
max-charlamb 8f13833
add comment
max-charlamb 8a6a118
rename add_interface_library -> _add_interface_library_before
max-charlamb e61c682
remove sub_descriptor reference from PR
max-charlamb 0770a04
improve comment
max-charlamb 291fe19
move datadescriptors from src/debug -> src/vm
max-charlamb 0461bb3
undo change
max-charlamb 9182cab
nit spacing
max-charlamb 948efd7
update doc
max-charlamb 0bd833f
add GetGCHeapList and cdac_data<> in GC
max-charlamb 4ca29e4
Merge remote-tracking branch 'fork/datadescriptor-refactor' into cdac…
max-charlamb f9fa94e
update to fix merge issues
max-charlamb 51860e0
Merge remote-tracking branch 'origin/main' into cdac-multi-contract
max-charlamb 3e9256d
reduce diff
max-charlamb 9a9d6c7
fix build issue
max-charlamb 8a71e6e
reduce diff
max-charlamb 18d23ab
fix gc usage of cdac_data<>
max-charlamb 8a936e5
try fix scoping issue again
max-charlamb aaca402
fix
max-charlamb a85bc13
remove dead code
max-charlamb 08240da
change to use single string global for identifiers
max-charlamb 2187ecf
move gcdatadescriptors behind a #ifdef
max-charlamb 6fe2642
undo commenting out
max-charlamb 8a28a69
fix clang preprocessor issue
max-charlamb 7ca6ab2
remove accidental file
max-charlamb c52465a
Merge remote-tracking branch 'origin/main' into cdac-multi-contract
max-charlamb 2814588
remove use of /Zc:externConstexpr which caused problems with existing…
max-charlamb 3e3f2ec
fix msvc compiler constexpr
max-charlamb 532c3cf
handle Volatile<T> in datadescriptors
max-charlamb 7833955
be more careful about when to include descriptors
max-charlamb 766a7de
fix clang errors
max-charlamb 97eb6a5
Merge branch 'main' into cdac-multi-contract
max-charlamb 31fb39d
fix volatile address of
max-charlamb 0629832
try fix pointer data
max-charlamb d42f8c7
fix pointer data
max-charlamb edcdb6b
spacing nits
max-charlamb af2dc29
Merge branch 'main' into cdac-multi-contract
max-charlamb 9240dd6
mark volatile addressof as constexpr
max-charlamb bd2566a
clean up whitespace
max-charlamb 74c521f
whitespace
max-charlamb 4fdcde7
Merge remote-tracking branch 'origin/main' into cdac-multi-contract
max-charlamb d6b1757
add inline
max-charlamb 8a75183
Merge remote-tracking branch 'origin/main' into cdac-multi-contract
max-charlamb b7ab8ea
Merge branch 'main' into cdac-multi-contract
max-charlamb d8d7ea6
Merge branch 'main' into cdac-multi-contract
max-charlamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # Contract GC | ||
|
|
||
| This contract is for getting information about the garbage collector configuration and state. | ||
|
|
||
| ## APIs of contract | ||
|
|
||
|
|
||
| ```csharp | ||
| // Return an array of strings identifying the GC type. | ||
| // Current return values can include: | ||
| // "workstation" or "server" | ||
| // "segments" or "regions" | ||
| string[] GetGCIdentifiers(); | ||
| // Return the number of GC heaps | ||
| uint GetGCHeapCount(); | ||
| // Return true if the GC structure is valid, otherwise return false | ||
| bool GetGCStructuresValid(); | ||
| // Return the maximum generation of the current GC | ||
| uint GetMaxGeneration(); | ||
| ``` | ||
|
|
||
| ## Version 1 | ||
|
|
||
| Data descriptors used: | ||
| | Data Descriptor Name | Field | Meaning | | ||
| | --- | --- | --- | | ||
| | _(none)_ | | | | ||
|
|
||
| Global variables used: | ||
| | Global Name | Type | Purpose | | ||
| | --- | --- | --- | | ||
| | `GCIdentifiers` | string | CSV string containing identifiers of the GC. Current values are "server", "workstation", "regions", and "segments" | | ||
| | `NumHeaps` | TargetPointer | Pointer to the number of heaps for server GC (int) | | ||
| | `StructureInvalidCount` | TargetPointer | Pointer to the count of invalid GC structures (int) | | ||
| | `MaxGeneration` | TargetPointer | Pointer to the maximum generation number (uint) | | ||
|
|
||
| Contracts used: | ||
| | Contract Name | | ||
| | --- | | ||
| | _(none)_ | | ||
|
|
||
|
|
||
| Constants used: | ||
| | Name | Type | Purpose | Value | | ||
| | --- | --- | --- | --- | | ||
| | `WRK_HEAP_COUNT` | uint | The number of heaps in the `workstation` GC type | `1` | | ||
|
|
||
| ```csharp | ||
| GCHeapType GetGCIdentifiers() | ||
| { | ||
| string gcIdentifiers = _target.ReadGlobalString("GCIdentifiers"); | ||
| return gcIdentifiers.Split(", "); | ||
| } | ||
|
|
||
| uint GetGCHeapCount() | ||
| { | ||
| string[] gcIdentifiers = GetGCIdentifiers() | ||
| if (gcType.Contains("workstation")) | ||
| { | ||
| return WRK_HEAP_COUNT; | ||
| } | ||
| if (gcType.Contains("server")) | ||
| { | ||
| TargetPointer pNumHeaps = target.ReadGlobalPointer("NumHeaps"); | ||
| return (uint)target.Read<int>(pNumHeaps); | ||
| } | ||
|
|
||
| throw new NotImplementedException("Unknown GC heap type"); | ||
| } | ||
|
|
||
| bool GetGCStructuresValid() | ||
| { | ||
| TargetPointer pInvalidCount = target.ReadGlobalPointer("StructureInvalidCount"); | ||
| int invalidCount = target.Read<int>(pInvalidCount); | ||
| return invalidCount == 0; // Structures are valid if the count of invalid structures is zero | ||
| } | ||
|
|
||
| uint GetMaxGeneration() | ||
| { | ||
| TargetPointer pMaxGeneration = target.ReadGlobalPointer("MaxGeneration"); | ||
| return target.Read<uint>(pMaxGeneration); | ||
| } | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,4 +14,3 @@ extern "C" | |
| #include "wrappeddatadescriptor.inc" | ||
| }; | ||
| }; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [contracts.jsonc] | ||
| indent_size = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # cDAC GC contract descriptor | ||
|
|
||
| # Up to four separate descriptors can be generated: | ||
| # 1. gc_dll_wks_descriptor - WKS GC contract descriptor for the GC DLL | ||
| # 2. gc_dll_svr_descriptor - SVR GC contract descriptor for the GC DLL (if FEATURE_SVR_GC is enabled) | ||
| # 3. gcexp_dll_wks_descriptor - WKS GC contract descriptor for the GC EXP DLL (if BUILD_EXP_GC is enabled) | ||
| # 4. gcexp_dll_svr_descriptor - SVR GC contract descriptor for the GC EXP DLL (if BUILD_EXP_GC and FEATURE_SVR_GC are enabled) | ||
|
|
||
| add_library(gc_dll_wks_descriptor_interface INTERFACE) | ||
| target_include_directories(gc_dll_wks_descriptor_interface INTERFACE | ||
| ${CMAKE_CURRENT_SOURCE_DIR}) | ||
| add_dependencies(gc_dll_wks_descriptor_interface eventing_headers) | ||
| generate_data_descriptors( | ||
| LIBRARY_NAME gc_dll_wks_descriptor | ||
| CONTRACT_NAME "GCContractDescriptorWKS" | ||
| CONTRACT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/contracts.jsonc" | ||
| INTERFACE_TARGET gc_dll_wks_descriptor_interface) | ||
|
|
||
| if (FEATURE_SVR_GC) | ||
| add_library(gc_dll_svr_descriptor_interface INTERFACE) | ||
| target_include_directories(gc_dll_svr_descriptor_interface INTERFACE | ||
| ${CMAKE_CURRENT_SOURCE_DIR}) | ||
| add_dependencies(gc_dll_svr_descriptor_interface eventing_headers) | ||
| target_compile_definitions(gc_dll_svr_descriptor_interface INTERFACE -DSERVER_GC) | ||
| generate_data_descriptors( | ||
| LIBRARY_NAME gc_dll_svr_descriptor | ||
| CONTRACT_NAME "GCContractDescriptorSVR" | ||
| CONTRACT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/contracts.jsonc" | ||
| INTERFACE_TARGET gc_dll_svr_descriptor_interface) | ||
| endif() | ||
|
|
||
| if(BUILD_EXP_GC) | ||
| add_library(gcexp_dll_wks_descriptor_interface INTERFACE) | ||
| target_include_directories(gcexp_dll_wks_descriptor_interface INTERFACE | ||
| ${CMAKE_CURRENT_SOURCE_DIR}) | ||
| add_dependencies(gcexp_dll_wks_descriptor_interface eventing_headers) | ||
| target_compile_definitions(gcexp_dll_wks_descriptor_interface INTERFACE -DUSE_REGIONS) | ||
| generate_data_descriptors( | ||
| LIBRARY_NAME gcexp_dll_wks_descriptor | ||
| CONTRACT_NAME "GCContractDescriptorWKS" | ||
| CONTRACT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/contracts.jsonc" | ||
| INTERFACE_TARGET gcexp_dll_wks_descriptor_interface) | ||
|
|
||
| if (FEATURE_SVR_GC) | ||
| add_library(gcexp_dll_svr_descriptor_interface INTERFACE) | ||
| target_include_directories(gcexp_dll_svr_descriptor_interface INTERFACE | ||
| ${CMAKE_CURRENT_SOURCE_DIR}) | ||
| add_dependencies(gcexp_dll_svr_descriptor_interface eventing_headers) | ||
| target_compile_definitions(gcexp_dll_svr_descriptor_interface INTERFACE -DUSE_REGIONS) | ||
| target_compile_definitions(gcexp_dll_svr_descriptor_interface INTERFACE -DSERVER_GC) | ||
| generate_data_descriptors( | ||
| LIBRARY_NAME gcexp_dll_svr_descriptor | ||
| CONTRACT_NAME "GCContractDescriptorSVR" | ||
| CONTRACT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/contracts.jsonc" | ||
| INTERFACE_TARGET gcexp_dll_svr_descriptor_interface) | ||
| endif() | ||
| endif() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.