Skip to content

Consolidate classlibnative directory into vm#122780

Merged
jkotas merged 11 commits intomainfrom
copilot/move-files-to-vm-directory
Dec 31, 2025
Merged

Consolidate classlibnative directory into vm#122780
jkotas merged 11 commits intomainfrom
copilot/move-files-to-vm-directory

Conversation

Copy link
Contributor

Copilot AI commented Dec 30, 2025

  • Move all files from src/coreclr/classlibnative to src/coreclr/vm. There was very little code remaining under classlibnative.
  • Delete some related dead code

Copilot AI changed the title [WIP] Move files from classlibnative to vm directory Consolidate classlibnative directory into vm Dec 30, 2025
Copilot AI requested a review from jkotas December 30, 2025 01:17
@jkotas
Copy link
Member

jkotas commented Dec 30, 2025

@copilot Move SystemNative::IsServerGC to GCInterface::IsServerGC

@jkotas
Copy link
Member

jkotas commented Dec 30, 2025

@copilot Delete SystemNative::CaptureStackTraceData . It looks like a dead code

Copilot AI requested a review from jkotas December 30, 2025 06:40
@jkotas
Copy link
Member

jkotas commented Dec 30, 2025

@copilot Fold objectnative.cpp/.h into comutilnative.cpp/.h

@jkotas
Copy link
Member

jkotas commented Dec 30, 2025

@copilot Factor out all GC-related code from comutilnative.cpp/.h to gchelpersnative.cpp/.h

…rverGC to GCInterface, delete dead code

Co-authored-by: jkotas <[email protected]>
Copy link
Contributor Author

Copilot AI commented Dec 30, 2025

@copilot Move SystemNative::IsServerGC to GCInterface::IsServerGC

Done in 5c67f56

@copilot Delete SystemNative::CaptureStackTraceData . It looks like a dead code

Done in 5c67f56

Copy link
Contributor Author

Copilot AI commented Dec 30, 2025

@copilot Fold objectnative.cpp/.h into comutilnative.cpp/.h

Done in f075b0e

@copilot Factor out all GC-related code from comutilnative.cpp/.h to gchelpersnative.cpp/.h

Created gchelpersnative.h in f075b0e. The implementation file and code extraction from comutilnative.cpp is a larger refactoring (~920 lines) that I'll continue working on. Would you like me to complete this in the current PR or defer it to a follow-up?

@jkotas jkotas force-pushed the copilot/move-files-to-vm-directory branch from 5f555a2 to 6cd3bc0 Compare December 30, 2025 18:02
@jkotas jkotas force-pushed the copilot/move-files-to-vm-directory branch from 6cd3bc0 to 07856ce Compare December 30, 2025 18:34
@jkotas jkotas changed the title Consolidate classlibnative directory into vm and cleanup native class organization Consolidate classlibnative directory into vm Dec 30, 2025
@jkotas jkotas marked this pull request as ready for review December 30, 2025 21:01
Copilot AI review requested due to automatic review settings December 30, 2025 21:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR consolidates the classlibnative directory structure into the vm directory to simplify the CoreCLR codebase organization. The changes primarily involve moving files and updating build configurations, with minimal code changes.

Key Changes

  • Moved all remaining files from src/coreclr/classlibnative subdirectories (bcltype and float) into src/coreclr/vm
  • Updated include paths and build configurations to reflect the new file locations
  • Removed unused GC pressure tracking code from RCW (Runtime Callable Wrapper)
  • Updated FreeExceptionData to be GC_NOTRIGGER instead of GC_TRIGGERS

Reviewed changes

Copilot reviewed 25 out of 36 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/mono/mono/metadata/sysmath.c Updated comment to reference new file locations in vm directory
src/coreclr/vm/varargsnative.h New file moved from classlibnative/bcltype
src/coreclr/vm/varargsnative.cpp New file moved from classlibnative/bcltype
src/coreclr/vm/runtimecallablewrapper.h Removed unused GC pressure tracking enum and methods
src/coreclr/vm/runtimecallablewrapper.cpp Removed unused GC pressure tracking implementation and objectnative.h include
src/coreclr/vm/qcallentrypoints.cpp Updated includes: variant.h → olevariant.h, removed obsolete includes
src/coreclr/vm/olevariant.h Added Variant_ConvertValueTypeToRecord declaration
src/coreclr/vm/olevariant.cpp Added Variant_ConvertValueTypeToRecord implementation
src/coreclr/vm/floatsingle.h New file moved from classlibnative/float
src/coreclr/vm/floatsingle.cpp New file moved from classlibnative/float
src/coreclr/vm/floatdouble.h New file moved from classlibnative/float
src/coreclr/vm/floatdouble.cpp New file moved from classlibnative/float
src/coreclr/vm/excep.h Added FreeExceptionData declaration under FEATURE_COMINTEROP
src/coreclr/vm/excep.cpp Changed FreeExceptionData to GC_NOTRIGGER, removed thread check and CONTRACT_VIOLATION
src/coreclr/vm/ecalllist.h Updated function references: SystemNative → EnvironmentNative/GCInterface
src/coreclr/vm/divmodint.h New file moved from classlibnative/float
src/coreclr/vm/divmodint.cpp New file moved from classlibnative/float
src/coreclr/vm/corelib.cpp Updated includes: variant.h → olevariant.h, removed obsolete includes
src/coreclr/vm/comutilnative.h Added EnvironmentNative and ObjectNative class declarations, removed unused declarations
src/coreclr/vm/comutilnative.cpp Added implementations for EnvironmentNative and ObjectNative methods
src/coreclr/vm/arraynative.inl New file moved from classlibnative/bcltype
src/coreclr/vm/arraynative.h New file moved from classlibnative/bcltype
src/coreclr/vm/arraynative.cpp New file moved from classlibnative/bcltype
src/coreclr/vm/CMakeLists.txt Added new source and header files to build
src/coreclr/vm/.vscode/c_cpp_properties.json Removed classlibnative include paths
src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt Removed bcltype and comfloat_wks library dependencies
src/coreclr/classlibnative/float/CMakeLists.txt Deleted (files moved to vm)
src/coreclr/classlibnative/bcltype/variant.h Deleted (consolidated into olevariant.h)
src/coreclr/classlibnative/bcltype/variant.cpp Deleted (consolidated into olevariant.cpp)
src/coreclr/classlibnative/bcltype/system.h Deleted (functionality moved to comutilnative.h)
src/coreclr/classlibnative/bcltype/system.cpp Deleted (functionality moved to comutilnative.cpp)
src/coreclr/classlibnative/bcltype/objectnative.h Deleted (moved to comutilnative.h)
src/coreclr/classlibnative/bcltype/objectnative.cpp Deleted (moved to comutilnative.cpp)
src/coreclr/classlibnative/bcltype/CMakeLists.txt Deleted (files moved to vm)
src/coreclr/classlibnative/CMakeLists.txt Deleted (subdirectories removed)
src/coreclr/CMakeLists.txt Removed classlibnative include paths and subdirectory

@jkotas
Copy link
Member

jkotas commented Dec 30, 2025

@jkoritzinsky @AaronRobinsonMSFT I have been thinking about improving factoring of FCalls/QCalls, with the eventual goal of sharing them between NAOT and non-NAOT where possible. This is a small increment towards that.

@jkotas jkotas merged commit ec72407 into main Dec 31, 2025
156 of 158 checks passed
@jkotas jkotas deleted the copilot/move-files-to-vm-directory branch December 31, 2025 03:25
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2026
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.

4 participants