Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Merge master to nmirror - #1227

Merged
jkotas merged 97 commits into
nmirrorfrom
master
May 2, 2016
Merged

jkotas merged 97 commits into
nmirrorfrom
master

Conversation

@jkotas

@jkotas jkotas commented May 2, 2016

Copy link
Copy Markdown
Member

No description provided.

MichalStrehovsky and others added 30 commits April 6, 2016 17:28
Found this with CoreCLR tests. The logic that special cases the
delegates expects resolvedCallVirt to be set, but we were never setting
it for this case. This pattern was copied from CoreCLR JitInterface and
it puzzles me as to how it could possibly work there.

We ended up asking for a ReadyToRun helper to resolve the virtual call
even though the method was not virtual.
Set resolvedCallvirt if virtual method can be resolved at compile time
Linux
Add a linker script which controls how sections are merged to group together module header indirection cells. This allows the ReadyToRun headers to be collated and iterated at start up. The updated CLI looks for a file named "linkerscript" in the CoreRT SDK folder and passes it to the linker on Unix platforms if so.

Remove work-around for Unix from ModulesSectionNode that was inserting symbols for __modules_a and __modules_z which are now consumed from those defined in main.cpp and linked in from libbootstrapper.a

OSX
On Windows / Linux each compiled object file contains a section, .Modules$I, which has a pointer to the ReadyToRun header describing the module's global data. The linker on those platforms collects all object file .Modules$I sections and sandwiches them between two other sections:.Modules$A and .Modules$Z in which we store sentinel symbols available at runtime to iterate the list of ReadyToRun headers.

On OSX the linker doesn't support this model. Instead, a MachO section with the type S_MOD_INIT_FUNC_POINTERS can be created. In that section, place a function pointer. At binary load time, the OS loader will scan for these sections and call all functions in them. Introduce a jump thunk in the compiler that carries the ReadyToRun header address in it. At runtime, it calls a native helper which collects all headers and passes them to the regular startup code.
Merge ReadyToRun header pointers on Unix platforms
Cleanup jitinterface getCallInfo
Set nostackexec and stack-protector options
Merged CoreCLR fix for C compilation warning in index_of_set_bit.
Fix compilation warning C4334
Fix invalid declaration of DefineConstants
Use CoreRT dir.props settings for Debug/Release configuration
Remove useless creation of a new temp name
As the comment above the line I'm changing states - the first argument
passed to C main() doesn't exist on the managed side. We need to shift
everything by one.

The logic to do that was lost at some point.
Stop passing executable name on the command line
* An attempt to get CoreCLR tests off the floor

* Update issues.targets
jkotas and others added 28 commits April 22, 2016 17:47
Type system support for answering questions about whether a type
can be cast to another type, along with unit tests.

I largely ported the C++ code from the Project N compiler to C#. The only
divergence is in the handling of casting arrays to System.Array and array
interfaces. We won't use the "treat it as `Array<T>`" wart in CoreRT.
The unit tests are all new because there were none.

I'm also adding a few convenience properties to the type system, stolen
from the Project N compiler type system:

* A few new `HasXXX` and `IsXXX` shortcuts on `GenericParameterDesc`. Makes code much more readable.
* `IsGenericParameter` and `IsDefType` on `TypeDesc`. This brings the existing `IsArray`, `IsPointer` etc. to completion.
* `HasVariance` on `TypeDesc`. This is a cached answer to whether a type has variance. It lets us quickly decide if we need to do the slow things.
* New SzArray TypeFlag
- Rename references to ryujit to clrjit
- Add verification of JIT-EE interface revision
- Add .bat file to automate generation of JIT-EE interface wrapper
C# compiler only emits those if the return parameter has field marshal
info and it's useless for what we're using it for.
Add ubuntu.14.04-x64 and osx.10.10-x64 to list of supported runtimes.
This change is to emit the new rare fields within the EEType so that at
runtime, we can perform variant interface calls (example: call
`IEnumerable<object>.GetEnumerator()` on `string[]`).

The second part forces generation of methods
declaring/implementing variant interfaces. The analysis
of which ones are actually needed is rather involved
and we might choose to do that at a later time.
This has been broken since the introduction of `CppCodeGen.h`.
- Update CLI to more recent version
- Remove last dependency on mono
- Update Microsoft.DotNet.AppDep version to 00004 that has stubbed out System.Resources.ResourceManager
My fix in #1127 fixed arguments to `Main` but broke
`Environment.GetCommandLine`. Make sure both work this time...
* Make Environment.GetCommandLineArgs work

My fix in #1127 fixed arguments to `Main` but broke
`Environment.GetCommandLine`. Make sure both work this time...

* Make Hello world test command line args
Get Activator.CreateInstance working for value types
`File.Create` will open an overlapped handle which is really
unnecessary.
BaseSize should report the boxed size of the type instance for value
types.

InstanceByteCount returns the number of bytes that would be reported by
the sizeof() operator. This doesn't include the one inherited field from
System.Object. That field is present when the type is boxed and needs to
be accounted for.
Set the expected flag and skip emitting fields that don't make sense for
generic type definitions.
By "working" I mean let reflection find out information about the
generic composition of the type.

Two parts:
* Implement TryGetConstructedGenericTypeComponents mapping table service
as a call into an existing runtime method (this works because EEType now
contains the composition information as of last week).
* Emit metadata and mapping table entries for components of generated
generic instances.
Dependency nodes always use referential equality. Trying to provide
other semantics would break the dependency analysis engine, so let's
forbid that.
This was falling back to the runtime supplied implementation which has
pretty bad perf characteristics.

Also made the fields read only and implemented IEquatable for good
measure.
Add exported native callable methods as compilation roots
Seal Equals and GetHashCode on DependencyNode
This is not exercised yet because we lie about thread statics not being
thread static, but we will hit it at some point (I hit it when testing
GC maps for them).
Use IsXXX properties in lieu of "is XXX" checks.

Also, downgrade "is MetadataType" to "IsDefType" where it makes sense.
Avoid defensive copy in String.Concat(string[])
#1225)

I hit this in #1212 when I started prefixing EEType nodes with GCDesc.
We can either emit a useless symbol for the GCDesc, or merge this
change.
@jkotas
jkotas merged commit 4b27289 into nmirror May 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.