Skip to content

Commit

Permalink
Sync to head (#13)
Browse files Browse the repository at this point in the history
* Arm64 (#5)

* CoreRT-ARM64: Helper node asm code generation

* CoreRT ARM64: Add additional relocation support

* CoreRT ARM64: Use alternative functions for write Barriers

On ARM the Jit uses a special register interface for to call the write barrier functions. But as the regular once still used in other places we need two different implemenations. The helper nodes need to call the custom variants

* ARM64 code generation

* unwind use only the dwarf index option

* ARM64 runtime assembler functions

* ARM64 unix stack walk

* ARM64 Exception Handling

* ARM64: Fix EH data decodeing

* Move nattive layout signature from read only to data section on non Windows target

* Fix exception handling macro call

* ARM64 thunk helpers

* ARM64 process cfi data for elf

* ARM64 missing assembler macro

* ARM64 port more assembler helpers

* ARM64: Add missing case for the gemeric helper node

* ARM64 intrinsic support

* ARM64 object writer for ELF object files

* ARM64 llvm patches for object writer

* ARM64 include untested helper code with debug break

* ARM64 reenable scanning fail exception

* Arm64 (#6)

* CoreRT-ARM64: Helper node asm code generation

* CoreRT ARM64: Add additional relocation support

* CoreRT ARM64: Use alternative functions for write Barriers

On ARM the Jit uses a special register interface for to call the write barrier functions. But as the regular once still used in other places we need two different implemenations. The helper nodes need to call the custom variants

* ARM64 code generation

* unwind use only the dwarf index option

* ARM64 runtime assembler functions

* ARM64 unix stack walk

* ARM64 Exception Handling

* ARM64: Fix EH data decodeing

* Move nattive layout signature from read only to data section on non Windows target

* Fix exception handling macro call

* ARM64 thunk helpers

* ARM64 process cfi data for elf

* ARM64 missing assembler macro

* ARM64 port more assembler helpers

* ARM64: Add missing case for the gemeric helper node

* ARM64 intrinsic support

* ARM64 object writer for ELF object files

* ARM64 llvm patches for object writer

* ARM64 include untested helper code with debug break

* ARM64 reenable scanning fail exception

* ARM64 formating

* ARM64: revert using alternative JIT

* Revert "ARM64 unix stack walk"

This reverts commit 6c9e235.

* Arm64 (#7)

* CoreRT-ARM64: Helper node asm code generation

* CoreRT ARM64: Add additional relocation support

* CoreRT ARM64: Use alternative functions for write Barriers

On ARM the Jit uses a special register interface for to call the write barrier functions. But as the regular once still used in other places we need two different implemenations. The helper nodes need to call the custom variants

* ARM64 code generation

* unwind use only the dwarf index option

* ARM64 runtime assembler functions

* ARM64 unix stack walk

* ARM64 Exception Handling

* ARM64: Fix EH data decodeing

* Move nattive layout signature from read only to data section on non Windows target

* Fix exception handling macro call

* ARM64 thunk helpers

* ARM64 process cfi data for elf

* ARM64 missing assembler macro

* ARM64 port more assembler helpers

* ARM64: Add missing case for the gemeric helper node

* ARM64 intrinsic support

* ARM64 object writer for ELF object files

* ARM64 llvm patches for object writer

* ARM64 include untested helper code with debug break

* ARM64 reenable scanning fail exception

* ARM64 formating

* ARM64: revert using alternative JIT

* Revert "ARM64 unix stack walk"

* ARM64 review reworks

* Arm64: review reworks (#10)

* Arm64 (#11)

* ARM64: remove left over code

* Update src/Native/Runtime/arm64/WriteBarriers.S

* Sync to head (#12)

* Fix alignment of marshaled inline arrays (dotnet#8275)

Fixes dotnet#8274

* Correct flags for allocating in RhpNewFastMisalign.  Add fast path (dotnet#8277)

* add switch case for LPUTF8Str in array element (dotnet#8278)

* Wasm: Add support for DefaultConstructorOf and hence Activator.CreateInstance<T> (dotnet#8279)

* Wasm: upgrade emscripten for an llvm and exception fixes. (dotnet#8281)

* upgrade emscripten for some llvm and exception fixes.

Correct retrieval of exception from landing pad.
end c++ exception when catch found.

* Update ILToWebAssemblyImporter.cs

remove cut/past comment

* Wasm: add support for new StackTrace().ToString() (dotnet#8201)

* wasm add rethrow support (dotnet#8206)

* Wasm: add support for overflow checks on signed and unsigned ints multiply (dotnet#8259)

* wasm-ovf-unsigned-int

* refactor for stack kind tests and add signed check

* use llvm intrinsics

* Wasm: bring add and sub overflow operations in line with mul (dotnet#8284)

* Support for ARM64 on UNIX like systems compiler and runtime (dotnet#8271)

* CoreRT-ARM64: Helper node asm code generation

* CoreRT ARM64: Add additional relocation support

* CoreRT ARM64: Use alternative functions for write Barriers

On ARM the Jit uses a special register interface for to call the write barrier functions. But as the regular once still used in other places we need two different implementations. The helper nodes need to call the custom variants

* ARM64 code generation

* unwind use only the dwarf index option

* ARM64 runtime assembler functions

* ARM64 unix stack walk

* ARM64 Exception Handling

* ARM64: Fix EH data decoding

* Move native layout signature from read only to data section on non Windows target

* Fix exception handling macro call

* ARM64 thunk helpers

* ARM64 process cfi data for elf

* ARM64 missing assembler macro

* ARM64 port more assembler helpers

* ARM64: Add missing case for the generic helper node

* ARM64 intrinsic support

* ARM64 object writer for ELF object files

* ARM64 llvm patches for object writer

* ARM64 include untested helper code with debug break

* ARM64 reenable scanning fail exception

* ARM64 Fix wrong function call for invoke return

* ARM64: Ensure module fixup node data is aligned

Data is updated with a compare exchange operation. Therefore it needs to be aligned or it will trigger a data exception on ARM64 CPUs

* Wasm fix LLVM Debug Information subroutine linkage (dotnet#8288)

* wasm - reinstate llvm debug subroutine linkage

Co-authored-by: Jan Kotas <[email protected]>
Co-authored-by: yowl <[email protected]>

Co-authored-by: Jan Kotas <[email protected]>
Co-authored-by: yowl <[email protected]>
  • Loading branch information
3 people authored Aug 28, 2020
1 parent a36ba2f commit 89933a9
Show file tree
Hide file tree
Showing 13 changed files with 710 additions and 207 deletions.
2 changes: 1 addition & 1 deletion Documentation/how-to-build-WebAssembly.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Build WebAssembly on Windows ##

1. Install Emscripten by following the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html).
2. Follow the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#updating-the-sdk) to update Emscripten to 1.39.19 ```./emsdk install 1.39.19``` followed by ```./emsdk activate 1.39.19```
2. Follow the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#updating-the-sdk) to update Emscripten to 2.0.1 ```./emsdk install 2.0.0``` followed by ```./emsdk activate 2.0.0```
3. Install [Firefox](https://www.getfirefox.com) (for testing).
3. Get CoreRT set up by following the [Visual Studio instructions](how-to-build-and-run-ilcompiler-in-visual-studio.md).
4. Build the WebAssembly runtime by running ```build.cmd wasm``` from the repo root.
Expand Down
6 changes: 3 additions & 3 deletions eng/install-emscripten.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ git clone https://github.com/emscripten-core/emsdk.git

cd emsdk
rem checkout a known good version to avoid a random break when emscripten changes the top of tree.
git checkout dec8a63
git checkout c1f0ad9

powershell -NoProfile -NoLogo -ExecutionPolicy ByPass -command "& """%~dp0update-machine-certs.ps1""" %*"

rem Use the python that is downloaded to native-tools explicitly as its not on the path
call "%1"\..\native-tools\bin\python3 emsdk.py install 1.39.19
call "%1"\..\native-tools\bin\python3 emsdk.py install 2.0.0
if %errorlevel% NEQ 0 goto fail
call emsdk activate 1.39.19
call emsdk activate 2.0.0
if %errorlevel% NEQ 0 goto fail

exit /b 0
Expand Down
12 changes: 12 additions & 0 deletions src/Common/src/TypeSystem/Interop/IL/InlineArrayType.Sorting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,17 @@ protected internal override int CompareToImpl(MethodDesc other, TypeSystemCompar
return comparer.CompareWithinClass(OwningType, otherMethod.OwningType);
}
}

partial class InlineArrayField
{
protected internal override int ClassCode => 1542668652;

protected internal override int CompareToImpl(FieldDesc other, TypeSystemComparer comparer)
{
var otherField = (InlineArrayField)other;

return comparer.CompareWithinClass(OwningType, otherField.OwningType);
}
}
}
}
107 changes: 103 additions & 4 deletions src/Common/src/TypeSystem/Interop/IL/InlineArrayType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Internal.TypeSystem.Interop
{
internal partial class InlineArrayType : MetadataType
internal sealed partial class InlineArrayType : MetadataType
{
public MetadataType ElementType
{
Expand Down Expand Up @@ -132,7 +132,8 @@ public override TypeSystemContext Context
}

private InteropStateManager _interopStateManager;
private MethodDesc [] _methods;
private MethodDesc[] _methods;
private FieldDesc[] _fields;

public InlineArrayType(ModuleDesc owningModule, MetadataType elementType, uint length, InteropStateManager interopStateManager)
{
Expand Down Expand Up @@ -250,13 +251,25 @@ public MethodDesc GetInlineArrayMethod(InlineArrayMethodKind kind)
return _methods[(int)kind];
}

private void InitializeFields()
{
// The inline array will inherit alignment from the dummy field
FieldDesc[] fields = new FieldDesc[] {
new InlineArrayField(this)
};

Interlocked.CompareExchange(ref _fields, fields, null);
}
public override IEnumerable<FieldDesc> GetFields()
{
return Array.Empty<FieldDesc>();
if (_fields == null)
{
InitializeFields();
}
return _fields;
}

private partial class InlineArrayMethod : ILStubMethod
private sealed partial class InlineArrayMethod : ILStubMethod
{
private InlineArrayType _owningType;
private InlineArrayMethodKind _kind;
Expand Down Expand Up @@ -374,7 +387,93 @@ public override MethodIL EmitIL()

codeStream.Emit(ILOpcode.ret);
return emitter.Link(this);
}
}

private sealed partial class InlineArrayField : FieldDesc
{
private InlineArrayType _owningType;

public override TypeSystemContext Context
{
get
{
return _owningType.Context;
}
}

public override TypeDesc FieldType
{
get
{
return _owningType.ElementType;
}
}

public override bool HasRva
{
get
{
return false;
}
}

public override bool IsInitOnly
{
get
{
return false;
}
}

public override bool IsLiteral
{
get
{
return false;
}
}

public override bool IsStatic
{
get
{
return false;
}
}

public override bool IsThreadStatic
{
get
{
return false;
}
}

public override DefType OwningType
{
get
{
return _owningType;
}
}

public override bool HasCustomAttribute(string attributeNamespace, string attributeName)
{
return false;
}

public override string Name
{
get
{
return "InlineArrayField";
}
}

public InlineArrayField(InlineArrayType owningType)
{
_owningType = owningType;
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/Common/src/TypeSystem/Interop/IL/MarshalHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,8 @@ private static MarshallerKind GetArrayElementMarshallerKind(
return MarshallerKind.AnsiString;
case NativeTypeKind.LPWStr:
return MarshallerKind.UnicodeString;
case NativeTypeKind.LPUTF8Str:
return MarshallerKind.UTF8String;
default:
return MarshallerKind.Invalid;
}
Expand Down
Loading

0 comments on commit 89933a9

Please sign in to comment.