[JSC] ThunkGenerators.cpp should hide its asm-defined symbols
authormorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jan 2012 23:28:19 +0000 (23:28 +0000)
committermorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jan 2012 23:28:19 +0000 (23:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77244

Reviewed by Filip Pizlo.

* jit/ThunkGenerators.cpp: Added HIDE_SYMBOLS()
* wtf/InlineASM.h: Moved some duplicated macros from ThunkGenerators.cpp

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106161 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/jit/ThunkGenerators.cpp
Source/JavaScriptCore/wtf/InlineASM.h

index 031e184..2ce2128 100644 (file)
@@ -1,3 +1,13 @@
+2012-01-27  Hajime Morita  <morrita@google.com>
+
+        [JSC] ThunkGenerators.cpp should hide its asm-defined symbols
+        https://bugs.webkit.org/show_bug.cgi?id=77244
+
+        Reviewed by Filip Pizlo.
+
+        * jit/ThunkGenerators.cpp: Added HIDE_SYMBOLS()
+        * wtf/InlineASM.h: Moved some duplicated macros from ThunkGenerators.cpp
+
 2012-01-27  Simon Hausmann  <simon.hausmann@nokia.com>
 
         [JSC] Asm-originated symbols should be marked as hidden
index 0e54c8a..0997969 100644 (file)
@@ -27,8 +27,9 @@
 #include "ThunkGenerators.h"
 
 #include "CodeBlock.h"
-#include <wtf/text/StringImpl.h>
+#include "InlineASM.h"
 #include "SpecializedThunkJIT.h"
+#include <wtf/text/StringImpl.h>
 
 #if ENABLE(JIT)
 
@@ -111,21 +112,6 @@ MacroAssemblerCodeRef sqrtThunkGenerator(JSGlobalData* globalData)
     return jit.finalize(*globalData, globalData->jitStubs->ctiNativeCall());
 }
 
-#if OS(DARWIN) || (OS(WINDOWS) && CPU(X86))
-#define SYMBOL_STRING(name) "_" #name
-#else
-#define SYMBOL_STRING(name) #name
-#endif
-    
-#if (OS(LINUX) || OS(FREEBSD)) && CPU(X86_64)
-#define SYMBOL_STRING_RELOCATION(name) #name "@plt"
-#elif OS(DARWIN) || (CPU(X86_64) && COMPILER(MINGW) && !GCC_VERSION_AT_LEAST(4, 5, 0))
-#define SYMBOL_STRING_RELOCATION(name) "_" #name
-#elif CPU(X86) && COMPILER(MINGW)
-#define SYMBOL_STRING_RELOCATION(name) "@" #name "@4"
-#else
-#define SYMBOL_STRING_RELOCATION(name) #name
-#endif
 
 #define UnaryDoubleOpWrapper(function) function##Wrapper
 enum MathThunkCallingConvention { };
@@ -147,6 +133,7 @@ double jsRound(double d)
     asm( \
         ".text\n" \
         ".globl " SYMBOL_STRING(function##Thunk) "\n" \
+        HIDE_SYMBOL(function##Thunk) "\n" \
         SYMBOL_STRING(function##Thunk) ":" "\n" \
         "call " SYMBOL_STRING_RELOCATION(function) "\n" \
         "ret\n" \
@@ -161,6 +148,7 @@ double jsRound(double d)
     asm( \
         ".text\n" \
         ".globl " SYMBOL_STRING(function##Thunk) "\n" \
+        HIDE_SYMBOL(function##Thunk) "\n" \
         SYMBOL_STRING(function##Thunk) ":" "\n" \
         "subl $8, %esp\n" \
         "movsd %xmm0, (%esp) \n" \
index c8a93f9..379ebd3 100644 (file)
@@ -44,6 +44,8 @@
 
 #if (OS(LINUX) || OS(FREEBSD)) && CPU(X86_64)
 #define SYMBOL_STRING_RELOCATION(name) #name "@plt"
+#elif OS(DARWIN) || (CPU(X86_64) && COMPILER(MINGW) && !GCC_VERSION_AT_LEAST(4, 5, 0))
+#define SYMBOL_STRING_RELOCATION(name) "_" #name
 #elif CPU(X86) && COMPILER(MINGW)
 #define SYMBOL_STRING_RELOCATION(name) "@" #name "@4"
 #else