platform/upstream/dotnet/runtime.git
4 years agoMerge branch 'master' into af/duplicate-socket
Anton Firszov [Wed, 22 Jan 2020 13:13:54 +0000 (14:13 +0100)]
Merge branch 'master' into af/duplicate-socket

4 years agoDo not run validation on runtime determined types (#1357)
Michal Strehovský [Wed, 22 Jan 2020 09:14:45 +0000 (10:14 +0100)]
Do not run validation on runtime determined types (#1357)

It doesn't seem like we validate anything for those and `IsRuntimeDeterminedSubtype` check is rather expensive.

4 years agoUnify char.IsControl and Rune.IsControl (#1988)
Levi Broderick [Wed, 22 Jan 2020 08:25:22 +0000 (00:25 -0800)]
Unify char.IsControl and Rune.IsControl (#1988)

Not perf-critical, just some cleanup of low hanging fruit.

4 years agoUnify CoreLib interop files (#1914)
Jan Kotas [Wed, 22 Jan 2020 04:49:54 +0000 (20:49 -0800)]
Unify CoreLib interop files (#1914)

- Unify more of CoreLib interop files
- Replace manual interop with regular managed APIs where possible
- Delete unused code

Contributes to #1232

4 years agoRebased version of CoreFX renames (#1941)
Erhan Atesoglu [Wed, 22 Jan 2020 04:05:51 +0000 (20:05 -0800)]
Rebased version of CoreFX renames (#1941)

* FinalCoreFXRenames

The last of the CoreFX renames.

* Update DirectorySearcher.cs

Fixed typo in DirectorySearcher.cs

* Update TestClasses.SimpleTestClassWithObjectArrays.cs

This fixes the expected value of the tests to runtime, instead of corefx.

* Update PersistedFiles.Names.Unix.cs

Adds a note to not update the corefx reference.

4 years agoEven faster modulo computation: remove one of the three multiplications. (#406)
Anton Lapounov [Wed, 22 Jan 2020 03:58:05 +0000 (19:58 -0800)]
Even faster modulo computation: remove one of the three multiplications. (#406)

4 years ago**BYPASS_SECRET_SCANNING**
Davis Goodin [Wed, 22 Jan 2020 02:01:38 +0000 (20:01 -0600)]
**BYPASS_SECRET_SCANNING**

4 years agoFix long name cross arch DAC (#1948)
Mike McLaughlin [Wed, 22 Jan 2020 00:38:26 +0000 (16:38 -0800)]
Fix long name cross arch DAC (#1948)

4 years agoWorkaround AzDo issue when evaluating Build.SourcesDirectory variable in a docker...
Santiago Fernandez Madero [Tue, 21 Jan 2020 23:58:30 +0000 (17:58 -0600)]
Workaround AzDo issue when evaluating Build.SourcesDirectory variable  in a docker container (#1982)

* Workaround AzDo issue when evaluating Build.SourcesDirectory variable in a docker container

* Only use env var when in a docker container

4 years agoMake EHInfo parsing lazy (#1899)
Andrew Au [Tue, 21 Jan 2020 23:56:12 +0000 (15:56 -0800)]
Make EHInfo parsing lazy (#1899)

4 years agoEliminate X509Extension allocations during ssl handshake with OpenSSL
Tomas Weinfurt [Tue, 21 Jan 2020 22:53:53 +0000 (14:53 -0800)]
Eliminate X509Extension allocations during ssl handshake with OpenSSL

Moves policydata to a PAL struct so it can be passed without creating and discarding the X509Extension objects.

4 years agoRemove unwanted instrumentation code (#1820)
Andrew Au [Tue, 21 Jan 2020 22:40:43 +0000 (14:40 -0800)]
Remove unwanted instrumentation code (#1820)

4 years agoMaking the Microsoft.NET.IL.Sdk cross target. (#1972)
Anirudh Agnihotry [Tue, 21 Jan 2020 21:38:18 +0000 (13:38 -0800)]
Making the Microsoft.NET.IL.Sdk cross target. (#1972)

* making ilsdk crosstarget

* editing the comment

4 years agoRename CLR_CMAKE_PLATFORM* CLR_CMAKE_HOST* (#1974)
Steve MacLean [Tue, 21 Jan 2020 20:36:37 +0000 (15:36 -0500)]
Rename CLR_CMAKE_PLATFORM* CLR_CMAKE_HOST* (#1974)

The term platform was ambiguous. Migrate to using common terminology for
cross compilation.

Host is the platfrom which will execute the code
Target is the platform which will be debugged or for which code will be generated.

In most cases HOST == TARGET.  The exceptions are the cross component crossgen
tools and the future cross DAC.

4 years agoenable unicode tests on OSX (#1728)
Tomas Weinfurt [Tue, 21 Jan 2020 20:29:24 +0000 (12:29 -0800)]
enable unicode tests on OSX (#1728)

4 years agoStreamline Regex path to matching, and improve Replace/Split (#1950)
Stephen Toub [Tue, 21 Jan 2020 20:14:00 +0000 (15:14 -0500)]
Streamline Regex path to matching, and improve Replace/Split (#1950)

* Add ThrowHelper, and clean up some style

Trying to streamline main path to the engine, ensuring helpers can be inlined, reducing boilerplate, etc.  And as long as ThrowHelper was being used in some places, used it in others where it didn't require adding additional methods.

Also cleaned style along the way.

* Streamline the Scan loop

The main costs remaining are the virtual calls to FindFirstChar/Go.

* Enumerate matches with a reusable match object in Regex.Replace/Split

The cost of re-entering the scan implementation and creating a new Match object for each NextMatch is measurable, but in these cases, we can use an iterator to quickly get back to where we were and reuse the match object.  It adds a couple interface calls per iteration, as well as an allocation for the enumerator, but it saves more than that in the common case.

* Use SegmentStringBuilder instead of ValueStringBuilder in Replace

A previous .NET Core release saw StringBuilder in Regex.Replace replaced by ValueStringBuilder.  This was done to avoid the allocations from the StringBuilder.  However, in some ways, for large input strings, it made things worse.  StringBuilder is implemented as a linked list of builders, whereas ValueStringBuilder is contiguous memory taken from the ArrayPool.  For large input strings, we start requesting buffers too large for the ArrayPool, and thus when we grow we generate large array allocations that become garbage.

We're better off using a simple arraypool-backed struct to store the segments that need to be concatenated, and then just creating the final string from those segments.  For the common case where there are many fewer replacements than the length of the string, this saves a lot of memory as well as avoiding a layer of copying.

* Replace previously added enumerator with a callback mechanism

The delegate invocation per match is faster than the two interface calls per match, plus we can avoid allocating the enumerator and just pass the relevant state through by ref.

* Remove unnecessary fields from MatchCollection

* More exception streamlining and style cleanup

* Address PR feedback, and fix merge with latest changes

4 years agoOptimize DateTime decomposition in CoreLib (#1944)
ts2do [Tue, 21 Jan 2020 20:01:36 +0000 (14:01 -0600)]
Optimize DateTime decomposition in CoreLib (#1944)

* Optimize DateTime decomposition in CoreLib
Add uses of DateTime.GetDate (renamed from GetDatePart) where appropriate
Add DateTime.GetTime method to eliminate duplicate computations

* Remove unused arithmetic from DateTime.GetTime

4 years agoWinHttpHandler tests are back (#1676)
Marie Píchová [Tue, 21 Jan 2020 18:55:08 +0000 (19:55 +0100)]
WinHttpHandler tests are back (#1676)

The tests used by PlatformHandlerTest moved to Common/tests in order to share them between System.Net.Http and System.Net.Http.WinHttpHandler.
The added conditions correspond to the state before WinHttpHandler removal. They're just based on IsWinHttpHandler instead of UseSocketHandler.
Some of the code must be conditionally compiled since there is no usable common base class for HttpClientHandler and WinHttpHandler. Other issues solved by introducing WinHttpClientHandler for testing purposes. It corresponds to HttpClientHandler.Windows.cs code from before its removal.

4 years agoFix typo (#1970)
Gérald Barré [Tue, 21 Jan 2020 18:10:07 +0000 (13:10 -0500)]
Fix typo (#1970)

4 years agoRemove try-catch from SmtpClient.Abort to see what Exceptions get caught. (#428)
Tom Deseyn [Tue, 21 Jan 2020 18:07:25 +0000 (19:07 +0100)]
Remove try-catch from SmtpClient.Abort to see what Exceptions get caught. (#428)

4 years agoSpecialize Regex codegen for ? (#1898)
Stephen Toub [Tue, 21 Jan 2020 17:34:20 +0000 (12:34 -0500)]
Specialize Regex codegen for ? (#1898)

We're currently generating the code for a one / not one / set ? quantifier (zero-or-one) as a loop, when it can actually just be a conditional check.  This adds a special path for that case.

(I've also added another reduction test for alternation, and tweaked the codegen for a successful match to touch fields less.)

4 years agoJIT: check that constant handles are not OK2_CONST_LONGs (#1831)
Andy Ayers [Tue, 21 Jan 2020 16:08:19 +0000 (08:08 -0800)]
JIT: check that constant handles are not OK2_CONST_LONGs (#1831)

Follow-up from #1788.

Add padding to `AssertionDsc` so that the `iconFlags` no longer overlap with `lconVal`. Assert that `iconFlags` is never set for an O2K_CONST_LONG assertion.

Also remove an arm-only handle block that should now be redundant.

4 years ago[Docs] Fix small typo (#1961)
Maxim Lipnin [Tue, 21 Jan 2020 15:13:49 +0000 (18:13 +0300)]
[Docs] Fix small typo (#1961)

4 years agoremove swallowing in Socket(SocketInformation)
Anton Firszov [Tue, 21 Jan 2020 13:18:37 +0000 (14:18 +0100)]
remove swallowing in Socket(SocketInformation)

4 years agoCleanup regex diagnostic output (#1947)
Dan Moseley [Tue, 21 Jan 2020 11:54:38 +0000 (03:54 -0800)]
Cleanup regex diagnostic output (#1947)

* Include actual pattern in diagnostic output

* Fix char category name in diagnostic output

* Tighten Boyer Moore debug output

* Clean up diagnostic output from RegexCode and RegexNode

* Apply suggestions from code review

Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* more

* display options and timeout

* Some random nits

* Update src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexBoyerMoore.cs

Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Github typo

Co-authored-by: Stephen Toub <stoub@microsoft.com>
4 years agoDelete outdated comment (#1952)
Jan Kotas [Tue, 21 Jan 2020 10:14:43 +0000 (02:14 -0800)]
Delete outdated comment (#1952)

4 years agoReadme for regex implementation (#1945)
Dan Moseley [Tue, 21 Jan 2020 04:41:13 +0000 (20:41 -0800)]
Readme for regex implementation (#1945)

* Readme for regex implementation

* typo

* Update src/libraries/System.Text.RegularExpressions/src/dotnet-regular-expressions.md

Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Text.RegularExpressions/src/dotnet-regular-expressions.md

Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Text.RegularExpressions/src/dotnet-regular-expressions.md

Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Text.RegularExpressions/src/dotnet-regular-expressions.md

Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Text.RegularExpressions/src/dotnet-regular-expressions.md

Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Text.RegularExpressions/src/dotnet-regular-expressions.md

Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Text.RegularExpressions/src/dotnet-regular-expressions.md

Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Updates

* More

* note

* rename

Co-authored-by: Stephen Toub <stoub@microsoft.com>
4 years agoFix documentation of R2R inline tracking map (#1942)
Michal Strehovský [Mon, 20 Jan 2020 23:51:44 +0000 (00:51 +0100)]
Fix documentation of R2R inline tracking map (#1942)

Don't want this to show up as a confusing diff when we upgrade the format later. Version is _not_ included in the format. We will need to key off the R2R version.

4 years agoDelete unnecessary clone of the assembly name (#1936)
Jan Kotas [Mon, 20 Jan 2020 18:26:48 +0000 (10:26 -0800)]
Delete unnecessary clone of the assembly name (#1936)

4 years agoCleanup double initialized fields in SPC (#1935)
Marek Safar [Mon, 20 Jan 2020 18:26:23 +0000 (19:26 +0100)]
Cleanup double initialized fields in SPC (#1935)

4 years agofix path for Interop.WSADuplicateSocket.cs
Anton Firszov [Mon, 20 Jan 2020 17:17:55 +0000 (18:17 +0100)]
fix path for Interop.WSADuplicateSocket.cs

4 years agoInitial pass on updating documentation to include MonoVM (#1863)
Marek Safar [Mon, 20 Jan 2020 15:50:07 +0000 (16:50 +0100)]
Initial pass on updating documentation to include MonoVM (#1863)

* Update documentation to cover also Mono runtime

* Updated requirements for mac and linux to include mono's

* Update System.Private.CoreLib/src/README.md

* Added initial mono building doc

* Added library testing steps for mono

* A bit of rewording based on feedback

* Add some scripts coloring

4 years agoDelete unnecessary defines from CoreCLR tests (#1922)
Jan Kotas [Sun, 19 Jan 2020 21:15:41 +0000 (13:15 -0800)]
Delete unnecessary defines from CoreCLR tests (#1922)

- PROJECK, STATIC, CORECLR
- Delete NoLogo
- Delete duplicate Exceptions/Finalization/Finalizer test
- Delete workaround for LLILC JIT

4 years agoMerge pull request #1912 from mono/consolidation
Alexander Köplinger [Sun, 19 Jan 2020 19:38:52 +0000 (20:38 +0100)]
Merge pull request #1912 from mono/consolidation

This adds the Mono runtime sources including the full history and some initial build system integration.

4 years agoDelete outdated workaround (#1921)
Jan Kotas [Sun, 19 Jan 2020 18:31:51 +0000 (10:31 -0800)]
Delete outdated workaround (#1921)

4 years agoAdd support for preserve references on JSON (#655)
David Cantu [Sun, 19 Jan 2020 00:40:36 +0000 (16:40 -0800)]
Add support for preserve references on JSON (#655)

* Initial commit for JSON reference handling / preserve references

* Remove ReferenceHandling.Ignore option

* Code clean-up.

* Remove stale tests.

* Address PR feedback

* Reference handling inline (#1)

* Inline ReferenceHandling logic within main methods.

* remove stale Handle*Ref methods

* Refactor the code for Deserialization
* Create methods to reuse code
* Try to isolate Preserve logic as much as I can
* Replaced Exceptions for ThrowHelper methods

* Remove stale condition on $ref

* Add AggressiveInlining to HandlePropertyNameDefault

* Inline feature code in Serialization

* Fix preserve references for ExtensionData

* Split Reference dictionary into two, for (De)Serialize each.
Add Reference EqualityComparer to Serialize dictionary.

* Do not set PropertyName to s_missingProperty to avoid race condition issues.

* Remove Asserts that compare against an exception message.

* Set preserved array passing setPropertyDirectly = true to avoid issue when enumerable is already initialized.

* Code clean-up.

* Separate write code into WritePreservedObject and WriteReferenceObject

* Address some PR feedback:
* Switched ReferenceResolver to access it through a read-only property that initializes it the first time is tried to be accesed.
* Renamed some methods and properties
* Refactored WriteReference* methods.
* Fixed Exception messages
* Removed literal message comparison on tests.

* * Add round-tripping coverage to suitable unit tests
* Fix issues found with Round-tripping scenarios
  * Move DictionaryPropertyIsPreserved to EndProperty() in order to fix issue where two dictionary properties were next to each other and the DictionaryPropertyIsPreserved was not reset.
  * Add ReadStackFrame.IsNestedPreservedArray in order to identify preserved arrays nested and prevent using setPropertyDirectly on them.

* Add nullability annotations

* Code clean-up, reword comments and removed unnecesary properties in ReferenceHandling

* Fix issue where an object that tries to map into an enumerable could skip the validation that prevents this.

* Fix issue where the wrong type was passed into the throw helper for nested enumerable in HandleStartObject

* Address PR comments.

* Refactor flags on ReadStackFrame to avoid using unrelated fields for validation.

* Consolidated MetadataPropertyName enum logic on read and write.

* Reuse HandleStartObjectInEnumerable to handle arrays with metadata nested in a Dictionary.

* Refactor code:
* Change ReferenceResolver from class to struct to avoid one allocation.
* Replace propertyName.ToArray() for constant arrays in order to avoid allocation.

* Move some exception logic to the ThrowHelper class.

* * Apply optimizations:
  * Use PropertyCacheArray on Values property lookup.
  * Make Comparer static field to avoid one allocation at runtime.
* Document reasoning for DefaultReferenceResolver and ReferenreEqualsEqualityComparer

* Address PR comments.

* Addres more PR feedback:
* Add documentation to DefaultReferenceResolver public methods.

* Address PR feedback.

* Adderss more PR suggestions.

* * Move tests to Serialization namespace.
* On $values, set PropertyName on state.Current.JsonPropertyName instead.

4 years agoContributing: fixed some typos (#1905)
Maher Jendoubi [Sun, 19 Jan 2020 00:32:21 +0000 (01:32 +0100)]
Contributing: fixed some typos (#1905)

4 years agoMerge remote-tracking branch 'upstream/master' into consolidation
Alexander Köplinger [Sat, 18 Jan 2020 23:54:54 +0000 (00:54 +0100)]
Merge remote-tracking branch 'upstream/master' into consolidation

4 years agoAdd option to select Mono as the testhost runtime with the `/p:TestRuntimeFlavor...
Alexander Köplinger [Sat, 18 Jan 2020 17:00:01 +0000 (18:00 +0100)]
Add option to select Mono as the testhost runtime with the `/p:TestRuntimeFlavor=Mono` property

4 years agoTemporarily disable Mono from default subset categories
Alexander Köplinger [Sat, 18 Jan 2020 17:00:01 +0000 (18:00 +0100)]
Temporarily disable Mono from default subset categories

4 years agoExtract methods from Cng.cs to Interop.*.cs
Robert Matusewicz [Sat, 18 Jan 2020 22:19:29 +0000 (23:19 +0100)]
Extract methods from Cng.cs to Interop.*.cs

* Extract BCryptImportKey from Cng.cs to Interop.BCryptImportKey.cs
* Extract BCryptEncrypt and BCryptDecrypt from BCryp/Cng.cs into Interop.BCryptEncryptDecrypt.cs

4 years agoMore renames of full framework to .NET Framework (#1900)
Jan Kotas [Sat, 18 Jan 2020 19:04:59 +0000 (11:04 -0800)]
More renames of full framework to .NET Framework (#1900)

* More renames of full framework to .NET Framework

* Apply suggestions from code review

Co-Authored-By: Stephen Toub <stoub@microsoft.com>
4 years agoMake Mono build in dotnet/runtime
Alexander Köplinger [Sat, 18 Jan 2020 17:00:01 +0000 (18:00 +0100)]
Make Mono build in dotnet/runtime

Also add packaging project for Microsoft.NETCore.Runtime.Mono.

4 years agoAdd new .gitignore for Mono
Alexander Köplinger [Sat, 18 Jan 2020 17:00:01 +0000 (18:00 +0100)]
Add new .gitignore for Mono

4 years agoDelete DESKTOP define in CoreCLR tests (#1901)
Jan Kotas [Sat, 18 Jan 2020 15:43:07 +0000 (07:43 -0800)]
Delete DESKTOP define in CoreCLR tests (#1901)

4 years agoMerge branch 'master' of mono
dotnet-bot [Sat, 18 Jan 2020 10:20:09 +0000 (05:20 -0500)]
Merge branch 'master' of mono

4 years agoAddress more issue numbers in the code (#1888)
Stephen Toub [Sat, 18 Jan 2020 08:52:17 +0000 (03:52 -0500)]
Address more issue numbers in the code (#1888)

* Address more issue numbers in the code

Replaced a bunch of unadorned issue numbers with links, so we know which repo the issue is for.  In some cases the repo was named, but for consistency I still replaced it with a link.

In some cases, in particular where the issue had been closed saying effectively "we're not going to do anything here", I removed TODOs and the associated issue numbers.

In a few cases, the TODO and issue number was to say "we should do X when Y is fixed", so I did X since Y was fixed.

* Apply suggestions from code review

Co-Authored-By: Jan Kotas <jkotas@microsoft.com>
* Address PR feedback

* Fix OrderedEnumerable by using MemoryExtensions.Sort

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
4 years ago[testing] Update TraceEvent package version and bypass corner case in EventPipe ...
John Salem [Sat, 18 Jan 2020 07:11:55 +0000 (23:11 -0800)]
[testing] Update TraceEvent package version and bypass corner case in EventPipe (#1794)

* Update TraceEvent package version

* Workaround for deadlock in EventPipe
* Remove this change once the fix has be made

* Force the event source to be created

4 years agoFix RepoRoot to always have a directory terminator at the end (#1893)
Jeremy Koritzinsky [Sat, 18 Jan 2020 06:02:09 +0000 (22:02 -0800)]
Fix RepoRoot to always have a directory terminator at the end (#1893)

* Make sure RepoRoot ends with a directory terminator.

* Use MSBuild::EnsureTrailingSlash

4 years agoImprove Regex codegen for negated / non-ASCII sets (#1799)
Stephen Toub [Sat, 18 Jan 2020 03:33:46 +0000 (22:33 -0500)]
Improve Regex codegen for negated / non-ASCII sets (#1799)

* Improve Regex codegen for negated sets

Given a set like `[ace]`, we currently generate a check along the lines of:
```C#
bool match = (uint)ch < 128 && asciiLookup[ch];
```
However, if there are any non-ASCII characters in the set, e.g. with `[ac\u1234]`, we need generate a non-ASCII fallback that does the full character set check:
```C#
bool match = (uint)ch < 128 ? asciiLookup[ch] : RegexRunner.CharInClass(ch, "...setstring");
```

This PR cleans that up and handles several additional cases to have a better fallback when possible.
- If we detect that the character class contains _only_ non-ASCII, such as would be the case with some of the named Unicode sets, then we generate the equivalent of `ch >= 128 && CharInClass(ch, "...")`.
- If we detect that every ASCII character is in the set, such as would be the case in a negated version of the above, then we generate the equivalent of `ch < 127 || CharInClass(ch, "...").
- If we detect that only ASCII is in the set (a very common case, such as with `[A-Fa-f0-9]`), then we generate the equivalent of `ch < 128 && lookup[ch]`.
- If we detect that all non-ASCII is in the set (such as when some ASCII characters are negated), then we generate the equivalent of `ch >= 128 || lookup[ch]`.
- Otherwise, we have our default of `ch < 128 ? lookup[ch] : CharInClass(ch, "...").

While this helps with non-ASCII inputs, it also helps to keep the code smaller/faster even when there are ASCI

* Update src/libraries/System.Text.RegularExpressions/tests/RegexCharacterSetTests.cs

4 years agoDisable failing test (#1896)
Jared Parsons [Sat, 18 Jan 2020 03:25:51 +0000 (22:25 -0500)]
Disable failing test (#1896)

Disables `ConnectAsync_NotWebSocketServer_ThrowsWebSocketExceptionWithMessage`
as it's consistently failing in the outerloop jobs. Specifically the
libraries linux outerloop job.

Tracking Issue is #1895

4 years agoMerge pull request #1199 from lmolkova/w3cTestSuiteCrashes
Noah Falk [Sat, 18 Jan 2020 02:43:32 +0000 (18:43 -0800)]
Merge pull request #1199 from lmolkova/w3cTestSuiteCrashes

W3C Trace-Context: Allow hex chars in version and don't crash on non-hex chars in traceFlags

4 years agoMerge pull request #1873 from jaredpar/standard
Jared Parsons [Sat, 18 Jan 2020 01:12:43 +0000 (20:12 -0500)]
Merge pull request #1873 from jaredpar/standard

Disable Apline.38 ARM64 runs

4 years agoTweak documentation on NotNullAttribute (#1891)
Julien Couvreur [Sat, 18 Jan 2020 01:12:01 +0000 (17:12 -0800)]
Tweak documentation on NotNullAttribute (#1891)

Tagging @BillWagner @stephentoub @RikkiGibson

The use of `[NotNull]` on an input parameter is allowed. The typical example is an `AssertNotNull` method. That behavior was [specified](https://github.com/dotnet/csharplang/blob/master/meetings/2019/LDM-2019-05-15.md#simple-postconditions), but does not appear in the docs. Adding a mention.

I assume that changes here propagate to docs automatically.

4 years agoImprovements for null check folding. (#1735)
Eugene Rozenfeld [Fri, 17 Jan 2020 23:35:53 +0000 (15:35 -0800)]
Improvements for null check folding. (#1735)

optFoldNullChecks attempts to remove GT_NULLCHECK nodes that are
post-dominated by indirections on the same variable. These changes
implement a number of improvements.

1. Recognize more patterns.
Before these changes only the following pattern was recognized:
x = comma(nullcheck(y), add(y, const1))

followed by

indir(add(x, const2))

where const1 + const2 is sufficiently small.

With these changes the following patterns are recognized:

nullcheck(x)
or
x = comma(nullcheck(y), add(y, const1))

followed by

indir(x)
or
indir(add(x, const2))

where const1 + const2 is sufficiently small.

2. Indirections now include GT_ARR_LENGTH nodes.

3. Morph has an optimization
((x+icon1)+icon2) => (x+(icon1+icon2))
These changes generalize it to handle commas:
((comma(y, x+icon1)+icon2) => comma(y, x+(icon1+icon2))

That exposes more trees to null check folding.

4. Fix a bug in flow transformations that could lose BBF_HAS_NULLCHECK flag
on some basic blocks, which led to missing opportunities for null check folding.

5. Make safety checks in optCanMoveNullCheckPastTree
(for trees between the nullcheck and the indirection) both more correct
and less conservative. For example, we were not allowing any assignments
if we were inside try; however, assignments to compiler temps are safe since
they won't be visible in handlers.

5. Increase the maximum number of trees we check between GT_NULLCHECK and
the indirection from 25 to 50.

7. Refactor the code and move pattern recognition and safety checks to
helper methods.

8. Add missing BBF_HAS_NULLCHECK and OMF_HAS_NULLCHECK when we create GT_NULLCHECK nodes.

4 years agoMerge pull request #1525 from vitek-karas/OpenInstallerTestSln
Vitek Karas [Fri, 17 Jan 2020 23:05:24 +0000 (15:05 -0800)]
Merge pull request #1525 from vitek-karas/OpenInstallerTestSln

Setup environment to open the installer test sln

4 years agoRemove unused/unnecessary defines (#1878)
Steve MacLean [Fri, 17 Jan 2020 23:01:25 +0000 (18:01 -0500)]
Remove unused/unnecessary defines (#1878)

4 years agoPort stubbed out Regex.CompileToAssembly (#1850)
Stephen Toub [Fri, 17 Jan 2020 23:00:49 +0000 (18:00 -0500)]
Port stubbed out Regex.CompileToAssembly (#1850)

* Port stubbed out Regex.CompileToAssembly

This ports Regex.CompileToAssembly.  The "only" thing missing is the ability to actually save the Assembly out, which is obviously critical.  I'm putting this commit up because I've been using the generated assembly to help debug/improve the code generation, using temporary hacks locally to get the Assembly saved to disk.  Hopefully in the near future we can have a permanent solution in place.

* Code cleanup

4 years agoFix MSVC warn as errors... (#1876)
Steve MacLean [Fri, 17 Jan 2020 22:49:08 +0000 (17:49 -0500)]
Fix MSVC warn as errors... (#1876)

* Fix warning as error

* Fix mismatched declaration/definition

4 years agoRemove stray sos reference (#1875)
Steve MacLean [Fri, 17 Jan 2020 22:48:28 +0000 (17:48 -0500)]
Remove stray sos reference (#1875)

4 years agoUse bitmask operation to check if a slot is untracked (#1870)
Andrew Au [Fri, 17 Jan 2020 22:36:17 +0000 (14:36 -0800)]
Use bitmask operation to check if a slot is untracked (#1870)

4 years agoEnable overriding CoreCLR and Libraries configurations in root… (#1826)
Jeremy Koritzinsky [Fri, 17 Jan 2020 22:34:04 +0000 (14:34 -0800)]
Enable overriding CoreCLR and Libraries configurations in root… (#1826)

* Override the configuration of the CoreCLR and Libraries builds during the root build when CoreCLRConfiguration and LibrariesConfiguration are specified respectively.

* Add coreclrConfiguration and librariesConfiguration parameters to build scripts.

* Update docs.

* Make arguments lowercase on bash.

* Fix typos.

4 years agoAdd Crossgen pack for crossgen2 tool (#1859)
Davis Goodin [Fri, 17 Jan 2020 22:01:01 +0000 (16:01 -0600)]
Add Crossgen pack for crossgen2 tool (#1859)

* Add Crossgen pack for crossgen2 tool

* Inline sharedfx tooling support for Crossgen pack

* Support publishing crossgen pack

* "Crossgen pack" => "Crossgen2 pack"

4 years agoFix bug with PInvokes having byref arguments. (#1843)
Fadi Hanna [Fri, 17 Jan 2020 21:09:02 +0000 (16:09 -0500)]
Fix bug with PInvokes having byref arguments. (#1843)

* Fix bug with PInvokes having byref arguments.

Make IsMarshalingRequired return true for a byref argument

4 years agoDisable Apline.38 ARM runs
Jared Parsons [Fri, 17 Jan 2020 19:29:49 +0000 (11:29 -0800)]
Disable Apline.38 ARM runs

These are consistently failing on all runs. Disabling to get the build
green again while we dig into this

https://github.com/dotnet/runtime/issues/1871

4 years agoFixes runtime issue #1739 (#1840)
Brian Sullivan [Fri, 17 Jan 2020 19:59:45 +0000 (11:59 -0800)]
Fixes runtime issue #1739 (#1840)

* Fixes runtime issue 1739
Added additional check for Jit Stress mode STRESS_LCL_FLDS
This stress mode requires that the types exactly match

* Code review feedback

4 years agoMerge pull request #1759 from vitek-karas/NativeSearchDirsFix
Vitek Karas [Fri, 17 Jan 2020 19:22:44 +0000 (11:22 -0800)]
Merge pull request #1759 from vitek-karas/NativeSearchDirsFix

hostfxr_get_native_search_directories must fail when given CLI command

There's no check that when running with a "command" like hostfxr_get_native_search_directories that the code will not try to locate SDK and run CLI commands.
If it happens not only it does wrong things, but the return values are bogus (it doesn't fill the output buffer).

This change adds the necessary check to avoid this completely. It also makes sure that the output buffer size is always correctly set, even on errors.

Moved all the tests for hostfxr_get_native_search_directories to use nativehost and add a test to cover this case.

4 years agoFix Linux_x64_glibc condition to build RPM/Deb (#1861)
Davis Goodin [Fri, 17 Jan 2020 19:15:31 +0000 (13:15 -0600)]
Fix Linux_x64_glibc condition to build RPM/Deb (#1861)

4 years agoAdding area owners for new mono labels (#1865)
Maryam Ariyan [Fri, 17 Jan 2020 18:49:42 +0000 (10:49 -0800)]
Adding area owners for new mono labels (#1865)

4 years agoaddress review findings
Anton Firszov [Fri, 17 Jan 2020 18:39:50 +0000 (19:39 +0100)]
address review findings

4 years agoImplement required HttpClient apis in System.Net.Quic (#1703)
Justin Kotalik [Fri, 17 Jan 2020 18:21:13 +0000 (10:21 -0800)]
Implement required HttpClient apis in System.Net.Quic (#1703)

4 years agoUpdate status badge link (#1855)
Adam Sitnik [Fri, 17 Jan 2020 17:48:49 +0000 (18:48 +0100)]
Update status badge link (#1855)

4 years agoungroup PNSE tests, no RemoteExecutor timeout
Anton Firszov [Fri, 17 Jan 2020 17:09:09 +0000 (18:09 +0100)]
ungroup PNSE tests, no RemoteExecutor timeout

4 years agoadditional cleanup
Anton Firszov [Fri, 17 Jan 2020 15:12:52 +0000 (16:12 +0100)]
additional cleanup

4 years agoreimplement socket duplication, fix #1760
Anton Firszov [Fri, 17 Jan 2020 15:02:29 +0000 (16:02 +0100)]
reimplement socket duplication, fix #1760

4 years agoadd benchmarking and profiling workflow docs links (#1856)
Adam Sitnik [Fri, 17 Jan 2020 14:37:34 +0000 (15:37 +0100)]
add benchmarking and profiling workflow docs links (#1856)

4 years agoSpanify and cleanup System.Security.Principal.Windows
Wraith2 [Fri, 17 Jan 2020 14:21:50 +0000 (14:21 +0000)]
Spanify and cleanup System.Security.Principal.Windows

* spanify internal constructor, caller and callees
* rename locals and fields to match current style
* save the SecurityIdentifier objects for WindowsIdentity's Is(Something) properties as statics

4 years agorevert CPU clipping to 3.0, 2.x behavior (#1851)
Vladimir Sadov [Fri, 17 Jan 2020 13:20:10 +0000 (05:20 -0800)]
revert CPU clipping to 3.0, 2.x behavior (#1851)

4 years agoCompilation warnings fixes (mono/mono#18495)
Nikolay Sivov [Fri, 17 Jan 2020 13:16:03 +0000 (16:16 +0300)]
Compilation warnings fixes (mono/mono#18495)

Compilation warnings fixes

Commit migrated from https://github.com/mono/mono/commit/0a96741f9374f27757000a3cfcf100d98bcc3758

4 years agoZipFile.CreateFromDirectory: ensure entryEncoding parameter is being passed (#1825)
Eirik Tsarpalis [Fri, 17 Jan 2020 11:51:34 +0000 (13:51 +0200)]
ZipFile.CreateFromDirectory: ensure entryEncoding parameter is being passed (#1825)

4 years agoRemove the option to specify VS path
vitek-karas [Fri, 17 Jan 2020 11:47:02 +0000 (03:47 -0800)]
Remove the option to specify VS path

4 years agoCoalesce adjacent loops in concatenation RegexNodes (#1838)
Stephen Toub [Fri, 17 Jan 2020 11:25:04 +0000 (06:25 -0500)]
Coalesce adjacent loops in concatenation RegexNodes (#1838)

* Coalesce adjacent loops in concatenation RegexNodes

This augments the reduction phase of concatenation nodes to combine adjacent one/notone/setloops, e.g. `a*a+a{1,2}b` becomes `a{2,}b` (previously added optimizations will then see that the a loop can be made atomic and replace it with the equivalent of `(?>a{2,})b`).  This has several benefits.  First, it simplifies the node tree, creating less work for IR writer and less work for the interpreter/compiler.  Second, it gives the compiler more opportunity to choose how the loop should be represented, when and how to unroll, etc.  Third, it enables the auto-atomicity step to apply to more loops (as in the previous example).  And most importantly, it can drastically reduce backtracking (especially with the atomicity optimization, but even without that).  An expression like `a*a*a*a*a*a*b` run against an input like `aaaaaaaaaaaaaa` could previously take a very long time; now, it'll be very fast.

* Follow-up from previous PRs this is now rebased on

4 years agoFix tests on linux
vitek-karas [Fri, 17 Jan 2020 11:06:35 +0000 (03:06 -0800)]
Fix tests on linux

Different path normalization behavior

4 years agoImplement SuppressGCTransition attribute in crossgen2 (#1772)
Michal Strehovský [Fri, 17 Jan 2020 10:49:57 +0000 (11:49 +0100)]
Implement SuppressGCTransition attribute in crossgen2 (#1772)

Fixes dotnet/coreclr#27188.

4 years ago[prof] remove wrong cast for format string (mono/mono#18477)
Bernhard Urban-Forster [Fri, 17 Jan 2020 10:05:50 +0000 (11:05 +0100)]
[prof] remove wrong cast for format string (mono/mono#18477)

[prof] remove wrong cast for format string

Fixes this warning:
```
  CC       mprof-report.o
mprof-report.c:408:62: warning: format specifies type 'char *' but the argument has type 'guint64' (aka 'unsigned long long') [-Wformat]
                        snprintf (format, sizeof (format), "%s : %%" PRIu64 "\n", (guint64)key_format);
                                                            ~~                    ^~~~~~~~~~~~~~~~~~~
                                                            %llu
/Applications/Xcode112.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:57:62: note: expanded from macro
      'snprintf'
  __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
                                                             ^~~~~~~~~~~
```

mistake in refactoring commit https://github.com/mono/mono/commit/mono/mono@07402062541fa9555bef99dbaac84cfb587926cd#diff-c825627ea9ddb3fa753fa3617eaec7c8R408

Commit migrated from https://github.com/mono/mono/commit/73eeda130fceacebec5f1ccbae10478e7fc7c051

4 years agoFix tracing rundown tests with optimizations and large version bubble (#507)
Jan Vorlicek [Fri, 17 Jan 2020 09:52:57 +0000 (10:52 +0100)]
Fix tracing rundown tests with optimizations and large version bubble (#507)

* Fix tracing rundown tests with optimizations

The test is failing when compiled with crossgen2 with optimizations due
to the fact that it didn't find System.Diagnostics.Tracing loaded. The
reason is that due to cross module inlining, the
System.Diagnostics.Tracing was not needed anymore.
I have fixed it by checking for the
Microsoft.Diagnostics.Tracing.TraceEvent assembly.

4 years ago[netcore] Mark InitializeCurrentThread NoInlining (mono/mono#18493)
Aleksey Kliger (λgeek) [Fri, 17 Jan 2020 09:43:05 +0000 (04:43 -0500)]
[netcore] Mark InitializeCurrentThread NoInlining (mono/mono#18493)

Follow-up for https://github.com/mono/mono/pull/18480

We might want to replace calls to this with an intrinsic

Commit migrated from https://github.com/mono/mono/commit/1f0e147cddcc9b900f7e487dfed2a8ca008830b0

4 years ago[runtime] fix warnings on linux (gcc 8.3.0) (mono/mono#18479)
Bernhard Urban-Forster [Fri, 17 Jan 2020 08:36:32 +0000 (09:36 +0100)]
[runtime] fix warnings on linux (gcc 8.3.0) (mono/mono#18479)

* [aot] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
aot-compiler.c: In function ‘emit_trampolines’:
aot-compiler.c:7675:28: warning: ‘_e’ directive writing 2 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
    sprintf (end_symbol, "%s_e", symbol);
                            ^~
aot-compiler.c:7675:4: note: ‘sprintf’ output between 3 and 258 bytes into a destination of size 256
    sprintf (end_symbol, "%s_e", symbol);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At top level:
aot-compiler.c:753:1: warning: ‘link_shared_library’ defined but not used [-Wunused-function]
 link_shared_library (MonoAotCompile *acfg)
 ^~~~~~~~~~~~~~~~~~~
aot-compiler.c:558:1: warning: ‘mangle_symbol_alloc’ defined but not used [-Wunused-function]
 mangle_symbol_alloc (const char * symbol)
 ^~~~~~~~~~~~~~~~~~~
aot-compiler.c:535:1: warning: ‘mangle_symbol’ defined but not used [-Wunused-function]
 mangle_symbol (const char * symbol, char * mangled_symbol, gsize length)
 ^~~~~~~~~~~~~~~~~~~
```

* [amd64] fix warnings on linux (gcc 8.3.0)

Fixes this warning:
```
tramp-amd64.c: In function ‘mono_arch_create_generic_trampoline’:
tramp-amd64.c:242:65: warning: variable ‘ex_offset’ set but not used [-Wunused-but-set-variable]
  int i, lmf_offset, offset, res_offset, arg_offset, rax_offset, ex_offset, tramp_offset, ctx_offset, saved_regs_offset;
                                                                 ^~~~~~~~~
```

* [lldb] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
lldb.c:243:1: warning: ‘buffer_add_buffer’ defined but not used [-Wunused-function]
 buffer_add_buffer (Buffer *buf, Buffer *data)
 ^~~~~~~~~~~~~~~~~
lldb.c:215:1: warning: ‘buffer_add_id’ defined but not used [-Wunused-function]
 buffer_add_id (Buffer *buf, int id)
 ^~~~~~~~~~~~~
lldb.c:208:1: warning: ‘buffer_add_long’ defined but not used [-Wunused-function]
 buffer_add_long (Buffer *buf, guint64 l)
 ^~~~~~~~~~~~~~~
lldb.c:188:1: warning: ‘buffer_add_short’ defined but not used [-Wunused-function]
 buffer_add_short (Buffer *buf, guint32 val)
 ^~~~~~~~~~~~~~~~

```

* [interp] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
interp/interp.c:3425:1: warning: ‘g_error_xsx’ defined but not used [-Wunused-function]
 g_error_xsx (const char *format, int x1, const char *s, int x2)
 ^~~~~~~~~~~
  CC       interp/libmono_ee_interp_la-mintops.lo
  CC       interp/libmono_ee_interp_la-transform.lo
  CCLD     libmono-ee-interp.la
ar: `u' modifier ignored since `D' is the default (see `U')
  CC       libmono_dbg_la-debugger-agent.lo
  CC       libmono_dbg_la-debugger-state-machine.lo
  CC       libmono_dbg_la-debugger-engine.lo
  CCLD     libmono-dbg.la
ar: `u' modifier ignored since `D' is the default (see `U')
  CCLD     mono-sgen
  AR       libmain.a
ar: `u' modifier ignored since `D' is the default (see `U')
  CC       interp/libmaintest_a-whitebox.o
In file included from interp/whitebox.c:3:
interp/transform.h:163:12: warning: ‘stack_type’ defined but not used [-Wunused-variable]
 static int stack_type [] = {
            ^~~~~~~~~~
interp/transform.h:155:20: warning: ‘stack_type_string’ defined but not used [-Wunused-variable]
 static const char *stack_type_string [] = { "I4", "I8", "R4", "R8", "O ", "VT", "MP", "F " };
                    ^~~~~~~~~~~~~~~~~

```

* [thread state] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
  CC       libmonoutils_la-mono-threads-state-machine.lo
mono-threads-state-machine.c:33:1: warning: ‘get_thread_no_safepoints’ defined but not used [-Wunused-function]
 get_thread_no_safepoints (int thread_state)
 ^~~~~~~~~~~~~~~~~~~~~~~~
mono-threads-state-machine.c:26:1: warning: ‘get_thread_suspend_count’ defined but not used [-Wunused-function]
 get_thread_suspend_count (int thread_state)
 ^~~~~~~~~~~~~~~~~~~~~~~~
```

* [domain] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
appdomain.c:2415:1: warning: ‘get_app_context_base_directory’ defined but not used [-Wunused-function]
 get_app_context_base_directory (MonoError *error)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       libmonoruntimesgen_la-assembly-load-context.lo
  CC       libmonoruntimesgen_la-domain.lo
domain.c:135:1: warning: ‘mono_domain_alcs_lock’ declared ‘static’ but never defined [-Wunused-function]
 mono_domain_alcs_lock (MonoDomain *domain);
 ^~~~~~~~~~~~~~~~~~~~~
domain.c:138:1: warning: ‘mono_domain_alcs_unlock’ declared ‘static’ but never defined [-Wunused-function]
 mono_domain_alcs_unlock (MonoDomain *domain);
 ^~~~~~~~~~~~~~~~~~~~~~~
domain.c:2129:1: warning: ‘mono_alc_free’ defined but not used [-Wunused-function]
 mono_alc_free (MonoAssemblyLoadContext *alc)
 ^~~~~~~~~~~~~
domain.c:2108:1: warning: ‘mono_domain_create_default_alc’ defined but not used [-Wunused-function]
 mono_domain_create_default_alc (MonoDomain *domain)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
domain.c:2084:1: warning: ‘create_alc’ defined but not used [-Wunused-function]
 create_alc (MonoDomain *domain, gboolean is_default)
 ^~~~~~~~~~

```

* [native library] fix warnings on linux (gcc 8.3.0)

Fixes this warning:
```
  CC       libmonoruntimesgen_la-native-library.lo
native-library.c:295:1: warning: ‘mono_loader_register_module_locking’ defined but not used [-Wunused-function]
 mono_loader_register_module_locking (const char *name, MonoDl *module)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

* [sample] fix warnings on linux (gcc 8.3.0)

Fixes this warning:
```
  CC       libtestlib_la-test-mono-embed.lo
In file included from test-mono-embed.c:7:
../../samples/embed/teste.c:20:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 gimme () {
 ^~~~~

```

* fix for checked builds

Commit migrated from https://github.com/mono/mono/commit/b4c506c3045516349d03ce8f3fe9fa5b79a7271c

4 years agoDo not look at Size when doing Auto layout (#1805)
Michal Strehovský [Fri, 17 Jan 2020 08:35:33 +0000 (09:35 +0100)]
Do not look at Size when doing Auto layout (#1805)

Seems like the deleted line was copypasted from the Sequential/Explicit case, but it's incorrect.

Fixes #1770.

4 years agoFlush GC log on shutdown (#1721)
Andrew Au [Fri, 17 Jan 2020 05:09:28 +0000 (21:09 -0800)]
Flush GC log on shutdown (#1721)

4 years agoRecording the reason why we change the generation to condemn during joined_generation...
Andrew Au [Fri, 17 Jan 2020 05:08:50 +0000 (21:08 -0800)]
Recording the reason why we change the generation to condemn during joined_generation_to_condemn() to the event stream (#1042)

4 years agoPort CreateDirectory method as a DirectorySecurity extension (#1834)
Carlos Sanchez Lopez [Fri, 17 Jan 2020 04:35:34 +0000 (20:35 -0800)]
Port CreateDirectory method as a DirectorySecurity extension (#1834)

4 years agoAddress PR feedback from old PR (#1837)
Santiago Fernandez Madero [Fri, 17 Jan 2020 03:54:36 +0000 (19:54 -0800)]
Address PR feedback from old PR (#1837)

4 years ago[runtime] NOHANDLES for ves_icall_System_Threading_Thread_GetCurrentThread (mono...
Aleksey Kliger (λgeek) [Fri, 17 Jan 2020 02:57:54 +0000 (21:57 -0500)]
[runtime] NOHANDLES for ves_icall_System_Threading_Thread_GetCurrentThread (mono/mono#18480)

* [runtime] NOHANDLES for ves_icall_System_Threading_Thread_GetCurrentThread

This function (and its call to mono_handle_new) was showing up in the
flamegraph for some async-heavy benchmarks

Commit migrated from https://github.com/mono/mono/commit/c1498b8d4ce83732d1bab794005cc12f8319053d

4 years agomore tests
Liudmila Molkova [Sat, 28 Dec 2019 04:20:50 +0000 (20:20 -0800)]
more tests

4 years agofix IsW3C check
Liudmila Molkova [Sat, 28 Dec 2019 04:11:16 +0000 (20:11 -0800)]
fix IsW3C check

4 years agoAllow hex chars in W3C Trace-Context version and fix crash with invalid traceFlags
Liudmila Molkova [Sat, 28 Dec 2019 02:33:30 +0000 (18:33 -0800)]
Allow hex chars in W3C Trace-Context version and fix crash with invalid traceFlags

4 years agoExpand RegexNode atomicity test to loops at the end of alternation branches (#1769)
Stephen Toub [Fri, 17 Jan 2020 02:20:48 +0000 (21:20 -0500)]
Expand RegexNode atomicity test to loops at the end of alternation branches (#1769)

Given an expression like `(abcd*|efgh*)ijk`, we will now see that if the `i` after the alternation doesn't match and we backtrack into the alternation, we won't need to backtrack into the `d*`, as it can't give back anything that would allow the `i` to match.

4 years agoAutomatically anchor regexes beginning with .* (#1706)
Stephen Toub [Fri, 17 Jan 2020 02:19:25 +0000 (21:19 -0500)]
Automatically anchor regexes beginning with .* (#1706)

4 years agoReview large alignment code in GC (#1351)
Anton Lapounov [Fri, 17 Jan 2020 01:39:12 +0000 (17:39 -0800)]
Review large alignment code in GC (#1351)

Improve comments and fix a couple of places where large alignment was not taken into account. Set pad_in_front to zero if SHORT_PLUGS is not defined.