Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization: Generic specialization for equality #513

Closed
wants to merge 422 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
422 commits
Select commit Hold shift + click to select a range
44401bc
fix 659
dsyme Oct 27, 2015
0908c2f
fix to only apply to extrinsic extensions
dsyme Oct 27, 2015
11287c2
add positive testing
dsyme Oct 27, 2015
34690b7
update tests
dsyme Oct 27, 2015
4ac3dad
updated to latest version of tests
enricosada Oct 26, 2015
d73eed8
upgrade to nunit 3, beta 3
enricosada Oct 26, 2015
3190096
Add failing test for 'ToString() returns null bug'
rojepp Oct 29, 2015
7ae2aca
Fix #706 Nullref exception in FSI
rojepp Oct 29, 2015
fde75b0
use tests\RunTests.cmd to run tests
enricosada Oct 29, 2015
930a8a6
use case sensitive env vars ( FSCBINPATH )
enricosada Oct 29, 2015
6637c9d
fix build
enricosada Oct 29, 2015
8f65c82
Update README.md
KevinRansom Oct 29, 2015
361aed2
Inline "Required Tools for Windows Development and Testing"
forki Oct 30, 2015
56e04f3
Merge pull request #709 from forki/requiredsoftware
KevinRansom Oct 30, 2015
25e573e
Update README.md
KevinRansom Oct 30, 2015
0192193
Add links to DEVGUIDE and TESTGUIDE
forki Nov 6, 2015
ff9c805
Merge pull request #714 from forki/patch-3
dsyme Nov 6, 2015
df3cac2
add in environment variable check for VS installed in non-default loc…
baronfel Nov 7, 2015
8c07362
Merge branch 'tests_suite_with_nunit' of https://github.com/enricosad…
KevinRansom Nov 16, 2015
3ed761e
fix appveyor build badge of master branch
enricosada Nov 16, 2015
e1a4e66
revert to run only a reduced set of tests
enricosada Nov 16, 2015
b48024c
Merge pull request #727 from enricosada/patch-6
KevinRansom Nov 16, 2015
990efb2
Merge pull request #726 from enricosada/patch-5
KevinRansom Nov 16, 2015
f3ec711
Update to nunit 3.0.0
KevinRansom Nov 19, 2015
0f72992
Send our our NUnit test results to AppVeyor
SamB Nov 20, 2015
fc0800a
Merge branch 'fix-654' of https://github.com/kbattocchi/visualfsharp …
KevinRansom Nov 20, 2015
ab9051a
ideunit test needs --x86
KevinRansom Nov 20, 2015
dc867b3
Merge branch 'master' of https://github.com/tpetricek/visualfsharp in…
KevinRansom Nov 20, 2015
3431e61
Merge branch 'fix-671' of https://github.com/dsyme/visualfsharp into …
KevinRansom Nov 20, 2015
56fbb87
Alignment with FCS to propagate specifier ranges in CheckFormatSt…
dsyme Nov 21, 2015
bc367dc
Merge branch 'to_string_null_fix' of https://github.com/rojepp/visual…
KevinRansom Nov 21, 2015
8e58c9d
Remove uncommented code in Async.Parallel and test for proper cancell…
forki Nov 9, 2015
89a25de
Merge branch 'vs_version_sniffing' of https://github.com/baronfel/vis…
KevinRansom Nov 21, 2015
e8f803b
Merge branch 'fix-regression' of https://github.com/dsyme/visualfshar…
KevinRansom Nov 21, 2015
d1f13d3
Fix nuget_config and build nunit cambridge tests
KevinRansom Nov 22, 2015
4eb0c4d
Merge remote-tracking branch 'refs/remotes/Microsoft/master'
KevinRansom Nov 22, 2015
82eac8b
Tweaks for internal build
KevinRansom Nov 23, 2015
2ebf0fc
fix build
enricosada Nov 24, 2015
7cb8e7d
Merge pull request #1 from Microsoft/master
Nov 24, 2015
13a8a34
remove status file
KevinRansom Nov 28, 2015
c4d42ea
Improve ideunit test results
KevinRansom Nov 28, 2015
48a9b0a
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
KevinRansom Nov 29, 2015
8156959
Merge branch 'vs2015' of https://github.com/Microsoft/visualfsharp in…
KevinRansom Nov 29, 2015
34b1e17
Fix runtests when running under appveyor
KevinRansom Nov 29, 2015
153965b
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
KevinRansom Nov 30, 2015
2523ecd
Merge branch 'vs2015' of https://github.com/Microsoft/visualfsharp in…
KevinRansom Nov 30, 2015
9e38a76
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
Nov 30, 2015
439e695
Merge pull request #747 from KevinRansom/master
KevinRansom Nov 30, 2015
f5238ea
Merge pull request #746 from KevinRansom/vs2015
KevinRansom Nov 30, 2015
7033a9c
Add portablelibrary259 to appveyor suite
KevinRansom Dec 1, 2015
f1bc1df
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
KevinRansom Dec 1, 2015
12b145c
Merge branch 'master' into vs2015
KevinRansom Dec 1, 2015
e27e4d1
fix ProductVersion file attribute
enricosada Sep 4, 2015
c0afb70
Add changelog for VS 2015 Update 1
dungpa Dec 1, 2015
b40ef57
Address comments
dungpa Dec 1, 2015
56df599
Merge pull request #751 from dungpa/changelog
KevinRansom Dec 1, 2015
21971fb
Merge branch 'master' into vs2015
KevinRansom Dec 1, 2015
fa4f10b
Update README.md
KevinRansom Dec 1, 2015
17a69f3
Changed all source references from F# 4.0 to F# 4.1
Dec 2, 2015
8759c24
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
Dec 2, 2015
c2ddb89
Fix VS Integration Script
Dec 2, 2015
619a44c
Fix for version matrices tests
Dec 3, 2015
261732c
fix problem with loop optimization
dsyme Dec 3, 2015
912b811
excluded files (not in build) from fsharp suite project
enricosada Dec 3, 2015
c68b5cb
Merge pull request #757 from enricosada/remove_nodes_from_tests_proj
dsyme Dec 3, 2015
41fb93f
Address PR refactoring comments
Dec 3, 2015
729d8d1
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
Dec 3, 2015
4822f99
Address PR Refactoring Comments
Dec 3, 2015
9a0886c
Fixing binding redirects in VS Integration
Dec 3, 2015
a3dc921
Merge pull request #755 from otawfik-ms/master
Dec 3, 2015
c1e0bc8
Merge branch 'fix-742' of https://github.com/dsyme/visualfsharp into …
KevinRansom Dec 4, 2015
bbb086e
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
KevinRansom Dec 4, 2015
c8b3c56
Fix 581 - Async.RunSynchronously tries to reuse current thread
radekm Oct 9, 2015
4598abf
Update CONTRIBUTING.md
dsyme Dec 5, 2015
a989745
fix build problem of #756
mexx Dec 6, 2015
558f92c
Merge remote-tracking branch 'refs/remotes/Microsoft/master'
Dec 7, 2015
8f8d7ea
Fix 4.1 registry key references
Dec 7, 2015
691bbdd
Adopt code of conduct
KevinRansom Dec 7, 2015
52d4e00
fix build problem of #756
mexx Dec 6, 2015
8a23295
Update CONTRIBUTING.md
dsyme Dec 5, 2015
d3b9694
Merge pull request #772 from KevinRansom/code_ofconduct
KevinRansom Dec 8, 2015
624b58a
Update LKG to 4.0
Dec 8, 2015
e714d30
Fix Compiler Load Order (during LKG build)
Dec 8, 2015
a571f3c
Fix typo in RunTests.cmd
Dec 8, 2015
f742220
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
Dec 8, 2015
b8eb598
Merge branch 'fix_upload_tests_results_to_appveyor' of https://github…
enricosada Dec 9, 2015
f3a0d7d
This closes #765 by removing an invalid nuget reference to Microsoft.…
WilliamBerryiii Dec 6, 2015
863f830
Remove dnx from packages.config
KevinRansom Dec 9, 2015
04d79f0
Adopt code of conduct
KevinRansom Dec 7, 2015
3deda35
Update LKG to F# 4.0
Dec 9, 2015
320d916
Merge pull request #776 from otawfik-ms/master
Dec 9, 2015
e7d41d8
Merge branch 'vs2015'
KevinRansom Dec 9, 2015
f94f3f8
use Interlocked.Increment to be thread safe
enricosada Dec 9, 2015
46f9382
Upgrading LKG FSharp.Core to 4.0
Dec 11, 2015
e064260
Updated FsLex/FsYacc Fsharp.Core bindings
Dec 11, 2015
4bb100f
Merge pull request #787 from otawfik-ms/master
Dec 11, 2015
b63b919
use appveyor build matrix / split CI build into 3 sections for now
enricosada Dec 11, 2015
1764b93
Add update-vsintegration for plib tests
KevinRansom Dec 11, 2015
e6f6797
Merge branch 'vs2015'
KevinRansom Dec 11, 2015
95c02dd
use IDisposable instead of ILModuleReader.CloseILModuleReader
enricosada Dec 12, 2015
7d11d03
use IDisposable instead of ILModuleReader.CloseILModuleReader
enricosada Dec 12, 2015
d8a83cb
fix build badge, use a matrix with all branches
enricosada Dec 10, 2015
4d30685
Add badge for vs2015
KevinRansom Dec 12, 2015
faaa316
fix build badge, use a matrix with all branches
enricosada Dec 10, 2015
32e98e4
Add badge for vs2015
KevinRansom Dec 12, 2015
a504061
Merge pull request #781 from enricosada/use_thread_safe_increment
KevinRansom Dec 12, 2015
38846c3
use Interlocked.Increment to be thread safe
enricosada Dec 9, 2015
e0be26e
Investigste failures in appveyor
KevinRansom Dec 12, 2015
673534d
Fix portable library fsharp.core paths for F# 4.1
KevinRansom Dec 13, 2015
7b170de
use ImplicitZero instead of Yield or Return unit
mexx Dec 5, 2015
130c86b
add tests for old and new behavior for last do!
mexx Dec 13, 2015
a74b2b8
Fix qa tests for 4.1
KevinRansom Dec 13, 2015
6bff0d3
go back to not using the matrix
KevinRansom Dec 13, 2015
ddb9218
Corrected portable libraries version strings
Dec 14, 2015
e04d313
Added missing .net references to test files
Dec 15, 2015
abcfc99
Upgrade - nuint-final
enricosada Dec 16, 2015
dcedbc8
Re-enable test matrix
Dec 17, 2015
8fdcbb7
Update vsix to 4.0.2 -- to enable gallery push
KevinRansom Dec 17, 2015
9ff4642
update runtests
KevinRansom Dec 17, 2015
c4de13e
Merge pull request #802 from KevinRansom/vs2015
KevinRansom Dec 17, 2015
de1e389
Merge branch 'vs2015'
KevinRansom Dec 17, 2015
9129c34
Squashed commit of the following:
enricosada Dec 17, 2015
d6924c4
Merge branch 'vs2015'
KevinRansom Dec 17, 2015
39527b9
implement Async.Choice
eiriktsarpalis Dec 17, 2015
c4bdb2d
add Async.Choice to SurfaceArea tests
eiriktsarpalis Dec 17, 2015
54de8fa
add build conditionals for .net portable
eiriktsarpalis Dec 17, 2015
43dd871
update Async.Choice description
eiriktsarpalis Dec 17, 2015
8b4cdd4
incorporate surface test changes
eiriktsarpalis Dec 17, 2015
4f44983
add choice to all surface area test definitions
eiriktsarpalis Dec 17, 2015
e758c51
incorporate feedback
eiriktsarpalis Dec 17, 2015
b81dea5
fix parameter names in Async.Parallel & Async.Choice.
eiriktsarpalis Dec 17, 2015
f225b87
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
Dec 18, 2015
89ae4a7
Fixed Appvoyer script to run QA suite smoke only
Dec 18, 2015
28d0c0c
improve async.choice xml doc
eiriktsarpalis Dec 18, 2015
1da20e4
changes to choice xml doc
eiriktsarpalis Dec 18, 2015
fd4d36f
Merge pull request #812 from otawfik-ms/master
KevinRansom Dec 18, 2015
97261db
Added missing .net references to test files
Dec 15, 2015
3ecb5e5
Re-enable test matrix
Dec 17, 2015
1e33305
Fixed Appvoyer script to run QA suite smoke only
Dec 18, 2015
9811603
Merge pull request #817 from otawfik-ms/vs2015
Dec 22, 2015
b861e4e
fixes counters warning 3180
mpetruska Dec 28, 2015
273ca0c
resolve merge conflict
dsyme Dec 31, 2015
589168b
Added CI groovy script
Jan 5, 2016
4de5084
Fix typo
Jan 5, 2016
5928a5a
Merge pull request #852 from otawfik-ms/ci
Jan 6, 2016
eefbbb8
Added NUnit Test Results/Running Smokes for now
Jan 7, 2016
89ed923
Archieving Release artifacts
Jan 7, 2016
267331c
Fixed commas in build paths
Jan 7, 2016
90643d1
Merge pull request #856 from otawfik-ms/dotnet-ci
Jan 7, 2016
596621f
add build_only argument at appveyor-build.cmd to skip tests ( others …
enricosada Dec 23, 2015
f4e2cfc
teach fsc/fsi how to use response files
enricosada Dec 23, 2015
6127e6a
add tests
enricosada Jan 5, 2016
dd75644
add help about @response files
enricosada Jan 5, 2016
2f30b90
add test compile error expected if response file does not exist
enricosada Jan 7, 2016
9bed9be
rename resources
enricosada Jan 7, 2016
d43f1a9
document how to add new resources and error numbers
enricosada Jan 7, 2016
2c6fedf
Merge pull request #841 from mpetruska/fix-fsharp-compiler-build
dsyme Jan 8, 2016
c372df4
add build_only argument at appveyor-build.cmd to skip tests ( others …
enricosada Dec 23, 2015
1370b0f
use a different build script for jenkins
enricosada Jan 8, 2016
79f7429
use elevated machine
enricosada Jan 8, 2016
e3a7c94
add debug/release
enricosada Jan 8, 2016
6bf9b41
Merge pull request #860 from enricosada/make_jenkins_green
Jan 11, 2016
757f35c
Added msbuild commands to Jenkins build
Jan 11, 2016
c620056
Jenkins skipIfNoTestFiles = true
Jan 11, 2016
9b6d582
Utilities.addXUnitDotNETResults string argument
Jan 11, 2016
f92376b
Merge pull request #868 from otawfik-ms/fix-jenkins-errors
Jan 11, 2016
64c16ed
Merge branch 'master' of https://github.com/otawfik-ms/visualfsharp i…
Jan 11, 2016
eff6f1c
Utilities.addArchival lowerConfiguration
Jan 11, 2016
73f8458
Merge pull request #867 from otawfik-ms/dotnet-ci
Jan 12, 2016
23f4612
Add nuget
KevinRansom Jan 14, 2016
1391291
Merge branch 'vs2015'
KevinRansom Jan 14, 2016
015001d
use detectEncodingFromByteOrderMarks
enricosada Jan 18, 2016
20f0552
add error if response file name is empty or invalid
enricosada Jan 18, 2016
e1531d5
Integrate FCS API: Changes to src\fsharp\vs\IncrementalBuild.{fs,fsi}
dsyme Jan 19, 2016
63f76f5
Integrate FCS API: Changes to src\fsharp\vs\service.{fs,fsi}
dsyme Jan 19, 2016
1b8fb96
Integrate FCS API: Changes to src\fsharp\vs
dsyme Jan 19, 2016
9635bd0
Integrate FCS API: Changes to src\fsharp
dsyme Jan 19, 2016
190f703
Integrate FCS API: Changes to src\absil
dsyme Jan 19, 2016
9342e0f
Integrate FCS API: Changes to vsintegration\src\vs\FsPkgs\FSharp.Lang…
dsyme Jan 19, 2016
6c47d21
Integrate FCS API: Other changes to vsintegration\src\Salsa
dsyme Jan 19, 2016
d36d267
Integrate FCS API: Other changes to vsintegration\src
dsyme Jan 19, 2016
f3508a5
Integrate FCS API: Other changes to tests\service
dsyme Jan 19, 2016
6e23d59
Integrate FCS API: Other changes
dsyme Jan 19, 2016
c420f55
Merge pull request #677 from dsyme/fix-528
KevinRansom Jan 19, 2016
0735d37
Merge branch 'fsharp4' of https://github.com/manofstick/visualfsharp …
KevinRansom Jan 19, 2016
13fcdf5
Merge branch 'manofstick-fsharp4'
KevinRansom Jan 20, 2016
c0a7595
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
KevinRansom Jan 20, 2016
28dfbe6
Merge branch 'issue_605_product_version' of https://github.com/enrico…
KevinRansom Jan 20, 2016
680ac34
Merge branch 'enricosada-issue_605_product_version'
KevinRansom Jan 20, 2016
939e6ab
Merge branch 'async-choice' of https://github.com/eiriktsarpalis/visu…
KevinRansom Jan 20, 2016
67f3497
Merge branch 'eiriktsarpalis-async-choice'
KevinRansom Jan 20, 2016
5639468
Merge branch 'mem2' of https://github.com/dsyme/visualfsharp into dsy…
KevinRansom Jan 20, 2016
c032027
Merge branch 'dsyme-mem2' into vs2015
KevinRansom Jan 20, 2016
c2becd4
Merge branch 'fix-sp-errors' of https://github.com/dsyme/visualfsharp…
KevinRansom Jan 20, 2016
093c5ed
Merge branch 'dsyme-fix-sp-errors' into vs2015
KevinRansom Jan 20, 2016
63cad60
Merge branch 'fix-659' of https://github.com/dsyme/visualfsharp into …
KevinRansom Jan 20, 2016
c82c33c
Merge branch 'dsyme-fix-659' into vs2015
KevinRansom Jan 20, 2016
93f3c82
Merge branch 'zero-for-return-unit' of https://github.com/mexx/visual…
KevinRansom Jan 20, 2016
3268a62
Merge branch 'mexx-zero-for-return-unit'
KevinRansom Jan 20, 2016
4afd93e
Merge branch 'vs2015'
KevinRansom Jan 20, 2016
bfa8532
Merge branch 'teach_fsc_how_to_use_responsefile' of https://github.co…
KevinRansom Jan 20, 2016
0937f9b
Merge branch 'vs2015'
KevinRansom Jan 20, 2016
fe5127c
Make FSC error numbers for response files consistent between F# 4.0 a…
KevinRansom Jan 20, 2016
20fecbc
Add nocopyfsharpcore option to fsc.exe
Jan 20, 2016
858931a
Update fscomp.txt to fix merge issue
KevinRansom Jan 21, 2016
69e9cb3
Merge branch 'vs2015'
KevinRansom Jan 21, 2016
2597c84
Merge pull request #678 from radekm/run-sync-reuses-thread
KevinRansom Jan 21, 2016
91a5323
Added copying Fsharp.Core to the compiler
Jan 21, 2016
e3b8c72
integrate with master
dsyme Jan 21, 2016
29f1952
Switch resolution order to search compilers directory first before cu…
Jan 21, 2016
5b73d8e
update vsintegration.cmd
dsyme Jan 22, 2016
736e9c1
Migrate "fsharpqa" suite to use NUnit
enricosada Jan 22, 2016
0c7c3de
Merge pull request #853 from dsyme/fcs-integration-1
KevinRansom Jan 22, 2016
b584ee7
Remove compiler code accessing GACUtil
Jan 22, 2016
cf47f70
Merge branch 'master' of https://github.com/Microsoft/visualfsharp in…
Jan 22, 2016
599f738
add jenkins badge to README
enricosada Jan 14, 2016
218bdf2
Merge pull request #874 from enricosada/add_jenkins_badge_to_readme
Jan 22, 2016
c9e992c
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
KevinRansom Jan 22, 2016
0148c07
Fix fsc.exe to copy FSharp.Core.dll from references if existed
Jan 23, 2016
3aef1ee
put back badly merged sources into Fsharp.compilr.fsproj
KevinRansom Jan 23, 2016
2f3d3f7
Fix update-vsintegration to copy GAC'ed files into VS PrivateAssembli…
Jan 23, 2016
55f9833
Fsc.exe now searchs its own directory for FSharp.Core.dll instead of …
Jan 23, 2016
62723aa
Fixing failed tests
Jan 24, 2016
0755207
update project files
dsyme Jan 25, 2016
bdea845
reorg solution file
dsyme Jan 25, 2016
feb99db
Merge pull request #891 from dsyme/proj-cleanup
dsyme Jan 25, 2016
fa0e079
reorg solution file (2)
dsyme Jan 25, 2016
149758a
reorg solution file (3)
dsyme Jan 25, 2016
1b967a6
rename Deployment.sln
dsyme Jan 25, 2016
ab3ac15
reorg solution file (4)
dsyme Jan 25, 2016
fcc5950
Merge branch 'master' of https://github.com/otawfik-ms/visualfsharp i…
Jan 25, 2016
e73ad5a
Merge branch 'copyfsharpcore' of https://github.com/otawfik-ms/visual…
Jan 25, 2016
318e679
PR comments
Jan 26, 2016
c301020
Merge pull request #894 from otawfik-ms/copyfsharpcore
Jan 26, 2016
29389b3
fix build and remove #light
dsyme Jan 26, 2016
26162cc
fix build
dsyme Jan 26, 2016
1bbc360
Merge pull request #893 from dsyme/proj-cleanup-2
dsyme Jan 27, 2016
52f5117
add xmldoc about Seq.rev consume input sequence
enricosada Jan 27, 2016
75c7624
feedback
enricosada Jan 27, 2016
f4cf7e3
don't clobber F# SDK
dsyme Jan 27, 2016
8ced26a
add doc to sort, foldBack, reduceBack, tryFindBack, findBack, scanBac…
enricosada Jan 28, 2016
a458989
Merge pull request #903 from enricosada/xmldoc_seqrev
dsyme Jan 28, 2016
ad8c5ee
Merge pull request #904 from dsyme/fix-ci-build-1
KevinRansom Jan 28, 2016
e3d64fe
reset (c) Microsoft Open Technologies, Inc. back to (c) Microsoft Cor…
KevinRansom Jan 29, 2016
95fb299
Merge pull request #906 from KevinRansom/master
KevinRansom Jan 29, 2016
fa1e55a
Gitignore generated FSharp.Core.dll
forki Jan 29, 2016
b837d75
Merge pull request #909 from forki/ignore
dsyme Jan 29, 2016
bf78c0f
Fix mini typo and remove commented code
forki Feb 2, 2016
4f761cb
Merge pull request #927 from forki/patch-4
dsyme Feb 2, 2016
c8461eb
Merge remote-tracking branch 'refs/remotes/Microsoft/master' into fsh…
Feb 3, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 106 additions & 6 deletions src/fsharp/FSharp.Core/prim-types.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1668,12 +1668,72 @@ namespace Microsoft.FSharp.Core
override iec.Equals(x:obj,y:obj) = GenericEqualityObj true iec (x,y) // ER Semantics
override iec.GetHashCode(x:obj) = raise (InvalidOperationException (SR.GetString(SR.notUsedForHashing))) }

type private EquivalenceRelation = class end
type private PartialEquivalenceRelation = class end
type private UnknownEquivalenceRelation = class end

type GenericSpecializeEquals<'a>() =
static let generalize (func:Func<'aa,'aa,bool>) =
match box func with
| :? Func<'a, 'a, bool> as f -> f
| _ -> raise (Exception "invalid logic")

static let _func =
match typeof<'a> with
| t when t.Equals typeof<bool> -> generalize (Func<_,_,_>(fun (a:bool) b -> a.Equals b))
| t when t.Equals typeof<sbyte> -> generalize (Func<_,_,_>(fun (a:sbyte) b -> a.Equals b))
| t when t.Equals typeof<int16> -> generalize (Func<_,_,_>(fun (a:int16) b -> a.Equals b))
| t when t.Equals typeof<int32> -> generalize (Func<_,_,_>(fun (a:int32) b -> a.Equals b))
| t when t.Equals typeof<int64> -> generalize (Func<_,_,_>(fun (a:int64) b -> a.Equals b))
| t when t.Equals typeof<byte> -> generalize (Func<_,_,_>(fun (a:byte) b -> a.Equals b))
| t when t.Equals typeof<uint16> -> generalize (Func<_,_,_>(fun (a:uint16) b -> a.Equals b))
| t when t.Equals typeof<uint32> -> generalize (Func<_,_,_>(fun (a:uint32) b -> a.Equals b))
| t when t.Equals typeof<uint64> -> generalize (Func<_,_,_>(fun (a:uint64) b -> a.Equals b))
| t when t.Equals typeof<nativeint> -> generalize (Func<_,_,_>(fun (a:nativeint) b -> a.Equals b))
| t when t.Equals typeof<unativeint> -> generalize (Func<_,_,_>(fun (a:unativeint)b -> a.Equals b))
| t when t.Equals typeof<char> -> generalize (Func<_,_,_>(fun (a:char) b -> a.Equals b))
| t when t.Equals typeof<string> -> generalize (Func<_,_,_>(fun (a:string) b -> System.String.Equals(a,b)))
| t when t.Equals typeof<decimal> -> generalize (Func<_,_,_>(fun (a:decimal) b -> System.Decimal.op_Equality(a,b)))
| _ -> null

static member Func = _func

type GenericSpecializeEqualsWithRelation<'relation, 'a>() =
static let generalize (func:Func<'aa,'aa,bool>) =
match box func with
| :? Func<'a, 'a, bool> as f -> f
| _ -> raise (Exception "invalid logic")

static let _func =
let relationBasedFunc =
match typeof<'relation> with
| r when r.Equals typeof<UnknownEquivalenceRelation> -> null
| r when r.Equals typeof<PartialEquivalenceRelation> ->
match typeof<'a> with
| t when t.Equals typeof<float> -> generalize (Func<_,_,_>(fun (a:float) b -> a.Equals b))
| t when t.Equals typeof<float32> -> generalize (Func<_,_,_>(fun (a:float32) b -> a.Equals b))
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel a little uneasy about using "a.Equals b" as the base case in all of these different type-specific implementations, both here and here. For example these implementations must exactly match the bases cases implemented here https://github.com/Microsoft/visualfsharp/pull/513/files#diff-5470ddaa52d99663f8d391a77ae04f0dL1518 and here: https://github.com/Microsoft/visualfsharp/pull/513/files#diff-5470ddaa52d99663f8d391a77ae04f0dL1758

I think I'd feel more comfortable if we textually repeated (# "ceq" x y : bool #) here. For example, I currently have to think carefully "does a.Equals(b) really get optimized down to exactly a ceq instruction?". Because "a" is a value type I'm not actually totally sure it does. If we just emit a ceq then I don't need to check.

| _ -> null
| r when r.Equals typeof<EquivalenceRelation> ->
match typeof<'a> with
| t when t.Equals typeof<float> -> generalize (Func<_,_,_>(fun (a:float) b -> if not (a.Equals a) && not (b.Equals b) then true else a.Equals b))
| t when t.Equals typeof<float32> -> generalize (Func<_,_,_>(fun (a:float32) b -> if not (a.Equals a) && not (b.Equals b) then true else a.Equals b))
| _ -> null
| _ -> raise (Exception "invalid logic")

match relationBasedFunc with
| null -> GenericSpecializeEquals<'a>.Func
| func -> func

static member Func = _func

/// Implements generic equality between two values, with PER semantics for NaN (so equality on two NaN values returns false)
//
// The compiler optimizer is aware of this function (see use of generic_equality_per_inner_vref in opt.fs)
// and devirtualizes calls to it based on "T".
let GenericEqualityIntrinsic (x : 'T) (y : 'T) : bool =
GenericEqualityObj false fsEqualityComparerNoHashingPER ((box x), (box y))
match GenericSpecializeEqualsWithRelation<PartialEquivalenceRelation,_>.Func with
| null -> GenericEqualityObj false fsEqualityComparerNoHashingPER ((box x), (box y))
| func -> func.Invoke (x, y)

/// Implements generic equality between two values, with ER semantics for NaN (so equality on two NaN values returns true)
//
Expand All @@ -1682,15 +1742,19 @@ namespace Microsoft.FSharp.Core
// The compiler optimizer is aware of this function (see use of generic_equality_er_inner_vref in opt.fs)
// and devirtualizes calls to it based on "T".
let GenericEqualityERIntrinsic (x : 'T) (y : 'T) : bool =
GenericEqualityObj true fsEqualityComparerNoHashingER ((box x), (box y))
match GenericSpecializeEqualsWithRelation<EquivalenceRelation,_>.Func with
| null -> GenericEqualityObj true fsEqualityComparerNoHashingER ((box x), (box y))
| func -> func.Invoke (x, y)

/// Implements generic equality between two values using "comp" for recursive calls.
//
// The compiler optimizer is aware of this function (see use of generic_equality_withc_inner_vref in opt.fs)
// and devirtualizes calls to it based on "T", and under the assumption that "comp"
// is either fsEqualityComparerNoHashingER or fsEqualityComparerNoHashingPER.
let GenericEqualityWithComparerIntrinsic (comp : System.Collections.IEqualityComparer) (x : 'T) (y : 'T) : bool =
comp.Equals((box x),(box y))
match GenericSpecializeEqualsWithRelation<UnknownEquivalenceRelation,_>.Func with
| null -> comp.Equals((box x),(box y))
| func -> func.Invoke (x, y)


/// Implements generic equality between two values, with ER semantics for NaN (so equality on two NaN values returns true)
Expand Down Expand Up @@ -1877,6 +1941,34 @@ namespace Microsoft.FSharp.Core
| _ ->
HashCombine 10 (x.GetLength(0)) (x.GetLength(1))

type GenericSpecializeHash<'a>() =
static let generalize (func:Func<'aa,int>) =
match box func with
| :? Func<'a,int> as f -> f
| _ -> raise (Exception "invalid logic")

static let _func =
match typeof<'a> with
| t when t.Equals typeof<bool> -> generalize (Func<_,_>(fun (a:bool) -> a.GetHashCode()))
| t when t.Equals typeof<sbyte> -> generalize (Func<_,_>(fun (a:sbyte) -> a.GetHashCode()))
| t when t.Equals typeof<int16> -> generalize (Func<_,_>(fun (a:int16) -> a.GetHashCode()))
| t when t.Equals typeof<int32> -> generalize (Func<_,_>(fun (a:int32) -> a.GetHashCode()))
| t when t.Equals typeof<int64> -> generalize (Func<_,_>(fun (a:int64) -> a.GetHashCode()))
| t when t.Equals typeof<byte> -> generalize (Func<_,_>(fun (a:byte) -> a.GetHashCode()))
| t when t.Equals typeof<uint16> -> generalize (Func<_,_>(fun (a:uint16) -> a.GetHashCode()))
| t when t.Equals typeof<uint32> -> generalize (Func<_,_>(fun (a:uint32) -> a.GetHashCode()))
| t when t.Equals typeof<uint64> -> generalize (Func<_,_>(fun (a:uint64) -> a.GetHashCode()))
| t when t.Equals typeof<nativeint> -> generalize (Func<_,_>(fun (a:nativeint) -> a.GetHashCode()))
| t when t.Equals typeof<unativeint> -> generalize (Func<_,_>(fun (a:unativeint) -> a.GetHashCode()))
| t when t.Equals typeof<char> -> generalize (Func<_,_>(fun (a:char) -> a.GetHashCode()))
| t when t.Equals typeof<string> -> generalize (Func<_,_>(fun (a:string) -> a.GetHashCode()))
| t when t.Equals typeof<decimal> -> generalize (Func<_,_>(fun (a:decimal) -> a.GetHashCode()))
| t when t.Equals typeof<float> -> generalize (Func<_,_>(fun (a:float) -> a.GetHashCode()))
| t when t.Equals typeof<float32> -> generalize (Func<_,_>(fun (a:float32) -> a.GetHashCode()))
| _ -> null

static member Func = _func

// Core implementation of structural hashing, corresponds to pseudo-code in the
// F# Language spec. Searches for the IStructuralHash interface, otherwise uses GetHashCode().
// Arrays are structurally hashed through a separate technique.
Expand Down Expand Up @@ -1928,10 +2020,16 @@ namespace Microsoft.FSharp.Core
//
// NOTE: The compiler optimizer is aware of this function (see uses of generic_hash_inner_vref in opt.fs)
// and devirtualizes calls to it based on type "T".
let GenericHashIntrinsic x = GenericHashParamObj fsEqualityComparerUnlimitedHashingPER (box(x))
let GenericHashIntrinsic x =
match GenericSpecializeHash.Func with
| null -> GenericHashParamObj fsEqualityComparerUnlimitedHashingPER (box x)
| func -> func.Invoke x

/// Intrinsic for calls to depth-limited structural hashing that were not optimized by static conditionals.
let LimitedGenericHashIntrinsic limit x = GenericHashParamObj (CountLimitedHasherPER(limit)) (box(x))
let LimitedGenericHashIntrinsic limit x =
match GenericSpecializeHash.Func with
| null -> GenericHashParamObj (CountLimitedHasherPER limit) (box x)
| func -> func.Invoke x

/// Intrinsic for a recursive call to structural hashing that was not optimized by static conditionals.
//
Expand All @@ -1941,7 +2039,9 @@ namespace Microsoft.FSharp.Core
// NOTE: The compiler optimizer is aware of this function (see uses of generic_hash_withc_inner_vref in opt.fs)
// and devirtualizes calls to it based on type "T".
let GenericHashWithComparerIntrinsic<'T> (iec : System.Collections.IEqualityComparer) (x : 'T) : int =
GenericHashParamObj iec (box(x))
match GenericSpecializeHash.Func with
| null -> GenericHashParamObj iec (box x)
| func -> func.Invoke x

/// Direct call to GetHashCode on the string type
let inline HashString (s:string) =
Expand Down