@@ -1520,13 +1520,16 @@ void HelperCallProperties::init()
1520
1520
bool mutatesHeap = false ; // true if any previous heap objects [are|can be] modified
1521
1521
bool mayRunCctor = false ; // true if the helper call may cause a static constructor to be run.
1522
1522
bool isNoEscape = false ; // true if none of the GC ref arguments can escape
1523
+ bool isNoGC = false ; // true is the helper cannot trigger GC
1523
1524
1524
1525
switch (helper)
1525
1526
{
1526
1527
// Arithmetic helpers that cannot throw
1527
1528
case CORINFO_HELP_LLSH:
1528
1529
case CORINFO_HELP_LRSH:
1529
1530
case CORINFO_HELP_LRSZ:
1531
+ isNoGC = true ;
1532
+ FALLTHROUGH;
1530
1533
case CORINFO_HELP_LMUL:
1531
1534
case CORINFO_HELP_LNG2DBL:
1532
1535
case CORINFO_HELP_ULNG2DBL:
@@ -1538,7 +1541,6 @@ void HelperCallProperties::init()
1538
1541
case CORINFO_HELP_DBLREM:
1539
1542
case CORINFO_HELP_FLTROUND:
1540
1543
case CORINFO_HELP_DBLROUND:
1541
-
1542
1544
isPure = true ;
1543
1545
noThrow = true ;
1544
1546
break ;
@@ -1729,6 +1731,8 @@ void HelperCallProperties::init()
1729
1731
1730
1732
case CORINFO_HELP_GET_GCSTATIC_BASE_NOCTOR:
1731
1733
case CORINFO_HELP_GET_NONGCSTATIC_BASE_NOCTOR:
1734
+ isNoGC = true ;
1735
+ FALLTHROUGH;
1732
1736
case CORINFO_HELP_GETDYNAMIC_GCSTATIC_BASE_NOCTOR:
1733
1737
case CORINFO_HELP_GETDYNAMIC_NONGCSTATIC_BASE_NOCTOR:
1734
1738
case CORINFO_HELP_GETPINNED_GCSTATIC_BASE_NOCTOR:
@@ -1749,24 +1753,41 @@ void HelperCallProperties::init()
1749
1753
nonNullReturn = true ;
1750
1754
break ;
1751
1755
1756
+ #ifdef TARGET_X86
1757
+ case CORINFO_HELP_ASSIGN_REF_EAX:
1758
+ case CORINFO_HELP_ASSIGN_REF_ECX:
1759
+ case CORINFO_HELP_ASSIGN_REF_EBX:
1760
+ case CORINFO_HELP_ASSIGN_REF_EBP:
1761
+ case CORINFO_HELP_ASSIGN_REF_ESI:
1762
+ case CORINFO_HELP_ASSIGN_REF_EDI:
1763
+ case CORINFO_HELP_CHECKED_ASSIGN_REF_EAX:
1764
+ case CORINFO_HELP_CHECKED_ASSIGN_REF_ECX:
1765
+ case CORINFO_HELP_CHECKED_ASSIGN_REF_EBX:
1766
+ case CORINFO_HELP_CHECKED_ASSIGN_REF_EBP:
1767
+ case CORINFO_HELP_CHECKED_ASSIGN_REF_ESI:
1768
+ case CORINFO_HELP_CHECKED_ASSIGN_REF_EDI:
1769
+ #endif
1752
1770
// GC Write barrier support
1753
1771
// TODO-ARM64-Bug?: Can these throw or not?
1754
1772
case CORINFO_HELP_ASSIGN_REF:
1755
1773
case CORINFO_HELP_CHECKED_ASSIGN_REF:
1756
- case CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP:
1757
1774
case CORINFO_HELP_ASSIGN_BYREF:
1775
+ isNoGC = true ;
1776
+ FALLTHROUGH;
1777
+ case CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP:
1758
1778
case CORINFO_HELP_BULK_WRITEBARRIER:
1759
-
1760
1779
mutatesHeap = true ;
1761
1780
break ;
1762
1781
1763
1782
// Accessing fields (write)
1764
1783
case CORINFO_HELP_ARRADDR_ST:
1765
-
1766
1784
mutatesHeap = true ;
1767
1785
break ;
1768
1786
1769
1787
// These helper calls always throw an exception
1788
+ case CORINFO_HELP_FAIL_FAST:
1789
+ isNoGC = true ;
1790
+ FALLTHROUGH;
1770
1791
case CORINFO_HELP_OVERFLOW:
1771
1792
case CORINFO_HELP_VERIFICATION:
1772
1793
case CORINFO_HELP_RNGCHKFAIL:
@@ -1779,17 +1800,14 @@ void HelperCallProperties::init()
1779
1800
case CORINFO_HELP_THROW_NOT_IMPLEMENTED:
1780
1801
case CORINFO_HELP_THROW_PLATFORM_NOT_SUPPORTED:
1781
1802
case CORINFO_HELP_THROW_TYPE_NOT_SUPPORTED:
1782
- case CORINFO_HELP_FAIL_FAST:
1783
1803
case CORINFO_HELP_METHOD_ACCESS_EXCEPTION:
1784
1804
case CORINFO_HELP_FIELD_ACCESS_EXCEPTION:
1785
1805
case CORINFO_HELP_CLASS_ACCESS_EXCEPTION:
1786
-
1787
1806
alwaysThrow = true ;
1788
1807
break ;
1789
1808
1790
1809
// These helper calls may throw an exception
1791
1810
case CORINFO_HELP_MON_EXIT_STATIC:
1792
-
1793
1811
break ;
1794
1812
1795
1813
// This is a debugging aid; it simply returns a constant address.
@@ -1798,26 +1816,37 @@ void HelperCallProperties::init()
1798
1816
noThrow = true ;
1799
1817
break ;
1800
1818
1819
+ case CORINFO_HELP_INIT_PINVOKE_FRAME:
1820
+ case CORINFO_HELP_JIT_REVERSE_PINVOKE_ENTER: // Never present on stack at the time of GC.
1821
+ case CORINFO_HELP_JIT_REVERSE_PINVOKE_ENTER_TRACK_TRANSITIONS:
1822
+ isNoGC = true ;
1823
+ FALLTHROUGH;
1801
1824
case CORINFO_HELP_DBG_IS_JUST_MY_CODE:
1802
1825
case CORINFO_HELP_BBT_FCN_ENTER:
1803
1826
case CORINFO_HELP_POLL_GC:
1804
1827
case CORINFO_HELP_MON_ENTER:
1805
1828
case CORINFO_HELP_MON_EXIT:
1806
1829
case CORINFO_HELP_MON_ENTER_STATIC:
1807
- case CORINFO_HELP_JIT_REVERSE_PINVOKE_ENTER:
1808
1830
case CORINFO_HELP_JIT_REVERSE_PINVOKE_EXIT:
1809
1831
case CORINFO_HELP_GETFIELDADDR:
1810
- case CORINFO_HELP_INIT_PINVOKE_FRAME:
1811
1832
case CORINFO_HELP_JIT_PINVOKE_BEGIN:
1812
1833
case CORINFO_HELP_JIT_PINVOKE_END:
1813
-
1814
1834
noThrow = true ;
1815
1835
break ;
1816
1836
1817
- // Not sure how to handle optimization involving the rest of these helpers
1818
- default :
1837
+ case CORINFO_HELP_TAILCALL: // Never present on stack at the time of GC.
1838
+ case CORINFO_HELP_STACK_PROBE:
1839
+ case CORINFO_HELP_CHECK_OBJ:
1840
+ case CORINFO_HELP_VALIDATE_INDIRECT_CALL:
1841
+ case CORINFO_HELP_PROF_FCN_LEAVE:
1842
+ case CORINFO_HELP_PROF_FCN_ENTER:
1843
+ case CORINFO_HELP_PROF_FCN_TAILCALL:
1844
+ isNoGC = true ;
1845
+ mutatesHeap = true ; // Conservatively.
1846
+ break ;
1819
1847
1820
- // The most pessimistic results are returned for these helpers
1848
+ default :
1849
+ // The most pessimistic results are returned for these helpers.
1821
1850
mutatesHeap = true ;
1822
1851
break ;
1823
1852
}
@@ -1830,6 +1859,7 @@ void HelperCallProperties::init()
1830
1859
m_mutatesHeap[helper] = mutatesHeap;
1831
1860
m_mayRunCctor[helper] = mayRunCctor;
1832
1861
m_isNoEscape[helper] = isNoEscape;
1862
+ m_isNoGC[helper] = isNoGC;
1833
1863
}
1834
1864
}
1835
1865
0 commit comments