Skip to content

Commit 5a5ad23

Browse files
committed
first successful build and run in simulator using in-repo test app
1 parent dbbf3a7 commit 5a5ad23

22 files changed

+590
-97
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@
2626
"start": "./scripts/start.sh"
2727
},
2828
"config": {
29-
"webkitGTK": "2.26.4",
30-
"chromiumICUCommit": "64e5d7d43a1ff205e3787ab6150bbc1a1837332b"
29+
"bunWebKitRepo": "https://github.com/oven-sh/WebKit.git",
30+
"bunWebKitCommit": "6d0f3aac0b817cc01a846b3754b21271adedac12",
31+
"icuRelease": "release-74-2",
32+
"icuArchive": "icu4c-74_2-src.tgz"
3133
},
3234
"devDependencies": {
3335
"commander": "^12.1.0",
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git a/webkit/Source/WTF/wtf/unicode/CollatorDefault.cpp b/webkit/Source/WTF/wtf/unicode/CollatorDefault.cpp
2+
index 9a45990fa7..b709f02052 100644
3+
--- a/webkit/Source/WTF/wtf/unicode/CollatorDefault.cpp
4+
+++ b/webkit/Source/WTF/wtf/unicode/CollatorDefault.cpp
5+
@@ -27,13 +27,15 @@
6+
*/
7+
8+
#include "config.h"
9+
+#include <wtf/text/StringView.h>
10+
+#include <wtf/text/WTFString.h>
11+
#include <wtf/unicode/Collator.h>
12+
13+
#if UCONFIG_NO_COLLATION
14+
15+
namespace WTF {
16+
17+
-int Collator::collate(StringView a, StringView b) const
18+
+int Collator::collate(StringView a, StringView b)
19+
{
20+
unsigned commonLength = std::min(a.length(), b.length());
21+
for (unsigned i = 0; i < commonLength; ++i) {
22+
@@ -51,7 +53,7 @@ int Collator::collate(StringView a, StringView b) const
23+
return 0;
24+
}
25+
26+
-int Collator::collate(const char8_t* a, const char8_t* b) const
27+
+int Collator::collate(const char8_t* a, const char8_t* b)
28+
{
29+
return collate(String::fromUTF8(byteCast<char>(a)), String::fromUTF8(byteCast<char>(b)));
30+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/webkit/Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp b/webkit/Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp
2+
index 483d333b83..1612e84271 100644
3+
--- a/webkit/Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp
4+
+++ b/webkit/Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp
5+
@@ -63,6 +63,10 @@
6+
7+
#endif
8+
9+
+#ifndef BUN_MACOSX
10+
+#define BUN_MACOSX 0
11+
+#endif
12+
+
13+
#ifdef MADV_DONTFORK
14+
#define BUN_MADV_DONTFORK MADV_DONTFORK
15+
#else
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
diff --git a/webkit/Source/JavaScriptCore/jit/JITInlineCacheGenerator.h b/webkit/Source/JavaScriptCore/jit/JITInlineCacheGenerator.h
2+
index 8b89733b83..9c1d93c23f 100644
3+
--- a/webkit/Source/JavaScriptCore/jit/JITInlineCacheGenerator.h
4+
+++ b/webkit/Source/JavaScriptCore/jit/JITInlineCacheGenerator.h
5+
@@ -53,7 +53,11 @@ enum class AccessType : int8_t;
6+
enum class CacheType : int8_t;
7+
enum class JITType : uint8_t;
8+
9+
+#if ENABLE(DFG_JIT)
10+
using CompileTimeStructureStubInfo = Variant<StructureStubInfo*, BaselineUnlinkedStructureStubInfo*, DFG::UnlinkedStructureStubInfo*>;
11+
+#else
12+
+using CompileTimeStructureStubInfo = Variant<StructureStubInfo*, BaselineUnlinkedStructureStubInfo*>;
13+
+#endif
14+
15+
class JITInlineCacheGenerator {
16+
protected:
17+
diff --git a/webkit/Source/JavaScriptCore/jit/PCToCodeOriginMap.h b/webkit/Source/JavaScriptCore/jit/PCToCodeOriginMap.h
18+
index 196e0516a9..572f6a4444 100644
19+
--- a/webkit/Source/JavaScriptCore/jit/PCToCodeOriginMap.h
20+
+++ b/webkit/Source/JavaScriptCore/jit/PCToCodeOriginMap.h
21+
@@ -41,6 +41,7 @@ namespace B3 {
22+
class PCToOriginMap;
23+
}
24+
25+
+#if ENABLE(WEBASSEMBLY)
26+
namespace Wasm {
27+
class WasmOrigin {
28+
MAKE_VALIDATED_REINTERPRET_CAST
29+
@@ -59,6 +60,7 @@ public:
30+
MAKE_VALIDATED_REINTERPRET_CAST_IMPL("WasmOrigin", WasmOrigin)
31+
32+
} // namespace Wasm
33+
+#endif
34+
35+
class LinkBuffer;
36+
class PCToCodeOriginMapBuilder;

patches/jsc_android_jsc_wait.patch

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/webkit/Source/JavaScriptCore/jsc.cpp b/webkit/Source/JavaScriptCore/jsc.cpp
2+
index 2b3b231e54..6b861fd1fe 100644
3+
--- a/webkit/Source/JavaScriptCore/jsc.cpp
4+
+++ b/webkit/Source/JavaScriptCore/jsc.cpp
5+
@@ -3649,7 +3649,7 @@ int main(int argc, char** argv)
6+
WTF::fastDisableScavenger();
7+
fprintf(stdout, "\njs shell waiting for input to exit\n");
8+
fflush(stdout);
9+
- getc(stdin);
10+
+ (void)getc(stdin);
11+
}
12+
13+
#if OS(UNIX)
14+
@@ -3658,7 +3658,7 @@ int main(int argc, char** argv)
15+
fprintf(stdout, "\njs shell waiting for `kill -USR2 [pid]` to exit\n");
16+
fflush(stdout);
17+
18+
- waitToExit.wait();
19+
+ (void)waitToExit.wait();
20+
21+
fprintf(stdout, "\njs shell exiting\n");
22+
fflush(stdout);
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff --git a/webkit/Source/JavaScriptCore/API/JSBase.cpp b/webkit/Source/JavaScriptCore/API/JSBase.cpp
2+
index f0b01ec79a..1c9869b40b 100644
3+
--- a/webkit/Source/JavaScriptCore/API/JSBase.cpp
4+
+++ b/webkit/Source/JavaScriptCore/API/JSBase.cpp
5+
@@ -37,6 +37,12 @@
6+
#include "OpaqueJSString.h"
7+
#include "SourceCode.h"
8+
9+
+#if OS(ANDROID)
10+
+#include <android/log.h>
11+
+#ifndef JSC_VERSION
12+
+#define JSC_VERSION "unknown"
13+
+#endif
14+
+#endif
15+
#if ENABLE(REMOTE_INSPECTOR)
16+
#include "JSGlobalObjectInspectorController.h"
17+
#endif
18+
@@ -220,3 +226,11 @@ JSObjectRef JSGetMemoryUsageStatistics(JSContextRef ctx)
19+
20+
return toRef(object);
21+
}
22+
+
23+
+#if OS(ANDROID)
24+
+__attribute__((constructor))
25+
+static void logJSCVersion()
26+
+{
27+
+ __android_log_print(ANDROID_LOG_INFO, "JavaScriptCore.Version", "%s", JSC_VERSION);
28+
+}
29+
+#endif
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/webkit/Source/JavaScriptCore/runtime/JSPromise.cpp b/webkit/Source/JavaScriptCore/runtime/JSPromise.cpp
2+
index 09b051775b..c1599e5c9d 100644
3+
--- a/webkit/Source/JavaScriptCore/runtime/JSPromise.cpp
4+
+++ b/webkit/Source/JavaScriptCore/runtime/JSPromise.cpp
5+
@@ -220,6 +220,7 @@ void JSPromise::fulfillWithNonPromise(JSGlobalObject* lexicalGlobalObject, JSVal
6+
VM& vm = lexicalGlobalObject->vm();
7+
auto scope = DECLARE_THROW_SCOPE(vm);
8+
uint32_t flags = this->flags();
9+
+ UNUSED_PARAM(scope);
10+
ASSERT_WITH_MESSAGE(!value.inherits<Exception>(), "Promise fulfilled with exception");
11+
ASSERT_WITH_MESSAGE(!value.inherits<JSPromise>(), "Promise fulfilled with another promise");
12+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
diff --git a/webkit/Source/JavaScriptCore/runtime/JSDateMath.cpp b/webkit/Source/JavaScriptCore/runtime/JSDateMath.cpp
2+
index cbd32cefe0..16df1ec5a0 100644
3+
--- a/webkit/Source/JavaScriptCore/runtime/JSDateMath.cpp
4+
+++ b/webkit/Source/JavaScriptCore/runtime/JSDateMath.cpp
5+
@@ -502,6 +502,12 @@ static std::tuple<String, Vector<char16_t, 32>> retrieveTimeZoneInformation()
6+
getTimeZoneOverride(timeZoneID);
7+
String canonical;
8+
UErrorCode status = U_ZERO_ERROR;
9+
+#if (defined(UCONFIG_NO_FORMATTING) && UCONFIG_NO_FORMATTING) || !defined(ucal_getCanonicalTimeZoneID)
10+
+ if (!timeZoneID.isEmpty())
11+
+ canonical = String(timeZoneID.span());
12+
+ else
13+
+ canonical = "UTC"_s;
14+
+#else
15+
if (timeZoneID.isEmpty()) {
16+
status = callBufferProducingFunction(ucal_getHostTimeZone, timeZoneID);
17+
ASSERT_UNUSED(status, U_SUCCESS(status));
18+
@@ -514,6 +520,7 @@ static std::tuple<String, Vector<char16_t, 32>> retrieveTimeZoneInformation()
19+
}
20+
if (canonical.isNull() || isUTCEquivalent(canonical))
21+
canonical = "UTC"_s;
22+
+#endif
23+
24+
globalCache.get() = std::tuple { canonical.isolatedCopy(), WTFMove(timeZoneID), currentID };
25+
}
26+
diff --git a/webkit/Source/WTF/wtf/DateMath.cpp b/webkit/Source/WTF/wtf/DateMath.cpp
27+
index d4551c78ef..37b2ef6fc2 100644
28+
--- a/webkit/Source/WTF/wtf/DateMath.cpp
29+
+++ b/webkit/Source/WTF/wtf/DateMath.cpp
30+
@@ -1008,6 +1008,10 @@ String makeRFC2822DateString(unsigned dayOfWeek, unsigned day, unsigned month, u
31+
32+
static std::optional<Vector<char16_t, 32>> validateTimeZone(StringView timeZone)
33+
{
34+
+#if defined(UCONFIG_NO_FORMATTING) && UCONFIG_NO_FORMATTING
35+
+ UNUSED_PARAM(timeZone);
36+
+ return std::nullopt;
37+
+#else
38+
auto buffer = timeZone.upconvertedCharacters();
39+
const char16_t* characters = buffer;
40+
Vector<char16_t, 32> canonicalBuffer;
41+
@@ -1015,6 +1019,7 @@ static std::optional<Vector<char16_t, 32>> validateTimeZone(StringView timeZone)
42+
if (!U_SUCCESS(status))
43+
return std::nullopt;
44+
return canonicalBuffer;
45+
+#endif
46+
}
47+
48+
bool isTimeZoneValid(StringView timeZone)

patches/jsc_android_uv_pri64.patch

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/webkit/Source/bmalloc/bmalloc/uv_get_constrained_memory.cpp b/webkit/Source/bmalloc/bmalloc/uv_get_constrained_memory.cpp
2+
index e39afda511..48f46d76fc 100644
3+
--- a/webkit/Source/bmalloc/bmalloc/uv_get_constrained_memory.cpp
4+
+++ b/webkit/Source/bmalloc/bmalloc/uv_get_constrained_memory.cpp
5+
@@ -21,11 +21,12 @@
6+
7+
#include "BPlatform.h"
8+
#include <cstdint>
9+
+#include <inttypes.h>
10+
11+
#if BOS(LINUX)
12+
13+
#ifndef PRIu64
14+
-#define PRIu64 "lu"
15+
+#define PRIu64 "llu"
16+
#endif
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
diff --git a/webkit/Source/WTF/wtf/PlatformJSCOnly.cmake b/webkit/Source/WTF/wtf/PlatformJSCOnly.cmake
2+
index 0ab58fe2a2..4b94606617 100644
3+
--- a/webkit/Source/WTF/wtf/PlatformJSCOnly.cmake
4+
+++ b/webkit/Source/WTF/wtf/PlatformJSCOnly.cmake
5+
@@ -36,8 +36,16 @@ else ()
6+
text/unix/TextBreakIteratorInternalICUUnix.cpp
7+
8+
unix/LanguageUnix.cpp
9+
- unix/LoggingUnix.cpp
10+
)
11+
+ if (CMAKE_SYSTEM_NAME MATCHES "Android")
12+
+ list(APPEND WTF_SOURCES
13+
+ android/LoggingAndroid.cpp
14+
+ )
15+
+ else ()
16+
+ list(APPEND WTF_SOURCES
17+
+ unix/LoggingUnix.cpp
18+
+ )
19+
+ endif ()
20+
if (WTF_OS_FUCHSIA)
21+
list(APPEND WTF_SOURCES
22+
fuchsia/CPUTimeFuchsia.cpp
23+
@@ -97,6 +105,22 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
24+
25+
unix/MemoryPressureHandlerUnix.cpp
26+
)
27+
+ list(APPEND WTF_PUBLIC_HEADERS
28+
+ linux/CurrentProcessMemoryStatus.h
29+
+ linux/ProcessMemoryFootprint.h
30+
+ )
31+
+elseif (CMAKE_SYSTEM_NAME MATCHES "Android")
32+
+ list(APPEND WTF_SOURCES
33+
+ linux/CurrentProcessMemoryStatus.cpp
34+
+ linux/MemoryFootprintLinux.cpp
35+
+ linux/RealTimeThreads.cpp
36+
+
37+
+ unix/MemoryPressureHandlerUnix.cpp
38+
+ )
39+
+ list(APPEND WTF_PUBLIC_HEADERS
40+
+ linux/CurrentProcessMemoryStatus.h
41+
+ linux/ProcessMemoryFootprint.h
42+
+ )
43+
elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
44+
list(APPEND WTF_SOURCES
45+
generic/MemoryFootprintGeneric.cpp

0 commit comments

Comments
 (0)