Skip to content

Commit

Permalink
[JSC] Enable alt_entry for newer SDKs
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=267055
rdar://120431675

Reviewed by Justin Michaud.

According to rdar://96556827, newer SDKs should fix linking issues with alt_entry.
This patch attempts to enable it.

* Source/JavaScriptCore/llint/LowLevelInterpreter.cpp:
* Source/WTF/wtf/PlatformEnable.h:

Canonical link: https://commits.webkit.org/273200@main
  • Loading branch information
Constellation committed Jan 19, 2024
1 parent 26cf474 commit 98e9371
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,6 @@ JSValue CLoop::execute(OpcodeID entryOpcodeID, void* executableAddress, VM* vm,
// Define the opcode dispatch mechanism when using an ASM loop:
//

// We're disabling this for now because of a suspected linker issue.
#define OFFLINE_ASM_USE_ALT_ENTRY 0

#if COMPILER(CLANG)

// We need an OFFLINE_ASM_BEGIN_SPACER because we'll be declaring every OFFLINE_ASM_GLOBAL_LABEL
Expand Down Expand Up @@ -512,7 +509,7 @@ JSValue CLoop::execute(OpcodeID entryOpcodeID, void* executableAddress, VM* vm,

// These are for building an interpreter from generated assembly code:

#if OFFLINE_ASM_USE_ALT_ENTRY
#if ENABLE(OFFLINE_ASM_ALT_ENTRY)
#define OFFLINE_ASM_BEGIN asm ( \
OFFLINE_ASM_GLOBAL_LABEL_IMPL(jsc_llint_begin, OFFLINE_ASM_NO_ALT_ENTRY_DIRECTIVE, OFFLINE_ASM_ALIGN4B) \
OFFLINE_ASM_BEGIN_SPACER
Expand Down Expand Up @@ -582,7 +579,7 @@ JSValue CLoop::execute(OpcodeID entryOpcodeID, void* executableAddress, VM* vm,
#define OFFLINE_ASM_ALIGN4B ".balign 4\n"
#define OFFLINE_ASM_NOALIGN ""

#if OFFLINE_ASM_USE_ALT_ENTRY
#if ENABLE(OFFLINE_ASM_ALT_ENTRY)
#define OFFLINE_ASM_GLOBAL_LABEL(label) \
OFFLINE_ASM_GLOBAL_LABEL_IMPL(label, OFFLINE_ASM_ALT_ENTRY_DIRECTIVE, OFFLINE_ASM_ALIGN4B)
#define OFFLINE_ASM_UNALIGNED_GLOBAL_LABEL(label) \
Expand All @@ -592,9 +589,9 @@ JSValue CLoop::execute(OpcodeID entryOpcodeID, void* executableAddress, VM* vm,
OFFLINE_ASM_GLOBAL_LABEL_IMPL(label, OFFLINE_ASM_NO_ALT_ENTRY_DIRECTIVE, OFFLINE_ASM_ALIGN4B)
#define OFFLINE_ASM_UNALIGNED_GLOBAL_LABEL(label) \
OFFLINE_ASM_GLOBAL_LABEL_IMPL(label, OFFLINE_ASM_NO_ALT_ENTRY_DIRECTIVE, OFFLINE_ASM_NOALIGN)
#endif // USE_ALT_ENTRY
#endif // ENABLE(OFFLINE_ASM_ALT_ENTRY)

#if COMPILER(CLANG) && OFFLINE_ASM_USE_ALT_ENTRY
#if COMPILER(CLANG) && ENABLE(OFFLINE_ASM_ALT_ENTRY)
#define OFFLINE_ASM_ALT_GLOBAL_LABEL(label) OFFLINE_ASM_GLOBAL_LABEL(label)
#else
#define OFFLINE_ASM_ALT_GLOBAL_LABEL(label)
Expand Down
9 changes: 9 additions & 0 deletions Source/WTF/wtf/PlatformEnable.h
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,15 @@
#define ENABLE_COMPUTED_GOTO_OPCODES 1
#endif

#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 150000) \
|| (PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000) \
|| (PLATFORM(IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MAX_ALLOWED >= 180000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MAX_ALLOWED >= 110000)
// Linkers from older SDKs causes wrong linking. ref: rdar://96556827
#define ENABLE_OFFLINE_ASM_ALT_ENTRY 1
#endif

/* Regular Expression Tracing - Set to 1 to trace RegExp's in jsc. Results dumped at exit */
#if !defined(ENABLE_REGEXP_TRACING)
#define ENABLE_REGEXP_TRACING 0
Expand Down

0 comments on commit 98e9371

Please sign in to comment.