summaryrefslogtreecommitdiff
path: root/src/ToolBox/superpmi/superpmi-shim-counter/jithost.cpp
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2016-11-23 19:09:09 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2016-11-23 19:09:09 +0900
commit4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (patch)
tree98110734c91668dfdbb126fcc0e15ddbd93738ca /src/ToolBox/superpmi/superpmi-shim-counter/jithost.cpp
parentfa45f57ed55137c75ac870356a1b8f76c84b229c (diff)
downloadcoreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.tar.gz
coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.tar.bz2
coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.zip
Imported Upstream version 1.1.0upstream/1.1.0
Diffstat (limited to 'src/ToolBox/superpmi/superpmi-shim-counter/jithost.cpp')
-rw-r--r--src/ToolBox/superpmi/superpmi-shim-counter/jithost.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/ToolBox/superpmi/superpmi-shim-counter/jithost.cpp b/src/ToolBox/superpmi/superpmi-shim-counter/jithost.cpp
new file mode 100644
index 0000000000..d4efc33c69
--- /dev/null
+++ b/src/ToolBox/superpmi/superpmi-shim-counter/jithost.cpp
@@ -0,0 +1,49 @@
+//
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+#include "standardpch.h"
+#include "runtimedetails.h"
+#include "spmiutil.h"
+#include "methodcallsummarizer.h"
+#include "jithost.h"
+
+JitHost* g_ourJitHost;
+
+JitHost::JitHost(ICorJitHost* wrappedHost) : wrappedHost(wrappedHost), mcs(nullptr)
+{
+}
+
+void JitHost::setMethodCallSummarizer(MethodCallSummarizer* methodCallSummarizer)
+{
+ this->mcs = methodCallSummarizer;
+}
+
+void* JitHost::allocateMemory(size_t size, bool usePageAllocator)
+{
+ return wrappedHost->allocateMemory(size, usePageAllocator);
+}
+
+void JitHost::freeMemory(void* block, bool usePageAllocator)
+{
+ return wrappedHost->freeMemory(block, usePageAllocator);
+}
+
+int JitHost::getIntConfigValue(const wchar_t* key, int defaultValue)
+{
+ mcs->AddCall("getIntConfigValue");
+ return wrappedHost->getIntConfigValue(key, defaultValue);
+}
+
+const wchar_t* JitHost::getStringConfigValue(const wchar_t* key)
+{
+ mcs->AddCall("getStringConfigValue");
+ return wrappedHost->getStringConfigValue(key);
+}
+
+void JitHost::freeStringConfigValue(const wchar_t* value)
+{
+ mcs->AddCall("freeStringConfigValue");
+ wrappedHost->freeStringConfigValue(value);
+}