Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compilation if GCC LTO enabled. #8

Open
wants to merge 1 commit into
base: 5.9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Source/JavaScriptCore/dfg/DFGOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,19 +311,19 @@
#endif

#define P_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function) \
void* DFG_OPERATION function##WithReturnAddress(ExecState*, ReturnAddressPtr) REFERENCED_FROM_ASM WTF_INTERNAL; \
void* DFG_OPERATION function##WithReturnAddress(ExecState*, ReturnAddressPtr) REFERENCE_KEEP_FOR_LTO WTF_INTERNAL; \
FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_E(function)

#define J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function) \
EncodedJSValue DFG_OPERATION function##WithReturnAddress(ExecState*, JSCell*, Identifier*, ReturnAddressPtr) REFERENCED_FROM_ASM WTF_INTERNAL; \
EncodedJSValue DFG_OPERATION function##WithReturnAddress(ExecState*, JSCell*, Identifier*, ReturnAddressPtr) REFERENCE_KEEP_FOR_LTO WTF_INTERNAL; \
FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_ECI(function)

#define J_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function) \
EncodedJSValue DFG_OPERATION function##WithReturnAddress(ExecState*, EncodedJSValue, Identifier*, ReturnAddressPtr) REFERENCED_FROM_ASM WTF_INTERNAL; \
EncodedJSValue DFG_OPERATION function##WithReturnAddress(ExecState*, EncodedJSValue, Identifier*, ReturnAddressPtr) REFERENCE_KEEP_FOR_LTO WTF_INTERNAL; \
FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJI(function)

#define V_FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function) \
void DFG_OPERATION function##WithReturnAddress(ExecState*, EncodedJSValue, JSCell*, Identifier*, ReturnAddressPtr) REFERENCED_FROM_ASM WTF_INTERNAL; \
void DFG_OPERATION function##WithReturnAddress(ExecState*, EncodedJSValue, JSCell*, Identifier*, ReturnAddressPtr) REFERENCE_KEEP_FOR_LTO WTF_INTERNAL; \
FUNCTION_WRAPPER_WITH_RETURN_ADDRESS_EJCI(function)

namespace JSC { namespace DFG {
Expand Down
4 changes: 2 additions & 2 deletions Source/JavaScriptCore/jit/HostCallReturnValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@

namespace JSC {

extern "C" EncodedJSValue HOST_CALL_RETURN_VALUE_OPTION getHostCallReturnValue() REFERENCED_FROM_ASM WTF_INTERNAL;
extern "C" EncodedJSValue HOST_CALL_RETURN_VALUE_OPTION getHostCallReturnValue() REFERENCE_KEEP_FOR_LTO WTF_INTERNAL;

#if COMPILER(GCC)

// This is a public declaration only to convince CLANG not to elide it.
extern "C" EncodedJSValue HOST_CALL_RETURN_VALUE_OPTION getHostCallReturnValueWithExecState(ExecState*) REFERENCED_FROM_ASM WTF_INTERNAL;
extern "C" EncodedJSValue HOST_CALL_RETURN_VALUE_OPTION getHostCallReturnValueWithExecState(ExecState*) REFERENCE_KEEP_FOR_LTO WTF_INTERNAL;

inline void initializeHostCallReturnValue()
{
Expand Down
2 changes: 1 addition & 1 deletion Source/JavaScriptCore/jit/JITStubs.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ void* JIT_STUB cti_stack_check(STUB_ARGS_DECLARATION) WTF_INTERNAL;
void* JIT_STUB cti_vm_lazyLinkCall(STUB_ARGS_DECLARATION) WTF_INTERNAL;
void* JIT_STUB cti_vm_lazyLinkClosureCall(STUB_ARGS_DECLARATION) WTF_INTERNAL;
void* JIT_STUB cti_vm_lazyLinkConstruct(STUB_ARGS_DECLARATION) WTF_INTERNAL;
void* JIT_STUB cti_vm_throw(STUB_ARGS_DECLARATION) REFERENCED_FROM_ASM WTF_INTERNAL;
void* JIT_STUB cti_vm_throw(STUB_ARGS_DECLARATION) REFERENCE_KEEP_FOR_LTO WTF_INTERNAL;
} // extern "C"

#elif ENABLE(LLINT_C_LOOP)
Expand Down
2 changes: 1 addition & 1 deletion Source/JavaScriptCore/jit/ThunkGenerators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ enum MathThunkCallingConvention { };
typedef MathThunkCallingConvention(*MathThunk)(MathThunkCallingConvention);
extern "C" {

double jsRound(double) REFERENCED_FROM_ASM;
double jsRound(double) REFERENCE_KEEP_FOR_LTO;
double jsRound(double d)
{
double integer = ceil(d);
Expand Down
2 changes: 1 addition & 1 deletion Source/JavaScriptCore/llint/LLIntSlowPaths.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ extern "C" SlowPathReturnType llint_trace_value(ExecState*, Instruction*, int fr
extern "C" SlowPathReturnType llint_##name(ExecState* exec, Instruction* pc)

#define LLINT_SLOW_PATH_HIDDEN_DECL(name) \
LLINT_SLOW_PATH_DECL(name) WTF_INTERNAL
LLINT_SLOW_PATH_DECL(name) REFERENCE_KEEP_FOR_LTO WTF_INTERNAL

LLINT_SLOW_PATH_HIDDEN_DECL(trace_prologue);
LLINT_SLOW_PATH_HIDDEN_DECL(trace_prologue_function_for_call);
Expand Down
8 changes: 4 additions & 4 deletions Source/WTF/wtf/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,13 @@
#define WTF_DELETED_FUNCTION
#endif

/* REFERENCED_FROM_ASM */
/* REFERENCE_KEEP_FOR_LTO */

#ifndef REFERENCED_FROM_ASM
#ifndef REFERENCE_KEEP_FOR_LTO
#if COMPILER(GCC)
#define REFERENCED_FROM_ASM __attribute__((used))
#define REFERENCE_KEEP_FOR_LTO __attribute__((used))
#else
#define REFERENCED_FROM_ASM
#define REFERENCE_KEEP_FOR_LTO
#endif
#endif

Expand Down