summaryrefslogtreecommitdiff
path: root/packaging/0032-Disable-VSD-Stub-Kind-Prediction-on-H-W-Exception-14.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/0032-Disable-VSD-Stub-Kind-Prediction-on-H-W-Exception-14.patch')
-rw-r--r--packaging/0032-Disable-VSD-Stub-Kind-Prediction-on-H-W-Exception-14.patch106
1 files changed, 106 insertions, 0 deletions
diff --git a/packaging/0032-Disable-VSD-Stub-Kind-Prediction-on-H-W-Exception-14.patch b/packaging/0032-Disable-VSD-Stub-Kind-Prediction-on-H-W-Exception-14.patch
new file mode 100644
index 0000000000..7dbc6eb07c
--- /dev/null
+++ b/packaging/0032-Disable-VSD-Stub-Kind-Prediction-on-H-W-Exception-14.patch
@@ -0,0 +1,106 @@
+From d768ef837a0a4f13cec786f0d8aa7278abf10bdb Mon Sep 17 00:00:00 2001
+From: Jonghyun Park <parjong@gmail.com>
+Date: Tue, 19 Sep 2017 17:17:10 +0900
+Subject: [PATCH] Disable VSD Stub Kind Prediction on H/W Exception (#14051)
+
+* Disable VSD Stub Kind Prediction on H/W Exception
+
+* Add a comment on a false argument
+
+* Use BOOL (instead of bool) for consistency
+
+* Replace remaining bool/true/false with BOOL/TRUE/FALSE
+---
+ src/vm/exceptionhandling.cpp | 2 +-
+ src/vm/virtualcallstub.cpp | 8 ++++----
+ src/vm/virtualcallstub.h | 7 ++++---
+ 3 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/src/vm/exceptionhandling.cpp b/src/vm/exceptionhandling.cpp
+index abea194..2802f73 100644
+--- a/src/vm/exceptionhandling.cpp
++++ b/src/vm/exceptionhandling.cpp
+@@ -5146,7 +5146,7 @@ static BOOL IsIPinVirtualStub(PCODE f_IP)
+ }
+
+ VirtualCallStubManager::StubKind sk;
+- VirtualCallStubManager::FindStubManager(f_IP, &sk);
++ VirtualCallStubManager::FindStubManager(f_IP, &sk, FALSE /* usePredictStubKind */);
+
+ if (sk == VirtualCallStubManager::SK_DISPATCH)
+ {
+diff --git a/src/vm/virtualcallstub.cpp b/src/vm/virtualcallstub.cpp
+index e753860..e659e35 100644
+--- a/src/vm/virtualcallstub.cpp
++++ b/src/vm/virtualcallstub.cpp
+@@ -970,7 +970,7 @@ void VirtualCallStubManager::Reclaim()
+
+ //----------------------------------------------------------------------------
+ /* static */
+-VirtualCallStubManager *VirtualCallStubManager::FindStubManager(PCODE stubAddress, StubKind* wbStubKind)
++VirtualCallStubManager *VirtualCallStubManager::FindStubManager(PCODE stubAddress, StubKind* wbStubKind, BOOL usePredictStubKind)
+ {
+ CONTRACTL {
+ NOTHROW;
+@@ -995,7 +995,7 @@ VirtualCallStubManager *VirtualCallStubManager::FindStubManager(PCODE stubAddres
+ // VirtualCallStubManager::isDispatchingStub
+ //
+ CONTRACT_VIOLATION(SOToleranceViolation);
+- kind = pCur->getStubKind(stubAddress);
++ kind = pCur->getStubKind(stubAddress, usePredictStubKind);
+ if (kind != SK_UNKNOWN)
+ {
+ if (wbStubKind)
+@@ -1007,7 +1007,7 @@ VirtualCallStubManager *VirtualCallStubManager::FindStubManager(PCODE stubAddres
+ // See if we are managed by the shared domain
+ //
+ pCur = SharedDomain::GetDomain()->GetLoaderAllocator()->GetVirtualCallStubManager();
+- kind = pCur->getStubKind(stubAddress);
++ kind = pCur->getStubKind(stubAddress, usePredictStubKind);
+ if (kind != SK_UNKNOWN)
+ {
+ if (wbStubKind)
+@@ -1022,7 +1022,7 @@ VirtualCallStubManager *VirtualCallStubManager::FindStubManager(PCODE stubAddres
+ {
+ _ASSERTE(pCur != NULL);
+
+- kind = pCur->getStubKind(stubAddress);
++ kind = pCur->getStubKind(stubAddress, usePredictStubKind);
+ if (kind != SK_UNKNOWN)
+ {
+ if (wbStubKind)
+diff --git a/src/vm/virtualcallstub.h b/src/vm/virtualcallstub.h
+index 7b6fedf..b8984ea 100644
+--- a/src/vm/virtualcallstub.h
++++ b/src/vm/virtualcallstub.h
+@@ -317,7 +317,7 @@ public:
+ /* know thine own stubs. It is possible that when multiple
+ virtualcallstub managers are built that these may need to become
+ non-static, and the callers modified accordingly */
+- StubKind getStubKind(PCODE stubStartAddress)
++ StubKind getStubKind(PCODE stubStartAddress, BOOL usePredictStubKind = TRUE)
+ {
+ WRAPPER_NO_CONTRACT;
+ SUPPORTS_DAC;
+@@ -329,7 +329,7 @@ public:
+
+ // Rather than calling IsInRange(stubStartAddress) for each possible stub kind
+ // we can peek at the assembly code and predict which kind of a stub we have
+- StubKind predictedKind = predictStubKind(stubStartAddress);
++ StubKind predictedKind = (usePredictStubKind) ? predictStubKind(stubStartAddress) : SK_UNKNOWN;
+
+ if (predictedKind == SK_DISPATCH)
+ {
+@@ -732,7 +732,8 @@ private:
+ public:
+ // Given a stub address, find the VCSManager that owns it.
+ static VirtualCallStubManager *FindStubManager(PCODE addr,
+- StubKind* wbStubKind = NULL);
++ StubKind* wbStubKind = NULL,
++ BOOL usePredictStubKind = TRUE);
+
+ #ifndef DACCESS_COMPILE
+ // insert a linked list of indirection cells at the beginning of m_RecycledIndCellList
+--
+2.7.4
+