Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

GCInfo: Support versioning. #6325

Merged
merged 1 commit into from
Jul 21, 2016
Merged

Conversation

swaroop-sridhar
Copy link

This change enables the VM to support multiple versions GCInfo concurrently.
This is necessary in light of upcoming work to add ReturnType and other
modifications to the GCInfo format -- so that existing ReadyToRun images
will continue to run correctly.

The version# is not stored in the GcInfo structure -- because it is
wasteful to store the version once for every method. Instead, it is
tracked per range-section of generated/loaded methods.

The GCInfo version is computed as:

  1. The current GCINFO_VERSION for JITted and Ngened images
  2. A function of the Ready-to-run major version stored in READYTORUN_HEADER
    for ready-to-run images. ReadyToRunJitManager::JitTokenToGCInfoVersion()
    provides the GcInfo version for any Method. Currently, there's only one
    version of GCInfo.

An abstraction GCTable is added to the GcInfo interface, which tracks the
{GcInfoBlock, GcInfoVersion} pair in-memory. Several GcInfo APIs are
modified to use GcTable in place of GcInfo pointers.

Notes:

  1. SOS GcDump: The GCDump API has separate dump routines for Header and the
    pointer-liveness information (DumpGCTable and DumpGCHeader) each of which
    advance a pointer to the GCInfo block. These APIs are not changed to
    recieve a GCTable in place of the GcInfo block pointer. Instead, they
    recieve the GcInfo version at the time of construction.
  2. Some routines that are specific to x86 GcTables (ex: crackMethodInfoHdr)
    are not yet updated to use versioning, since the development plan is to
    update the Non-x86 GcInfo structure first.

@swaroop-sridhar
Copy link
Author

@dotnet-bot test Ubuntu x64 Checked Build and Test

@swaroop-sridhar
Copy link
Author

@jkotas please review

@swaroop-sridhar
Copy link
Author

cc: @dotnet/jit-contrib

@jkotas
Copy link
Member

jkotas commented Jul 20, 2016

We have always called this GCInfo. What's the point in renaming it to GCTable?

@swaroop-sridhar
Copy link
Author

swaroop-sridhar commented Jul 20, 2016

GCInfo is the data format written to the disk -- that structure is unchanged, and still called GcInfo.
GCTable is only the in-memory container that holds {GcInfo pointer, and Version#}.
So, its not a renaming. We can call the wrapper struct something else, if its confusing.

@jkotas
Copy link
Member

jkotas commented Jul 20, 2016

Using GCTable name for {GcInfo pointer, and Version#} sounds confusing to me - I do not see the table part. I think the name should still have GCInfo in it. Would it make sense to call it just GCInfo? Or something like GCInfoBlob?

@swaroop-sridhar
Copy link
Author

@jkotas: I renamed the GCTable structure as GCInfoToken and updated all the APIs appropriately. I did not call it simply GCInfo, because there's another struct called GCInfo defined by the jIT.

@@ -3130,13 +3130,13 @@ BOOL JITNotifications::UpdateOutOfProcTable()

GPTR_IMPL(GcNotification, g_pGcNotificationTable);

GcNotifications::GcNotifications(GcNotification *gcTable)
Copy link
Member

Choose a reason for hiding this comment

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

This looks like find&replace mistake. This class has nothing to with GCInfo

@jkotas
Copy link
Member

jkotas commented Jul 20, 2016

LGTM otherwise.

This change enables the VM to support multiple versions GCInfo concurrently.
This is necessary in light of upcoming work to add ReturnType and other
modifications to the GCInfo format -- so that existing ReadyToRun images
will continue to run correctly.

The version# is not stored in the GcInfo structure -- because it is
wasteful to store the version once for every method. Instead, it is
tracked per range-section of generated/loaded methods.

The GCInfo version is computed as:
1) The current GCINFO_VERSION for JITted and Ngened images
2) A function of the Ready-to-run major version stored in READYTORUN_HEADER
   for ready-to-run images. ReadyToRunJitManager::JitTokenToGCInfoVersion()
   provides the GcInfo version for any Method. Currently, there's only one
   version of GCInfo.

An abstraction GCInfoToken is added to the GcInfo interface, which tracks the
{GcInfo, Version} pair in-memory. Several GcInfo APIs are
modified to use GCInfoToken in place of GcInfo pointers.

Notes:
1) SOS GcDump: The GCDump API has separate dump routines for Header and the
pointer-liveness information (DumpGCTable and DumpGCHeader) each of which
advance a pointer to the GCInfo block. These APIs are not changed to
recieve a GCInfoToken in place of the GcInfo block pointer. Instead, they
recieve the GcInfo version at the time of construction.
2) Some routines that are specific to x86 gcInfo (ex: crackMethodInfoHdr)
are not yet updated to use versioning, since the development plan is to
update the Non-x86 GcInfo structure first.
3) The x86 specific structs defining GcInfo headers are moved to GcInfoTypes.h,
along with the non-x86 GcInfo type definitions.
@swaroop-sridhar swaroop-sridhar merged commit 0d5eac0 into dotnet:master Jul 21, 2016
@swaroop-sridhar swaroop-sridhar deleted the R2Rver branch July 21, 2016 04:11
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants