Title: [98891] trunk/Source/_javascript_Core
- Revision
- 98891
- Author
- [email protected]
- Date
- 2011-10-31 15:38:06 -0700 (Mon, 31 Oct 2011)
Log Message
Fix DFG JIT compilation on Linux targets.
https://bugs.webkit.org/show_bug.cgi?id=70904
Patch by Andy Wingo <[email protected]> on 2011-10-31
Reviewed by Darin Adler.
* jit/JITStubs.cpp (SYMBOL_STRING_RELOCATION): Simplify this
macro.
* dfg/DFGOperations.cpp (SYMBOL_STRING_RELOCATION): Copy the
simplified definition from jit/JITStubs.cpp.
(FUNCTION_WRAPPER_WITH_RETURN_ADDRESS, getHostCallReturnValue):
Use the macro to access trampoline targets through the PLT on PIC
systems, instead of introducing a text relocation. Otherwise, the
library fails to link.
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (98890 => 98891)
--- trunk/Source/_javascript_Core/ChangeLog 2011-10-31 22:31:16 UTC (rev 98890)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-10-31 22:38:06 UTC (rev 98891)
@@ -1,3 +1,20 @@
+2011-10-31 Andy Wingo <[email protected]>
+
+ Fix DFG JIT compilation on Linux targets.
+ https://bugs.webkit.org/show_bug.cgi?id=70904
+
+ Reviewed by Darin Adler.
+
+ * jit/JITStubs.cpp (SYMBOL_STRING_RELOCATION): Simplify this
+ macro.
+
+ * dfg/DFGOperations.cpp (SYMBOL_STRING_RELOCATION): Copy the
+ simplified definition from jit/JITStubs.cpp.
+ (FUNCTION_WRAPPER_WITH_RETURN_ADDRESS, getHostCallReturnValue):
+ Use the macro to access trampoline targets through the PLT on PIC
+ systems, instead of introducing a text relocation. Otherwise, the
+ library fails to link.
+
2011-10-31 Mark Hahnenberg <[email protected]>
De-virtualize JSObject::defineGetter
Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.cpp (98890 => 98891)
--- trunk/Source/_javascript_Core/dfg/DFGOperations.cpp 2011-10-31 22:31:16 UTC (rev 98890)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.cpp 2011-10-31 22:38:06 UTC (rev 98891)
@@ -42,6 +42,14 @@
#define SYMBOL_STRING(name) #name
#endif
+#if (OS(LINUX) || OS(FREEBSD)) && CPU(X86_64)
+#define SYMBOL_STRING_RELOCATION(name) #name "@plt"
+#elif CPU(X86) && COMPILER(MINGW)
+#define SYMBOL_STRING_RELOCATION(name) "@" #name "@4"
+#else
+#define SYMBOL_STRING_RELOCATION(name) SYMBOL_STRING(name)
+#endif
+
#if CPU(X86_64)
#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, register) \
@@ -49,7 +57,7 @@
".globl " SYMBOL_STRING(function) "\n" \
SYMBOL_STRING(function) ":" "\n" \
"mov (%rsp), %" STRINGIZE(register) "\n" \
- "jmp " SYMBOL_STRING(function) "WithReturnAddress" "\n" \
+ "jmp " SYMBOL_STRING_RELOCATION(function##WithReturnAddress) "\n" \
);
#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, rsi)
#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, rcx)
@@ -63,7 +71,7 @@
SYMBOL_STRING(function) ":" "\n" \
"mov (%esp), %eax\n" \
"mov %eax, " STRINGIZE(offset) "(%esp)\n" \
- "jmp " SYMBOL_STRING(function) "WithReturnAddress" "\n" \
+ "jmp " SYMBOL_STRING_RELOCATION(function##WithReturnAddress) "\n" \
);
#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, 8)
#define FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function) FUNCTION_WRAPPER_WITH_RETURN_ADDRESS(function, 16)
@@ -509,7 +517,7 @@
SYMBOL_STRING(getHostCallReturnValue) ":" "\n"
"mov -40(%r13), %r13\n"
"mov %r13, %rdi\n"
- "jmp " SYMBOL_STRING(getHostCallReturnValueWithExecState) "\n"
+ "jmp " SYMBOL_STRING_RELOCATION(getHostCallReturnValueWithExecState) "\n"
);
#elif CPU(X86)
asm (
@@ -517,7 +525,7 @@
SYMBOL_STRING(getHostCallReturnValue) ":" "\n"
"mov -40(%edi), %edi\n"
"mov %edi, 4(%esp)\n"
- "jmp " SYMBOL_STRING(getHostCallReturnValueWithExecState) "\n"
+ "jmp " SYMBOL_STRING_RELOCATION(getHostCallReturnValueWithExecState) "\n"
);
#endif
Modified: trunk/Source/_javascript_Core/jit/JITStubs.cpp (98890 => 98891)
--- trunk/Source/_javascript_Core/jit/JITStubs.cpp 2011-10-31 22:31:16 UTC (rev 98890)
+++ trunk/Source/_javascript_Core/jit/JITStubs.cpp 2011-10-31 22:38:06 UTC (rev 98891)
@@ -82,12 +82,10 @@
#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
+#define SYMBOL_STRING_RELOCATION(name) SYMBOL_STRING(name)
#endif
#if OS(DARWIN)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes