Ver Fonte

Fix Dynamic Profile info on macOS and Linux
- Dynamic profile (DPL) was #ifdef'd out when CC was ported to linux
- DPL is intended for testing
- DPL can store profiling info from the interpreter in a file
- DPL can then be loaded on a future run for use by the jit
- Dynopogo CI on macOS + Unix was trying to load DPL that didn't exist
- It would try multiple times, this added ~2 seconds to every test
- Fixing this therefore makes tests much faster
- Fix was:
a) enable in CommmonDefines
b) Fix a compiler error in ScriptContextProfiler AND
c) Change a condition so the Uninitalize method is called

rhuanjl há 5 anos atrás
pai
commit
3f20941279

+ 1 - 4
lib/Common/CommonDefines.h

@@ -1,5 +1,6 @@
 //-------------------------------------------------------------------------------------------------------
 // Copyright (C) Microsoft. All rights reserved.
+// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
 // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
 //-------------------------------------------------------------------------------------------------------
 #pragma once
@@ -378,11 +379,7 @@
 #define RUNTIME_DATA_COLLECTION
 #define SECURITY_TESTING
 
-// xplat-todo: Temporarily disable profile output on non-Win32 builds
-#ifdef _WIN32
 #define PROFILE_EXEC
-#endif
-
 #define BGJIT_STATS
 #define REJIT_STATS
 #define PERF_HINT

+ 2 - 1
lib/Jsrt/JsrtHelper.cpp

@@ -1,5 +1,6 @@
 //-------------------------------------------------------------------------------------------------------
 // Copyright (C) Microsoft. All rights reserved.
+// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
 // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
 //-------------------------------------------------------------------------------------------------------
 
@@ -109,7 +110,7 @@ void JsrtCallbackState::ObjectBeforeCallectCallbackWrapper(JsObjectBeforeCollect
 
     // setup the cleanup
     // we do not track the main thread. When it exits do the cleanup below
-#ifdef CHAKRA_STATIC_LIBRARY
+#if defined(CHAKRA_STATIC_LIBRARY) || !defined(_WIN32)
     atexit([]() {
         ThreadBoundThreadContextManager::DestroyContextAndEntryForCurrentThread();
 

+ 4 - 2
lib/Runtime/Base/ScriptContextProfiler.h

@@ -1,17 +1,19 @@
 //-------------------------------------------------------------------------------------------------------
 // Copyright (C) Microsoft. All rights reserved.
+// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
 // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
 //-------------------------------------------------------------------------------------------------------
 #pragma once
 
 class ServerScriptContext;
+class NativeCodeGenerator;
 namespace Js
 {
     class ScriptContextProfiler
     {
 #ifdef PROFILE_EXEC
-        friend class NativeCodeGenerator;
-        friend class ServerScriptContext;
+        friend class ::NativeCodeGenerator;
+        friend class ::ServerScriptContext;
 
     public:
         ScriptContextProfiler();