- 18 3月, 2022 19 次提交
-
-
由 Aleksey Kliger (λgeek) 提交于
Fully implement support for the `NewTypeDefinition` EnC capability: a hot reload edit can add a new type definition (class, struct, interface, enum) that contains new fields, methods, properties, events, and nested classes, and can have generic params. Also add reflection support for all of the above. This is sufficient to support hot reload of types tagged with [`CreateNewOnMetadataUpdateAttribute`](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.createnewonmetadataupdateattribute?view=net-6.0). Contributes to https://github.com/dotnet/runtime/issues/63643 and https://github.com/dotnet/runtime/issues/57365 --- The implementation introduces `MonoAddedDefSkeleton` which is a bookkeeping structure that records the metadata indexes of where to find methods, fields, properties and events for a newly-added class. The issue is that normally `mono_class_create_from_typedef` expects to find all that stuff in a contiguous block starting at the row pointed by the `MONO_TYPEDEF_FIELD_LIST` or `MONO_TYPEDEF_METHOD_LIST` columns of the new typedef. But in EnC deltas, those columns are zeroed out, and instead the EnCLog functions like `ENC_FUNC_ADD_METHOD` and `ENC_FUNC_ADD_FIELD` explicitly record when a new row is added that is relevant to a particular type definition. So during the pass over the EnCLog, we start creating skeletons when we see a new row added to the typedef table. Then when we see the add functions, we record the row indices of the field, method, etc tables. As far as I can tell, the rows for a particular type definition are contiguous, so we just record the first index and the count. At the end of the pass, we save the skeletons on the metadata delta, and when code finally creates the `MonoClass` for a particular freshly-added type definition, we check the skeleton and use the recorded rows to populate the fields and methods. Event and property data is created on-demand (the demand being reflection) in basically the same way. One important note: we try very hard not to accidentally materialize a newly-added class as a `MonoClass` during the update itself - we need to at least get through the entire EnCLog - otherwise we might not see every field/method/etc and set up the class incorrectly. The upshot is that the newly-added `MonoClass` behaves like any other "normal" class - all its fields are laid out normally (they're stored in the object, not in a separate hash table). It can be generic. It can have base types, interfaces, etc. This is different from how added fields, props and events will be implemented on existing classes - we won't modify `MonoClass:fields` or the `MonoClassPropertyInfo:properties` arrays - once they have been allocated, we don't want to mess with them. Instead additions to existing classes with create `MonoClassMetadataUpdateField` (`MonoClassMetadataUpdateProperty` and `MonoClassMetadataUpdateEvent`) structs that are going to be stored on the `MonoClassMetadataUpdateInfo` that's associated with each `MonoClass`. The various iterators like `mono_class_get_fields` and `mono_class_get_props` will be modified to return the added fields/props/etc after the existing ones. This is already implemented for fields. Props and Events will be part of a separate effort to implement reflection support for them. --- * Checkpoint. Infrastructure for added types * register member->parent lookups for newly-added classes and members * fix off by one error creating class from skeleton * AddNestedClass test works with mono now; also make it generic * checkpoint: adding properties it "works" but only because we don't look very hard for the new properties anywhere. reflection is probably pretty broken. * Add a property to AddNestedClass test * remove allow class/field/method/property ifdefs keep the instance field ifdef for now * add event to AddNestedClass * add DISALLOW_BROKEN_PARENT ifdef allow CustomAttribute row modifications to change Parent, while https://github.com/dotnet/roslyn/issues/60125 is being sorted out * checkpoint: adding events * Add new test ReflectionAddNewType * Add new types to the image name cache * Assembly.GetTypes and additional tests * Make nested types work * GetInterfaces on new types; also Activator.CreateInstance * Mark mono_class_get_nested_classes_property as a component API also mono_class_set_nested_classes_property * Add GetMethods, GetFields, GetMethod, GetField test * [class] Implement added method iteration Change the iterator from storing MonoMethod** values to storing an iteration count. For added methods, when the iteration count is more than mono_class_get_method_count, run through the hot reload added_members list and iterate over any relevant methods * Implement added field iteration * Add a GetField(BindingFlags.Static) test case * Add Enum.GetNames and GetProperties tests - not working yet * Mark mono_class_get_method_count as a component API also mono_class_get_field_count * Enum values work * Use GSList for added_fields (and props, events); add from_update bit Use GSList to simplify the concurrency story for accessing added_fields (and added_props and added_events, eventually): unlike a GPtrArray it won't resize, so we don't need to lock readers. Add a from_update bit to MonoProperty and MonoEvent - when props or events are added to existing classes, they will have the bit set. That means that pointer arithmetic to figure out the prop (or event) tokens won't be usable (since they're not allocated in one big block). * Reflection on props in new classes works * events on new classes work * Add CustomAttribute reflection test * remove test for props on existing type - it's not part of this PR * instance field additions to existing types aren't supported yet * rm TODO and FIXME * store prop and event from_update bit in attrs The upper 16 bits aren't used for ECMA flags, so grab a bit for metadata-update * remove instance fields from reflection test since Mono doesn't support them yet * make the Browser EAT lanes happy Add some fields to the baseline versions of some test assemblies to keep some types that are used in the deltas from getting trimmed away
-
由 Stephen Toub 提交于
-
由 Adeel Mujahid 提交于
In this scope, `__uint64_t` is not available on musl based systems. Switched to `guint64`, which nearby code is using.
-
由 Jakob Botsch Nielsen 提交于
-
由 Aaron Robinson 提交于
-
由 Elinor Fung 提交于
-
由 dotnet-maestro[bot] 提交于
Co-authored-by: Ndotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
-
由 Layomi Akinrinade 提交于
-
由 Steve 提交于
* Implement missing SymUnmanaged* interfaces * Add try-finally around GCHandle * Marshal interface argument to pinned pointer * Minor fixes * Address feedbacks from review
-
由 Jan Vorlicek 提交于
* Reimplement stubs to improve performance This change implements `FixupPrecodeStub`, `PrecodeStub` and `CallCountingStub` using a new mechanism with fixed code and separate RW data. The `LoaderHeap` was updated to support a new kind of allocation using interleaved code and data pages to support this new mechanism. The JIT now generates code that uses indirection slot to jump to the methods using `FixupPrecode`, improving performance of the ASPNet plaintext benchmark by 3-4% depending on the target platform (measured on x64 Windows / Linux and arm64 Linux). I have also removed the Holders, as the stubs are naturally properly aligned due to the way they are allocated. There is now only a single variant of each stub, there are no long / short ones anymore as they are not needed - the indirect jumps we use now are not range limited. Most of the stubs stuff is now target agnostic and the originally split implementation is now in single place for all targets. Only a few constants are defined as target specific in these. The code for the stubs is no longer generated as bytes by C++ code, but rather written in asm and compiled. These precompiled templates are then used as a source to copy the code from. The x86 is a bit more complex than that due to the fact that it doesn't support PC relative indirect addressing, so we need to relocate all access to the data slots when generating the code pages. As a further improvement, we could generate just a single page of the code and then just map it many times. This is left for future work. ARM64 Unix differs from the other targets / platforms - there are various page sizes being used. So the asm templates are generated for 4k..64k page sizes and the variant is then picked at runtime based on the page size extracted from the OS. This also removes a lot of writeable mappings created for modifications of the stub code when W^X is enabled, in the plaintext benchmark they were reduced by 75%. That results in a significant reducing of the .NET application startup time with W^X enabled. I think the `LoaderHeap` would benefit from some refactoring, but I'd prefer leaving it for a follow up. It seems that for the sake of the review, it is better to keep it as is. The change also implements logging of number of mappings and their exact locations. This helped me to drive the work and I am planning to use it for further changes. It can be removed in the future once we reach a final state. There are still opportunities for improvement, but these stubs allowed me to scrape off the most significant portion of the mappings.
-
由 Aaron Robinson 提交于
* Always append the "dll" extension for native libraries loads on Windows Due to case-sensitive file systems on Windows the runtime will now always append the ".dll" extension unless the name contains a trailing "." or a known loadable extensions. This is an attempt to mitigate the default Windows behavior that appends a ".DLL" which is rarely the casing used for Windows shared libraries. Co-authored-by: NJan Kotas <jkotas@microsoft.com>
-
由 Tanner Gooding 提交于
* Updating generic math interfaces to be implicitly implemented where possible * Resolve a build error in OdbcConnection caused by new Parse APIs * Revert "Resolve a build error in OdbcConnection caused by new Parse APIs" This reverts commit 6fd7ec7797cad7b28d381a695e84430c8d1081ae. * Suppress CA1846 for System.Data.Odbc * Updating the xml doc comments for exposed constants
-
由 Thays Grazia 提交于
* Fix incompatibility between runtime and nuget package * Update debug.ts
-
由 Thays Grazia 提交于
* Show the callstack as it's shown on net5. * Addressing @lewing and @radical comments. * addressing @lewing comment.
-
由 Natalia Kondratyeva 提交于
The additional trace should help troubleshoot hanged "pending" connection issues (i.e. the reasons why new connections were not created) in HttpConnectionPool. The issue manifests as growing number of timeouted requests. It is not easy to link a timeouted request (esp. with a small timeout) to a connection that was created 3 minutes ago but still is not connected. There are no traces of the state of HttpConnectionPool, e.g. number of pending connections, so it is unclear from existing traces why the pool decided not to create a connection. Related to #66297
-
由 Juan Hoyos 提交于
* Use managed sourcelink infrastructure to allow for win native sourcelink
-
由 Radek Zikmund 提交于
Temporarily disable HttpClientTest.GetContentAsync_WhenCanNotConnect_ExceptionContainsHostInfo on OSX (#66761)
-
由 Dan Moseley 提交于
-
由 Steve Dunn 提交于
-
- 17 3月, 2022 21 次提交
-
-
由 Kunal Pathak 提交于
* Preliminary changes * Add the missing push of ssadef * Fix an issue for call tree cloning * formatting * minor review comments incorporation * Make GT_CALL as full-def * Merge RenameCall into RenameDef * Fix DefinesLocalAddr and lateuse arg * Minor comments * fix the recently added code to account that GT_CALL can also have defintion: * clone the return buffer arg * Another round of review comments * Handle return buffer calls in optIsVarAssgCB * Update locals defined by calls in NodeInfo * Fix a case where arg can be putarg * Restructure the cases in GetLclRetBufArgNode() * move ivaMaskCall outside the condition * Add back to call for DoNotEnregister which was missed for Release builds * Retrieve the appropriate node in case of copyReload * Added an assert * remove assert and add comment
-
由 Stephen Toub 提交于
-
由 Alexander Köplinger 提交于
This was originally done in mono/mono to allow building both legacy and netcore, but we don't need this split anymore in dotnet/runtime.
-
由 Viktor Hofer 提交于
* Remove dotnet6 feeds dotnet7 feeds are currently the target feeds for the main branch. The dotnet6 feeds shouldn't be used anymore. * Update targetingpacks.targets * Update prebuilt package versions * Update NativeExports.csproj
-
由 Kunal Pathak 提交于
* Remove coverge of FeatureSIMD=0 * Remove COMPlus_FeatureSIMD flag * Remove isSacalarIsa() condition * Remove the flag from other places of VM
-
由 Aaron Robinson 提交于
* Reenable 4701 Co-authored-by: NJan Kotas <jkotas@microsoft.com>
-
由 dependabot[bot] 提交于
Co-authored-by: Ndependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
-
由 Jeremy Barton 提交于
The tracing is heavily focused on transient behaviors, like AIA/CRL/OCSP downloads and cache interactions. Things like applying ApplicationPolicy aren't really traced because that can be "easily" evaluated by looking at the certificates in isolation.
-
由 Jose Perez Rodriguez 提交于
-
由 Maksym Koshovyi 提交于
TFrame non null
-
由 Maksym Koshovyi 提交于
* First pass (src) * Update Microsoft.Extensions.Hosting.Abstractions.cs * Update HostBuilderContext * Values of Properties cannot be null
-
由 Jeremy Koritzinsky 提交于
-
由 Huo Yaoyuan 提交于
-
由 Tanner Gooding 提交于
* Moving "Generic Math" in box and making it no longer experimental * Removing an unused using from the generic math interfaces * Updating the ordering of the checked keyword for the commented out checked operators
-
由 Adam Sitnik 提交于
* don't try to call WaitNamedPipeW if we know that no instances exist and the sys-call will quit immediately * remove code duplication Co-authored-by: NStephen Toub <stoub@microsoft.com>
-
由 Jose Perez Rodriguez 提交于
Only move PRs to Done column on projects that already contain the PR when they are moved to a different area. (#66737)
-
由 Stephen Toub 提交于
The Regex span support changed the scanning infrastructure to always be based on spans. That means that when a string is passed in by the caller, internally we still operate on it as a span. That also means we can take advantage of slicing, and if the caller has specified via a beginning/length set of arguments that we should only process a substring, we can just slice to that substring. That, however, then means that all offsets computed by the scanning implementation are 0-based rather than beginning-based. The span change included a fixup for the overall match position, but not for the position of each individual capture, and that then meant that captures were providing the wrong values. We unfortunately didn't have any tests for validating groups that also involved non-0 beginnings with string inputs.
-
由 Dan Moseley 提交于
-
由 Johan Lorensson 提交于
https://github.com/dotnet/runtime/pull/66552 did incorrect switch to size_t from int in a sections that expects variable to go negative.
-
由 Adeel Mujahid 提交于
-
由 Stephen Toub 提交于
-