Title: [280770] trunk/Source/_javascript_Core
Revision
280770
Author
[email protected]
Date
2021-08-09 03:53:05 -0700 (Mon, 09 Aug 2021)

Log Message

Adding missing REFERENCED_FROM_ASM annotations to facilitate LTO
https://bugs.webkit.org/show_bug.cgi?id=228865

Patch by Michael Catanzaro <[email protected]> on 2021-08-09
Reviewed by Yusuke Suzuki.

When investigating why WebKitGTK fails to build with LTO (link-time optimization) enabled,
one of the GCC developers noticed that we are missing __attribute__ (("used")) on several
C++ functions declared in LLIntSlowPaths.h and WasmSlowPaths.h that are called only from
asm. Without this attribute, GCC assumes the functions are unused and drops them, then
linking fails because they really are used.

* llint/LLIntSlowPaths.h:
* wasm/WasmSlowPaths.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (280769 => 280770)


--- trunk/Source/_javascript_Core/ChangeLog	2021-08-09 09:58:22 UTC (rev 280769)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-08-09 10:53:05 UTC (rev 280770)
@@ -1,3 +1,19 @@
+2021-08-09  Michael Catanzaro  <[email protected]>
+
+        Adding missing REFERENCED_FROM_ASM annotations to facilitate LTO
+        https://bugs.webkit.org/show_bug.cgi?id=228865
+
+        Reviewed by Yusuke Suzuki.
+
+        When investigating why WebKitGTK fails to build with LTO (link-time optimization) enabled,
+        one of the GCC developers noticed that we are missing __attribute__ (("used")) on several
+        C++ functions declared in LLIntSlowPaths.h and WasmSlowPaths.h that are called only from
+        asm. Without this attribute, GCC assumes the functions are unused and drops them, then
+        linking fails because they really are used.
+
+        * llint/LLIntSlowPaths.h:
+        * wasm/WasmSlowPaths.h:
+
 2021-08-07  Michael Catanzaro  <[email protected]>
 
         Fix ODR violations in JSC

Modified: trunk/Source/_javascript_Core/llint/LLIntSlowPaths.h (280769 => 280770)


--- trunk/Source/_javascript_Core/llint/LLIntSlowPaths.h	2021-08-09 09:58:22 UTC (rev 280769)
+++ trunk/Source/_javascript_Core/llint/LLIntSlowPaths.h	2021-08-09 10:53:05 UTC (rev 280770)
@@ -36,15 +36,15 @@
 
 namespace LLInt {
 
-extern "C" SlowPathReturnType llint_trace_operand(CallFrame*, const Instruction*, int fromWhere, int operand);
-extern "C" SlowPathReturnType llint_trace_value(CallFrame*, const Instruction*, int fromWhere, VirtualRegister operand);
-extern "C" void llint_write_barrier_slow(CallFrame*, JSCell*) WTF_INTERNAL;
+extern "C" SlowPathReturnType llint_trace_operand(CallFrame*, const Instruction*, int fromWhere, int operand) REFERENCED_FROM_ASM;
+extern "C" SlowPathReturnType llint_trace_value(CallFrame*, const Instruction*, int fromWhere, VirtualRegister operand) REFERENCED_FROM_ASM;
+extern "C" void llint_write_barrier_slow(CallFrame*, JSCell*) REFERENCED_FROM_ASM WTF_INTERNAL;
 
 #define LLINT_SLOW_PATH_DECL(name) \
     extern "C" SlowPathReturnType llint_##name(CallFrame* callFrame, const Instruction* pc)
 
 #define LLINT_SLOW_PATH_HIDDEN_DECL(name) \
-    LLINT_SLOW_PATH_DECL(name) WTF_INTERNAL
+    LLINT_SLOW_PATH_DECL(name) REFERENCED_FROM_ASM WTF_INTERNAL
 
 LLINT_SLOW_PATH_HIDDEN_DECL(trace_prologue);
 LLINT_SLOW_PATH_HIDDEN_DECL(trace_prologue_function_for_call);
@@ -149,13 +149,13 @@
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_super_sampler_begin);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_super_sampler_end);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_out_of_line_jump_target);
-extern "C" SlowPathReturnType llint_throw_stack_overflow_error(VM*, ProtoCallFrame*) WTF_INTERNAL;
-extern "C" SlowPathReturnType llint_slow_path_checkpoint_osr_exit(CallFrame* callFrame, EncodedJSValue unused) WTF_INTERNAL;
-extern "C" SlowPathReturnType llint_slow_path_checkpoint_osr_exit_from_inlined_call(CallFrame* callFrame, EncodedJSValue callResult) WTF_INTERNAL;
+extern "C" SlowPathReturnType llint_throw_stack_overflow_error(VM*, ProtoCallFrame*) REFERENCED_FROM_ASM WTF_INTERNAL;
+extern "C" SlowPathReturnType llint_slow_path_checkpoint_osr_exit(CallFrame* callFrame, EncodedJSValue unused) REFERENCED_FROM_ASM WTF_INTERNAL;
+extern "C" SlowPathReturnType llint_slow_path_checkpoint_osr_exit_from_inlined_call(CallFrame* callFrame, EncodedJSValue callResult) REFERENCED_FROM_ASM WTF_INTERNAL;
 #if ENABLE(C_LOOP)
-extern "C" SlowPathReturnType llint_stack_check_at_vm_entry(VM*, Register*) WTF_INTERNAL;
+extern "C" SlowPathReturnType llint_stack_check_at_vm_entry(VM*, Register*) REFERENCED_FROM_ASM WTF_INTERNAL;
 #endif
-extern "C" SlowPathReturnType llint_check_vm_entry_permission(VM*, ProtoCallFrame*) WTF_INTERNAL;
-extern "C" NO_RETURN_DUE_TO_CRASH void llint_crash() WTF_INTERNAL;
+extern "C" SlowPathReturnType llint_check_vm_entry_permission(VM*, ProtoCallFrame*) REFERENCED_FROM_ASM WTF_INTERNAL;
+extern "C" NO_RETURN_DUE_TO_CRASH void llint_crash() REFERENCED_FROM_ASM WTF_INTERNAL;
 
 } } // namespace JSC::LLInt

Modified: trunk/Source/_javascript_Core/wasm/WasmSlowPaths.h (280769 => 280770)


--- trunk/Source/_javascript_Core/wasm/WasmSlowPaths.h	2021-08-09 09:58:22 UTC (rev 280769)
+++ trunk/Source/_javascript_Core/wasm/WasmSlowPaths.h	2021-08-09 10:53:05 UTC (rev 280770)
@@ -47,7 +47,7 @@
     extern "C" SlowPathReturnType slow_path_wasm_##name(CallFrame* callFrame, const Instruction* pc, Wasm::Instance* instance)
 
 #define WASM_SLOW_PATH_HIDDEN_DECL(name) \
-    WASM_SLOW_PATH_DECL(name) WTF_INTERNAL
+    WASM_SLOW_PATH_DECL(name) REFERENCED_FROM_ASM WTF_INTERNAL
 
 #if ENABLE(WEBASSEMBLY_B3JIT)
 WASM_SLOW_PATH_HIDDEN_DECL(prologue_osr);
@@ -84,9 +84,9 @@
 WASM_SLOW_PATH_HIDDEN_DECL(memory_atomic_wait64);
 WASM_SLOW_PATH_HIDDEN_DECL(memory_atomic_notify);
 
-extern "C" SlowPathReturnType slow_path_wasm_throw_exception(CallFrame*, const Instruction*, Wasm::Instance* instance, Wasm::ExceptionType) WTF_INTERNAL;
-extern "C" SlowPathReturnType slow_path_wasm_popcount(const Instruction* pc, uint32_t) WTF_INTERNAL;
-extern "C" SlowPathReturnType slow_path_wasm_popcountll(const Instruction* pc, uint64_t) WTF_INTERNAL;
+extern "C" SlowPathReturnType slow_path_wasm_throw_exception(CallFrame*, const Instruction*, Wasm::Instance* instance, Wasm::ExceptionType) REFERENCED_FROM_ASM WTF_INTERNAL;
+extern "C" SlowPathReturnType slow_path_wasm_popcount(const Instruction* pc, uint32_t) REFERENCED_FROM_ASM WTF_INTERNAL;
+extern "C" SlowPathReturnType slow_path_wasm_popcountll(const Instruction* pc, uint64_t) REFERENCED_FROM_ASM WTF_INTERNAL;
 
 } } // namespace JSC::LLInt
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to